[R] dyn.load()
NMBahoshy@aol.com
NMBahoshy at aol.com
Tue Oct 22 10:17:40 CEST 2002
Dear R-help,
I am trying to use routines written in C and Embedded SQL on Sybase in R using dyn.load().
I compiled a couple of test functions into a .so file which I tried to load with R's dynl.load(). This is what happened:
> dyn.load("libRClib.so")
Error in dyn.load(x, as.logical(local), as.logical(now)) :
unable to load shared library "/home/develop/bahomar/tmp/libRClib.so":
ld.so.1: /home/develop/bahomar/R/lib/R/bin/R.bin: fatal: relocation error: file /opt/sybase/embeddedsql/lib/libct.so: symbol comn_free: referenced symbol not found
As far as I can see there are no unsatisfied symbols. In particular, the symbol comn_free is defined:
> ldd libRClib.so
libdl.so.1 => /usr/lib/libdl.so.1
libct.so => /opt/sybase/embeddedsql/lib/libct.so
libcs.so => /opt/sybase/embeddedsql/lib/libcs.so
libtcl.so => /opt/sybase/embeddedsql/lib/libtcl.so
libcomn.so => /opt/sybase/embeddedsql/lib/libcomn.so
libintl.so => /opt/sybase/embeddedsql/lib/libintl.so
libnsl.so.1 => /usr/lib/libnsl.so.1
libm.so.1 => /usr/lib/libm.so.1
libc.so.1 => /usr/lib/libc.so.1
libmp.so.2 => /usr/lib/libmp.so.2
/usr/platform/SUNW,Ultra-Enterprise/lib/libc_psr.so.1
> nm /opt/sybase/embeddedsql/lib/libct.so | grep comn_free
[1719] | 0| 0|NOTY |GLOB |0 |UNDEF |comn_free
But:
> nm /opt/sybase/embeddedsql/lib/libintl.so | grep comn_free
[167] | 5624| 12|FUNC |GLOB |0 |7 |comn_free
Platform:
I am running R:
> R.Version()
$platform
[1] "sparc-sun-solaris2.8"
$arch
[1] "sparc"
$os
[1] "solaris2.8"
$system
[1] "sparc, solaris2.8"
$status
[1] ""
$major
[1] "1"
$minor
[1] "5.1"
$year
[1] "2002"
$month
[1] "06"
$day
[1] "17"
$language
[1] "R"
on UNIX:
> uname -a
SunOS amtss014 5.8 Generic_108528-01 sun4u sparc SUNW,Ultra-Enterprise
I compiled the shared library as follows:
cc -o libRClib.so -G RCtest.c \
-I${SYBASE}/embeddedsql/include \
-I${FIRAS_INCLUDE} \
-L${SYBASE}/embeddedsql/lib -L${FIRAS_LIB} \
-ldl -lct -lcs -ltcl -lcomn -lintl -lnsl \
-lmm_infc -lmm_fc -lm
I tried different orderings for the included libraries; to no avail.
I also used the shared library from a test programme. It compile and ran correctly.
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
More information about the R-help
mailing list