- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am installing an application that I have specified to use ifort (by setting the appropriate env. variable). But during the build, I got this error
gfortran: error: unrecognized command line option ‘-i8’; did you mean ‘-k8’?
I never intended to use gfortran. Then I notice that executing source /opt/intel/oneapi/setvars.sh redefines mpif90 wrapper. After sourcing setvars.sh, mpif90 -show produces gfortran -I"/opt/intel/oneapi/mpi/2021.7.1/include/gfortran/8.2.0" -I"/opt/intel/oneapi/mpi/2021.7.1/include", i.e. its underlying fortran compiler becomes gfortran, although before sourcing setvars.sh above, the underlying compiler for mpif90 is ifort. Is this a default behavior? Because of this I got the above error of gfortran not recognizing -i8, since I set this flag with ifort as the underlying compiler in mind.
The full compiler flags and linking option was generated by Intel link line advisor :
-qmkl-ilp64=sequential ${MKLROOT}/lib/intel64/libmkl_blas95_ilp64.a ${MKLROOT}/lib/intel64/libmkl_lapack95_ilp64.a -lmkl_blacs_openmpi_ilp64 -I${MKLROOT}/include/intel64/ilp64 -i8 -qmkl-ilp64=sequential
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Are you using a makefile to build your application? I suspect that to be the case, and that the default rule for building .o files from .f or .f90 files is causing gFortran to be used. Posting the makefile or the build script that you use may help pinpoint the root cause.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Well, yes the program uses makefiles to build. The thing is it's a large program consisting of a handful of folders many of which has their own makefiles to allow building locally. So, I don't know which of these many makefiles causes the above behavior. The build script might be more helpful, it is located here: https://github.com/nwchemgit/nwchem/blob/df6c95650b2418501ee788050b969846e0ee7100/contrib/distro-tools/build_nwchem
.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The README file in the "distro-tools" Nwchem directory contains this statement (underlining added by me for emphasis), which may explain the behavior that you observed:
build_nwchem This script sets up a set of environment variables and builds NWChem accordingly. I can easily be adapted to any particular build of interest. At present it is set up to build a statically linked executable with the GNU compilers.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That part of the documentation is not up-to-date. This is not the first time I build NWChem from source, I have been developing codes in this program for some times using Intel compilers by setting certain variable, and I never ran into the error above. I encountered the issue above when building it on a new computer cluster that uses Intel OneAPI, in my previous institution, their computer cluster didn't use Intel OneAPI apparently.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am intrigued, does /opt/intel/oneapi/mpi/2021.7.1/include/gfortran/8.2.0 exist? And if so why?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Out of curiosity, I checked it on my company's system: such a directory does indeed exist and it has several siblings.
the subdirectories of include/gfortran are:
10.2.0 11.1.0 4.8.0 4.9.0 5.1.0 6.1.0 7.1.0 8.2.0 9.1.0
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please note the contents of that include/gfortran directory. It only contains .mod files. No compiler per se. I don't know what part of MPI needs those gfortran .mod files.
The easiest way to compile with ifort and MPI is to use mpiifort.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page