[R] configure problem - mixed fortran/c

Prof Brian Ripley ripley at stats.ox.ac.uk
Fri Apr 30 16:10:52 CEST 2004


On Fri, 30 Apr 2004, Skip Montanaro wrote:

> 
>     Brian> There is one, and it told you, `check LDFLAGS for paths to
>     Brian> Fortran libraries'. I don't see that you have told us the result
>     Brian> of your check, so surmise you haven't checked, and suspect that
>     Brian> is the problem.
> 
>     >> My environment is:
>     >> 
>     >> Solaris 9 on Intel
>     >> gcc and g77 3.3.2
> 
>     Brian> You need wherever libg2c.so is installed in your LD_LIBRARY_PATH.
> 
> Thanks, that was the ticket.  Now that I know what's going on, I understand
> what I was looking at in config.log.  I see link lines like this:
> 
>     gcc -o conftest -g -O2 -I/usr/local/include -L/usr/local/lib conftest.c \
>     cfortran_test.o -ldl -ltermcap -lm   -L/usr/ccs/lib -L/usr/lib \
>     -L/usr/local/lib \
>     -L/opt/lang/gcc-g77-3.3.2/lib/gcc-lib/i386-pc-solaris2.8/3.3.2 \
>     -L/usr/ccs/bin \
>     -L/opt/lang/gcc-g77-3.3.2/lib/gcc-lib/i386-pc-solaris2.8/3.3.2/../../.. \
>     -lfrtbegin -lg2c -lm -lgcc_s 
> 
> libg2c.so resides in /opt/lang/gcc-g77-3.3.2/lib.  It would never have
> occurred to me that a library which is part of the g77 distribution couldn't
> be found by configure when other directories in that tree.  Given that
> that's within the g77 tree and presumably that tree is structured in a
> consistent manner, wouldn't it make sense for configure to also add
> "-L/opt/lang/gcc-g77-3.3.2/lib" to the link line?  

No.  You need it in the run library path, not just the link library path.  
So you could put

-L/opt/lang/gcc-g77-3.3.2/lib -R/opt/lang/gcc-g77-3.3.2/lib

in LDFLAGS.

> (Maybe that's an autoconf
> issue.  I don't see mention of "mixed C/Fortran" in configure.ac, just in
> configure.)

Look in m4/R.m4 or aclocal.m4.

We have no idea where you installed g77, but that is not a standard place 
on (Sparc-)Solaris, BTW, so I think it's a `feature' of your system.
But not even /usr/local/lib (the usual place for an install of gcc from 
sources) is in the standard Solaris path AFAIR.

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list