[R] 0.99.0 --with-f77 configure problem

Rich Bud starab at nus.edu.sg
Tue Feb 8 06:10:44 CET 2000

Installing 0.99.0 with Dec UNIX 4.0f, if I use the native fortran compiler
(--with-f77) configure fails with:

  checking for Fortran libraries...  -lUfor -lfor -lFutil -lm -lots -lm
  checking whether Fortran libraries work correctly... no

In case anyone else runs into this, the quick fix is to change line 2071
of configure from
  ${CC} ${LDFLAGS} -o conftest conftest.o ${FLIBS} \
  ${FC} ${LDFLAGS} -o conftest conftest.o ${FLIBS} \

(Or just change line 2076 to set r_cv_prog_f77_flibs_ok=yes, if you're 
 sure your fortran setup is correct...)

For those who actually want to know why...

The error in config.log is that 'main' is unresolved. The problem is that 
the test program is specified as follows in configure:

2069  echo "      END" > conftest.f
2070  ${FC} -c ${FFLAGS} conftest.f 1>&5 2>&5
2071  ${CC} ${LDFLAGS} -o conftest conftest.o ${FLIBS} \

That is, the C compiler is used instead of the fortran compiler for the 
linking stage. This seems wrong to me, although it probably works for g77
because of the way gcc and g77 are linked.

In 0.90.1 this step was done as just ${FC} -o conftest conftest.f, which 
works. So does the fix above, to use the fortran compiler for both stages 
of the compile...

r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list