compile with ifort problems

Discussion on computers, ROMS installation and compiling

Moderators: arango, robertson

Post Reply
Message
Author
jit079
Posts: 1
Joined: Fri Feb 10, 2023 4:06 pm
Location: Scripps Insitution of Oceanography

compile with ifort problems

#1 Unread post by jit079 »

Hi I am new to ROMS. I tried to compile ROMS using gfortran and it succeeded. However, there is memory leak problem if using gfortran (viewtopic.php?p=24029&hilit=leak#p24029). It is recommended to use ifort instead. So I install ifort. When typing "which fort", I got "/opt/intel/oneapi/compiler/2023.0.0/linux/bin/intel64/ifort". Then in the makefile, I changed the compiler to be ifort, but I got the following errors:

f95: error: precise: No such file or directory
f95: error: all: No such file or directory
f95: error: bounds: No such file or directory
f95: error: uninit: No such file or directory
f95: error: interfaces,nouncalled: No such file or directory
f95: error: unrecognized debug output level ‘en-interfaces’
f95: error: unrecognized command line option ‘-fp-model’
f95: error: unrecognized command line option ‘-h’
f95: error: unrecognized command line option ‘-check’; did you mean ‘-fcheck=’?
f95: error: unrecognized command line option ‘-check’; did you mean ‘-fcheck=’?
f95: error: unrecognized command line option ‘-traceback’
f95: error: unrecognized command line option ‘-check’; did you mean ‘-fcheck=’?
f95: error: unrecognized command line option ‘-warn’; did you mean ‘--warn-’?
make: *** [ROMS/Modules/Module.mk:14: Build_roms/mod_kinds.o] Error 1


When I typed "f95 --version", it seems that f95 points to GNU Fortran instead of Intel Fortran Compiler.

GNU Fortran (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


So how can I make f95 point to ifort instead of GNU Fortran. I tried to search online, but just could not find any useful information. Any help is appreciated!

User avatar
arango
Site Admin
Posts: 1367
Joined: Wed Feb 26, 2003 4:41 pm
Location: DMCS, Rutgers University
Contact:

Re: compile with ifort problems

#2 Unread post by arango »

You can compile with gfortran; I do it all the time. However, you need to use a newer version of the compiler. Notice that in the :arrow: message that you referred to, the user solved the memory leak and bug in the compiler by using a newer version. To use ifort, you need to customize the proper *-ifort.mk configuration file or use CMake. Remember that you still need the required :arrow: external libraries to be compiled with the same version of the compiler.

There is plenty of information in :arrow: wikiROMS. You may need the help of the computer manager at your institution.

robertson
Site Admin
Posts: 227
Joined: Wed Feb 26, 2003 3:12 pm
Location: IMCS, Rutgers University

Re: compile with ifort problems

#3 Unread post by robertson »

Do you have USE_MPI and USE_MPIF90 set in your build script? If so, I would guess that your system has Intel MPI installed and in your path and you didn't change which_MPI to be set to intel. To access the MPI enabled Intel Fortran compilers when you are using Intel's MPI implementation, you need to set which_MPI to intel so the ROMS build script knows to use mpiifort (note the double i) for the compiler.

Intel MPI ships with both GCC linked MPI compilers (mpifort, mpicc, etc.) and Intel linked MPI compilers (mpiifort, mpiicc, etc.) so ROMS needs which_MPI to be set correctly to find the right compilers.

If you have not set USE_MPI and USE_MPIF90 then perhaps attach your ROMS build script and the full output log so we have a better idea what is happening.

Post Reply