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

mpiifort build NETCDF-f and generate netcdf.mod but it is shown by gfortran10

RyanOcean
Beginner
1,123 Views

Dear Everyone,

 

I'm using intel compiler 2018 and installing NETCDF-C-4.8.1 and NETCDF-F.4.5.2. I set CC=mpiicc FC=mpiifort F77=mpiifort F90=mpiifort. And I successfully built and generated the netcdf.mod file. However, the first line of netcdf.mod shows that GFORTRAN module version '10' created from netcdf4.f90. And this leads a downstream software using mpiifort fail to link the netcdf.mod. My question is, why does mpiifort generate a netcdf.mod with GFORTRAN module version? Thanks!

 

Wish you good,

RyanOcean

0 Kudos
1 Solution
Ron_Green
Moderator
1,079 Views

mpiifort does not create gfortran mod files by default.  Something in the NETCDF build system must be in error.  

If you can capture the make with VERBOSE perhaps it will show the issue.  For example, if mpiifort is given a bad argument like

mpiifort -fc=gfortran

is one way mpiifort can call gfortran instead of ifort.  you may try

export FC='mpiifort -fc=ifort'

same for F90, F77.

 

what I am telling you is this:  the default for mpiifort is to use ifort.  It can invoke gfortran if FC is set incorrectly to gfortran.  You'll have to dig around to find where their build is running amok

View solution in original post

0 Kudos
4 Replies
Ron_Green
Moderator
1,080 Views

mpiifort does not create gfortran mod files by default.  Something in the NETCDF build system must be in error.  

If you can capture the make with VERBOSE perhaps it will show the issue.  For example, if mpiifort is given a bad argument like

mpiifort -fc=gfortran

is one way mpiifort can call gfortran instead of ifort.  you may try

export FC='mpiifort -fc=ifort'

same for F90, F77.

 

what I am telling you is this:  the default for mpiifort is to use ifort.  It can invoke gfortran if FC is set incorrectly to gfortran.  You'll have to dig around to find where their build is running amok

0 Kudos
RyanOcean
Beginner
1,015 Views

Many thanks. I find that export FC='mpiifort -fc=ifort' really works, although I don't find some clues that claim to use gfortran wrapper for mpiifort in the configure file. And I get a *.mod with intel compiler now. Thanks again! 

0 Kudos
mecej4
Honored Contributor III
1,071 Views

It is possible that the Gfortran .mod file was generated by using make, which used Gfortran as the Fortran compiler according to its implicit rules for .f90 source files. That make procedure may have failed in a step after the production of the .mod file, and failing to find a rule for deleting such files (possibly as part of make clean), would leave behind the mod file. That mod file could become a nuisance later.

In other words, the mere presence of a module file does not justify the claim "I successfully built and generated the netcdf.mod file".

0 Kudos
RyanOcean
Beginner
1,013 Views

Many thanks! I understand your ideas. After export FC='mpiifort -fc=ifort', I got a *.mod file with intel compiler.

0 Kudos
Reply