From maninalift at googlemail.com  Fri May  8 14:19:52 2009
From: maninalift at googlemail.com (Casper Clemence)
Date: Fri, 8 May 2009 13:19:52 +0100
Subject: [Rd] dqrdc2_ dqrsl_ dtrsl_ missing from libs? compiling earth
	standalone
Message-ID: <4c1964560905080519rd70c5efjc7edd27a0860e817@mail.gmail.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



[Rd] dqrdc2_ dqrsl_ dtrsl_ missing from libs? compiling earth standalone
Casper Clemence