Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Ifort compiler problem

phiphys
Beginner
1,106 Views

Good day,

I am using the Intel Fortran Compiler 11.1 to compile a simulation program. It consists of several independent *.f files, which are compiled collectively via a "make" command. My problem is now that when I try to run the make command, i receive the following error message:

ifort -static -m32 mac.o parout.o parein.o anfbed.o uneu.o pneu.o nmod.o datueb.o rbng.o w0ab.f w0zu.f vcouette.o wpoiseuille.o ctrl.o sneu.o random.o zsp_fld.o zsp_fft.o zsp_mov.o modstat.o readfields.o ramp.o rbspi.o zsp_cut.o -lsvml -o mac_l_ifc
ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.1/../../..//libm.a when searching for -lm
ld: skipping incompatible /usr/lib//libm.a when searching for -lm
ld: skipping incompatible /usr/lib/libm.a when searching for -lm
ld: cannot find -lm
make: *** [mac_l_ifc] Fehler 1

This is the makefile in question:

# Makefile fuer ifc

.SUFFIXES: .o .f

FC = ifort
#FC = gfortran-4.3
#FC = /"INTEL COMPILER DIR"/064/bin/ia32/ifort

FLAGS = -u -nowarn -132 -O3 -static -msse3
#FLAGS = -u -nowarn -132 -O3 -static -m32 -no-prec-div -vec-report0
#-real-size 64 -integer-size 64

# f|r sleipnir:
# -msse3 -axT


LD = ld
LFLAGS = -static -m32
MAKE = make
MAKEFLAGS = b r
datum=`date +%y%m%d`
dir="MAC"
bindir="../"


SRC1 = mac.f parout.f parein.f anfbed.f uneu.f pneu.f nmod.f datueb.f \\
rbng.f w0ab.f w0zu.f vcouette.f wpoiseuille.f ctrl.f sneu.f \\
random.f zsp_fld.f zsp_fft.f zsp_mov.f modstat.f readfields.f \\
ramp.f rbspi.f zsp_cut.f
OBJ1 = mac.o parout.o parein.o anfbed.o uneu.o pneu.o nmod.o datueb.o \\
rbng.o w0ab.f w0zu.f vcouette.o wpoiseuille.o ctrl.o sneu.o \\
random.o zsp_fld.o zsp_fft.o zsp_mov.o modstat.o readfields.o \\
ramp.o rbspi.o zsp_cut.o
LIB1 = -lsvml

Consider me as new to Linux and relatively inexperienced.

Thank you,

Phiphys

0 Kudos
3 Replies
TimP
Honored Contributor III
1,106 Views

If you are using the 32-bit ifort on an x86_64 system, you require working installations of both g++ 64-bit and g++ 32-bit (g++ -m32). It looks like you have mixed efforts to compile 32- and 64-bit modes, which can't be mixed. For 32-bit ifort, you must set the environment variables in accordance with /bin/ifortvars.sh ia32. The -m32 option doesn't work to switch from 64- to 32- bit mode, unless that capability has been added without being mentioned publicly.

If you don't have a reason for 32-bit mode, why not do it all in 64-bit (intel64) mode?

0 Kudos
phiphys
Beginner
1,106 Views

Hello Tim,

I have tried to do so, by sourcing the intel64 ifort compiler. After doing so, I retried the make command, but received more error messages:

bohr@pc:/media/HDD1/MAC/src$ source /home/bohr/intel/Compiler/11.1/064/bin/ifortvars.sh intel64
bohr@pc:/media/HDD1/MAC/src$ make
ifort -static -m32 mac.o parout.o parein.o anfbed.o uneu.o pneu.o nmod.o datueb.o rbng.o w0ab.f w0zu.f vcouette.o wpoiseuille.o ctrl.o sneu.o random.o zsp_fld.o zsp_fft.o zsp_mov.o modstat.o readfields.o ramp.o rbspi.o zsp_cut.o -lsvml -o mac_l_ifc
ld: skipping incompatible /home/bohr/intel/Compiler/11.1/064/lib/intel64/libsvml.a when searching for -lsvml
ld: skipping incompatible /home/bohr/intel/Compiler/11.1/064/lib/intel64/libifport.a when searching for -lifport
ld: skipping incompatible /home/bohr/intel/Compiler/11.1/064/lib/intel64/libifcore.a when searching for -lifcore
ld: skipping incompatible /home/bohr/intel/Compiler/11.1/064/lib/intel64/libimf.a when searching for -limf
ld: skipping incompatible /home/bohr/intel/Compiler/11.1/064/lib/intel64/libsvml.a when searching for -lsvml
ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.1/../../..//libm.a when searching for -lm
ld: skipping incompatible /usr/lib//libm.a when searching for -lm
ld: skipping incompatible /usr/lib/libm.a when searching for -lm
ld: cannot find -lm
make: *** [mac_l_ifc] Fehler 1

Another question: How do I specifically install the 32-bit version of g++? g++ is fully installed, as far as I can tell.

phiphys

0 Kudos
TimP
Honored Contributor III
1,106 Views

If you use the 64-bit compiler with the 32-bit linker, you can expect these messages about incompatible .a libraries. You must permit the use of the 64-bit linker. Perhaps ifort should be made to warn you when you over-ride its choice of ld.

ifort ia32 will search for libraries by

g++ -m32 -print-search-dirs

So this command will give you an idea whether the 32-bit g++ is working to the required extent.

0 Kudos
Reply