RCall.jl icon indicating copy to clipboard operation
RCall.jl copied to clipboard

Sourcing Conda environment during R package compilation

Open m-wells opened this issue 6 years ago • 2 comments

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.

m-wells avatar Apr 19 '18 02:04 m-wells

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

randy3k avatar Apr 19 '18 02:04 randy3k

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.

m-wells avatar Apr 19 '18 05:04 m-wells