Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GNU Fortran module error #2677

Open
Ajmal-1301 opened this issue Jan 10, 2025 · 3 comments
Open

GNU Fortran module error #2677

Ajmal-1301 opened this issue Jan 10, 2025 · 3 comments
Assignees
Labels
category: Debug Help Request for assistance debugging GEOS-Chem topic: Build Related to makefiles or the build sequence topic: User Environment Relating to libraries, containers, AMIs, etc.

Comments

@Ajmal-1301
Copy link

Your name

Ajmal

Your affiliation

North Carolina State University

Please provide a clear and concise description of your question or discussion topic.

Hi,
I was following the GEOS-Chem tutorial and was compiling the code, and I got the following error,

File ‘/usr/local/pgi/linux86-64/2018/netcdf/netcdf-4.5.0/openmpi-2.1.2/include/netcdf.mod’ opened at (1) is not a GNU Fortran module file

the code is not going to the correct location where I loaded my netcdf module, which is at (/usr/local/apps/netcdf/4.9.2-openmpi5.0.3/)

I think the traced the issue to the HEMCOBuildproperties.txt file which is providing the location and not the location where I loaded the module
HEMCOBuildProperties.txt

Thanks

@Ajmal-1301 Ajmal-1301 added the category: Question Further information is requested label Jan 10, 2025
@yantosca yantosca added topic: Build Related to makefiles or the build sequence category: Debug Help Request for assistance debugging GEOS-Chem and removed category: Question Further information is requested labels Jan 10, 2025
@yantosca
Copy link
Contributor

Thanks for writing @Ajmal-1301. I think the issue is that yuou are using a netCDF library that is built with the PGI compiler, which is not supported by GEOS-Chem.

File ‘/usr/local/pgi/linux86-64/2018/netcdf/netcdf-4.5.0/openmpi-2.1.2/include/netcdf.mod’ opened at (1) is not a GNU Fortran module file

You need to build GEOS-Chem with the same version of the compiler that your netCDF and OpenMPI libraries have been built with. Otherwise it will result in an error similar to that above.

@yantosca yantosca self-assigned this Jan 10, 2025
@Ajmal-1301
Copy link
Author

Ajmal-1301 commented Jan 10, 2025

Hi @yantosca
Thank you for replying, I am not sure I follow but this is the environment file I loaded before building

###############################################################################`
# Environment file for GCClassic + GNU compilers`
#
###############################################################################`

# Unload all modules first
module purge

# Load modules
module load cmake`
module load openmpi-gcc/openmpi5.0.5-gcc11.4.1
module load netcdf/4.9.2-openmpi5.0.3

#==============================================================================
# Environment variables and related settings
# (NOTE: We will have to define <module>_HOME variables manually, based on what GEOS-Chem needs)
#==============================================================================

# Set number of threads for OpenMP.

# In our LSF script, we may want to start with just shared memory parallelization, where we use multiple cores on a *single* node
## this would look like this in our LSF script:
### #BSUB -R span[hosts=1]
### export OMP_NUM_THREADS="${LSB_DJOB_NUMPROC}"

# Max out the stacksize memory limit
export OMP_STACKSIZE="500m"

# Compilers
export CC="gcc"
export CXX="g++"
export FC="gfortran"
export F77="${FC}"

# netCDF
export NETCDF_HOME=/usr/local/apps/netcdf/4.9.2-openmpi5.0.3/
export NETCDF_C_ROOT="${NETCDF_HOME}"
export NETCDF_FORTRAN_ROOT="${NETCDF_HOME}"

# MPI
export MPI_HOME=/usr/local/apps/openmpi/5.0.5-gcc11.4.1/

# KPP 3.0.0+
# (not worrying with this for now). export KPP_FLEX_LIB_DIR="${FLEX_HOME}/lib64"


#==============================================================================
# Print information
#==============================================================================

module list

echo ""
echo "Environment:"
echo ""
echo "CC : ${CC}"
echo "CXX : ${CXX}"
echo "FC : ${FC}"
echo "KPP_FLEX_LIB_DIR : ${KPP_FLEX_LIB_DIR}"
echo "MPI_HOME : ${MPI_HOME}"
echo "NETCDF_HOME : ${NETCDF_HOME}"
echo "NETCDF_FORTRAN_HOME : ${NETCDF_FORTRAN_HOME}"
echo "OMP_NUM_THREADS : ${OMP_NUM_THREADS}"
echo ""
echo "Done sourcing ${BASH_SOURCE[0]}"

@yantosca yantosca reopened this Jan 10, 2025
@yantosca yantosca added the topic: User Environment Relating to libraries, containers, AMIs, etc. label Jan 10, 2025
@yantosca
Copy link
Contributor

Thanks @Ajmal-1301 for the environment file. A couple of thoughts:

  1. You haven't explicitly loaded a module for the GNU compilers. Therefore it is probably just defaulting to the version in /usr/bin (the default location for libraries).

  2. I still believe that these modules:

module load openmpi-gcc/openmpi5.0.5-gcc11.4.1
module load netcdf/4.9.2-openmpi5.0.3

were built with the PGI compiler instead of with the GNU compiler. You can use the

$ module spider netcdf

and

$ module spider netcdf-fortran

commands to find a version of the netCDF libraries on your system that were built with the GNU compilers.

If you do not have netcdf or netcdf-fortran libraries that were built with GNU compilers, you can build them yourselves following the instructions on ReadTheDocs:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: Debug Help Request for assistance debugging GEOS-Chem topic: Build Related to makefiles or the build sequence topic: User Environment Relating to libraries, containers, AMIs, etc.
Projects
None yet
Development

No branches or pull requests

2 participants