[Rcpp-devel] Compiler errors with RcppGSL
Dirk Eddelbuettel
edd at debian.org
Thu Nov 13 14:24:18 CET 2014
On 13 November 2014 at 11:47, Devin Heer wrote:
| Thanks.
|
| I think, I messed up with the setting of the environment variable...due to the
| following new error message:
|
| g++ -m64 -I"C:/PROGRA~1/R/R-31~1.1/include" -DNDEBUG -IC:\Program Files (x86)\
| CodeLibraries/include -I"C:/PROGRA~1/R/R-31~1.1/library/Rcpp/include" -I"C:
| /PROGRA~1/R/R-31~1.1/library/RcppGSL/include" -I"d:/RCompile/CRANpkg/
| extralibs64/local/include" -O2 -Wall -mtune=core2 -c colNorm.cpp -o
| colNorm.o
| Syntax error: "(" unexpected
| make: *** [colNorm.o] Error 2
| Warning message:
| running command 'make -f "C:/PROGRA~1/R/R-31~1.1/etc/x64/Makeconf" -f "C:/
| PROGRA~1/R/R-31~1.1/share/make/winshlib.mk" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)'
| SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="sourceCpp_32194.dll" WIN=64 TCLBIN=64 OBJECTS=
| "colNorm.o"' had status 2
You generally want to do two things:
-- Avoid installing in directories with spaces in their name; this used to
be more important as mant components (ie R, Rcpp, ... ) try to be
resilient. But to keep things simple and reliable, I still install into
c:/opt/R-version/ (for R) and c:/opt/R/library/ (for packages) when on Windows
-- Use forward slashes (ie / ) not backward slashes. Backward slashes are
meta characters so you need _two_ of them. Hence a preference for a
single one.
So with that I'd try something like
LIB_GSL="C:/Program Files (x86)/Code/Libraries/"
and better still find the old dos-style 8.3 abbreviation -- something like
c:/progra~1/ or whatever the trick was.
Cheers, Dirk
|
| I assume this error is caused by the missing quotation mark around C:\Program
| Files (x86)\CodeLibraries/include. The path I used for LIB_GSL was C:\Program
| Files (x86)\CodeLibraries. I tried to fix by adjusting the environment variable
| and reinstalled RcppGSL package, but the same error consists. Even after
| removing the environment variable, RcppGSL still searches at this particular
| place, which is obviously the place the compiler is expecting the GSL library.
|
| Where does the g++ compiler take that information from? How I can adjust for
| that second location?
|
| Regards
| Devin
|
| On Thu, Nov 13, 2014 at 2:47 AM, Dirk Eddelbuettel <edd at debian.org> wrote:
|
|
| On 12 November 2014 at 18:08, Devin Heer wrote:
| | Thanks for your quick reply!
| |
| | Indeed, the file you described within RcppGSL\examples\RcppGSLExample\
| src looks
| | as follows:
| |
| | ## This assumes that the LIB_GSL variable points to working GSL libraries
| | PKG_CPPFLAGS=-I$(LIB_GSL)/include
| | PKG_LIBS=-L$(LIB_GSL)/lib -lgsl -lgslcblas
| |
| |
| | I can now simply replace LIB_GSL by the path where my GSL folder is
| located?
|
| Sure. The better way, though, is to the set the environment variable to the
| value of the directory. That way the portable code remains valid, and next
| you time you upgrade/build it still works.
|
| See any of the many fine tutorials on the web on how to set an environment
| variable.
|
| | And when I define a new function (outside RcppGSLExample), which
| Makevars.win
| | file is then queried? (since there is also a makevars.win file in RcppGSL
| \
| | skeleton; I should update this as well?)
|
| Always the one in the src/ directory of the package you are building.
|
| Dirk
|
| | Thanks
| |
| | On Wed, Nov 12, 2014 at 3:32 PM, Dirk Eddelbuettel <edd at debian.org>
| wrote:
| |
| |
| | Hi Devin,
| |
| | On 12 November 2014 at 15:13, Devin Heer wrote:
| | | Thus, I would really like to get the RcppGSL package up and
| running. I
| | have
| | | downloaded the GSL library and saved it in the same folder where
| the
| | header
| | | file Rcpp.h is located (I assume this is the default place RcppGSL
| is
| | looking
| | | for header- and source files).
| |
| | Nope. See below.
| |
| | | For test purposes, I try to compile the following (copied from
| | r-bloggers):
| |
| | [...]
| |
| | | c:/rbuildtools/3.1/gcc-4.6.3/bin/../lib/gcc/i686-w64-mingw32/4.6.3
| /../..
| | /../../
| | | i686-w64-mingw32/bin/ld.exe: cannot find -lgsl
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| | You need to communicate to your systeh where GSL is.
| |
| | Linux and OS X do that by querying the gsl-config script.
| |
| | Windows does that by querying the environment variable LIB_GSL, see
| src/
| | Makevars.win
| | and this comment:
| |
| | ## This assumes that the LIB_GSL variable points to working GSL
| | libraries
| |
| | The RcppGSL package comes with its test package examples/
| RcppGSLExample --
| | I
| | would recommend trying to build that first.
| |
| | Dirk
| |
| | --
| | http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org
| |
| |
|
| --
| http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org
|
|
--
http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org
More information about the Rcpp-devel
mailing list