I’ve compiled a .c file for R under Windows using Rtools (R CMD SHLIB filename.c) without any big problems, obtaining an .o file and a .dll file (I think it is only the last one that I need for R Windows). But now I need to compile another .c file prepared for R under Unix with a Makefile and I don’t know how to do this. Does R CMD admit this file? If so, how should I do it? The program I want to compile uses the gsl library, so its Makefile has the following sentences:
all: zeta_func.o
gcc -L/sw/lib zeta_func.o -lgsl -lgslcblas -lm -o zeta_func
zeta_func.o:
gcc -I/sw/include -c zeta_func.c

I suppose I should make changes in the Makefile to adapt it to my configuration (where I have the gsl library) but I’m not sure the following adaptation is correct:
all: zeta_func.dll
gcc C:\R\library zeta_func.dll -lgsl -lgslcblas -lm -o zeta_func
zeta_func.dll:
gcc C:\R\include -c zeta_func.c

Thank you.

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to