Comments (8)
Thanks for the report. I've just started playing myself with pqR on a Mac, but haven't tried the GUI yet. As others have reported, helper threads don't work at all with the version of gcc 4.2 distributed with Xcode (at least in the old Xcode 3.2.6 on Snow Leopard that I'm using at the moment), since it doesn't support the "threadprivate" feature of OpenMP. I found that helper threads do work with gcc 4.7.3 (but don't try it with -O3). Could you say what compiler you are using? Does pqR with helper threads work when you compile it without the R GUI?
The error above seems to result from the threadprivate pointer variable this_task_info being null, when it should point to a suitable structure. So this could have something to do with support (or lack of it) for the threadprivate feature. Is it possible that you compiled the shared library for pqR with a compiler supporting "threadprivate", but this library was then called from a GUI that was compiled with a compiler that doesn't support this feature, and hence didn't initialize properly for use of threadprivate variables? (This is speculation. I haven't investigated the GUI and OpenMP on Macs enough yet to know whether this scenario actually makes sense...)
from pqr.
Or, continuing my speculation, could it be that the GUI was compiled with a suitable compiler, but without the -fopenmp option to gcc?
from pqr.
Is it possible that you compiled the shared library for pqR with a compiler supporting "threadprivate", but this library was then called from a GUI that was compiled with a compiler that doesn't support this feature, and hence didn't initialize properly for use of threadprivate variables?
Yes, you are right. I am now trying to use GNU gcc to compile the GUI, but it seems to be not obvious..
from pqr.
When I complied the guy with GNU gcc... I got the followings..
/usr/local/Cellar/gcc47/4.7.3/bin/gcc-4.7 -x objective-c-header -fmessage-length=0 -pipe -std=gnu99 -Wno-trigraphs -O0 -DUSE_POOLS -gdwarf-2 -fvisibility=hidden -I/Users/Randy/Desktop/pqR/Mac-GUI-1.53 -I/Users/Randy/Desktop/pqR/Mac-GUI-1.53/build/Debug/include -I/opt/Frameworks/R.framework/Headers -I/opt/Frameworks/R.framework/PrivateHeaders -I/Users/Randy/Desktop/pqR/Mac-GUI-1.53/build/R.build/Debug/R.build/DerivedSources/x86_64 -I/Users/Randy/Desktop/pqR/Mac-GUI-1.53/build/R.build/Debug/R.build/DerivedSources -Wall -F/Users/Randy/Desktop/pqR/Mac-GUI-1.53/build/Debug -F/opt/Frameworks -DPLAIN_STDERR -DDEBUG_RGUI -DUSE_POOLS -c /Users/Randy/Desktop/pqR/Mac-GUI-1.53/R_Prefix.pch -o /var/folders/w9/7w10svxj5093z4831n7m27w00000gp/C/com.apple.Xcode.502/SharedPrecompiledHeaders/R_Prefix-hakfwqlftgjqhleiynzlpicfjuuw/R_Prefix.pch.gch
In file included from /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:123:0,
from /System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12,
from /Users/Randy/Desktop/pqR/Mac-GUI-1.53/R_Prefix.pch:6:
/System/Library/Frameworks/Foundation.framework/Headers/NSTask.h:69:24: error: expected identifier or '(' before '^' token
/System/Library/Frameworks/Foundation.framework/Headers/NSTask.h:72:1: error: expected identifier before 'end'
It seems that the GNU gcc won't compile some system header files.
However, the working complier (by Apple) doesn't support openmp....
I don't have any clue at this moment.
from pqr.
I'm planning to try this out myself soon. I'll see whether I can figure out a solution. Thanks for trying it, and getting as far as identifying the problem here.
from pqr.
From a quick look at the R GUI code, it seems that it doesn't call the usual R mainloop procedure (in src/main.c), which is where helpers_startup is called to set up the whole helpers scheme. So I think the R GUI needs to be modified to call helpers_startup itself at some appropriate point. I can't guess whether the R GUI also needs to be compiled with a compiler that support OpenMP threadprivate variables, but I think just using such a compiler would not be sufficient.
from pqr.
I think that setup_Rmainloop() is called in REngine/Rinit.m and it is the source of error.
from pqr.
Calling setup_Rmainloop isn't sufficient. The actual Rf_mainloop procedure needs to be called. It's not possible for the full setup to be done in a separate "setup" function because OpenMP creates threads as a result of a "parallel" construct, with the threads being destroyed when that construct is left. So the whole main part of the R interpreter needs to be called from within that parallel construct, which exists inside the mainloop procedure.
from pqr.
Related Issues (20)
- What is preventing the merge of pqR into R? HOT 1
- pqR side by side with GNU-R HOT 8
- T and F don't work with mat_mult_with_BLAS configuration argument
- Docker image for pqR HOT 3
- No window version available HOT 1
- Incompatible library version HOT 3
- Will pqR code be merged to R? HOT 9
- Missing <R_ext/sggc-app.h> HOT 11
- Proposal of new feature: native 64 bit integers support HOT 2
- R/time.R - filename restricted? HOT 5
- Update formula does not work as expected HOT 6
- make error: multiple definitions HOT 6
- segfault when using attributes HOT 1
- buffer overflow when using attributes on a recursive function HOT 2
- floating point exception
- pqR aborted when using plot
- Problems with installation ubuntu 20.04 HOT 5
- Pqr and running Rstudio on mac
- Installation fails on Slackware 15.0 HOT 13
- Slow pqR loops vs R (CRAN)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pqr.