1
votes

I am compiling a third-part software, with mpif90, that in my case is the mpi version of gcc. The package comes with a makefile. After compiling the object files, the makefile creates the archive with ar, but this fails because there are not input object files. In effect I tried to compile by hand the object files (.o) with

mpif90 -lmkl_gf -lmkl_intel_thread -lmkl_core -liomp5 -lpthread -lm -openmp -O3  -DMPI -c a.f90

and the a.o is not created, a .mod file is created instead. I don't have much experience with fortran, and I am a bit puzzled, because the -c flag should create an object, shouldn' it?

I have verified that gfortran does create the object file if I remove the flag openmp


Notes:

mpif90 -v
gcc version 4.4.3

OS : Ubuntu 10.04.4 LTS

2
.mod files are related to modules in fortran 90. It should be one of the files generated by the compiler - ascobol

2 Answers

1
votes
0
votes

In case anyone comes across this question in the future ... the flags used by the OP are specific to the intel fortran compiler while it seems the mpif90 wrapper is using the gfortran compiler. The proper flag to use OpenMP with gfortran is -fopenmp and the library is -lgomp. It is possible to use the intel library with a different vendors compiler, but its easiest to stick with one vendor.