install.packages("rjags") and the install.packages("rjags", configure.args="--enable-rpath") recomended in rjags's INSTALL fails with the following error:

** 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 '/<path to r libraries>/R_libraries/00LOCK-rjags/00new/rjags/libs/rjags.so':
  /<path to r libraries>/R_libraries/00LOCK-rjags/00new/rjags/libs/rjags.so: undefined symbol: _ZN4jags7Console10setRNGnameERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEj
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘<path to r libraries>/R_libraries/rjags’
Warning in install.packages :
  installation of package ‘rjags’ had non-zero exit status
1

There are 1 best solutions below

0
On

Apparently, this problem occures when using different compilers (/versions) for JAGS and rjags. After reading these comments in the JAGS support forum, I changed the compiler used to compile rjags to the system default that was presumably also used to build JAGS by unloading the gcc/7.2.0 module I use (module rm gcc/7.2.0).