[R] Dyn.load of sharing object with GSL library

moghadameh mirzai moghadameh_mirzai at yahoo.com
Sun Jun 9 09:27:10 CEST 2013


Dear R-list,
I want to use shared library of gsl in R(2.15.1) on unix .I have a makefile such as 
CC = gcc
CFLAGS = -fPIC -O2
PKG_LIBS -lgsl -lgslcblas -lm -lpthread
 
OBJS_SPB = calc_spb.o k.o dk.o ddk.o
 
 
calc_spb.so : $(OBJS_SPB)
 
      $(CC) -shared -o calc_spb.so $(LIBS) $(OBJS_SPB)
 
clean :
      rm -f ../*.o *.o
 
clean.so:
      rm -f *.so
 
I use R CMD SHLIB calc_spb.c in terminal window of unix and in my directory was built  calc_spb.o and calc_spb.so.
And  I use dyn.load in R the error is
Dyn.load(“calc_spb.so”)
Error in dyn.load(“calc_spb.so”):
Unable to load shared object ‘/home/mir/cal/calc_spb.so’:
/home/mir/cal/calc_spb.so: undefined symbol :gsl_finite
Thanks to all who tried to help me in solving my problem.
 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: A problem.pdf
Type: application/pdf
Size: 4392 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20130609/cae127dd/attachment.pdf>


More information about the R-help mailing list