Skip to content

install of nls.lm failed

4 messages · Joerg van den Hoff, Simon Urbanek

#
hi everybody,

trying to install nls.lm  under R.2.1.0 and Tiger I got:

======================cut============================
* Installing *source* package 'minpack.lm' ...
** libs
g77   -fno-common  -g -O2 -c chkder.f -o chkder.o
g77   -fno-common  -g -O2 -c dogleg.f -o dogleg.o
g77   -fno-common  -g -O2 -c dpmpar.f -o dpmpar.o
g77   -fno-common  -g -O2 -c enorm.f -o enorm.o
gcc-3.3 -no-cpp-precomp 
-I/Library/Frameworks/R.framework/Resources/include 
-I/usr/local/include   -fno-common  -g -O2 -c fcn_lmder.c -o fcn_lmder.o
gcc-3.3 -no-cpp-precomp 
-I/Library/Frameworks/R.framework/Resources/include 
-I/usr/local/include   -fno-common  -g -O2 -c fcn_lmdif.c -o fcn_lmdif.o
gcc-3.3 -no-cpp-precomp 
-I/Library/Frameworks/R.framework/Resources/include 
-I/usr/local/include   -fno-common  -g -O2 -c fcn_message.c -o fcn_message.o
g77   -fno-common  -g -O2 -c fdjac2.f -o fdjac2.o
gcc-3.3 -no-cpp-precomp 
-I/Library/Frameworks/R.framework/Resources/include 
-I/usr/local/include   -fno-common  -g -O2 -c get_element.c -o get_element.o
g77   -fno-common  -g -O2 -c lmder.f -o lmder.o
g77   -fno-common  -g -O2 -c lmdif.f -o lmdif.o
g77   -fno-common  -g -O2 -c lmpar.f -o lmpar.o
gcc-3.3 -no-cpp-precomp 
-I/Library/Frameworks/R.framework/Resources/include 
-I/usr/local/include   -fno-common  -g -O2 -c nls_lm.c -o nls_lm.o
gcc-3.3 -no-cpp-precomp 
-I/Library/Frameworks/R.framework/Resources/include 
-I/usr/local/include   -fno-common  -g -O2 -c prod.c -o prod.o
g77   -fno-common  -g -O2 -c qform.f -o qform.o
g77   -fno-common  -g -O2 -c qrfac.f -o qrfac.o
g77   -fno-common  -g -O2 -c qrsolv.f -o qrsolv.o
g77   -fno-common  -g -O2 -c r1mpyq.f -o r1mpyq.o
g77   -fno-common  -g -O2 -c r1updt.f -o r1updt.o
g77   -fno-common  -g -O2 -c rwupdt.f -o rwupdt.o
gcc-3.3 -no-cpp-precomp 
-I/Library/Frameworks/R.framework/Resources/include 
-I/usr/local/include   -fno-common  -g -O2 -c transpose.c -o transpose.o
gcc-3.3 -no-cpp-precomp 
-I/Library/Frameworks/R.framework/Resources/include 
-I/usr/local/include   -fno-common  -g -O2 -c vector.c -o vector.o
gcc-3.3 -bundle -flat_namespace -undefined suppress -L/usr/local/lib -o 
minpack.lm.so chkder.o dogleg.o dpmpar.o enorm.o fcn_lmder.o fcn_lmdif.o 
fcn_message.o fdjac2.o get_element.o lmder.o lmdif.o lmpar.o nls_lm.o 
prod.o qform.o qrfac.o qrsolv.o r1mpyq.o r1updt.o rwupdt.o transpose.o 
vector.o -framework vecLib 
-L/usr/local/lib/gcc/powerpc-apple-darwin6.8/3.4.2 -lg2c -lSystem 
-framework R
ld: warning -L: directory name 
(/usr/local/lib/gcc/powerpc-apple-darwin6.8/3.4.2) does not exist
ld: can't locate file for: -lg2c
make: *** [minpack.lm.so] Error 1
ERROR: compilation failed for package 'minpack.lm'
======================cut============================
indeed, (/usr/local/lib/gcc/powerpc-apple-darwin6.8/3.4.2) does not 
exist (rather, there only is a /usr/lib/gcc/powerpc-apple-darwin6.8/4.0.0).

since the library path seems to be set by R CMD INSTALL, not by the 
package content itself (no Makefile ...), I would be grateful if someone 
could help me out: is the lib-path somehow  hardcoded in the binary 
(.dmg) of R?


regards,

joerg
#
On Jun 29, 2005, at 12:33 PM, joerg van den hoff wrote:

            
You didn't tell us what Fortran compiler you are using, but my wild  
guess is that you use the one from fink. If that turns out to be true  
and you insist on using that one, you'll need to compile your own R  
(or you can try to patch the paths in various places or specify  
additional flags for the package to find your libg2c ...). The CRAN  
binary requires g77 3.4.2 in /usr/local which you don't have.

Cheers,
Simon
#
Simon Urbanek wrote:
simon,
thanks for your response.
your "wild guess" is correct and, well, I insist on nothing like that, 
but it's simply the only g77 which materialized/was required at some 
point of installing packages via fink.
after some false starts: the only thing which seems necessary is:

- mkdir /usr/local/lib/gcc/powerpc-apple-darwin6.8
- ln -s /sw/lib 3.4.2

after this the package installed and seems(...) to run without problems.
and since g77 seems not to be installed as part of the DevTools, this 
would mean to recompile/reinstall gcc from scratch? would it not be a 
better idea to use environment variables instead of hardcoding the path 
into the binary which seems, after all, not to be a standard setup? or 
am I wrong (apart from the "given infinite time, one could do 
everything" problem)?
regards,
joerg
#
On Jun 30, 2005, at 5:24 AM, joerg van den hoff wrote:

            
Not necessarily - see the R for Mac FAQ - there are several places  
where you can get just the g77 compiler.
By design R on unix platforms determines compiler settings at  
configure/build time (and for a good reason). If you use a binary,  
you have to make sure all parts of the system (including compilers)  
are exactly same as at build time. It's not just the paths - it is  
not guaranteed that the fink compiler uses the same includes and  
libraries (in fact it often doesn't), so all other flags have to be  
set accordingly as well. Users reported several problems with the  
fink g77 so the only 'clean' solution is to re-compile R, because  
that is the only guarantee that all flags are determined correctly.

Cheers,
Simon