[Rcpp-devel] Problems with installing RcppGSL

Dirk Eddelbuettel edd at debian.org
Wed Oct 14 09:14:43 CEST 2015


There is a chance you may be confused.

On 14 October 2015 at 14:18, binbinlu at whu.edu.cn wrote:
| Hi,
| 
| Recently I am trying to use GSL for improving my code and I found RcppGSL is
| really great. BUT I am stuck by configuring it for a few days. What I've done
| is as:
| 
| 1. Install Rcpp and RcppGSL;
| 2. Download "local320.zip" file and unzipped it as "LIB_GSL"

You don't "unzip it as 'LIB_GSL'. You can ubzip it anywhere. Say you use 
c:/libs/gsl/ -- but then you have to set the _environment variable_ named
LIB_GSL to the _value_ of the location you used, eg c:/lib/gsl

| 3. Add an environment variable LIB_GSL, and make it as "D:/LIB_GSL"
| 4. Edit the "Makevars.win" as follows:
| 
| PKG_CPPFLAGS=-I$(LIB_GSL)/include -I../inst/include
| PKG_LIBS=-L$(LIB_GSL)/lib/x64 -lgsl -lgslcblas $(shell "${R_HOME}/bin$
| {R_ARCH_BIN}/Rscript.exe" -e "Rcpp:::LdFlags()")

What did you edit? Why did you think you needed to edit?
| 
| Then I started to run the example code:
| 
| > sourceCpp("bSpline.cpp")
| 
| I got the following errors:
| 
| g++ -m64 -I"D:/PROGRA~1/R/R-31~1.1/include" -DNDEBUG -ID:/LIB_GSL/include -ID:/
| LIB_GSL/include -I../inst/include -I"D:/PROGRA~1/R/R-31~1.1/library/Rcpp/
| include" -I"D:/PROGRA~1/R/R-31~1.1/library/RcppGSL/include" -I"E:/Dropbox/Paper
| /HIGHPE~1/packages/RcppGSL/inst/examples/bSpline" -I"d:/RCompile/CRANpkg/
| extralibs64/local/include" -O2 -Wall -mtune=core2 -c bSpline.cpp -o bSpline.o
| g++ -m64 -shared -s -static-libgcc -o sourceCpp_1.dll tmp.def bSpline.o -LD:/
| LIB_GSL/lib -lgsl -lgslcblas -LD:/PROGRA~1/R/R-31~1.1/bin/x64 -lRlapack -LD:/
| PROGRA~1/R/R-31~1.1/bin/x64 -lRblas -lgfortran -LD:/LIB_GSL/lib -lgsl
| -lgslcblas -Ld:/RCompile/CRANpkg/extralibs64/local/lib/x64 -Ld:/RCompile/
| CRANpkg/extralibs64/local/lib -LD:/PROGRA~1/R/R-31~1.1/bin/x64 -lR
| d:/rtools/gcc-4.6.3/bin/../lib/gcc/i686-w64-mingw32/4.6.3/../../../../
| i686-w64-mingw32/bin/ld.exe: cannot find -lgsl
| d:/rtools/gcc-4.6.3/bin/../lib/gcc/i686-w64-mingw32/4.6.3/../../../../
| i686-w64-mingw32/bin/ld.exe: cannot find -lgslcblas
| d:/rtools/gcc-4.6.3/bin/../lib/gcc/i686-w64-mingw32/4.6.3/../../../../
| i686-w64-mingw32/bin/ld.exe: cannot find -lgsl
| d:/rtools/gcc-4.6.3/bin/../lib/gcc/i686-w64-mingw32/4.6.3/../../../../
| i686-w64-mingw32/bin/ld.exe: cannot find -lgslcblas
| collect2: ld returned 1 exit status
| 
| I've no idea what happened. Did I miss anything or do something wrongly? Many
| thanks!

It seems to have found the headers (or else it would not have compiled) but
not the library.  Check D:/LIB_GSL/lib/ and see if it has the missing
libraries libgsl and libgslcblas.

All this is used the same way at CRAN so it works there....

Dirk

| 
| Best regards,
| 
| Binbin 
| 
| _______________________________________________
| Rcpp-devel mailing list
| Rcpp-devel at lists.r-forge.r-project.org
| https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org


More information about the Rcpp-devel mailing list