[Rcpp-devel] problem compiling package using Rcpp

Nick Matzke matzke at berkeley.edu
Thu Jan 3 02:00:41 CET 2013


Hi all,

I had a package that made use of Rcpp and compiled well in R 
2.14.  However, I just updated to R 2.15.2, and updated Rcpp 
etc. to the current standard, and now I get a compile error 
right at the end.  Any hints about what might cause this? 
It looks kind of like an Rcpp problem and not something with 
my package code, which didn't change.

=====================================
 > sessionInfo()
R version 2.15.2 (2012-10-26)
Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)

locale:
[1] 
en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] tools     stats     grDevices utils     datasets 
graphics  methods   base

other attached packages:
[1] rexpokit_0.1          SparseM_0.96          ape_3.0-6 
           RcppArmadillo_0.3.6.1 RcppGSL_0.2.0 
Rcpp_0.10.2           roxygen2_2.2.2        digest_0.6.0 


loaded via a namespace (and not attached):
[1] brew_1.0-6      codetools_0.2-8 compiler_2.15.2 
gee_4.13-18     grid_2.15.2     lattice_0.20-10 nlme_3.1-106 
    stringr_0.6.2




[...]



processing ‘phyRmcmc’
a directory
* build_help_types=
* DBG: 'R CMD INSTALL' now doing do_install()
* created lock directory 
‘/Library/Frameworks/R.framework/Versions/2.15/Resources/library/00LOCK-phyRmcmc’
* installing *source* package ‘phyRmcmc’ ...
** libs
*** arch - x86_64
about to run R CMD SHLIB -o phyRmcmc.so Num.cpp basics.cpp 
calc_anclikes_sp.cpp rcpp_hello_world.cpp rcpp_module.cpp 
stdVector.cpp
g++ -arch x86_64 
-I/Library/Frameworks/R.framework/Resources/include 
-I/Library/Frameworks/R.framework/Resources/include/x86_64 
-DNDEBUG  -I/usr/local/include 
-I/Library/Frameworks/R.framework/Resources/include 
-I/Library/Frameworks/R.framework/Resources/include/x86_64 
-I/Library/Frameworks/R.framework/Versions/2.14/Resources/library/Rcpp/include 
-I/Library/Frameworks/R.framework/Versions/2.14/Resources/library/RcppArmadillo/include 
-lf2c -lm 
-I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include" 
-I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppArmadillo/include" 
   -fPIC  -g -O2  -c Num.cpp -o Num.o
i686-apple-darwin11-g++-4.2.1: -lf2c: linker input file 
unused because linking not done
i686-apple-darwin11-g++-4.2.1: -lm: linker input file unused 
because linking not done
g++ -arch x86_64 
-I/Library/Frameworks/R.framework/Resources/include 
-I/Library/Frameworks/R.framework/Resources/include/x86_64 
-DNDEBUG  -I/usr/local/include 
-I/Library/Frameworks/R.framework/Resources/include 
-I/Library/Frameworks/R.framework/Resources/include/x86_64 
-I/Library/Frameworks/R.framework/Versions/2.14/Resources/library/Rcpp/include 
-I/Library/Frameworks/R.framework/Versions/2.14/Resources/library/RcppArmadillo/include 
-lf2c -lm 
-I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include" 
-I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppArmadillo/include" 
   -fPIC  -g -O2  -c basics.cpp -o basics.o
i686-apple-darwin11-g++-4.2.1: -lf2c: linker input file 
unused because linking not done
i686-apple-darwin11-g++-4.2.1: -lm: linker input file unused 
because linking not done
g++ -arch x86_64 
-I/Library/Frameworks/R.framework/Resources/include 
-I/Library/Frameworks/R.framework/Resources/include/x86_64 
-DNDEBUG  -I/usr/local/include 
-I/Library/Frameworks/R.framework/Resources/include 
-I/Library/Frameworks/R.framework/Resources/include/x86_64 
-I/Library/Frameworks/R.framework/Versions/2.14/Resources/library/Rcpp/include 
-I/Library/Frameworks/R.framework/Versions/2.14/Resources/library/RcppArmadillo/include 
-lf2c -lm 
-I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include" 
-I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppArmadillo/include" 
   -fPIC  -g -O2  -c calc_anclikes_sp.cpp -o calc_anclikes_sp.o
i686-apple-darwin11-g++-4.2.1: -lf2c: linker input file 
unused because linking not done
i686-apple-darwin11-g++-4.2.1: -lm: linker input file unused 
because linking not done
g++ -arch x86_64 
-I/Library/Frameworks/R.framework/Resources/include 
-I/Library/Frameworks/R.framework/Resources/include/x86_64 
-DNDEBUG  -I/usr/local/include 
-I/Library/Frameworks/R.framework/Resources/include 
-I/Library/Frameworks/R.framework/Resources/include/x86_64 
-I/Library/Frameworks/R.framework/Versions/2.14/Resources/library/Rcpp/include 
-I/Library/Frameworks/R.framework/Versions/2.14/Resources/library/RcppArmadillo/include 
-lf2c -lm 
-I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include" 
-I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppArmadillo/include" 
   -fPIC  -g -O2  -c rcpp_hello_world.cpp -o rcpp_hello_world.o
i686-apple-darwin11-g++-4.2.1: -lf2c: linker input file 
unused because linking not done
i686-apple-darwin11-g++-4.2.1: -lm: linker input file unused 
because linking not done
g++ -arch x86_64 
-I/Library/Frameworks/R.framework/Resources/include 
-I/Library/Frameworks/R.framework/Resources/include/x86_64 
-DNDEBUG  -I/usr/local/include 
-I/Library/Frameworks/R.framework/Resources/include 
-I/Library/Frameworks/R.framework/Resources/include/x86_64 
-I/Library/Frameworks/R.framework/Versions/2.14/Resources/library/Rcpp/include 
-I/Library/Frameworks/R.framework/Versions/2.14/Resources/library/RcppArmadillo/include 
-lf2c -lm 
-I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include" 
-I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppArmadillo/include" 
   -fPIC  -g -O2  -c rcpp_module.cpp -o rcpp_module.o
i686-apple-darwin11-g++-4.2.1: -lf2c: linker input file 
unused because linking not done
i686-apple-darwin11-g++-4.2.1: -lm: linker input file unused 
because linking not done
g++ -arch x86_64 
-I/Library/Frameworks/R.framework/Resources/include 
-I/Library/Frameworks/R.framework/Resources/include/x86_64 
-DNDEBUG  -I/usr/local/include 
-I/Library/Frameworks/R.framework/Resources/include 
-I/Library/Frameworks/R.framework/Resources/include/x86_64 
-I/Library/Frameworks/R.framework/Versions/2.14/Resources/library/Rcpp/include 
-I/Library/Frameworks/R.framework/Versions/2.14/Resources/library/RcppArmadillo/include 
-lf2c -lm 
-I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include" 
-I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppArmadillo/include" 
   -fPIC  -g -O2  -c stdVector.cpp -o stdVector.o
i686-apple-darwin11-g++-4.2.1: -lf2c: linker input file 
unused because linking not done
i686-apple-darwin11-g++-4.2.1: -lm: linker input file unused 
because linking not done
g++ -arch x86_64 -dynamiclib 
-Wl,-headerpad_max_install_names -undefined dynamic_lookup 
-single_module -multiply_defined suppress -L/usr/local/lib 
-o phyRmcmc.so Num.o basics.o calc_anclikes_sp.o 
rcpp_hello_world.o rcpp_module.o stdVector.o 
/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/lib/x86_64/libRcpp.a 
-F/Library/Frameworks/R.framework/.. -framework R 
-Wl,-framework -Wl,CoreFoundation
installing to 
/Library/Frameworks/R.framework/Versions/2.15/Resources/library/phyRmcmc/libs/x86_64

** R
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
Error in dyn.load(file, DLLpath = DLLpath, ...) :
   unable to load shared object 
'/Library/Frameworks/R.framework/Versions/2.15/Resources/library/phyRmcmc/libs/x86_64/phyRmcmc.so':
 
dlopen(/Library/Frameworks/R.framework/Versions/2.15/Resources/library/phyRmcmc/libs/x86_64/phyRmcmc.so, 
6): Symbol not found: 
__ZN4Rcpp8internal14r_vector_startILi10EiEEPT0_P7SEXPREC
   Referenced from: 
/Library/Frameworks/R.framework/Versions/2.15/Resources/library/phyRmcmc/libs/x86_64/phyRmcmc.so
   Expected in: flat namespace
  in 
/Library/Frameworks/R.framework/Versions/2.15/Resources/library/phyRmcmc/libs/x86_64/phyRmcmc.so
Error: loading failed
Execution halted
ERROR: loading failed
* removing 
‘/Library/Frameworks/R.framework/Versions/2.15/Resources/library/phyRmcmc’
Warning message:
In install.packages(packagename, lib = 
"/Library/Frameworks/R.framework/Resources/library/",  :
   installation of package ‘phyRmcmc’ had non-zero exit status

=====================================



One other difference between the compilation runs:

These are in my package:
basics.cpp
calc_anclikes_sp.cpp
rcpp_hello_world.cpp
rcpp_module.cpp

But the compilation of these:
Num.cpp
stdVector.cpp

...is new I think, this didn't happen when I compiled in 
2.14 IIRC.

Any help MUCH appreciated...

-- 
====================================================
Nicholas J. Matzke
Ph.D. Candidate, Graduate Student Researcher

Huelsenbeck Lab
Center for Theoretical Evolutionary Genomics
4151 VLSB (Valley Life Sciences Building)
Department of Integrative Biology
University of California, Berkeley

Graduate Student Instructor, IB200B
Principles of Phylogenetics: Ecology and Evolution
http://ib.berkeley.edu/courses/ib200b/
http://phylo.wikidot.com/


Lab websites:
http://ib.berkeley.edu/people/lab_detail.php?lab=54
http://fisher.berkeley.edu/cteg/hlab.html
Dept. personal page: 
http://ib.berkeley.edu/people/students/person_detail.php?person=370
Lab personal page: 
http://fisher.berkeley.edu/cteg/members/matzke.html
Lab phone: 510-643-6299
Dept. fax: 510-643-6264

Cell phone: 510-301-0179
Email: matzke at berkeley.edu

Mailing address:
Department of Integrative Biology
1005 Valley Life Sciences Building #3140
Berkeley, CA 94720-3140

-----------------------------------------------------
"[W]hen people thought the earth was flat, they were wrong. 
When people thought the earth was spherical, they were 
wrong. But if you think that thinking the earth is spherical 
is just as wrong as thinking the earth is flat, then your 
view is wronger than both of them put together."

Isaac Asimov (1989). "The Relativity of Wrong." The 
Skeptical Inquirer, 14(1), 35-44. Fall 1989.
http://chem.tufts.edu/AnswersInScience/RelativityofWrong.htm
====================================================


More information about the Rcpp-devel mailing list