Casper Clemence
2009-May-08 12:19 UTC
[Rd] dqrdc2_ dqrsl_ dtrsl_ missing from libs? compiling earth standalone
I have been trying to compile the earth Multivariate Adaptive Regression of Splines package as a standalone application under Linux (x86_64 kernel-2.6.27.21 openSUSE 11.1) with gcc 4.3.2. The package compiles without problems from within R as an R module and I get the following linker error: earth.c:(.text+0x1a14): undefined reference to `dqrdc2_' earth.c:(.text+0x1ae4): undefined reference to `dqrsl_' earth.c:(.text+0x1d99): undefined reference to `dtrsl_' earth.c includes: extern _C_ int dqrdc2_(... extern _C_ int dqrsl_(... extern _C_ void dtrsl_(.. extern _C_ void daxpy_(... extern _C_ double ddot_(... I'm linking against libRblas.so and libRlapack.so so I did "nm libRblas.so libRlapack.so" and found that there were no symbols for dqrdc2_, dqrsl_, dqrsl_ and dtrsl_. The functions are declared in "R_ext/Applic.h" and implemented in separate f77 files. I find that libR.a appears to contain the symbols but there is no libR.so I'm compiling earth using: gcc -DSTANDALONE -DMAIN -Wall -pedantic -Wextra -O3 -std=gnu99 -I/home/badbear/Documents/code/localpackages/lib64/R/include -I../src/tests ../src/earth.c -L. -lblas -lRblas -lRlapack -o earthMain (I have placed libRblas.so and libRlapack.so in the local folder because I was having problems with linking to them in another location) Do I need to create a shared-object from libR.a? Do I need to link agains libR.a directly? Many thanks, Casper
Casper Clemence
2009-May-08 14:42 UTC
[Rd] dqrdc2_ dqrsl_ dtrsl_ missing from libs? compiling earth standalone
solved I just linked to the libR.a :?/ 2009/5/8 Casper Clemence <maninalift at googlemail.com>:> I have been trying to compile the earth Multivariate Adaptive > Regression of Splines package as a standalone application under Linux > (x86_64 kernel-2.6.27.21 openSUSE 11.1) with gcc 4.3.2. > > The package compiles without problems from within R as an R module and > I get the following linker error: > > ? ?earth.c:(.text+0x1a14): undefined reference to `dqrdc2_' > ? ?earth.c:(.text+0x1ae4): undefined reference to `dqrsl_' > ? ?earth.c:(.text+0x1d99): undefined reference to `dtrsl_' > > earth.c includes: > > ? extern _C_ int dqrdc2_(... > ? extern _C_ int dqrsl_(... > ? extern _C_ void dtrsl_(.. > ? extern _C_ void daxpy_(... > ? extern _C_ double ddot_(... > > I'm linking against libRblas.so and libRlapack.so so I did "nm > libRblas.so libRlapack.so" and found that there were no symbols for > dqrdc2_, dqrsl_, dqrsl_ and dtrsl_. > > The functions are declared in "R_ext/Applic.h" and implemented in > separate f77 files. > > I find that libR.a appears to contain the symbols but there is no libR.so > > I'm compiling earth using: > > ? gcc -DSTANDALONE -DMAIN -Wall -pedantic -Wextra -O3 -std=gnu99 > -I/home/badbear/Documents/code/localpackages/lib64/R/include > -I../src/tests ../src/earth.c -L. -lblas -lRblas -lRlapack -o > earthMain > > (I have placed libRblas.so and libRlapack.so in the local folder > because I was having problems with linking to them in another > location) > > Do I need to create a shared-object from libR.a? Do I need to link > agains libR.a directly? > > Many thanks, > > Casper >