rjags install problem. undefined symbol
Brought to you by:
martyn_plummer
Hi all,
I have tried to install rjags in R 3.6.0. I have installed jags/4.3.0 via modules.
I try to install rjags from cran with both:
install.packages("rjags",)
install.packages("rjags", configure.args="--enable-rpath")
And I get the following error (I tried many things and did not work). Any idea?
Installing package into ‘/icgc/dkfzlsdf/analysis/B260/software/R_libraries’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/src/contrib/rjags_4-10.tar.gz'
Content type 'application/x-gzip' length 74060 bytes (72 KB)
==================================================
downloaded 72 KB
* installing *source* package ‘rjags’ ...
** package ‘rjags’ successfully unpacked and MD5 sums checked
** using staged installation
checking for pkg-config... /home/r511a/.conda/envs/gparra/bin/pkg-config
configure: Setting compile and link flags according to pkg-config
configure: Compile flags are -I/software/jags/4.3.0/include/JAGS
configure: Link flags are -L/software/jags/4.3.0/lib -ljags
checking for gcc... gcc -std=gnu99
checking whether we are using the GNU C compiler... no
checking whether gcc -std=gnu99 accepts -g... no
checking for gcc -std=gnu99 option to accept ISO C89... unsupported
checking for jags_version in -ljags... yes
checking version of JAGS library... OK
configure: creating ./config.status
config.status: creating src/Makevars
configure: creating ./config.status
config.status: creating src/Makevars
config.status: creating R/unix/zzz.R
** libs
gcc -std=gnu99 -I"/software/r/3.6.0/lib64/R/include" -DNDEBUG -I/software/jags/4.3.0/include/JAGS -I/usr/local/include -fpic -g -O2 -c init.c -o init.o
g++ -std=gnu++11 -I"/software/r/3.6.0/lib64/R/include" -DNDEBUG -I/software/jags/4.3.0/include/JAGS -I/usr/local/include -fpic -g -O2 -c jags.cc -o jags.o
g++ -std=gnu++11 -I"/software/r/3.6.0/lib64/R/include" -DNDEBUG -I/software/jags/4.3.0/include/JAGS -I/usr/local/include -fpic -g -O2 -c parallel.cc -o parallel.o
g++ -std=gnu++11 -shared -L/software/r/3.6.0/lib64/R/lib -L/usr/local/lib64 -o rjags.so init.o jags.o parallel.o -L/software/jags/4.3.0/lib -ljags -Wl,-rpath /software/jags/4.3.0/lib -L/software/r/3.6.0/lib64/R/lib -lR
installing to /icgc/dkfzlsdf/analysis/B260/software/R_libraries/00LOCK-rjags/00new/rjags/libs
** R
** data
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for ‘rjags’:
.onLoad failed in loadNamespace() for 'rjags', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object '/icgc/dkfzlsdf/analysis/B260/software/R_libraries/00LOCK-rjags/00new/rjags/libs/rjags.so':
/icgc/dkfzlsdf/analysis/B260/software/R_libraries/00LOCK-rjags/00new/rjags/libs/rjags.so: undefined symbol: _ZN4jags7Console10setRNGnameERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEj
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/icgc/dkfzlsdf/analysis/B260/software/R_libraries/rjags’
Warning in install.packages :
installation of package ‘rjags’ had non-zero exit status
Anonymous
Any luck? I'm having the same issue using R-3.6.2 with JAGS 4.3.0 with
and I have the "jags" executable in my $PATH as well.
Hi, just to follow up on my previous reply, I was able to resolve the issue by going back and recompiling JAGS-4.3.0 with the exact same version of the gcc compiler which R uses to compile the rjags package.
Initially, I had compiled JAGS-4.3.0 with gcc-4.4.7, while R-3.62 was using gcc-9.2.0 to compile the rjags package (as defined with the CC / CXX definitions in my /path/to/R_install/lib64/R/etc/Makeconf file). Compiling JAGS-4.30 with gcc-9.2.0 resolved the issue for me.
Can you share how you compiled JAGS with the gcc-9.2.0? I am not savy enough to know how to do that. Thanks!
I'm having the same issue.
I too am having the same issue.
I have also resolved the very same issue (in R 3.6.1, conda, ubuntu) by recompiling jags.
I downloaded JAGS-4.3.0.tar.gz, then followed the instructions in INSTALL:
./configure
make
sudo make install
make installcheck
installation went into
/usr/local/bin/jags, /usr/local/include/JAGS, /usr/local/lib/libjags.so.4.0.3
and then, from R (Rstudio):
install.packages("rjags", configure.args="--enable-rpath")
Easy :)
HTH
Alberto from Milan
Dear all.
Any advise will be very appreciated it.
That error has to do with locating the version of JAGS/BUGS on my
system (Mac Mojave)
WARNING: The locate database (/var/db/locate.database) does not exist./
Thank you