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

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

Closed
zeekus opened this issue Feb 24, 2023 · 2 comments
Closed

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

zeekus opened this issue Feb 24, 2023 · 2 comments

Comments

@zeekus
Copy link

zeekus commented Feb 24, 2023

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
Copy link
Author

zeekus commented Mar 6, 2023

@josephzhang8
Copy link
Member

josephzhang8 commented Mar 7, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants