Problem compiling module for R under SLES9 (86_64) with pgi8

Hi,

I’ve compile R (2.8.1) for our cluster using pgi 8.0.2 with pgf90, pgcc and pgCC. For many extentions within R it’s working well, but for one
module (Matrix) I get the following error:

make[1]: Leaving directory /tmp/R.INSTALL.K23929/Matrix/src/AMD' pgCC -L/usr/lib64 -L/usr/X11R6/lib64 -pgf90libs -pgf90libs -o Matrix.so CHMfactor.o Csparse.o TMatrix_as.o Tsparse.o init.o Mutils.o chm_common.o cs.o cs_utils.o dense.o dgCMatrix.o dgTMatrix.o dgeMatrix.o dpoMatrix.o dppMatrix.o dsCMatrix.o dsyMatrix.o dspMatrix.o dtCMatrix.o dtTMatrix.o dtrMatrix.o dtpMatrix.o factorizations.o ldense.o lgCMatrix.o sparseQR.o SPQR.a CHOLMOD.a COLAMD.a AMD.a -L/usr/local/apps/R/R-2.8.1/lib64/R/lib -lRlapack -L/usr/local/apps/R/R-2.8.1/lib64/R/lib -lRblas -lpgf90 -lpgf90_rpm1 -lpgf902 -lpgf90rtl -lpgftnrtl -lnspgc -lpgc -lrt -lpthread -lm -pgf90libs /usr/lib64/crt1.o(.text+0x21): In function _start’:
…/sysdeps/x86_64/elf/start.S:109: undefined reference to main' CHMfactor.o(.text+0x28): In function CHMfactor_to_sparse’:


I’m compiling within R using “install.packages(“Matrix”)”.
Everything is compling with some warnings (variable set, but not used),
but the final step fails.

Any idea whats wrong here ?

Thanks, Peer

Hi Peer,

You need to add the “-shared” flag since you’re creating a shared object (dynamic library).

  • Mat

Hi,

thanks. It worked. There is a general variable for shared files.
But this one is not use everywhere. Anyway it’s working now.

Bye, Peer