bug-autoconf
[Top][All Lists]
Advanced

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

fort77(f2c wrapper) is not properly detected


From: Giulio Paci
Subject: fort77(f2c wrapper) is not properly detected
Date: Fri, 26 Nov 2010 23:17:11 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.15) Gecko/20101030 Icedove/3.0.10

Hi,
    recently I packaged (using autoconf 2.67 on a Debian squeeze system)
a program that mixes Fortran and C++ code.
The configure.ac includes the following macros:
AC_PROG_F77
AC_F77_LIBRARY_LDFLAGS
AC_F77_DUMMY_MAIN

Everything is working fine with gfortran, but the configure script fails
to detect proper settings for fort77 (the f2c wrapper).

The macro fails to parse the following output (and then fails to detect
both the -lf2c -lm flags and the MAIN__ function):

$ f77 -v test.f
/usr/bin/f77: fort77 Version 1.15
/usr/bin/f77: Running "/usr/bin/f2c -Nn802 -I. < test.f >
/tmp/fort77-30492-1.c"
   MAIN main:
/usr/bin/f77: Running "gcc" "-c" "-o" "test.o" "/tmp/fort77-30492-1.c"
/usr/bin/f77: unlinking /tmp/fort77-30492-1.c
/usr/bin/f77: Running "gcc" "test.o" "-lf2c" "-lm"
/usr/bin/f77: unlinking test.o

$ fort77 -v test.f
/usr/bin/fort77: fort77 Version 1.15
/usr/bin/fort77: Running "/usr/bin/f2c -Nn802 -I. < test.f >
/tmp/fort77-30454-1.c"
   MAIN main:
/usr/bin/fort77: Running "gcc" "-c" "-o" "test.o" "/tmp/fort77-30454-1.c"
/usr/bin/fort77: unlinking /tmp/fort77-30454-1.c
/usr/bin/fort77: Running "gcc" "test.o" "-lf2c" "-lm"
/usr/bin/fort77: unlinking test.o

Adding manually the following two lines in the configure script:

  *"Running \"gcc\""*)
    ac_f77_v_output=`echo "$ac_f77_v_output" | grep "Running \"gcc\"" |
grep -v '"-c"' | sed 's/^.*Running //' | sed 's/"//g' ` ;;

solves the problem.
Is it possible to include support for fort77 in the autoconf macros? Is
there a temporary workaround that I can use in the meantime?

Bests,
    Giulio.





reply via email to

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