Skip to content

Cross-platform linking of a simple front-end

4 messages · Simon Urbanek, Brian Ripley, Jon Clayden

1 day later
#
Jon,
On Jul 4, 2013, at 10:52 AM, Jon Clayden wrote:

            
My guess would be that you did not use --enable-R-shlib when compiling R on Ubuntu so you don't have a shared version of the R library to link against (which is needed to resolve the dependencies). Could that be the case?

Cheers,
Simon
#
On 06/07/2013 03:19, Simon Urbanek wrote:
I was able to reproduce this on Fedora: that is not the error if R was 
not built as a shared library.

I would simply copy how R does it (for R.bin in src/main).  libtool 
(used by R CMD LINK) is not coming up with the same flags.  On my system 
R is not using -lm:

gcc -std=gnu99 -Wl,--export-dynamic -fopenmp  -L/usr/local/lib64 -o 
R.bin Rmain.o  -L../../lib -lR -lRblas


Adding -lm is not portable (some OSes do not have a separate libm and 
some always add it when linking via $(CC)), but there is a LIBM macro in 
etc/Makeconf which tells you if configure found one.

  
    
2 days later