I can not use gcc and ifc compiler

I can not use gcc and ifc compiler

I am tring to compile a program composed by .f and .c files.
I am using gcc :

gcc version 3.2 20020903 (Red Hat Linux 8.0 3.2-7)

and intel fortran compiler 7.0:

Intel Fortran Compiler for 32-bit applications, Version 7.0 Build 20021028Z
Copyright (C) 1985-2002 Intel Corporation. All rights reserved.

GNU ld version 20020802
Supported emulations:

The problem come when the program link and it does't reconise the c subroutine because it looks for somethinds like namesubroutine_

In the makefile I use the option for gcc -std=c99
I tried to use the ifc option -C90 but nothing change: I have always the same error type:

ld: Warning: type of symbol `stat_' changed from 2 to 1 in ccdne.o
ccdne_inp_03.o: In function `ccdne_inp_one_':
ccdne_inp_03.o(.text+0x9fc): undefined reference to `head_'
ccdne_inp_03.o(.text+0xad5): undefined reference to `head_'
ccdne_inp_03.o(.text+0xc19): undefined reference to `decod_oneframe_'
ccdne_inp_04.o: In function `ccdne_inp_':
ccdne_inp_04.o(.text+0xc33): undefined reference to `head_'
ccdne_inp_04.o(.text+0xd0b): undefined reference to `head_'
ccdne_inp_04.o(.text+0xe54): undefined reference to `decod_'
ccdne_inp_04.o(.text+0x1fa5): undefined reference to `cluster_c_'
ccdne_fit.o: In function `ccdne_fit_':
ccdne_fit.o(.text+0x9ce): undefined reference to `paralin_'
date.o: In function `rs6date_':
date.o(.text+0x28): undefined reference to `fdate__'
badpix.o: In function `badpix_':
badpix.o(.text+0x98f): undefined reference to `head_'
badpix.o(.text+0xaa4): undefined reference to `head_'
badpix.o(.text+0xbe3): undefined reference to `decod_'
make: *** [ccdm.exe] Error 1
where the head_, decod_ .. are .c subroutines.

Anybody knows the otption to use to put the underscore in the good place of the subroutine and so do the compatibility between ifc and gcc?



2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

You can compile with ifc -nus to avoid appending underscores to the external symbol names for subroutines. There are other ways to match symbol names between C and Fortran, (see the Fortran User's Guide), but this is the simplest. There is more than just the symbol name to match when calling C from Fortran, again see the corresponding chapter in the User's Guide.


Leave a Comment

Please sign in to add a comment. Not a member? Join today