← 输入框|github.com|刷新
Skip to content

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

Closed

Description

@bastistician

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/.

Activity

  1. s-u commented on Jan 24, 2014

    @s-u
    Owner

    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.

  2. bastistician commented on Jan 24, 2014

    @bastistician
    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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions