[Rd] Changing options in R CMD SHLIB

Fabio Mathias Corrêa fabio.ufla at yahoo.com.br
Tue Oct 20 22:21:10 CEST 2009


I managed to use directives OpenMP in R.
To compile I used the gfortran directly. For example:

gfortran-shared-O2 teste.f90-fopenmp-fPIC

By using the code in R, it works perfectly!

However, I need to use some specific libraries of R, for use in C functions in Fortran 95.

When compiling using the command:

gfortran-shared-O2-o teste.f90 myrandom.c func.out -fopenmp -fPIC

However, I need to indicate the path for the compiler to use the files of the type: Rmath.h, R.h and others.

I observed the project ROMP and the library Rcsdp. The developers of the library Rcsdp in the installation file present the following modification in the compiler for enable the OpenMP. 

CFLAGS=CFLAGS=-O3 -march=nocona -m64 -fprefetch-loop-arrays -ftree-vectorize -ftree-vectorizer-verbose=1 -fopenmp  -ansi -Wall -DNOSHORTS -DBIT64 -DUSEOPENMP -I../include

LIBS=LIBS=-static -L../lib -lsdp -llapack -lptf77blas -lptcblas -latlas -lgomp -lrt -lpthread -lgfortran -lm 

 I already tried

~/Fortran/parallel/tri $ export PKG_FCFLAGS= -fopenmp
bash: export: `-fopenmp': not a valid identifier

I could indicate the path of the files R.h, Rmath.h and other to the gfortran? How? 

Thank you!

               Fábio Mathias Corrêa
Estatística e Experimentação Agropecuária/UFLA

Veja quais são os assuntos do momento no Yahoo! +Buscados

More information about the R-devel mailing list