[R-SIG-Mac] problem installing rjags package

Michael Braun braunm at mit.edu
Sat Oct 9 23:56:44 CEST 2010


Hi!

I am trying to install rjags on my Mac Pro running OSX 10.6.4, and R 2.11.1 (which I compiled myself so I could link to the Intel MKL blas, which I prefer to other options).   I was successfully able to install JAGS 2.1.0 through both the binary installer, and compiling from source (I get the same problem either way).

But I would like to use the rjags package. When I do 

install.packages("rjags")


I get the folliowing output:

* installing *source* package ‘rjags’ ...
checking for prefix by checking for jags... /usr/local/bin/jags
checking for g++... g++
checking for C++ compiler default output file name... a.out
checking whether the C++ compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking how to run the C++ preprocessor... g++ -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking Console.h usability... yes
checking Console.h presence... yes
checking for Console.h... yes
checking for gcc... gcc
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for jags_version in -ljags... yes
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
*** arch - x86_64
g++ -arch x86_64 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/x86_64 -I/usr/local/include/JAGS -I/opt/intel/Compiler/11.1/089/Frameworks/mkl/Headers -I/Install_Files/MKL_gfortran_interface/include/em64t/lp64    -fPIC  -m64 -msse4.2 -g -O2 -c jags.cc -o jags.o
g++ -arch x86_64 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/opt/intel/Compiler/11.1/089/Frameworks/mkl/Libraries/em64t -L/Users/braunm/Install_Files/MKL_gfortran_interface/lib/em64t -o rjags.so jags.o -lgsl -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
installing to /Users/braunm/.R/Library/rjags/libs/x86_64
** R
** data
** preparing package for lazy loading
** help
*** installing help indices
** building package indices ...
Error : .onLoad failed in loadNamespace() for 'rjags', details:
  call: dyn.load(file, DLLpath = DLLpath, ...)
  error: unable to load shared library '/Users/braunm/.R/Library/rjags/libs/x86_64/rjags.so':
  dlopen(/Users/braunm/.R/Library/rjags/libs/x86_64/rjags.so, 10): Symbol not found: _JAGS_NA
  Referenced from: /Users/braunm/.R/Library/rjags/libs/x86_64/rjags.so
  Expected in: flat namespace
 in /Users/braunm/.R/Library/rjags/libs/x86_64/rjags.so
ERROR: installing package indices failed
* removing ‘/Users/braunm/.R/Library/rjags’


However, when I go to look at the symbols in the jags library, I see

braunm4: /usr/local/lib $ nm libjags.dylib |grep JAGS
0000000000098650 S _JAGS_NA
0000000000110338 S _JAGS_NAN
0000000000110348 S _JAGS_NEGINF
0000000000110340 S _JAGS_POSINF
000000000000133c t __GLOBAL__I_JAGS_NA

and when I try

braunm4: /usr/local/lib $ nm libjags.a |grep JAGS
                 U _JAGS_NA
                 U _JAGS_NEGINF
                 U _JAGS_NA
                 U _JAGS_NA
0000000000000060 S _JAGS_NA
00000000000000b8 B _JAGS_NAN
00000000000000c8 B _JAGS_NEGINF
00000000000000c0 B _JAGS_POSINF
                 U _JAGS_NA
                 U _JAGS_NEGINF
                 U _JAGS_POSINF
                 U _JAGS_NEGINF
                 U _JAGS_POSINF
                 U _JAGS_NEGINF
                 U _JAGS_NA
                 U _JAGS_NEGINF
                 U _JAGS_NEGINF
                 U _JAGS_NA
                 U _JAGS_NEGINF
                 U _JAGS_POSINF


So the jags libraries (both static and dynamic) are in the standard place, and it looks like the symbols rjags.so needs are there as well.  So I'm not sure what the rjags installer is looking for.  Is there perhaps an environment variable that I am missing?

Here is my sessionInfo():

> sessionInfo()
R version 2.11.1 (2010-05-31) 
x86_64-apple-darwin10.4.2 

locale:
[1] en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     grDevices datasets  graphics  utils     methods   base     

other attached packages:
 [1] xtable_1.5-6     doMC_1.2.1       multicore_0.1-3  foreach_1.3.0    codetools_0.2-2  iterators_1.0.3  coda_0.13-5      matrixcalc_1.0-1 lattice_0.18-8   reshape_0.8.3    plyr_1.2.1      
[12] mvtnorm_0.9-92  

loaded via a namespace (and not attached):
[1] grid_2.11.1  tcltk_2.11.1 tools_2.11.1


Thanks in advance for your help.

Michael








-------------------------------------------
Michael Braun
Homer A. Burnell (1928) Career Development Professor, 
	and Assistant Professor of Management Science (Marketing Group)
MIT Sloan School of Management
100 Main St.., E62-535
Cambridge, MA 02139
braunm at mit.edu
617-253-3436



More information about the R-SIG-Mac mailing list