autoconf
[Top][All Lists]
Advanced

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

Mixing Fortran and C: how to force the linking with CC?


From: Sebastien Maret
Subject: Mixing Fortran and C: how to force the linking with CC?
Date: Wed, 28 May 2008 02:08:21 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (darwin)

Hello,

I am using autoconf and automake for a code written in Fortran and
C. The main program is written in C; Fortran routines are used to do
numerical computations.

My configure.in file contains the following lines:

AC_PROG_CC
AC_PROG_FC
AC_FC_WRAPPERS

and my Makefile.am file looks something like:

myprog_SOURCES = myprog.c myprog.h subroutine1.f subroutine2.f

For some reason, the final linking is done with FC.  This works fine
CC=gcc and FC=gfortran, but fails with CC=icc and FC=ifort, because
_main is defined in both myprog.o and one of the Fortran compiler
libraries. It works fine when the final link is done with CC.

Is there a way to force the final linking with CC instead of FC?

Thanks in advance,
Sébastien





reply via email to

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