autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problems with linking tests with fortran


From: L. D. Marks
Subject: Problems with linking tests with fortran
Date: Mon, 1 Aug 2005 04:19:56 -0500 (CDT)

I've run into some problems writing some tests for intrinsics in fortran
-- there are subtle (annoying) differences between these for different
systems, so this is exactly what autoconf should be able to handle. It
looks like some of the autoconf scripts are broken for anything except C
(maybe C++ is OK) and need some patches. Two examples:

1) The test
        AC_LINK_IFELSE( AC_LANG_PROGRAM([],
[       integer*4 FSEEK,I1,I2,I3
        i=FSEEK( I1, I2, I3) ]), ....

does not work as expected since everything after the first FSEEK is
ignored so I1,I2,I3 are not defined. This might give a false rejection if,
for instance, an -i2 (integer*2 default) flag is used. Instead one has to
use
        AC_LINK_IFELSE( AC_LANG_PROGRAM([],
[        integer*4 FSEEK,i1,i2,i3
         integer*4  I1
         integer*4  I2
         integer*4  I3
        i=FSEEK( I1, I2, I3) ]),...

2) Getting AC_LIBOBJ to accept a fortran substitution is painful. The only
method that I've managed to get to work is
        foo="foo.f"
        AC_LIBSOURCE(foo.f)
        AC_LIBOBJ([$foo])
and ignoring the warning that I should use literals. If you use
AC_LIBOBJ(foo.f) it looks for foo.f.c! I think AC_LANG "should" define the
extension so
        AC_LANG([Fortran 77])
        AC_LIBOBJ(foo)
will find foo.f (this might require changes in automake/autoheader..)
-----------------------------------------------
Laurence Marks
Department of Materials Science and Engineering
MSE Rm 2036 Cook Hall
2220 N Campus Drive
Northwestern University
Evanston, IL 60201, USA
Tel: (847) 491-3996 Fax: (847) 491-7820
email: L-marks at northwestern dot edu
http://www.numis.northwestern.edu
-----------------------------------------------





reply via email to

[Prev in Thread] Current Thread [Next in Thread]