-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unable to run Mac GUI with helpers enabled #17
Comments
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...) |
Or, continuing my speculation, could it be that the GUI was compiled with a suitable compiler, but without the -fopenmp option to gcc? |
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.. |
When I complied the guy with GNU gcc... I got the followings..
It seems that the GNU gcc won't compile some system header files. |
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 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. |
I think that setup_Rmainloop() is called in REngine/Rinit.m and it is the source of error. |
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. |
The official Mac R GUI can be complied successfully for both the helper-enabled and disabled versions.
However only the helper-disabled R GUI can be run without errors.
For the helper-enabled R GUI, I got the following runtime error
I tracked down the problem, I found that the GUI crashes when running the function
setup_Rmainloop()
.The problem should be also related to
libR.dylib
and functionhelpers_avail1
as indicated in the top-right corner of the above figure.I am not good in objective C and the structure of R.
Hope this piece of information will help somebody to fix the problem.
The text was updated successfully, but these errors were encountered: