[R] R CMD SHLIB problem with -lg2c and make:

Richard Zur zur at uchicago.edu
Wed Jul 11 17:23:52 CEST 2007


Hello,

I have 2 problems with R CMD SHLIB.  The first problem didn't resolve, 
it just morphed into the new problem.  I first have to admit that even 
though I've used R CMD SHLIB for a few years, I don't understand C 
compiling.

The problem arose after our linux guy upgraded from Mandriva 2005 to 
Mandriva 2007.  I was using R 2.4.1, but now it's upgraded to the 
current version.  I used R CMD SHLIB to compile a C file that also 
linked to some fortran code.  The error was something along the lines of 
not being able to find -lg2c.  The gcc version I'm using is now 4.1.1, 
so our linux guy suggested the problem might be related to gfortran and 
f2c.  I'm not sure... is this enough information to know what might be 
going on?

So, I started looking around the FAQs online to try and figure out the 
problem and stumbled upon the R CMD COMPILE command.  I ran it on my C 
and fortran code and didn't see any errors.  I thought that was funny, 
so I erased the .o files it had created and tried again, with COMPILE 
and SHLIB... but now I get the error

make: *** No rule to make target 'mhroc.o'. Stop.

I have no idea what I did or how to correct it.  Can anyone help?

Thank you,
Richard Zur



More information about the R-help mailing list