Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
318 Views

linking ERROR: for_main.c:(.text+0x2a): undefined reference to `MAIN__'

Hi All,

 

While linking with mpif90, I met the following error:

 [....omitted other shell message that means that files .o were successfully created.... ]

ar -r comes_htc.a A11.o   ABFOR5.o   ACC3.o   AUTOGEN.o   BCOND.o   BFLUX5_new.o   BMMFRONTbaseFINAL.o   C60_franek.o   C60maecenas_nottc.o   C90.o   CASTEM.o   Cor1.o   CRC.o   DAMAGE.o   DERIV.o   DERIVtriang.o   ERSTOP.o   FIXINT.o   fluxext.o   FORMBE.o   FORMDE.o   FPAR.o   GAUSSL.o   GAUSSP.o   HMTRA5.o   ICOND.o   INOUT.o   LOCEPSEQ.o   MATPROP.o   MYALLOC.o   MYOPEN.o   MYTIME.o   NONLOC.o   PERM.o   PRMEFF.o   promat.o   PRVAP.o   READCNTL.o   READINPUT.o   RHSCAL.o   RPC.o   SATBGM.o   SATDER.o   SATUR_A.o   SATUR_B.o   SATUR_C.o   SFR.o   SFRtriang.o   SIEP.o   SIGHIS.o   smoothing.o   STORAGEBIN.o   TEMHIS.o   TLOOP.o   USERMAT.o   VARCA2S.o   WATPROP.o   fems_interface.o   FINDLOCAL.o   PARALLEL.o comate.o   comdam.o   comesh.o   comfems.o   comfron.o   comgdl.o   comm1nl.o   comphys.o   comsiep.o   control.o   ctimdis.o kdtree.o findloc.o cbridge.o
/opt/openmpi/bin/mpif90 -cxxlib comes_htc.a -m64 -W1 -lm -openmp -L/opt/intel/mkl/lib/intel64 -mkl -L/usr/include/metis -lmetis -L/opt/gidpost/source -lgidpost -L/opt/fems/parallel64/lib -lfems -lperfm -L/opt/fems/parallel64/lib -lfems -lperfm -o comes_htc_bin.exe
/opt/intel/composer_xe_2015.3.187/compiler/lib/intel64/for_main.o: In function `main':
for_main.c:(.text+0x2a): undefined reference to `MAIN__'
make: *** [comes_htc] Error 1

My project is a mix of c and fortran files, but the main file is HMTRA.f90 (a fortran 90 file).

I've attached the Makefile and Makefile.inc that contains all the rule for compilation and linking. The error stated above comes on the linking phase. I've reported more than Error row because you can find which rule of Makefile have caused the Error.

I am almost desperate now. Any suggestion is appreciated. Thank you very much!

0 Kudos
7 Replies
Highlighted
Black Belt Retired Employee
318 Views

This error occurs when there is no main program in the objects being linked. Which source contains the main program?

0 Kudos
Highlighted
Black Belt
318 Views

Pull the .o file that was compiled from the Fortran file containing the main program out of the .a file. The linker regards .o files in an object archive as optional routines, to be used only if they contain symbols needed by one or more object files from which an a.out is being built. Since you have zero object files specified this way, the link failed.

After you have removed hmtra.o from the .a file, your link command may look like

   mpif90 hmtra.o comeshtc.a ...

0 Kudos
Highlighted
Beginner
318 Views

Thank you for your replies.

 

Steve:This error occurs when there is no main program in the objects being linked. Which source contains the main program? 

Source that contains the main program is named HMTRA.f90 

mecej4:Pull the .o file that was compiled from the Fortran file containing the main program out of the .a file. The linker regards .o files in an object archive as optional routines, to be used only if they contain symbols needed by one or more object files from which an a.out is being built. Since you have zero object files specified this way, the link failed.

After you have removed hmtra.o from the .a file, your link command may look like

   mpif90 hmtra.o comeshtc.a ...

I tried as you suggested me, but previous error is still present and a new error was added to the previous one. All message from shell appears as follow:

/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o precis.o -c precis.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o comate.o -c comate.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o comdam.o -c comate.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o comesh.o -c comate.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o comfems.o -c comate.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o comfron.o -c comate.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o comgdl.o -c comate.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o comm1nl.o -c comate.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o comphys.o -c comate.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o comsiep.o -c comate.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o control.o -c comate.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o ctimdis.o -c comate.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o A11.o -c A11.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o ABFOR5.o -c A11.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o ACC3.o -c A11.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o AUTOGEN.o -c A11.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o BCOND.o -c A11.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o BFLUX5_new.o -c A11.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o BMMFRONTbaseFINAL.o -c A11.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o C60_franek.o -c A11.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o C60maecenas_nottc.o -c A11.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o C90.o -c A11.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o CASTEM.o -c A11.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o Cor1.o -c A11.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o CRC.o -c A11.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o DAMAGE.o -c A11.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o DERIV.o -c A11.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o DERIVtriang.o -c A11.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o ERSTOP.o -c A11.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o FIXINT.o -c A11.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o fluxext.o -c A11.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o FORMBE.o -c A11.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o FORMDE.o -c A11.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o FPAR.o -c A11.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o GAUSSL.o -c A11.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o GAUSSP.o -c A11.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o HMTRA5.o -c A11.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o ICOND.o -c A11.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o INOUT.o -c A11.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o LOCEPSEQ.o -c A11.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o MATPROP.o -c A11.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o MYALLOC.o -c A11.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o MYOPEN.o -c A11.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o MYTIME.o -c A11.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o NONLOC.o -c A11.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o PERM.o -c A11.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o PRMEFF.o -c A11.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o promat.o -c A11.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o PRVAP.o -c A11.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o READCNTL.o -c A11.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o READINPUT.o -c A11.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o RHSCAL.o -c A11.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o RPC.o -c A11.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o SATBGM.o -c A11.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o SATDER.o -c A11.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o SATUR_A.o -c A11.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o SATUR_B.o -c A11.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o SATUR_C.o -c A11.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o SFR.o -c A11.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o SFRtriang.o -c A11.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o SIEP.o -c A11.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o SIGHIS.o -c A11.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o smoothing.o -c A11.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o STORAGEBIN.o -c A11.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o TEMHIS.o -c A11.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o TLOOP.o -c A11.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o USERMAT.o -c A11.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o VARCA2S.o -c A11.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o WATPROP.o -c A11.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o fems_interface.o -c A11.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o FINDLOCAL.o -c A11.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o PARALLEL.o -c A11.f90
/opt/openmpi/bin/mpicc -qopenmp -parallel -align -O3 -m64 -xAVX -D_Add_ -D_AddPTR -D_lb -D_par -D_F2C -I/opt/fems/include -I/usr/include/metis -o kdtree.o -c kdtree.c
/opt/openmpi/bin/mpicc -qopenmp -parallel -align -O3 -m64 -xAVX -D_Add_ -D_AddPTR -D_lb -D_par -D_F2C -I/opt/fems/include -I/usr/include/metis -o findloc.o -c findloc.c
/opt/openmpi/bin/mpicc -qopenmp -parallel -align -O3 -m64 -xAVX -D_Add_ -D_AddPTR -D_lb -D_par -D_F2C -I/opt/fems/include -I/usr/include/metis -o cbridge.o -c cbridge.c

ar -r comes_htc.a A11.o   ABFOR5.o   ACC3.o   AUTOGEN.o   BCOND.o   BFLUX5_new.o   BMMFRONTbaseFINAL.o   C60_franek.o   C60maecenas_nottc.o   C90.o   CASTEM.o   Cor1.o   CRC.o   DAMAGE.o   DERIV.o   DERIVtriang.o   ERSTOP.o   FIXINT.o   fluxext.o   FORMBE.o   FORMDE.o   FPAR.o   GAUSSL.o   GAUSSP.o              ICOND.o   INOUT.o   LOCEPSEQ.o   MATPROP.o   MYALLOC.o   MYOPEN.o   MYTIME.o   NONLOC.o   PERM.o   PRMEFF.o   promat.o   PRVAP.o   READCNTL.o   READINPUT.o   RHSCAL.o   RPC.o   SATBGM.o   SATDER.o   SATUR_A.o   SATUR_B.o   SATUR_C.o   SFR.o   SFRtriang.o   SIEP.o   SIGHIS.o   smoothing.o   STORAGEBIN.o   TEMHIS.o   TLOOP.o   USERMAT.o   VARCA2S.o   WATPROP.o   fems_interface.o   FINDLOCAL.o   PARALLEL.o comate.o   comdam.o   comesh.o   comfems.o   comfron.o   comgdl.o   comm1nl.o   comphys.o   comsiep.o   control.o   ctimdis.o kdtree.o findloc.o cbridge.o

/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX -fpp -traceback -D_libdir=\"/opt/fems/parallel64\" -D_par -I/opt/fems/include -I/usr/include/metis -o HMTRA5.o -c A11.f90
/opt/openmpi/bin/mpif90 -cxxlib  HMTRA5.o -m64 -W1 -lm -openmp comes_htc.a -L/opt/intel/mkl/lib/intel64 -mkl -L/usr/include/metis -lmetis -L/opt/gidpost/source -lgidpost -L/opt/fems/parallel64/lib -lfems -lperfm -L/opt/fems/parallel64/lib -lfems -lperfm  -o comes_htc_bin.exe
/opt/intel/composer_xe_2015.3.187/compiler/lib/intel64/for_main.o: In function `main':
for_main.c:(.text+0x2a): undefined reference to `MAIN__'
HMTRA5.o: In function `a11_':
A11.f90:(.text+0xa): undefined reference to `precis_mp_pid_'
make: *** [comes_htc] Error 1

I'm think there is a problem during compilation. It seems that all file .o are created using the same subroutine A11.f90 ....

 

0 Kudos
Highlighted
Black Belt
318 Views

You did not show the file "makefile.inc", which probably has a significant effect of how make interprets the makefile. (If you post such files, please zip up (zip or tar zcf ...) the actual file(s) and attach the zip/tgz file. PDF files are fine for reading, but copying text from a PDF file gives a corrupt makefile with leading whitespace removed, etc.)

However, rules such as 

     $(MODF_O): $(MODF_F)

are probably the major reason why your builds are failing. What this says is that every one of the .o files represented by MODF_O depends on all the .f90 files represented by MODF_F. However, the implicit or explicit rules for building .o files from the corresponding source files (rules that are probably in the missing file makefile.inc) imply or specify a one-on-one dependency, so the corresponding compile command generated by make will use the first item represented by MODF_F to build every one of the items represented by MODF_O.

To see how this misuse of make takes place, try the following makefile:

default: comes_htc

FC1=f77A
FC2=f77B
LD = LNK
PROG_F = A11.f90 ABFOR5.f90
PROG_O = A11.o ABFOR5.o
MODF_F = comate.f90 comdam.f90
MODF_O = comate.o comdam.o
$(MODF_O): $(MODF_F)
	$(FC1) $(OFLAGS) $(FCLAGS) $(INCLUDES) -o $@ -c $<
$(PROG_O) : $(PROG_F) $(MODF_O)
	$(FC2) $(OFLAGS) $(FCLAGS) $(INCLUDES) -o $@ -c $<
comes_htc : $(PROG_O)
	$(LD) $(PROG_O) $(MODF_O) -o comes_htc

I created dummy files for the four .f90 files that this makefile needs, and make -n generated the following build commands:

f77A    -o comate.o -c comate.f90
f77A    -o comdam.o -c comate.f90   <<<---#####****** WRONG build rule used!
f77B    -o A11.o -c A11.f90
f77B    -o ABFOR5.o -c A11.f90   <<<---#####****** WRONG build rule used!
LNK A11.o ABFOR5.o comate.o comdam.o -o comes_htc

A telltale sign of the presence of fault dependency specifications in your makefile is seeing lots of warnings from make of this kind:

     makefile:18: warning: overriding recipe for target 'A11.o'

0 Kudos
Highlighted
Beginner
318 Views

Thank you for your replies: you are right.

I've attached some files: Makefile and Makefile.inc. In particoular I've modified compiling procedure in order to avoid misuse of "make" command you said.

Now I'm dealing with new compilation error and after that, I hope, I can finally do linking phase.

 

0 Kudos
Highlighted
Beginner
318 Views

Now, error looks like as follow. 

_________________________SHELL MESSAGE:________________________

/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o precis.o -c precis.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o comate.o -c comate.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o comdam.o -c comdam.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o comesh.o -c comesh.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o comfems.o -c comfems.f90
comfems.f90(18): warning #5117: Bad # preprocessor line
#ifdef _par
-^
comfems.f90(20): warning #5117: Bad # preprocessor line
#endif
-^
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o comfron.o -c comfron.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o comgdl.o -c comgdl.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o comm1nl.o -c comm1nl.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o comphys.o -c comphys.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o comsiep.o -c comsiep.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o control.o -c control.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o ctimdis.o -c ctimdis.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o A11.o -c A11.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o ABFOR5.o -c ABFOR5.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o ACC3.o -c ACC3.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o AUTOGEN.o -c AUTOGEN.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o BCOND.o -c BCOND.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o BFLUX5_new.o -c BFLUX5_new.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o BMMFRONTbaseFINAL.o -c BMMFRONTbaseFINAL.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o C60_franek.o -c C60_franek.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o C60maecenas_nottc.o -c C60maecenas_nottc.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o C90.o -c C90.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o CASTEM.o -c CASTEM.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o Cor1.o -c Cor1.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o CRC.o -c CRC.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o DAMAGE.o -c DAMAGE.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o DERIV.o -c DERIV.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o DERIVtriang.o -c DERIVtriang.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o ERSTOP.o -c ERSTOP.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o FIXINT.o -c FIXINT.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o fluxext.o -c fluxext.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o FORMBE.o -c FORMBE.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o FORMDE.o -c FORMDE.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o FPAR.o -c FPAR.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o GAUSSL.o -c GAUSSL.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o GAUSSP.o -c GAUSSP.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o HMTRA5.o -c HMTRA5.f90
HMTRA5.f90(135): warning #5117: Bad # preprocessor line
#ifdef _par
-^
HMTRA5.f90(138): warning #5117: Bad # preprocessor line
#endif
-^
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o ICOND.o -c ICOND.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o INOUT.o -c INOUT.f90
INOUT.f90(87): warning #5117: Bad # preprocessor line
#ifdef _par
-^
INOUT.f90(89): warning #5117: Bad # preprocessor line
#endif
-^
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o LOCEPSEQ.o -c LOCEPSEQ.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o MATPROP.o -c MATPROP.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o MYALLOC.o -c MYALLOC.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o MYOPEN.o -c MYOPEN.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o MYTIME.o -c MYTIME.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o NONLOC.o -c NONLOC.f90
NONLOC.f90(287): warning #5117: Bad # preprocessor line
#ifdef _par
-^
NONLOC.f90(291): warning #5117: Bad # preprocessor line
#endif
-^
NONLOC.f90(329): warning #5117: Bad # preprocessor line
#ifdef _par
-^
NONLOC.f90(333): warning #5117: Bad # preprocessor line
#endif
-^
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o PERM.o -c PERM.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o PRMEFF.o -c PRMEFF.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o promat.o -c promat.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o PRVAP.o -c PRVAP.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o READCNTL.o -c READCNTL.f90
READCNTL.f90(64): warning #5117: Bad # preprocessor line
#ifdef _par
-^
READCNTL.f90(67): warning #5117: Bad # preprocessor line
#endif
-^
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o READINPUT.o -c READINPUT.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o RHSCAL.o -c RHSCAL.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o RPC.o -c RPC.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o SATBGM.o -c SATBGM.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o SATDER.o -c SATDER.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o SATUR_A.o -c SATUR_A.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o SATUR_B.o -c SATUR_B.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o SATUR_C.o -c SATUR_C.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o SFR.o -c SFR.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o SFRtriang.o -c SFRtriang.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o SIEP.o -c SIEP.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o SIGHIS.o -c SIGHIS.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o smoothing.o -c smoothing.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o STORAGEBIN.o -c STORAGEBIN.f90
STORAGEBIN.f90(1002): remark #8291: Recommended relationship between field width 'W' and the number of fractional digits 'D' in this edit descriptor is 'W>=D+7'.
19 FORMAT(I6,(2X,E11.5))
------------------^
STORAGEBIN.f90(1000): remark #8291: Recommended relationship between field width 'W' and the number of fractional digits 'D' in this edit descriptor is 'W>=D+7'.
17 FORMAT(I6,6(2X,E11.5))
-------------------^
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o TEMHIS.o -c TEMHIS.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o TLOOP.o -c TLOOP.f90
TLOOP.f90(376): remark #8291: Recommended relationship between field width 'W' and the number of fractional digits 'D' in this edit descriptor is 'W>=D+7'.
50 FORMAT(//65(1H*)/2X,A,I5,A,E12.6,A,A,E12.6,A/65(1H*),E12.6)
-------------------------------^
TLOOP.f90(376): remark #8291: Recommended relationship between field width 'W' and the number of fractional digits 'D' in this edit descriptor is 'W>=D+7'.
50 FORMAT(//65(1H*)/2X,A,I5,A,E12.6,A,A,E12.6,A/65(1H*),E12.6)
-----------------------------------------^
TLOOP.f90(376): remark #8291: Recommended relationship between field width 'W' and the number of fractional digits 'D' in this edit descriptor is 'W>=D+7'.
50 FORMAT(//65(1H*)/2X,A,I5,A,E12.6,A,A,E12.6,A/65(1H*),E12.6)
---------------------------------------------------------^
TLOOP.f90(226): remark #8291: Recommended relationship between field width 'W' and the number of fractional digits 'D' in this edit descriptor is 'W>=D+7'.
             write (*,'(/2(A,E12.6),A)') &
------------------------------^
TLOOP.f90(228): remark #8291: Recommended relationship between field width 'W' and the number of fractional digits 'D' in this edit descriptor is 'W>=D+7'.
             write (7,'(/2(A,E12.6),A)') &
------------------------------^
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o USERMAT.o -c USERMAT.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o VARCA2S.o -c VARCA2S.f90
VARCA2S.f90(117): warning #5117: Bad # preprocessor line
#ifdef _par
-^
VARCA2S.f90(120): warning #5117: Bad # preprocessor line
#endif
-^
VARCA2S.f90(135): warning #5117: Bad # preprocessor line
#ifdef _par
-^
VARCA2S.f90(138): warning #5117: Bad # preprocessor line
#endif
-^
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o WATPROP.o -c WATPROP.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o fems_interface.o -c fems_interface.f90
fems_interface.f90(134): warning #5117: Bad # preprocessor line
#ifdef _par
-^
fems_interface.f90(143): warning #5117: Bad # preprocessor line
#else
-^
fems_interface.f90(147): warning #5117: Bad # preprocessor line
#endif
-^
fems_interface.f90(229): warning #5117: Bad # preprocessor line
#ifdef _par
-^
fems_interface.f90(231): warning #5117: Bad # preprocessor line
#else
-^
fems_interface.f90(233): warning #5117: Bad # preprocessor line
#endif
-^
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o FINDLOCAL.o -c FINDLOCAL.f90
/opt/openmpi/bin/mpif90 -qopenmp -parallel -align -O3 -m64 -xAVX  -I/opt/fems/include -I/usr/include/metis -o PARALLEL.o -c PARALLEL.f90
/opt/openmpi/bin/mpicc -qopenmp -parallel -align -O3 -m64 -xAVX -D_Add_ -D_AddPTR -D_lb -D_par -D_F2C -I/opt/fems/include -I/usr/include/metis -o kdtree.o -c kdtree.c
/opt/openmpi/bin/mpicc -qopenmp -parallel -align -O3 -m64 -xAVX -D_Add_ -D_AddPTR -D_lb -D_par -D_F2C -I/opt/fems/include -I/usr/include/metis -o findloc.o -c findloc.c
/opt/openmpi/bin/mpicc -qopenmp -parallel -align -O3 -m64 -xAVX -D_Add_ -D_AddPTR -D_lb -D_par -D_F2C -I/opt/fems/include -I/usr/include/metis -o cbridge.o -c cbridge.c
ar -r comes_htc.a A11.o ABFOR5.o ACC3.o AUTOGEN.o BCOND.o BFLUX5_new.o BMMFRONTbaseFINAL.o C60_franek.o C60maecenas_nottc.o C90.o CASTEM.o Cor1.o CRC.o DAMAGE.o DERIV.o DERIVtriang.o ERSTOP.o FIXINT.o fluxext.o FORMBE.o FORMDE.o FPAR.o GAUSSL.o GAUSSP.o          ICOND.o INOUT.o LOCEPSEQ.o MATPROP.o MYALLOC.o MYOPEN.o MYTIME.o NONLOC.o PERM.o PRMEFF.o promat.o PRVAP.o READCNTL.o READINPUT.o RHSCAL.o RPC.o SATBGM.o SATDER.o SATUR_A.o SATUR_B.o SATUR_C.o SFR.o SFRtriang.o SIEP.o SIGHIS.o smoothing.o STORAGEBIN.o TEMHIS.o TLOOP.o USERMAT.o VARCA2S.o WATPROP.o fems_interface.o FINDLOCAL.o PARALLEL.o comate.o comdam.o comesh.o comfems.o comfron.o comgdl.o comm1nl.o comphys.o comsiep.o control.o ctimdis.o kdtree.o findloc.o cbridge.o
/opt/openmpi/bin/mpif90 -cxxlib HMTRA5.o comes_htc.a  -L/opt/intel/mkl/lib/intel64 -mkl -L/usr/include/metis -lmetis -L/opt/gidpost/source -lgidpost -L/opt/fems/parallel64/lib -lfems -lperfm -L/opt/fems/parallel64/lib -lfems -lperfm -o comes_htc_bin.exe
comes_htc.a(BCOND.o): In function `bcond_':
BCOND.f90:(.text+0x18): undefined reference to `precis_mp_pid_'
BCOND.f90:(.text+0x6f6): undefined reference to `precis_mp_pid_'
BCOND.f90:(.text+0x772): undefined reference to `precis_mp_pid_'
BCOND.f90:(.text+0x861): undefined reference to `precis_mp_pid_'
BCOND.f90:(.text+0x901): undefined reference to `precis_mp_pid_'
comes_htc.a(FIXINT.o):FIXINT.f90:(.text+0x1de): more undefined references to `precis_mp_pid_' follow
comes_htc.a(fems_interface.o): In function `set_femssolv_':
fems_interface.f90:(.text+0xaf6): undefined reference to `precis_mp_nproc_'
fems_interface.f90:(.text+0xb0f): undefined reference to `precis_mp_pid_'
fems_interface.f90:(.text+0xb15): undefined reference to `precis_mp_nproc_'
comes_htc.a(fems_interface.o): In function `write_time_':
fems_interface.f90:(.text+0x130a): undefined reference to `precis_mp_nproc_'
fems_interface.f90:(.text+0x13c9): undefined reference to `precis_mp_pid_'
fems_interface.f90:(.text+0x13d7): undefined reference to `precis_mp_nproc_'
comes_htc.a(PARALLEL.o): In function `findmyelems_':
PARALLEL.f90:(.text+0x14): undefined reference to `precis_mp_nproc_'
PARALLEL.f90:(.text+0x1d): undefined reference to `precis_mp_pid_'
PARALLEL.f90:(.text+0x1e6): undefined reference to `precis_mp_pid_'
PARALLEL.f90:(.text+0x1ed): undefined reference to `precis_mp_nproc_'
comes_htc.a(A11.o): In function `a11_':
A11.f90:(.text+0x6): undefined reference to `precis_mp_pid_'
comes_htc.a(ABFOR5.o): In function `abfor5_':
ABFOR5.f90:(.text+0x5449): undefined reference to `matmul_mkl_f64_'
comes_htc.a(AUTOGEN.o): In function `autogen_':
AUTOGEN.f90:(.text+0x216): undefined reference to `precis_mp_pid_'
AUTOGEN.f90:(.text+0x912): undefined reference to `precis_mp_pid_'
comes_htc.a(ERSTOP.o): In function `erstop_':
ERSTOP.f90:(.text+0x25): undefined reference to `precis_mp_pid_'
comes_htc.a(FINDLOCAL.o): In function `initlocal_':
FINDLOCAL.f90:(.text+0x94e): undefined reference to `initloc_'
comes_htc.a(FINDLOCAL.o): In function `findlocal_':
FINDLOCAL.f90:(.text+0x10d7): undefined reference to `findnloc_'
FINDLOCAL.f90:(.text+0x1376): undefined reference to `findloc_'
comes_htc.a(FINDLOCAL.o): In function `termlocal_':
FINDLOCAL.f90:(.text+0x1473): undefined reference to `termloc_'
make: *** [comes_htc] Error 1

0 Kudos
Highlighted
Black Belt
318 Views

In the file "makefile.inc" that is in the zip file that you attached, "FCLAGS" is probably a misspelled version of an intended "FFLAGS". Because of that error, the -fpp compiler option is not being used by the compiler to produce .o files from .f90 files and, consequently, compilation failed for F90 files containing C-style #<directive> preprocessor lines.

0 Kudos