[Rcpp-devel] Rcpp installation fails with undefined symbol: _ZTISo - what library am I missing?

Steven McKinney smckinney at bccrc.ca
Wed Dec 17 05:14:46 CET 2014

Many thanks Dirk,

I seem unable to specify an alternate compiler.  configure.args and configure.vars with CC or CXX designations do not appear to invoke an alternate compiler.

Again, I'm not finding this addressed in any other way in the R-admin pdf or other info sources.  Can you tell me where to look, or what the incantation is to get install.packages to signal that an alternate compiler is wanted?

Do I need to compile R itself using g++ from the outset?

Warning message:
In install.packages("Rcpp", configure.args = "CXX=/share/data/usr/bin/g++") :
  installation of package ‚ had non-zero exit status
> install.packages("Rcpp", configure.args='CC=/share/data/usr/bin/g++')
trying URL 'http://cran.stat.sfu.ca/src/contrib/Rcpp_0.11.3.tar.gz'
Content type 'application/x-gzip' length 2169583 bytes (2.1 Mb)
opened URL
downloaded 2.1 Mb

* installing *source* package ‚ ...
** package ‚ successfully unpacked and MD5 sums checked
** libs
/share/data/usr/bin/gcc44 -I/share/data/apps/R/R-3.1.2/lib64/R/include -DNDEBUG -I../inst/include/ -I/share/data/usr/local/include -I/share/data/usr/include    -fpic  -g -O2  -c Date.cpp -o Date.o
/share/data/usr/bin/gcc44 -I/share/data/apps/R/R-3.1.2/lib64/R/include -DNDEBUG -I../inst/include/ -I/share/data/usr/local/include -I/share/data/usr/include    -fpic  -g -O2  -c Module.cpp -o Module.o

Steven McKinney

From: Dirk Eddelbuettel [edd at debian.org]
Sent: December 16, 2014 7:31 PM
To: Steven McKinney
Cc: rcpp-devel at lists.r-forge.r-project.org
Subject: Re: [Rcpp-devel] Rcpp installation fails with undefined symbol: _ZTISo - what library am I missing?

Hi Steven,

On 16 December 2014 at 19:16, Steven McKinney wrote:
| Hi,
| I installed R-3.1.2 today, and am having trouble installing Rcpp.
| The error message is
| Error in dyn.load(file, DLLpath = DLLpath, ...) :
|   unable to load shared object '/share/data/apps/R/R-3.1.2/lib64/R/library/Rcpp/libs/Rcpp.so':
|   /share/data/apps/R/R-3.1.2/lib64/R/library/Rcpp/libs/Rcpp.so: undefined symbol: _ZTISo
| so there's some library I haven't linked against.  I've combed the vignettes and the web, but haven't found anything specific for this symbol, and haven't found a list of libraries that need to be specified when compiling Rcpp.
| Can anyone tell me what libraries I should be linking against?

The c++filt tool is helpful:

  edd at max:~$ c++filt _ZTISo
  typeinfo for std::basic_ostream<char, std::char_traits<char> >
  edd at max:~$

This suggests basic iostream, ie C++ input/output. And indeed ...

| Best
| Steven McKinney
| Details:
| This is a custom install for a cluster situation, so libraries are in non-standard locations so as to be accessible to all machines in the cluster and local network.
| The error message in R is:
| libs
| /share/data/usr/bin/gcc44 -I/share/data/apps/R/R-3.1.2/lib64/R/include -DNDEBUG -I../inst/include/ -I/share/data/usr/local/include -I/share/data/usr/include    -fpic  -g -O2  -c Date.cpp -o Date.o

That is a) a bug OUCH for having to cope with a five-year old compiler
(gcc-4.4) but b) a serious error on your part: you generally want __g++__ and
not gcc for C++ code.  One of the differences is that g++ automagically links
against the C++ libraries.

That may be all you need.


| /share/data/usr/bin/gcc44 -I/share/data/apps/R/R-3.1.2/lib64/R/include -DNDEBUG -I../inst/include/ -I/share/data/usr/local/include -I/share/data/usr/include    -fpic  -g -O2  -c Module.cpp -o Module.o
| /share/data/usr/bin/gcc44 -I/share/data/apps/R/R-3.1.2/lib64/R/include -DNDEBUG -I../inst/include/ -I/share/data/usr/local/include -I/share/data/usr/include    -fpic  -g -O2  -c Rcpp_init.cpp -o Rcpp_init.o
| /share/data/usr/bin/gcc44 -I/share/data/apps/R/R-3.1.2/lib64/R/include -DNDEBUG -I../inst/include/ -I/share/data/usr/local/include -I/share/data/usr/include    -fpic  -g -O2  -c api.cpp -o api.o
| /share/data/usr/bin/gcc44 -I/share/data/apps/R/R-3.1.2/lib64/R/include -DNDEBUG -I../inst/include/ -I/share/data/usr/local/include -I/share/data/usr/include    -fpic  -g -O2  -c attributes.cpp -o attributes.o
| /share/data/usr/bin/gcc44 -I/share/data/apps/R/R-3.1.2/lib64/R/include -DNDEBUG -I../inst/include/ -I/share/data/usr/local/include -I/share/data/usr/include    -fpic  -g -O2  -c barrier.cpp -o barrier.o
| /share/data/usr/bin/gcc44 -shared -L/share/data/usr/local/lib64 -L/share/data/usr/lib64 -o Rcpp.so Date.o Module.o Rcpp_init.o api.o attributes.o barrier.o
| installing to /share/data/apps/R/R-3.1.2/lib64/R/library/Rcpp/libs
| ** R
| ** inst
| ** preparing package for lazy loading
| ** help
| *** installing help indices
| ** building package indices
| ** installing vignettes
| ** testing if installed package can be loaded
| Error in dyn.load(file, DLLpath = DLLpath, ...) :
|   unable to load shared object '/share/data/apps/R/R-3.1.2/lib64/R/library/Rcpp/libs/Rcpp.so':
|   /share/data/apps/R/R-3.1.2/lib64/R/library/Rcpp/libs/Rcpp.so: undefined symbol: _ZTISo
| Error: loading failed
| Execution halted
| ERROR: loading failed
| > sessionInfo()
| R version 3.1.2 (2014-10-31)
| Platform: x86_64-unknown-linux-gnu (64-bit)
| locale:
|  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
|  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
|  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C
|  [9] LC_ADDRESS=C               LC_TELEPHONE=C
| attached base packages:
| [1] stats     graphics  grDevices utils     datasets  methods   base
| loaded via a namespace (and not attached):
| [1] tcltk_3.1.2 tools_3.1.2
| >
| Steven McKinney, Ph.D.
| Statistician
| Molecular Oncology and Breast Cancer Program
| British Columbia Cancer Research Centre
| email: smckinney +at+ bccrc +dot+ ca
| tel: 604-675-8000 x7561
| Molecular Oncology
| 675 West 10th Ave, Floor 4
| Vancouver B.C.
| V5Z 1L3
| Canada
| _______________________________________________
| 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