Skip to content
Prev 56 / 2152 Next

Help installing sprng libraries

David Marra wrote:
Yes, I see. I'm not a Mac OS X expert, I only use it from time to time 
within my R-Forge work.

Anyway, there are two more things I forgot:

1) You need of course the right sprng library for your architecture. As 
far as I understood you'd like to run code on 64 bit R, then you need of 
course to get the 64 bit sprng from Na Li's website (this was not the 
case as far as I see from your initial mail).

2) Mac OS X has a binary package repository (the default) where rsprng 
is obviously not available.
That means you have to install rsprng via

install.packages("rsprng", configure.args="LD_FLAGS=\"-lgmp\" 
--with-sprng=/pathto/lib/sprng", type="source")

the latter argument indicates that you want to access the source part of 
CRAN (the package tarballs).

This works for me (at least when using 32 bit R and sprng on Leopard) 
but introduces a new problem:

 > install.packages("rsprng", configure.args="LD_FLAGS=\"-lgmp\" 
--with-sprng=/Users/theussl/lib/sprng", type="source")
trying URL 'http://cran.at.r-project.org/src/contrib/rsprng_0.4.tar.gz'
Content type 'application/x-gzip' length 36435 bytes (35 Kb)
opened URL
==================================================
downloaded 35 Kb

* Installing *source* package 'rsprng' ...
checking for gcc... gcc
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 gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
Try to find sprng.h ...
Found in /Users/theussl/lib/sprng/include
Try to find libsprng.a ...
Found in /Users/theussl/lib/sprng/lib
Try to find libgmp.a if we need it ...
checking for main in -lgmp... no
libgmp not found. exiting...
ERROR: configuration failed for package 'rsprng'
** Removing '/Library/Frameworks/R.framework/Resources/library/rsprng'

The downloaded packages are in
        /private/tmp/RtmpmMmU4y/downloaded_packages
Updating HTML index of packages in '.Library'
Warning message:
In install.packages("rsprng", configure.args = "LD_FLAGS=\"-lgmp\" 
--with-sprng=/Users/theussl/lib/sprng",  :
  installation of package 'rsprng' had non-zero exit status

But this is the point where my knowledge ends. I don't know if the GMP 
library is somewhere available in binary form. In the worst case you 
have to compile it yourself.

Best,
Stefan