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

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

 



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



_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf

[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux