pleydell at supagro.inra.fr
2010-Jan-22 09:59 UTC
[Rd] R CMD check error with the GNU Scientific Library
I have been working on an R package that calls C code using .C(). I recently started including some functions from the GNU Scientific Library in my code. The code runs fine on my machine when not wrapped in the package. But I get the following error from "R CMD check" * checking whether the package can be loaded ... ERROR Loading required package: splancs Loading required package: sp Spatial Point Pattern Analysis Code in S-Plus Version 2 - Spatial and Space-Time analysis Loading required package: ellipse Loading required package: mvtnorm Error in dyn.load(file, DLLpath = DLLpath, ...) : unable to load shared library '/home/david/papers/inProgress/sharka_istanbull/package/sharka.Rcheck/sharka/libs/sharka.so': /home/david/papers/inProgress/sharka_istanbull/package/sharka.Rcheck/sharka/libs/sharka.so: undefined symbol: gsl_multimin_fminimizer_nmsimplex Error in library(sharka) : .First.lib failed for 'sharka' Execution halted Clearly there is some difficulty linking up with gsl_multimin_fminimizer_nmsimplex. I noticed the QRMlib library also includes gsl functions. In that package they include a src/gsl directory with the required .h files and in Makevars they have "PKG_CFLAGS = -I./gsl". I have copied this approach, but wonder if using the standard "R CMD build myPackage" "R CMD check myPackage" needs modifying in some way? All hints or ideas welcome. Thanks David -- David Pleydell UMR BGPI CIRAD TA A-54/K Campus International de Baillarguet 34398 MONTPELLIER CEDEX 5 FRANCE Tel: +33 4 99 62 48 65 - Secr?tariat : +33 4 99 62 48 21 Fax : +33 4 99 62 48 22 http://umr-bgpi.cirad.fr/trombinoscope/pleydell_d.htm https://sites.google.com/site/drjpleydell/
Maybe you want to check out the R package gsl and take a look how it is solved there using a configure script that looks up the gsl installation. Best wishes, Uwe On 22.01.2010 10:59, pleydell at supagro.inra.fr wrote:> I have been working on an R package that calls C code using .C(). I recently > started including some functions from the GNU Scientific Library in my code. > The code runs fine on my machine when not wrapped in the package. But I get the > following error from "R CMD check" > > * checking whether the package can be loaded ... ERROR > Loading required package: splancs > Loading required package: sp > > Spatial Point Pattern Analysis Code in S-Plus > > Version 2 - Spatial and Space-Time analysis > Loading required package: ellipse > Loading required package: mvtnorm > Error in dyn.load(file, DLLpath = DLLpath, ...) : > unable to load shared library > '/home/david/papers/inProgress/sharka_istanbull/package/sharka.Rcheck/sharka/libs/sharka.so': > > /home/david/papers/inProgress/sharka_istanbull/package/sharka.Rcheck/sharka/libs/sharka.so: > undefined symbol: gsl_multimin_fminimizer_nmsimplex > Error in library(sharka) : .First.lib failed for 'sharka' > Execution halted > > Clearly there is some difficulty linking up with > gsl_multimin_fminimizer_nmsimplex. > > I noticed the QRMlib library also includes gsl functions. In that package they > include a src/gsl directory with the required .h files and in Makevars they > have "PKG_CFLAGS = -I./gsl". I have copied this approach, but wonder if using > the standard > > "R CMD build myPackage" > "R CMD check myPackage" > > needs modifying in some way? > > All hints or ideas welcome. > Thanks > David > > > > >
Romain Francois
2010-Jan-22 10:12 UTC
[Rd] R CMD check error with the GNU Scientific Library
Hi, You'll need something like : PKG_LIBS=-lgsl -lgslcblas in your Makevars. This is from package gsl (on CRAN). Or maybe you can just depend on the gsl package and let it worry about finding where gsl is, etc ... Romain On 01/22/2010 10:59 AM, pleydell at supagro.inra.fr wrote:> > I have been working on an R package that calls C code using .C(). I recently > started including some functions from the GNU Scientific Library in my code. > The code runs fine on my machine when not wrapped in the package. But I get the > following error from "R CMD check" > > * checking whether the package can be loaded ... ERROR > Loading required package: splancs > Loading required package: sp > > Spatial Point Pattern Analysis Code in S-Plus > > Version 2 - Spatial and Space-Time analysis > Loading required package: ellipse > Loading required package: mvtnorm > Error in dyn.load(file, DLLpath = DLLpath, ...) : > unable to load shared library > '/home/david/papers/inProgress/sharka_istanbull/package/sharka.Rcheck/sharka/libs/sharka.so': > > /home/david/papers/inProgress/sharka_istanbull/package/sharka.Rcheck/sharka/libs/sharka.so: > undefined symbol: gsl_multimin_fminimizer_nmsimplex > Error in library(sharka) : .First.lib failed for 'sharka' > Execution halted > > Clearly there is some difficulty linking up with > gsl_multimin_fminimizer_nmsimplex. > > I noticed the QRMlib library also includes gsl functions. In that package they > include a src/gsl directory with the required .h files and in Makevars they > have "PKG_CFLAGS = -I./gsl". I have copied this approach, but wonder if using > the standard > > "R CMD build myPackage" > "R CMD check myPackage" > > needs modifying in some way? > > All hints or ideas welcome. > Thanks > David-- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://tr.im/KfKn : Rcpp 0.7.2 |- http://tr.im/JOlc : External pointers with Rcpp `- http://tr.im/JFqa : R Journal, Volume 1/2, December 2009