kevinushey / sourcetools

Tools for reading, tokenizing, and parsing R code.
MIT License
77 stars 3 forks source link

Linux build fails #19

Closed andrewrech closed 7 years ago

andrewrech commented 7 years ago

Hello,

I cannot compile on Linux due to undefined symbol: _ZTVN10__cxxabiv117__class_type_infoE? Thanks!

Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.2 LTS

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8     LC_MONETARY=en_US.UTF-8
 [6] LC_MESSAGES=en_US.UTF-8    LC_PAPER=en_US.UTF-8       LC_NAME=C                  LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

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

gcc -v

Using built-in specs.
COLLECT_GCC=gcc-6
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/6/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 6.2.0-3ubuntu11~16.04' --with-bugurl=file:///usr/share/doc/gcc-6/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-6 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-6-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-6-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-6-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 6.2.0 20160901 (Ubuntu 6.2.0-3ubuntu11~16.04)
devtools::install_github("kevinushey/sourcetools")
Downloading GitHub repo kevinushey/sourcetools@master
from URL https://api.github.com/repos/kevinushey/sourcetools/zipball/master
Installing sourcetools
'/usr/lib/R/bin/R' --no-site-file --no-environ --no-save --no-restore --quiet  \
  CMD INSTALL  \
  '/tmp/root/RtmpOqm4IG/devtools9c4c12f7ca1a/kevinushey-sourcetools-0e66b34'  \
  --library='/usr/local/lib/R/site-library' --install-tests

* installing *source* package ‘sourcetools’ ...
** libs
gcc-6 -fopenmp -I/usr/share/R/include -DNDEBUG -I../inst/include  -I"/usr/local/lib/R/site-library/testthat/include"   -fpic  -g -O3 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c Completion.cpp -o Completion.o
gcc-6 -fopenmp -I/usr/share/R/include -DNDEBUG -I../inst/include  -I"/usr/local/lib/R/site-library/testthat/include"   -fpic  -g -O3 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c NSE.cpp -o NSE.o
gcc-6 -fopenmp -I/usr/share/R/include -DNDEBUG -I../inst/include  -I"/usr/local/lib/R/site-library/testthat/include"   -fpic  -g -O3 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c Parser.cpp -o Parser.o
gcc-6 -fopenmp -I/usr/share/R/include -DNDEBUG -I../inst/include  -I"/usr/local/lib/R/site-library/testthat/include"   -fpic  -g -O3 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c Reader.cpp -o Reader.o
gcc-6 -fopenmp -I/usr/share/R/include -DNDEBUG -I../inst/include  -I"/usr/local/lib/R/site-library/testthat/include"   -fpic  -g -O3 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c Tokenizer.cpp -o Tokenizer.o
gcc-6 -fopenmp -I/usr/share/R/include -DNDEBUG -I../inst/include  -I"/usr/local/lib/R/site-library/testthat/include"   -fpic  -g -O3 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c ValidateSyntax.cpp -o ValidateSyntax.o
gcc-6 -fopenmp -I/usr/share/R/include -DNDEBUG -I../inst/include  -I"/usr/local/lib/R/site-library/testthat/include"   -fpic  -g -O3 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c sourcetools-init.c -o sourcetools-init.o
gcc-6 -fopenmp -I/usr/share/R/include -DNDEBUG -I../inst/include  -I"/usr/local/lib/R/site-library/testthat/include"   -fpic  -g -O3 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c test-Parser.cpp -o test-Parser.o
gcc-6 -fopenmp -I/usr/share/R/include -DNDEBUG -I../inst/include  -I"/usr/local/lib/R/site-library/testthat/include"   -fpic  -g -O3 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c test-Tokenizer.cpp -o test-Tokenizer.o
gcc-6 -fopenmp -I/usr/share/R/include -DNDEBUG -I../inst/include  -I"/usr/local/lib/R/site-library/testthat/include"   -fpic  -g -O3 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c test-multibyte.cpp -o test-multibyte.o
gcc-6 -fopenmp -I/usr/share/R/include -DNDEBUG -I../inst/include  -I"/usr/local/lib/R/site-library/testthat/include"   -fpic  -g -O3 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c test-r.cpp -o test-r.o
gcc-6 -fopenmp -I/usr/share/R/include -DNDEBUG -I../inst/include  -I"/usr/local/lib/R/site-library/testthat/include"   -fpic  -g -O3 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c test-runner.cpp -o test-runner.o
gcc-6 -fopenmp -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o sourcetools.so Completion.o NSE.o Parser.o Reader.o Tokenizer.o ValidateSyntax.o sourcetools-init.o test-Parser.o test-Tokenizer.o test-multibyte.o test-r.o test-runner.o -L/usr/lib/R/lib -lR
installing to /usr/local/lib/R/site-library/sourcetools/libs
** R
** inst
** tests
** preparing 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 '/usr/local/lib/R/site-library/sourcetools/libs/sourcetools.so':
  /usr/local/lib/R/site-library/sourcetools/libs/sourcetools.so: undefined symbol: _ZTVN10__cxxabiv117__class_type_infoE
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/usr/local/lib/R/site-library/sourcetools’
* restoring previous ‘/usr/local/lib/R/site-library/sourcetools’
Error: Command failed (1)
kevinushey commented 7 years ago

AFAIK the Ubuntu repositories don't provide gcc-6 for Ubuntu 16.04. How was your version of gcc installed?

Given this:

$ c++filt _ZTVN10__cxxabiv117__class_type_infoE
vtable for __cxxabiv1::__class_type_info

I think that you're likely attempting to link against a version of libstdc++ that's not providing this symbol.

andrewrech commented 7 years ago

I installed gcc-6 from ppa:ubuntu-toolchain-r/test.

With vanilla gcc-5 I saw the same error. I had to change gcc-5 to g++-5 in my Makevars to automatically link libstdc++, which solved the issue.

Thanks for pointing me in the right direction!

R: devtools::install_github("kevinushey/sourcetools")

Downloading GitHub repo kevinushey/sourcetools@master
from URL https://api.github.com/repos/kevinushey/sourcetools/zipball/master
Installing sourcetools
'/usr/lib/R/bin/R' --no-site-file --no-environ --no-save --no-restore --quiet CMD INSTALL '/tmp/root/RtmppzRGCo/devtools8f7cdfd3dbf/kevinushey-sourcetools-0e66b34'  \
  --library='/usr/local/lib/R/site-library' --install-tests

* installing *source* package ‘sourcetools’ ...
** libs
g++-5 -fopenmp -I/usr/share/R/include -DNDEBUG -I../inst/include  -I"/usr/local/lib/R/site-library/testthat/include"   -fpic  -g -O3 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c Completion.cpp -o Completion.o
g++-5 -fopenmp -I/usr/share/R/include -DNDEBUG -I../inst/include  -I"/usr/local/lib/R/site-library/testthat/include"   -fpic  -g -O3 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c NSE.cpp -o NSE.o
g++-5 -fopenmp -I/usr/share/R/include -DNDEBUG -I../inst/include  -I"/usr/local/lib/R/site-library/testthat/include"   -fpic  -g -O3 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c Parser.cpp -o Parser.o
g++-5 -fopenmp -I/usr/share/R/include -DNDEBUG -I../inst/include  -I"/usr/local/lib/R/site-library/testthat/include"   -fpic  -g -O3 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c Reader.cpp -o Reader.o
g++-5 -fopenmp -I/usr/share/R/include -DNDEBUG -I../inst/include  -I"/usr/local/lib/R/site-library/testthat/include"   -fpic  -g -O3 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c Tokenizer.cpp -o Tokenizer.o
g++-5 -fopenmp -I/usr/share/R/include -DNDEBUG -I../inst/include  -I"/usr/local/lib/R/site-library/testthat/include"   -fpic  -g -O3 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c ValidateSyntax.cpp -o ValidateSyntax.o
gcc-5 -fopenmp -I/usr/share/R/include -DNDEBUG -I../inst/include  -I"/usr/local/lib/R/site-library/testthat/include"   -fpic  -g -O3 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c sourcetools-init.c -o sourcetools-init.o
g++-5 -fopenmp -I/usr/share/R/include -DNDEBUG -I../inst/include  -I"/usr/local/lib/R/site-library/testthat/include"   -fpic  -g -O3 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c test-Parser.cpp -o test-Parser.o
g++-5 -fopenmp -I/usr/share/R/include -DNDEBUG -I../inst/include  -I"/usr/local/lib/R/site-library/testthat/include"   -fpic  -g -O3 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c test-Tokenizer.cpp -o test-Tokenizer.o
g++-5 -fopenmp -I/usr/share/R/include -DNDEBUG -I../inst/include  -I"/usr/local/lib/R/site-library/testthat/include"   -fpic  -g -O3 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c test-multibyte.cpp -o test-multibyte.o
g++-5 -fopenmp -I/usr/share/R/include -DNDEBUG -I../inst/include  -I"/usr/local/lib/R/site-library/testthat/include"   -fpic  -g -O3 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c test-r.cpp -o test-r.o
g++-5 -fopenmp -I/usr/share/R/include -DNDEBUG -I../inst/include  -I"/usr/local/lib/R/site-library/testthat/include"   -fpic  -g -O3 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c test-runner.cpp -o test-runner.o
g++-5 -fopenmp -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o sourcetools.so Completion.o NSE.o Parser.o Reader.o Tokenizer.o ValidateSyntax.o sourcetools-init.o test-Parser.o test-Tokenizer.o test-multibyte.o test-r.o test-runner.o -L/usr/lib/R/lib -lR
installing to /usr/local/lib/R/site-library/sourcetools/libs
** R
** inst
** tests
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (sourcetools)