Hi,
I have been trying to install the rj/
rj.gd packages from source on a Mac, unsuccessfully. I mostly worked on this a couple of weeks ago, but decided to give it another try today, using the latest versions (4.0.1):
The problem seems to be with the C compiler that Mac uses by default, which doesn't support the -fopenmp option:
clang: error: unsupported option '-fopenmp'
make[2]: *** [libjri.jnilib] Error 1
make[1]: *** [src/JRI.jar] Error 2
make: *** [jri] Error 2
ERROR: compilation failed for package ‘rj’
This is running on a fresh install of MacOS 10.15.3 (Catalina) with R 3.6.1 I tried installed alternate compilers (gfortran 4.2.3, jdk-11.0.6+10_openj9-0.18.1 and clang 8.0.0) and creating/tweaking a ~/.R/Makevars file, but I wasn't been able to get R to use the clang 8 compiler.
Finally, I tried setting things up with conda, to isolate the problem:
conda create -n r36
conda activate r36
conda config --env --add channels bioconda \
&& conda config --env --add channels conda-forge \
&& conda config --show channels
conda install -c bioconda java-jdk gcc llvm
conda install r=3.6 r-essentials r-rjava r-tidyverse r-devtools r-plotly
pkg.dir <- "~/Downloads"
install.packages(
file.path(pkg.dir, c("rj_4.0.1-1.tar.gz", "rj.gd_4.0.1-0.tar.gz")),
repos=NULL, type="source", verbose=TRUE)
This finally worked for the rj package (yay-- progress), but I got an error with
rj.gd:
Error: package or namespace load failed for ‘rj.gd’:
.onLoad failed in loadNamespace() for 'rj.gd', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object '~/opt/miniconda3/envs/r36/lib/R/library/00LOCK-rj.gd/00new/rj.gd/libs/rj.gd.dylib':
dlopen(~/opt/miniconda3/envs/r36/lib/R/library/00LOCK-rj.gd/00new/rj.gd/libs/rj.gd.dylib, 6): Library not loaded: @rpath/libjvm.dylib
Referenced from: ~/opt/miniconda3/envs/r36/lib/R/library/00LOCK-rj.gd/00new/rj.gd/libs/rj.gd.dylib
Reason: image not found
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘~/opt/miniconda3/envs/r36/lib/R/library/rj.gd’
(note: the tilde in the above output was originally the full path to my homedir.)
I also tried installing from the production version, with the same results:
Has anybody else had luck with installing these on MacOS Catalina? Any help provided would be appreciated.
Thanks,
Mike