problem between icc and ifc

problem between icc and ifc

I am trying to compile a big program with fortran and c subrutines. I arrive to compile it with XLF and XLC in AIX system but I didn't in my laptop. I work with linux redhat 8.0. I installed ifc, icc, gcc, g77.
Until now I tried to compile this program with ifc and gcc without any result: When ifc link it doesn't reconise the C fuctions. So I thougt that using icc to compile I shouldn't have this kind of problem. But I obtained the same error in the lik phase. This is the message:

d: 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+0xc17): 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+0xe52): undefined reference to `decod_'
ccdne_inp_04.o(.text+0x1fa4): 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+0xbe1): undefined reference to `decod_'
make: *** [ccdm.exe] Error 1

and this is the Makefile:

NAME = ccdm.exe
.SUFFIXES : .f90 .f .o .c .mod
FC = ifc
FC90 = ifc
CC= icc

$(FC) -c $(FFLAGS) $<
$(FC90) -c $(FFLAGS) $<
$(CC) -c $(CFLAGS) $<

#OPT = -nus
FFLAGS = -C90 -w90 -w95
# set maximal data segment size to 2x256 Mo data segments
LDFLAGS = -L/usr/local/pgplot -lpgplot -L/usr/X11R6/lib -lX11 -L/usr/lib/gcc-lib/i386-redhat-linux/3.2/ -lg2c
# Module must be compiled first
FFILES = ccdne_dis.f ccdne_inp_03.f ccdne_inp_04.f ccdne_fit.f ccdne_out.f ccdne_sta.f ccdne_lib.f cl_ana.f show_cs.f date.f ccdne.f badpix.f menu.f ccdne_fit_lin.f ccdne_pre1.f ccd_lib_new.f ccd_dis_new.f ccd_sta_new.f ccd_pre_new.f ccd_out_new.f
#F90FILES = cluster.f90
CFILES = paralin.c decod_26.c decod_27.c head.c Cluster.c
OBJFILES = $(CFILES:.c=.o) $(FFILES:.f=.o) $(F90FILES:.f90=.o)


Is there any nice option to use to link correctly?
Thanks in advance,


2 post / 0 nuovi
Ultimo contenuto
Per informazioni complete sulle ottimizzazioni del compilatore, consultare l'Avviso sull'ottimizzazione

Since you haven't told us about your C source, my guess is that you didn't include the trailing underscore in the C function names. That is a common convention for Unix and linux Fortran, and I believe even xlf has an option to support it.

If you are counting on a Fortran library to provide any of those functions,ifc -Vaxlib may take care of some.

Accedere per lasciare un commento.