Skip to content
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

rJava/jri compilation fails with parallel make (-j) #1

Closed
bastistician opened this issue Jan 10, 2014 · 2 comments · Fixed by #6
Closed

rJava/jri compilation fails with parallel make (-j) #1

bastistician opened this issue Jan 10, 2014 · 2 comments · Fixed by #6

Comments

@bastistician
Copy link

I'm running R-3.0.2 on Ubuntu x86_64, configured with --enable-R-shlib (not sure if this is important).

I just found out that my use of parallel make (via the setting MAKE=make -j2 in my ~/.R/config) was the cause of the following compilation error:

Rcallbacks.c:9:36: fatal error: org_rosuda_JRI_Rengine.h: No such file or directory
compilation terminated.
make[1]: *** [Rcallbacks.o] Error 1

when trying to install.packages("rJava").

To reproduce this:

  1. Download http://cran.r-project.org/src/contrib/rJava_0.9-6.tar.gz
  2. Run ./configure in the root directory of the extracted archive
  3. Run make -j2 in the jri subdirectory
    This fails with the above error, but using make -j1 works.

To be able to use install.packages("rJava") in R, I temporarily set MAKE=make -j1 in my ~/.R/Makevars.

Since it took quiet some time to track down the error, I thought I should write about it here as a reference for other affected users. Maybe it would also be worth mentioning this potential error in the installation notes on http://www.rforge.net/rJava/.

@s-u
Copy link
Owner

s-u commented Jan 24, 2014

Parallel make is in general not supported, so by changing MAKE your'e entirely on your own (btw that should never be used to set make flags - it defines the make program, not its flags - those are separate). I'll flag this as an enhancement in case someone wants to contribute a pull request.

@bastistician
Copy link
Author

Up to now I did not have any problems installing contributed R packages using parallel make, I only recognized that I am "entirely on my own" when installing rJava.

Thanks for pointing me to MAKEFLAGS (I now set MAKEFLAGS=-j in my ~/.R/Makevars).

It might be an idea to set MAKEFLAGS=-j1 in rJava's jri/Makefile.all since https://www.gnu.org/software/make/manual/html_node/Options_002fRecursion.html says:

You can also set MAKEFLAGS in a makefile, to specify additional flags
that should also be in effect for that makefile

Telling make that way that the makefile infrastructure of rJava's jri is incompatible with parallelization works on my system (Ubuntu Linux, GNU make).

I'm not an expert, but it seems to me that this is no portable solution since the -j argument is not declared in POSIX make. So I have no idea what happens in other implementations of make...

krlmlr pushed a commit to KentonWhite/ProjectTemplate that referenced this issue Mar 5, 2014
krlmlr pushed a commit to KentonWhite/ProjectTemplate that referenced this issue Mar 5, 2014
@s-u s-u closed this as completed in #6 Mar 26, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants