[Rcpp-devel] undefined symbol: _ZTVN10__cxxabiv120__si_class_type_infoE (on Ubuntu but not on Mac OS X)

Peng Yu pengyu.ut at gmail.com
Tue Jul 7 00:24:14 CEST 2015


> PS Looking the ~/.R/Makevars (an optional file) I use here you may want
> to set SHLIB_CXXLD.
>
>   edd at max:~$ grep LD .R/Makevars
>   SHLIB_CXXLD=g++$(VER)
>   edd at max:~$
>
> (Here $(VER) is a local setting allowing me to switch between g++ versions.)

The things above do not solve my problem on Ubuntu (I use R-3.1.0).

I tried minqa_1.2.4. Originally, there were only .f files in its src/
directory. When I installed the package, I saw the following command
was run to make the shared library.

g++ -shared -L/usr/local/lib -o minqa.so altmov.o bigden.o biglag.o
bobyqa.o bobyqb.o lagmax.o minqa.o newuoa.o newuob.o prelim.o rescue.o
trsapp.o trsbox.o trstep.o uobyqa.o uobyqb.o update.o updatebobyqa.o
-lgfortran -lm -lquadmath

Then I changed lagmax.f to lagmax.f90 (and changed the fortran code
from fixed format to free format). Now, it calls the follow command to
make the shared library.

gfortran -shared -L/usr/local/lib -o minqa.so altmov.o bigden.o
biglag.o bobyqa.o bobyqb.o lagmax.o minqa.o newuoa.o newuob.o prelim.o
rescue.o trsapp.o trsbox.o trstep.o uobyqa.o uobyqb.o update.o
updatebobyqa.o -lgfortran -lm -lquadmath

So the problem seems that R somehow handles .f and .f90 differently.

I then manually changed the following file in the directory where the
R is installed.

/opt/packages/R/R-3.1.0/lib/R/etc/Makeconf

In particular, I addd three "info" commands before and after where
SHLIB_LD is set.

$(info CC $(CC))
$(info SHLIB_LD 1 $(SHLIB_LD))
SHLIB_LD = $(CC)
$(info SHLIB_LD 2 $(SHLIB_LD))

When I install the R package (with a .f90 file), I see the following
command. The weird thing is that SHLIB_LD is not changed after it is
set in `/opt/packages/R/R-3.1.0/lib/R/etc/Makeconf`.

CC gcc -std=gnu99
SHLIB_LD 1 gfortran
SHLIB_LD 2 gfortran

Could you try if you can reproduce the problem?

I know that make has an option -e to ignore variable set within the
script. This sounds to be the case. However, it is not clear to where
make is called and how it is called as when try to search "make" I got
many files containing, it is hard to find the location where it
matters.

Do you have a way to solve this problem?

Thanks.

BTW, I checked all the packages that depend on Rcpp one way or
another. All the packages which use FORTRAN only have .f files but not
.f90 files. Is it an coincident or it is known that R does not support
.f90 well?

-- 
Regards,
Peng


More information about the Rcpp-devel mailing list