I'm creating my own shared lib that depends on LAPACK. It works fine on my mac (R version 2.15.0). It is compiled as such:

> R CMD SHLIB estfit.c

It's loaded in R with

> dyn.load("estfit.so")

When doing this on Kubuntu (with r-base and r-base-dev, version 2.15.0 of R), it results in:

 > dyn.load("estfit.so")
Error in dyn.load("estfit.so") :
   unable to load shared object
'/home/project/estfit.so':
   /home/project/estfit.so: undefined
symbol: dgetrf_

ldd output shows no problems.

~/rsch/project:ldd estfit.so
         linux-vdso.so.1 =>  (0x00007fff1b1b0000)
         libgfortran.so.3 => /usr/lib/libgfortran.so.3 (0x00007f0eb314b000)
         libm.so.6 => /lib/libm.so.6 (0x00007f0eb2ec8000)
         libR.so => /usr/lib/libR.so (0x00007f0eb28e7000)
         libc.so.6 => /lib/libc.so.6 (0x00007f0eb2564000)
         libblas.so.3gf => /usr/lib/libblas.so.3gf (0x00007f0eb22c9000)
         libreadline.so.6 => /lib/libreadline.so.6 (0x00007f0eb2087000)
         libpcre.so.3 => /lib/libpcre.so.3 (0x00007f0eb1e59000)
         liblzma.so.1 => /usr/lib/liblzma.so.1 (0x00007f0eb1c38000)
         libz.so.1 => /lib/libz.so.1 (0x00007f0eb1a20000)
         librt.so.1 => /lib/librt.so.1 (0x00007f0eb1818000)
         libdl.so.2 => /lib/libdl.so.2 (0x00007f0eb1614000)
         libgomp.so.1 => /usr/lib/libgomp.so.1 (0x00007f0eb1405000)
         libpthread.so.0 => /lib/libpthread.so.0 (0x00007f0eb11e8000)
         /lib64/ld-linux-x86-64.so.2 (0x00007f0eb3a71000)
         libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00007f0eb0fd1000)
         libncurses.so.5 => /lib/libncurses.so.5 (0x00007f0eb0d8d000)
 ~/rsch/project:ldd /usr/lib/libblas.so.3gf
         linux-vdso.so.1 =>  (0x00007ffffe9a0000)
         libgfortran.so.3 => /usr/lib/libgfortran.so.3 (0x00007f498f39f000)
         libm.so.6 => /lib/libm.so.6 (0x00007f498f11c000)
         libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00007f498ef04000)
         libc.so.6 => /lib/libc.so.6 (0x00007f498eb81000)
         /lib64/ld-linux-x86-64.so.2 (0x00007f498f949000)
 ~/rsch/project:ldd /usr/lib/libR.so
         linux-vdso.so.1 =>  (0x00007fff1494e000)
         libblas.so.3gf => /usr/lib/libblas.so.3gf (0x00007f558ef5e000)
         libgfortran.so.3 => /usr/lib/libgfortran.so.3 (0x00007f558ec71000)
         libm.so.6 => /lib/libm.so.6 (0x00007f558e9ed000)
         libreadline.so.6 => /lib/libreadline.so.6 (0x00007f558e7ac000)
         libpcre.so.3 => /lib/libpcre.so.3 (0x00007f558e57e000)
         liblzma.so.1 => /usr/lib/liblzma.so.1 (0x00007f558e35c000)
         libz.so.1 => /lib/libz.so.1 (0x00007f558e145000)
         librt.so.1 => /lib/librt.so.1 (0x00007f558df3d000)
         libdl.so.2 => /lib/libdl.so.2 (0x00007f558dd38000)
         libgomp.so.1 => /usr/lib/libgomp.so.1 (0x00007f558db2a000)
         libpthread.so.0 => /lib/libpthread.so.0 (0x00007f558d90d000)
         libc.so.6 => /lib/libc.so.6 (0x00007f558d589000)
         /lib64/ld-linux-x86-64.so.2 (0x00007f558f7fb000)
         libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00007f558d372000)
         libncurses.so.5 => /lib/libncurses.so.5 (0x00007f558d12f000)

Questions:

(1) What is going on and how can this be fixed to run on Kubuntu?  Why is lapack not linking on the dynamic load?

(2) If I publish this as a package, how do I specify a dependency on lapack? Does CRAN handle this? I.e., will Windows have similar problems?


--
Shawn Garbett
Vanderbilt University
Cancer Biology
Quaranta Lab

	[[alternative HTML version deleted]]

