schism-dev / schism

Semi-implicit Cross-scale Hydroscience Integrated System Model (SCHISM)
http://ccrm.vims.edu/schismweb/
Apache License 2.0
93 stars 88 forks source link

schism doesn't seem compile with gcc and openmpi #98

Closed zeekus closed 1 year ago

zeekus commented 1 year ago

I am trying to compile pschism with gcc and openmpi. However, it appears there is a static module in the source tree.

Problem File: src/GOTM3.2.5/netcdf_include/netcdf.mod seems to be blocking the compiling.

When I run a 'make pschism' I get this error:

Scanning dependencies of target sversion
/modeling/pschism/schism/src/Core/gen_version.py
/modeling/pschism/schism/src/Core
/modeling/pschism/schism/src/Core/_version
SCHISM version not available, searching for src/schism_user_version.txt or default
Attempting to get version text manually from first line of
src/Core/schism_version_user.txt if file exists
ad9f479
 SCHISM version:  develop
 GIT commit       ad9f479
[  0%] Built target sversion
Scanning dependencies of target core
[  0%] Building Fortran object Core/CMakeFiles/core.dir/schism_glbl.F90.o
[  2%] Building Fortran object Core/CMakeFiles/core.dir/schism_msgp.F90.o
[  2%] Building Fortran object Core/CMakeFiles/core.dir/gen_modules_clock.F90.o
[  4%] Building Fortran object Core/CMakeFiles/core.dir/hydraulic_structures.F90.o
[  4%] Building Fortran object Core/CMakeFiles/core.dir/misc_modules.F90.o
[  4%] Building Fortran object Core/CMakeFiles/core.dir/schism_io.F90.o
/modeling/pschism/schism/src/Core/schism_io.F90:30.8:

    use netcdf
        1
Fatal Error: File 'netcdf.mod' opened at (1) is not a GNU Fortran module file
make[3]: *** [Core/CMakeFiles/core.dir/schism_io.F90.o] Error 1
make[2]: *** [Core/CMakeFiles/core.dir/all] Error 2
make[1]: *** [Driver/CMakeFiles/pschism.dir/rule] Error 2
make: *** [pschism] Error 2

I am using this cmake file:

source /modeling/pschism/load_modules_openmpi.sh

export MPI_ROOT=$(spack location -i openmpi)
export NETFORTRAN=$(spack location -i netcdf-fortran%gcc)
export NETCDF=$(spack location -i netcdf-c%gcc)
export NetCDF_C_DIR=$NETCDF
export NetCDF_INCLUDE_DIR=$NETCDF"/include"
export NetCDF_FORTRAN_DIR=$NETCDF
export NetCDF_INCLUDE_DIR=$NETCDF"/include"
export NetCDF_LIBRARIES=$NETCDF"/lib"

cmake3 -C /modeling/pschism/SCHISM.local.build  -C /modeling/pschism/SCHISM.local.bluefish.gnu -D MPI_LIBRARY_PATH=$MPI_ROOT/include -D MPI_ROOT=$MPI_ROOT -D NETCDF=$NETCDF  -D NETFORTRAN=$NETFORTRAN -D CMAKE_Fortran_COMPILER=$(spack location -i openmpi%gcc)/bin/mpifort -D CMAKE_C_COMPILER=$(spack location -i openmpi%gcc)/bin/mpicc ../src

make pschism

My /modeling/pschism/load_modules_openmpi file looks like this:

echo "load openmpi"
module load openmpi-4.1.4-gcc-12.2.0-7t3buqn
echo $?
echo "load netcdf-c"
module load netcdf-c-4.9.0-gcc-12.2.0-jht24ic
echo $?
echo "load netcdf-fortan"
module load netcdf-fortran-4.6.0-gcc-12.2.0-cvtwnpl
echo $?
echo "load hdf5"
module load hdf5-1.12.2-gcc-12.2.0-djtremk
echo $?

Is there a work around for this ?

zeekus commented 1 year ago

It seem that the static binaries are coming from this area: ref: https://github.com/schism-dev/schism/tree/master/src/GOTM3.2.5/netcdf_include

This file in particular: https://github.com/schism-dev/schism/blob/master/src/GOTM3.2.5/netcdf_include/netcdf.mod

josephzhang8 commented 1 year ago

Hi Teddy:

Please do not use the netcdf include in that dir. It was kept only for that obsolete version of GOTM. When you compile, please do not invoke GOTM - you do not need it.

Regards,

Joseph Zhang (804)684 7595 (office) SCHISM web: http://ccrm.vims.edu/schism/ From: Teddy Knab @.> Sent: Monday, March 6, 2023 7:59 AM To: schism-dev/schism @.> Cc: Subscribed @.***> Subject: Re: [schism-dev/schism] schism doesn't seem compile with gcc and openmpi (Issue #98)

[EXTERNAL to VIMS received message]

It seem that the static binaries are coming from this area: ref: https://github.com/schism-dev/schism/tree/master/src/GOTM3.2.5/netcdf_includehttps://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fschism-dev%2Fschism%2Ftree%2Fmaster%2Fsrc%2FGOTM3.2.5%2Fnetcdf_include&data=05%7C01%7Cyjzhang%40vims.edu%7C252ac778835a4d6281a708db1e429ba5%7C8cbcddd9588d4e3b9c1e2367dbdf1740%7C0%7C0%7C638137043644351750%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=XUYMlzzQcE7KGPyUbAiFbyoLeQYY6sbVOxVijk2M7HA%3D&reserved=0

- Reply to this email directly, view it on GitHubhttps://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fschism-dev%2Fschism%2Fissues%2F98%23issuecomment-1456085985&data=05%7C01%7Cyjzhang%40vims.edu%7C252ac778835a4d6281a708db1e429ba5%7C8cbcddd9588d4e3b9c1e2367dbdf1740%7C0%7C0%7C638137043644351750%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=K4W3CEAemDPB%2FJB379xI7LrLr8NwkSN33qv1UqjgzAg%3D&reserved=0, or unsubscribehttps://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAFBKNZZRIM2T47A3WB25Z5LW2XNSVANCNFSM6AAAAAAVHCAN4U&data=05%7C01%7Cyjzhang%40vims.edu%7C252ac778835a4d6281a708db1e429ba5%7C8cbcddd9588d4e3b9c1e2367dbdf1740%7C0%7C0%7C638137043644351750%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=utTK3%2FarfOs3qV9Z1Ln%2FW72e%2B%2FYjx4OggDuuemNlmjU%3D&reserved=0. You are receiving this because you are subscribed to this thread.Message ID: @.**@.>>