[Rcpp-devel] problems using libc++ on ubuntu

Mark Lilback mlilback at stat.wvu.edu
Thu Dec 11 20:49:47 CET 2014

I’m using vagrant on a mac and will eventually deploy via docker.

I made a new container with 14.10, installed everything, and the same problem happens. The R-generated line:

clang++ -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o Rcpp.so Date.o Module.o Rcpp_init.o api.o attributes.o barrier.o -lc++ -v -L/usr/lib/R/lib -lR

is converted into

"/usr/bin/ld" --eh-frame-hdr -m elf_x86_64 -shared -o Rcpp.so /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu/crti.o /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/crtbeginS.o -L/usr/lib/R/lib -L/usr/lib/R/lib -L/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9 -L/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu -L/lib/x86_64-linux-gnu -L/lib/../lib64 -L/usr/lib/x86_64-linux-gnu -L/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../.. -L/usr/lib/llvm-3.5/bin/../lib -L/lib -L/usr/lib -Bsymbolic-functions -z relro Date.o Module.o Rcpp_init.o api.o attributes.o barrier.o -lc++ -lR -lstdc++ -lm -lgcc_s -lc -lgcc_s /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/crtendS.o /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu/crtn.o

I still can’t figure out where that “-lstdc++” is coming from. For now, I’m running that ld command without that extra flag and then copying the .so into place. 

On Dec 10, 2014, at 5:26 PM, Dirk Eddelbuettel <edd at debian.org> wrote:

> On 10 December 2014 at 15:28, Mark Lilback wrote:
> | I’m trying to intall Rcpp using clang and libc++ instead of gcc and
> | libstdc++. However, something is adding =lstdc++ to the call to ld and I
> | can’t figure out what it is.
> Ubuntu happens to be my default setup -- but it managed to fsck up clang in
> 13.10 and 14.04. Luckily it now works in 14.10:
> edd at max:~/git$ R CMD INSTALL Rcpp_0.11.3.3.tar.gz    # is my current dev snapshot
> * installing to library ‘/usr/local/lib/R/site-library’
> * installing *source* package ‘Rcpp’ ...
> ** libs
> ccache clang++ -Qunused-arguments -I/usr/share/R/include -DNDEBUG -I../inst/include/     -fpic  -O3  -c Date.cpp -o Date.o
> ccache clang++ -Qunused-arguments -I/usr/share/R/include -DNDEBUG -I../inst/include/     -fpic  -O3  -c Module.cpp -o Module.o
> ccache clang++ -Qunused-arguments -I/usr/share/R/include -DNDEBUG -I../inst/include/     -fpic  -O3  -c Rcpp_init.cpp -o Rcpp_init.o
> ccache clang++ -Qunused-arguments -I/usr/share/R/include -DNDEBUG -I../inst/include/     -fpic  -O3  -c api.cpp -o api.o
> ccache clang++ -Qunused-arguments -I/usr/share/R/include -DNDEBUG -I../inst/include/     -fpic  -O3  -c attributes.cpp -o attributes.o
> ccache clang++ -Qunused-arguments -I/usr/share/R/include -DNDEBUG -I../inst/include/     -fpic  -O3  -c barrier.cpp -o barrier.o
> g++-4.8 -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o Rcpp.so Date.o Module.o Rcpp_init.o api.o attributes.o barrier.o -L/usr/lib/R/lib -lR
> installing to /usr/local/lib/R/site-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
> * DONE (Rcpp)
> edd at max:~/git$ 
> You should upgrade to 14.10, or just run (say) Debian in a chroot / Docker
> container / virtual machine.
> Dirk
> -- 
> http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org

Mark Lilback
West Virginia University Department of Statistics
mlilback at stat.wvu.edu

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20141211/2386b55b/attachment.html>

More information about the Rcpp-devel mailing list