Skip to content

Help installing sprng libraries

6 messages · Stefan Theussl, David Marra, Dirk Eddelbuettel

#
Hi David,

it seems to me that your unpacked sprng library and header files are not 
in a standard path. If so, you can install rsprng directly from R using
install.packages("rsprng", configure.args = 
"--with-sprng=/path/to/your/unpacked/sprng")

Best,
Stefan
David Marra wrote:
#
Hi Stefan/Everyone,

Thank you for the suggestion. I am getting the following message now:

Warning message:
package ?rsprng? is not available

Any thoughts?

David
On Dec 11, 2008, at 10:50 PM, Stefan Theussl wrote:

            
#
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
#
Stefan/Everyone,

This is helpful. Using the code you provided I am able to install  
rsprng for 32 bit Leopard, but still leaves open how to achieve this  
for 64-bit.

Is anyone aware of whether the Linux 64-bit sprng on Na Li's website  
will work with Leopard or alternatively where one can download a 64- 
bit sprng for Leopard?

many thanks,
David
On Dec 11, 2008, at 11:39 PM, Stefan Theussl wrote:

            
#
On 11 December 2008 at 23:57, David Marra wrote:
| Stefan/Everyone,
| 
| This is helpful. Using the code you provided I am able to install  
| rsprng for 32 bit Leopard, but still leaves open how to achieve this  
| for 64-bit.
| 
| Is anyone aware of whether the Linux 64-bit sprng on Na Li's website  
| will work with Leopard or alternatively where one can download a 64- 
| bit sprng for Leopard?

I cannot help you with respect to Leopard and other four-legged cats ;-) but
when I added rsprng (and hence sprng) to Debian years ago, I mod'ed the sprng
Makefile etc to make it cope with the standard so that it would build on all
11 or 12 Debian architectures.  Now, these are all Linux -- but they span
tiny to large systems and do work on a number of 64 bit systems.  You could
glance at the diff and see if it helps.

You can start e.g. here 
  http://packages.debian.org/source/sid/sprng
and fetch the .diff.gz from the bar on the right. 

Dirk