Skip to content
Prev 2012 / 63424 Next

Fortran vs C, easing using Fortran

On Mon, 12 Apr 1999, Prof Brian Ripley wrote:

            
splitting 
   LDCMD="f77 -g -nofor_main -fpe3 "
into 
   LDCMD=f77
   LDFLAGS="-g -nofor_main -fpe3"
results in

root@delta[R]# ./configure
loading cache ./config.cache
checking for a BSD compatible install... (cached) /usr/local/bin/install -c
checking whether ln -s works... (cached) yes
checking for ranlib... (cached) ranlib
checking for bison... (cached) bison -y
checking for ar... (cached) ar
checking for latex... (cached) /usr/local/bin/latex
checking for dvips... (cached) /usr/local/bin/dvips
checking for makeindex... (cached) /usr/local/bin/makeindex
checking for perl... (cached) /usr/local/bin/perl
checking whether perl is perl 5... yes
checking for cc... (cached) cc
checking for underscore after Fortran symbols... configure: error: Nothing
worked - cannot use FORTRAN

setting SHLIBLD to f77 and SHLIBLDFLAGS="-shared" works.
(SHLIBLDFLAGS="-shared -expect_unresolved '*'" fails, f77 doesn't
understand this linker option, but no matter: it would only suppress some
warnings)
BTW, the value of SHLIBLDFLAGS specified in config.site gets never used:
it will be overwritten from the configure script with the host specific
versions of SHLIBLDFLAGS.
The same thing for SHLIBLD, this is hardcoded to "ld" in configure.in.
 
But I think there is no difference between
  SHLIBLD=ld
  SHLIBLDFLAGS="-shared -expect_unresolved '*'"
and
  SHLIBLD=f77
  SHLIBLDFLAGS="-shared"
because f77 also calls ld (ok, with the correct Fortran libraries,
libUfor.so, libFutil.so, libots.so). I guess this works because I link R
with LDCMD="f77 -nofor_main", so it already contains the symbols of the
Fortran libraries.

Albrecht
-------------------------------------------------------------------------------
Albrecht Gebhardt                   email   : albrecht.gebhardt@uni-klu.ac.at
Institut fuer Mathematik            Tel.    : (++43 463) 2700/837
Universitaet Klagenfurt             Fax     : (++43 463) 2700/834
Villacher Str. 161
A-9020 Klagenfurt, Austria
-------------------------------------------------------------------------------



-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel 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-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._