JuliaInterop / RCall.jl

Call R from Julia
Other
317 stars 59 forks source link

Sourcing Conda environment during R package compilation #240

Closed m-wells closed 4 days ago

m-wells commented 6 years ago

I encounter an issue while installing an R package. I've install the histogram package like so R"install.library('histogram')" without an issue. However, when I do R"install.library('ftnonpar')" it gives me

x86_64-conda_cos6-linux-gnu-gfortran   -fpic  -fopenmp -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -pipe -I/home/mark/.julia/v0.6/Conda/deps/usr/include -fdebug-prefix-map==/usr/local/src/conda/- -fdebug-prefix-map==/usr/local/src/conda-prefix  -c NPSPCDN.f -o NPSPCDN.o
make: x86_64-conda_cos6-linux-gnu-gfortran: Command not found
make: *** [/home/mark/.julia/v0.6/Conda/deps/usr/lib/R/etc/Makeconf:184: NPSPCDN.o] Error 127
ERROR: compilation failed for package ‘ftnonpar’
* removing ‘/home/mark/.julia/v0.6/Conda/deps/usr/lib/R/library/ftnonpar’

To fix this I located my Conda activate script which is at

/home/mark/.julia/v0.6/Conda/deps/usr/bin/activate

Then I drop out of julia, run source activate, restart julia, and do

using RCall
R"install.library('ftnonpar')"

and it installs and I can use it.

Anyway, maybe this can be useful to someone else.

randy3k commented 6 years ago

👍 @m-wells I could imagine someone will encounter similar issues sooner or later.

m-wells commented 6 years ago

To expand upon the above. The reason ftnonpar needed me to source the Conda environment and the histogram package did not is because ftnonpar has NeedsCompilation yes while histogram has NeedsCompilation no.