DOI-USGS / COAWST

COAWST modeling system git repository
Other
110 stars 52 forks source link

Cannot compile inlet_test (ROMS+SWAN): Cannot open module file ‘m_coupling.mod’ #161

Closed stamenminkov closed 1 year ago

stamenminkov commented 1 year ago

Hi, I've managed to compile both MCT and SCRIP now, however when trying to compile COAWST for the first time by using the inlet_test project, it fails with the following error:

/usr/bin/cpp -P -traditional -w               -DMPI -DLINUX -DX86_64 -DGFORTRAN -D'ROOT_DIR="/home/stamen-easy/Documents/COAWST"' -DINLET_TEST -D'HEADER="inlet_test.h"' -D'ROMS_HEADER="/home/stamen-easy/Documents/COAWST/Projects/Inlet_test/Coupled/inlet_test.h"' -DNestedGrids= -D'ANALYTICAL_DIR="/home/stamen-easy/Documents/COAWST/Projects/Inlet_test/Coupled"' -D'MY_ANALYTICAL="on"' -D'GIT_URL=""' -D'GIT_REV=""' -D'SVN_URL="https://www.myroms.org/svn/src/trunk"' -D'SVN_REV="1151"' -IROMS/Include -I/home/stamen-easy/Documents/COAWST/Projects/Inlet_test/Coupled -IROMS/Nonlinear -IROMS/Nonlinear/Biology -IROMS/Nonlinear/Sediment -IROMS/Nonlinear/Wec -IROMS/Nonlinear/Vegetation -IROMS/Utility -IROMS/Drivers -IROMS/Functionals -I/home/stamen-easy/Documents/COAWST/Projects/Inlet_test/Coupled -IMaster -ICompilers -D'HEADER_DIR="/home/stamen-easy/Documents/COAWST/Projects/Inlet_test/Coupled"'  Master/get_numswan_grids.F > /home/stamen-easy/Documents/COAWST/Build_roms/get_numswan_grids.f90
ROMS/Bin/cpp_clean /home/stamen-easy/Documents/COAWST/Build_roms/get_numswan_grids.f90
cd /home/stamen-easy/Documents/COAWST/Build_roms; /home/stamen-easy/.local/easybuild/software/OpenMPI/4.1.4-GCC-12.2.0/bin/mpif90 -c -frepack-arrays -fallow-argument-mismatch        -O3 -ffast-math -I/home/stamen-easy/.local/easybuild/software/MCT-COAWST/2.6.0-gompi-2022b/include get_numswan_grids.f90
get_numswan_grids.f90:10:11:

   10 |       USE M_COUPLING
      |           1
Fatal Error: Cannot open module file ‘m_coupling.mod’ for reading at (1): No such file or directory
compilation terminated.
make: *** [Master/Module.mk:33: /home/stamen-easy/Documents/COAWST/Build_roms/get_numswan_grids.o] Error 1

Is this any known issue? Again, based on the errors from the MCT/SCRIP compilations I've had, it looks like an issue with either MPI or Fortran, however not sure what's wrong here.

jcwarner-usgs commented 1 year ago

need to see the full build output. there can be an error that happens, and then the build tries to keep going. So i need to look at the whole output. do a scrip build.log ./build_coawst exit and then send the build.log here. -j

stamenminkov commented 1 year ago

There you go, thank you for looking into that :)

build.log

If needed I can upload also my build_coast.sh and my Linux_gfortran.mk.

jcwarner-usgs commented 1 year ago

" cmake: not found" SWAN needs to use Cmake to build. can you get that installed? -j

dkobashi commented 1 year ago

John,

I've updated COAWST to the latest version on github and I had the same error. ROMS compile works fine and so does WW3 only and ROMS-WW3. SWAN only and ROMS-SWAN do not work.

A strange thing is that if I compile COAWST in parallel mode (with -j 4), I have the error on M_COUPLING. However, if I compile COAWST in a single mode, I do not have this error, but have different errors. I installed a recent version of Cmake that was required to compile WW3.

The errors come from different sources, but many are related to modules.

` /home/oceanforecast/ROHS/mycoawst/COAWST.v3p8/SWAN/src_coawst/swmod2.f:1496: Error: Can't open included file 'mpif.h' make[3]: ** [lib/CMakeFiles/swan41.45.dir/build.make:91: lib/CMakeFiles/swan41.45.dir/swmod2.f.o] Error 1 make[2]: [CMakeFiles/Makefile2:139: lib/CMakeFiles/swan41.45.dir/all] Error 2 make[1]: *** [Makefile:139: all] Error 2 master.f90:22:10:

22 | USE swan_iounits | 1 Fatal Error: Cannot open module file ‘swan_iounits.mod’ for reading at (1): No such file or directory compilation terminated. make: * [Master/Module.mk:33: /home/oceanforecast/ROHS/mycoawst/work/Build_roms/master.o] Error 1 `

This mpif.h error is a strange one because I set the path of openmpi in my_build_paths.sh (attached) as MPI_ROOT=/opt/openmpi-4.1.5 and subsequently, MPI_INCDIR=${MPI_ROOT}/include is set. I confirmed that there is mpif.h in MPI_INCDIR. So I don't understand why.

There is a notation in build.sh about mpif.h.

Notice that sometimes the parallel compilation fail to find MPI # include file "mpif.h".

I attach my build log.

build_roms_swan.log

I also attach my build script and path script

my_build_paths.sh.log build_coawst_v3p8.sh.log

I wonder if you know how to fix the errors.

Thanks in advance.

DJ

stamenminkov commented 1 year ago

Good morning John,

I'm back from holidays and I've just looked into what you said regarding Cmake.

It's quite strange, because when I load CMake, the compilation hangs after the following:

stamen-easy@stameneasy-VirtualBox:~/Documents/COAWST$ module load CMake/3.24.3-GCCcore-12.2.0
stamen-easy@stameneasy-VirtualBox:~/Documents/COAWST$ bash ./build_coawst.sh 
make: git: No such file or directory
rm -f -r core *.ipo /home/stamen-easy/Documents/COAWST/Build_roms /home/stamen-easy/make_macros.mk
make: git: No such file or directory
cp -f /home/stamen-easy/.local/easybuild/software/netCDF-Fortran/4.6.0-gompi-2022b/include/netcdf.mod /home/stamen-easy/Documents/COAWST/Build_roms
cp -f /home/stamen-easy/.local/easybuild/software/netCDF-Fortran/4.6.0-gompi-2022b/include/typesizes.mod /home/stamen-easy/Documents/COAWST/Build_roms
cp -p /home/stamen-easy/make_macros.mk /home/stamen-easy/Documents/COAWST/Build_roms
make: git: No such file or directory
\
cd /home/stamen-easy/Documents/COAWST/Build_roms;                                                                           \
echo "";                                                                                     \
cpp -P -traditional -w               -DMPI -DLINUX -DX86_64 -DGFORTRAN -D'ROOT_DIR="/home/stamen-easy/Documents/COAWST"' -DINLET_TEST -D'HEADER="inlet_test.h"' -D'ROMS_HEADER="/home/stamen-easy/Documents/COAWST/Projects/Inlet_test/Coupled/inlet_test.h"' -DNestedGrids= -D'ANALYTICAL_DIR="/home/stamen-easy/Documents/COAWST/Projects/Inlet_test/Coupled"' -D'MY_ANALYTICAL="on"' -D'GIT_URL=""' -D'GIT_REV=""' -D'SVN_URL="https://www.myroms.org/svn/src/trunk"' -D'SVN_REV="1151"' -IROMS/Include -I/home/stamen-easy/Documents/COAWST/Projects/Inlet_test/Coupled -IROMS/Nonlinear -IROMS/Nonlinear/Biology -IROMS/Nonlinear/Sediment -IROMS/Nonlinear/Wec -IROMS/Nonlinear/Vegetation -IROMS/Utility -IROMS/Drivers -IROMS/Functionals -I/home/stamen-easy/Documents/COAWST/Projects/Inlet_test/Coupled -IMaster -ICompilers -D'HEADER_DIR="/home/stamen-easy/Documents/COAWST/Projects/Inlet_test/Coupled"'  -I/home/stamen-easy/Documents/COAWST//ROMS/Include /home/stamen-easy/Documents/COAWST//Master/MCT_coupler/mod_coupler_kinds.F > mod_coupler_kinds.f90; \
/home/stamen-easy/Documents/COAWST//ROMS/Bin/cpp_clean mod_coupler_kinds.f90;                                               \
/home/stamen-easy/.local/easybuild/software/OpenMPI/4.1.4-GCC-12.2.0/bin/mpif90 -c -frepack-arrays -fallow-argument-mismatch        -O3 -ffast-math -I/home/stamen-easy/.local/easybuild/software/MCT-COAWST/2.6.0-gompi-2022b/include mod_coupler_kinds.f90;                                                    \
echo "";                                                                                     \
cpp -P -traditional -w               -DMPI -DLINUX -DX86_64 -DGFORTRAN -D'ROOT_DIR="/home/stamen-easy/Documents/COAWST"' -DINLET_TEST -D'HEADER="inlet_test.h"' -D'ROMS_HEADER="/home/stamen-easy/Documents/COAWST/Projects/Inlet_test/Coupled/inlet_test.h"' -DNestedGrids= -D'ANALYTICAL_DIR="/home/stamen-easy/Documents/COAWST/Projects/Inlet_test/Coupled"' -D'MY_ANALYTICAL="on"' -D'GIT_URL=""' -D'GIT_REV=""' -D'SVN_URL="https://www.myroms.org/svn/src/trunk"' -D'SVN_REV="1151"' -IROMS/Include -I/home/stamen-easy/Documents/COAWST/Projects/Inlet_test/Coupled -IROMS/Nonlinear -IROMS/Nonlinear/Biology -IROMS/Nonlinear/Sediment -IROMS/Nonlinear/Wec -IROMS/Nonlinear/Vegetation -IROMS/Utility -IROMS/Drivers -IROMS/Functionals -I/home/stamen-easy/Documents/COAWST/Projects/Inlet_test/Coupled -IMaster -ICompilers -D'HEADER_DIR="/home/stamen-easy/Documents/COAWST/Projects/Inlet_test/Coupled"'  -I/home/stamen-easy/Documents/COAWST//ROMS/Include /home/stamen-easy/Documents/COAWST//Master/MCT_coupler/mct_coupler_params.F > mct_coupler_params.f90; \
/home/stamen-easy/Documents/COAWST//ROMS/Bin/cpp_clean mct_coupler_params.f90;                                              \
/home/stamen-easy/.local/easybuild/software/OpenMPI/4.1.4-GCC-12.2.0/bin/mpif90 -c -frepack-arrays -fallow-argument-mismatch        -O3 -ffast-math -I/home/stamen-easy/.local/easybuild/software/MCT-COAWST/2.6.0-gompi-2022b/include mct_coupler_params.f90;                                                   \
echo "";                                                                                     \
cpp -P -traditional -w               -DMPI -DLINUX -DX86_64 -DGFORTRAN -D'ROOT_DIR="/home/stamen-easy/Documents/COAWST"' -DINLET_TEST -D'HEADER="inlet_test.h"' -D'ROMS_HEADER="/home/stamen-easy/Documents/COAWST/Projects/Inlet_test/Coupled/inlet_test.h"' -DNestedGrids= -D'ANALYTICAL_DIR="/home/stamen-easy/Documents/COAWST/Projects/Inlet_test/Coupled"' -D'MY_ANALYTICAL="on"' -D'GIT_URL=""' -D'GIT_REV=""' -D'SVN_URL="https://www.myroms.org/svn/src/trunk"' -D'SVN_REV="1151"' -IROMS/Include -I/home/stamen-easy/Documents/COAWST/Projects/Inlet_test/Coupled -IROMS/Nonlinear -IROMS/Nonlinear/Biology -IROMS/Nonlinear/Sediment -IROMS/Nonlinear/Wec -IROMS/Nonlinear/Vegetation -IROMS/Utility -IROMS/Drivers -IROMS/Functionals -I/home/stamen-easy/Documents/COAWST/Projects/Inlet_test/Coupled -IMaster -ICompilers -D'HEADER_DIR="/home/stamen-easy/Documents/COAWST/Projects/Inlet_test/Coupled"'  -I/home/stamen-easy/Documents/COAWST//ROMS/Include /home/stamen-easy/Documents/COAWST//Master/MCT_coupler/mod_coupler_iounits.F > mod_coupler_iounits.f90; \
/home/stamen-easy/Documents/COAWST//ROMS/Bin/cpp_clean mod_coupler_iounits.f90;                                             \
/home/stamen-easy/.local/easybuild/software/OpenMPI/4.1.4-GCC-12.2.0/bin/mpif90 -c -frepack-arrays -fallow-argument-mismatch        -O3 -ffast-math -I/home/stamen-easy/.local/easybuild/software/MCT-COAWST/2.6.0-gompi-2022b/include mod_coupler_iounits.f90;

make: git: No such file or directory
make: Nothing to be done for 'wrfclean'.
make: git: No such file or directory
make: Nothing to be done for 'wrf'.
make: git: No such file or directory
make: Nothing to be done for 'wrfhydroclean'.
make: git: No such file or directory
make: Nothing to be done for 'wrfhydro'.
make: git: No such file or directory
make: Nothing to be done for 'ww3clean'.
make: git: No such file or directory
make: Nothing to be done for 'ww3'.
make: git: No such file or directory
rm -rf SWAN/src_coawst;  \
cd SWAN; ls;            \
cmake -P clobber.cmake; \
echo "cleaned swan";
bin  build  clobber.cmake  cmake  CMakeLists.txt  doc  LICENSE  misc  README.md  src  switch.pl  tools
cleaned swan
make: git: No such file or directory
mkdir SWAN/src_coawst;                                                                        \
cp -r SWAN/src/* SWAN/src_coawst/;                                                          \
cd SWAN/src_coawst;                                                                           \
echo "";                                                                                     \
for file in swanpre3 swancom4 ocpmix mod_swan_kinds swancom3 waves_control swanparll ocpcre swanout1 swancom5 ocpids SwanSpectPart swpoint swanout2 swan_iounits swmod2 swanmain swanpre1 swanser swancom1 swancom2 waves_coupler swanpre2 swmod1; do                                                              \
mv $file.ftn $file.b;                                                                      \
/usr/bin/cpp -P -traditional -w               -DMPI -DLINUX -DX86_64 -DGFORTRAN -D'ROOT_DIR="/home/stamen-easy/Documents/COAWST"' -DINLET_TEST -D'HEADER="inlet_test.h"' -D'ROMS_HEADER="/home/stamen-easy/Documents/COAWST/Projects/Inlet_test/Coupled/inlet_test.h"' -DNestedGrids= -D'ANALYTICAL_DIR="/home/stamen-easy/Documents/COAWST/Projects/Inlet_test/Coupled"' -D'MY_ANALYTICAL="on"' -D'GIT_URL=""' -D'GIT_REV=""' -D'SVN_URL="https://www.myroms.org/svn/src/trunk"' -D'SVN_REV="1151"' -IROMS/Include -I/home/stamen-easy/Documents/COAWST/Projects/Inlet_test/Coupled -IROMS/Nonlinear -IROMS/Nonlinear/Biology -IROMS/Nonlinear/Sediment -IROMS/Nonlinear/Wec -IROMS/Nonlinear/Vegetation -IROMS/Utility -IROMS/Drivers -IROMS/Functionals -I/home/stamen-easy/Documents/COAWST/Projects/Inlet_test/Coupled -IMaster -ICompilers -D'HEADER_DIR="/home/stamen-easy/Documents/COAWST/Projects/Inlet_test/Coupled"'  -I/home/stamen-easy/Documents/COAWST//ROMS/Include "$file.b" > "$file.ftn";  \
/home/stamen-easy/Documents/COAWST//ROMS/Bin/cpp_clean "$file.ftn";                                                        \
rm $file.b;                                                                                 \
done;                                                                                        \
echo "";                                                                                     \
for file in SwanVTKPDataSets SwanBraggScat SwanPointinMesh SwanTranspX SwanGradDepthorK SwanThreadBounds SwanPrepComp SwanTranspAc SwanPropvelX SwanReadADCGrid SwanGSECorr SwanGridobjects SwanFindPoint SwanDiffPar SwanConvAccur SwanGriddata SwanVTKWriteHeader swn_outnc m_constants SwanPropvelS SwanReadTriangleGrid SwanGradVel SwanFindObstacles SwanConvStopc SwanPrintGridInfo SwanBpntlist SwanCompUnstruc SwanCompdata SwanSweepSel serv_xnl4v5 nctablemd SdsBabanin SwanSumOverNodes SwanIntgratSpc SwanMinOverNodes SwanBndStruc mod_xnl4v5 SwanVertlist SwanGridCell SwanInterpolateAc SwanInitCompGrid SwanReadEasymeshGrid SwanReadGrid SwanMaxOverNodes SwanGridTopology m_fileio SwanComputeForce fftpack51 SwanGridFace SwanCheckGrid SwanDispParm SwanGridVert SwanQCM SwanIEM SwanReadfort18 SwanInterpolatePoint SwanInterpolateOutput SwanPunCollect SwanVTKWriteData agioncmd SwanCrossObstacle SwanCreateEdges; do                                                            \
mv $file.ftn90 $file.b;                                                                    \
/usr/bin/cpp -P -traditional -w               -DMPI -DLINUX -DX86_64 -DGFORTRAN -D'ROOT_DIR="/home/stamen-easy/Documents/COAWST"' -DINLET_TEST -D'HEADER="inlet_test.h"' -D'ROMS_HEADER="/home/stamen-easy/Documents/COAWST/Projects/Inlet_test/Coupled/inlet_test.h"' -DNestedGrids= -D'ANALYTICAL_DIR="/home/stamen-easy/Documents/COAWST/Projects/Inlet_test/Coupled"' -D'MY_ANALYTICAL="on"' -D'GIT_URL=""' -D'GIT_REV=""' -D'SVN_URL="https://www.myroms.org/svn/src/trunk"' -D'SVN_REV="1151"' -IROMS/Include -I/home/stamen-easy/Documents/COAWST/Projects/Inlet_test/Coupled -IROMS/Nonlinear -IROMS/Nonlinear/Biology -IROMS/Nonlinear/Sediment -IROMS/Nonlinear/Wec -IROMS/Nonlinear/Vegetation -IROMS/Utility -IROMS/Drivers -IROMS/Functionals -I/home/stamen-easy/Documents/COAWST/Projects/Inlet_test/Coupled -IMaster -ICompilers -D'HEADER_DIR="/home/stamen-easy/Documents/COAWST/Projects/Inlet_test/Coupled"'  -I/home/stamen-easy/Documents/COAWST//ROMS/Include $file.b > $file.ftn90;    \
rm $file.b;                                                                                 \
/home/stamen-easy/Documents/COAWST//ROMS/Bin/cpp_clean "$file.ftn90";                                                      \
done;                                                                                        \
echo "";                                                                                     \
cd hcat;                                                                                     \
/usr/bin/cpp -P -traditional -w               -DMPI -DLINUX -DX86_64 -DGFORTRAN -D'ROOT_DIR="/home/stamen-easy/Documents/COAWST"' -DINLET_TEST -D'HEADER="inlet_test.h"' -D'ROMS_HEADER="/home/stamen-easy/Documents/COAWST/Projects/Inlet_test/Coupled/inlet_test.h"' -DNestedGrids= -D'ANALYTICAL_DIR="/home/stamen-easy/Documents/COAWST/Projects/Inlet_test/Coupled"' -D'MY_ANALYTICAL="on"' -D'GIT_URL=""' -D'GIT_REV=""' -D'SVN_URL="https://www.myroms.org/svn/src/trunk"' -D'SVN_REV="1151"' -IROMS/Include -I/home/stamen-easy/Documents/COAWST/Projects/Inlet_test/Coupled -IROMS/Nonlinear -IROMS/Nonlinear/Biology -IROMS/Nonlinear/Sediment -IROMS/Nonlinear/Wec -IROMS/Nonlinear/Vegetation -IROMS/Utility -IROMS/Drivers -IROMS/Functionals -I/home/stamen-easy/Documents/COAWST/Projects/Inlet_test/Coupled -IMaster -ICompilers -D'HEADER_DIR="/home/stamen-easy/Documents/COAWST/Projects/Inlet_test/Coupled"'  -I/home/stamen-easy/Documents/COAWST//ROMS/Include swanhcat.ftn > swanhcat.b;  \
mv swanhcat.b swanhcat.ftn;                                                                  \
echo "";                                                                                     \
cd ../..; mkdir build;                                                                       \
cd build;                                                                                    \
cmake .. -G "Unix Makefiles" -DUNIX=ON -DMPI=ON -DNETCDF=ON -DCMAKE_VERBOSE_MAKEFILE=ON;     \
make;                                                                                        \
echo " "; echo " ";                                                                          \
echo "";                                                                                     \
echo "-------- Finished compiling SWAN ------------"                                         \
echo ""

-- The Fortran compiler identification is GNU 12.2.0
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Check for working Fortran compiler: /home/stamen-easy/.local/easybuild/software/GCCcore/12.2.0/bin/f95 - skipped
-- Found Perl: /usr/bin/perl (found version "5.34.0") 
-- Found MPI_Fortran: /home/stamen-easy/.local/easybuild/software/OpenMPI/4.1.4-GCC-12.2.0/lib/libmpi_usempif08.so (found version "3.1") 
-- Found MPI: TRUE (found version "3.1")  
-- Found NetCDF: /home/stamen-easy/.local/easybuild/software/netCDF/4.9.0-gompi-2022b/include;/home/stamen-easy/.local/easybuild/software/netCDF-Fortran/4.6.0-gompi-2022b/include (found version "4.9.0") found components: Fortran 
-- FindNetCDF defines targets:
--   - NetCDF_VERSION [4.9.0]
--   - NetCDF_PARALLEL [TRUE]
--   - NetCDF_C_CONFIG_EXECUTABLE [/home/stamen-easy/.local/easybuild/software/netCDF/4.9.0-gompi-2022b/bin/nc-config]
--   - NetCDF::NetCDF_C [SHARED] [Root: /home/stamen-easy/.local/easybuild/software/netCDF/4.9.0-gompi-2022b] Lib: /home/stamen-easy/.local/easybuild/software/netCDF/4.9.0-gompi-2022b/lib64/libnetcdf.so 
--   - NetCDF_Fortran_CONFIG_EXECUTABLE [/home/stamen-easy/.local/easybuild/software/netCDF-Fortran/4.6.0-gompi-2022b/bin/nf-config]
--   - NetCDF::NetCDF_Fortran [SHARED] [Root: /home/stamen-easy/.local/easybuild/software/netCDF-Fortran/4.6.0-gompi-2022b] Lib: /home/stamen-easy/.local/easybuild/software/netCDF-Fortran/4.6.0-gompi-2022b/lib64/libnetcdff.so 

The last few lines are new, they didn't appear before, however It just freezes and does nothing else. If I don't include CMake, the previous error keeps appearing. EDIT: I left it running for more than 2h and it didn't make any progress, it's still freezing at that point.

jcwarner-usgs commented 1 year ago

@stamenminkov- the system needs Cmake to build swan. I am not sure why it just stops. can you ask a systems admin person?

@dkobashi- your main problem is that swan build can not find the mpif.h. the other errors just follow due to this one. I am not sure why cmake is using f95. can you try some other mpi option? i think we may need to add a cmake option to the cmake build line, like -DMPI_Fortran_COMPILER=mpif90 that would be in the makefile, there is a line cmake .. -G "Unix Makefiles" -DUNIX=ON -DMPI=ON -DNETCDF=ON -DCMAKE_VERBOSE_MAKEFILE=ON; \ change that to cmake .. -G "Unix Makefiles" -DUNIX=ON -DMPI=ON -DNETCDF=ON -DCMAKE_VERBOSE_MAKEFILE=ON -DMPI_Fortran_COMPILER=mpif90; \

be carful to keep the first tab indent, and the end of the line ; \

dkobashi commented 1 year ago

Thanks for your suggestion, John. Adding -DCMAKE_Fortran_COMPILER:FILEPATH="/opt/openmpi-4.1.5/bin/mpif90" passed the error on mpif.h. Now I have different errors.

Looks like the error is for MCT. This is with debug=on, but strangely coawstG was created. The same for coawstM. So I don't have to worry about these errors? Or something was wrong for the MCT installation?

Build log is also attached for your reference. build.log

(base) oceanforecast@k8s-metocean-node2:~/ROHS/mycoawst/work$ ./build_coawst.sh > build.log /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/Scrt1.o: in function_start': (.text+0x24): undefined reference to main' /usr/bin/ld: /home/oceanforecast/ROHS/mycoawst/work/Build_romsG/mct_coupler_params.o: in functionmct_coupler_params_MOD_allocate_coupler_params': /home/oceanforecast/ROHS/mycoawst/work/Build_romsG/mct_coupler_params.f90:74: undefined reference to __asan_report_load4' /usr/bin/ld: /home/oceanforecast/ROHS/mycoawst/work/Build_romsG/mct_coupler_params.f90:74: undefined reference toubsan_handle_load_invalid_value' /usr/bin/ld: /home/oceanforecast/ROHS/mycoawst/work/Build_romsG/mct_coupler_params.f90:74: undefined reference to __asan_handle_no_return' /usr/bin/ld: /home/oceanforecast/ROHS/mycoawst/work/Build_romsG/mct_coupler_params.f90:81: undefined reference toubsan_handle_add_overflow' /usr/bin/ld: /home/oceanforecast/ROHS/mycoawst/work/Build_romsG/mct_coupler_params.f90:81: undefined reference to `ubsan_handle_mul_overflow' /usr/bin/ld: /home/oceanforecast/ROHS/mycoawst/work/Build_romsG/mct_coupler_params.f90:81: undefined reference to __ubsan_handle_add_overflow' /usr/bin/ld: /home/oceanforecast/ROHS/mycoawst/work/Build_romsG/mct_coupler_params.f90:81: undefined reference toasan_handle_no_return' /usr/bin/ld: /home/oceanforecast/ROHS/mycoawst/work/Build_romsG/mct_coupler_params.f90:81: undefined reference to `asan_handle_no_return' /usr/bin/ld: /home/oceanforecast/ROHS/mycoawst/work/Build_romsG/mct_coupler_params.f90:82: undefined reference to __ubsan_handle_add_overflow' /usr/bin/ld: /home/oceanforecast/ROHS/mycoawst/work/Build_romsG/mct_coupler_params.f90:82: undefined reference toubsan_handle_mul_overflow' /usr/bin/ld: /home/oceanforecast/ROHS/mycoawst/work/Build_romsG/mct_coupler_params.f90:82: undefined reference to `ubsan_handle_add_overflow' /usr/bin/ld: /home/oceanforecast/ROHS/mycoawst/work/Build_romsG/mct_coupler_params.f90:82: undefined reference to __asan_handle_no_return' /usr/bin/ld: /home/oceanforecast/ROHS/mycoawst/work/Build_romsG/mct_coupler_params.f90:82: undefined reference toasan_handle_no_return' /usr/bin/ld: /home/oceanforecast/ROHS/mycoawst/work/Build_romsG/mct_coupler_params.f90:83: undefined reference to `ubsan_handle_add_overflow' /usr/bin/ld: /home/oceanforecast/ROHS/mycoawst/work/Build_romsG/mct_coupler_params.f90:83: undefined reference to __ubsan_handle_mul_overflow' /usr/bin/ld: /home/oceanforecast/ROHS/mycoawst/work/Build_romsG/mct_coupler_params.f90:83: undefined reference toubsan_handle_add_overflow' /usr/bin/ld: /home/oceanforecast/ROHS/mycoawst/work/Build_romsG/mct_coupler_params.f90:83: undefined reference to `asan_handle_no_return' /usr/bin/ld: /home/oceanforecast/ROHS/mycoawst/work/Build_romsG/mct_coupler_params.f90:83: undefined reference to __asan_handle_no_return' /usr/bin/ld: /home/oceanforecast/ROHS/mycoawst/work/Build_romsG/mct_coupler_params.f90:84: undefined reference toubsan_handle_add_overflow' /usr/bin/ld: /home/oceanforecast/ROHS/mycoawst/work/Build_romsG/mct_coupler_params.f90:84: undefined reference to `ubsan_handle_mul_overflow' /usr/bin/ld: /home/oceanforecast/ROHS/mycoawst/work/Build_romsG/mct_coupler_params.f90:84: undefined reference to __ubsan_handle_add_overflow' /usr/bin/ld: /home/oceanforecast/ROHS/mycoawst/work/Build_romsG/mct_coupler_params.f90:84: undefined reference toasan_handle_no_return' /usr/bin/ld: /home/oceanforecast/ROHS/mycoawst/work/Build_romsG/mct_coupler_params.f90:84: undefined reference to `asan_handle_no_return' /usr/bin/ld: /home/oceanforecast/ROHS/mycoawst/work/Build_romsG/mct_coupler_params.f90:85: undefined reference to __ubsan_handle_add_overflow' /usr/bin/ld: /home/oceanforecast/ROHS/mycoawst/work/Build_romsG/mct_coupler_params.f90:85: undefined reference toasan_handle_no_return' /usr/bin/ld: /home/oceanforecast/ROHS/mycoawst/work/Build_romsG/mct_coupler_params.f90:85: undefined reference to `asan_handle_no_return' /usr/bin/ld: /home/oceanforecast/ROHS/mycoawst/work/Build_romsG/mct_coupler_params.o: in function _sub_D_00099_0': /home/oceanforecast/ROHS/mycoawst/work/Build_romsG/mct_coupler_params.f90:87: undefined reference toasan_unregister_globals' /usr/bin/ld: /home/oceanforecast/ROHS/mycoawst/work/Build_romsG/mct_coupler_params.o: in function _sub_I_00099_1': /home/oceanforecast/ROHS/mycoawst/work/Build_romsG/mct_coupler_params.f90:87: undefined reference toasan_init' /usr/bin/ld: /home/oceanforecast/ROHS/mycoawst/work/Build_romsG/mct_coupler_params.f90:87: undefined reference to __asan_version_mismatch_check_v8' /usr/bin/ld: /home/oceanforecast/ROHS/mycoawst/work/Build_romsG/mct_coupler_params.f90:87: undefined reference to__asan_register_globals' collect2: error: ld returned 1 exit status make[3]: [lib/CMakeFiles/swan.exe.dir/build.make:103: bin/swan.exe] Error 1 make[2]: [CMakeFiles/Makefile2:165: lib/CMakeFiles/swan.exe.dir/all] Error 2 make[1]: *** [Makefile:139: all] Error 2 `

Thanks in advance.

-DJ

dkobashi commented 1 year ago

I found your old response on ROMS forum. As COAWST created coawstM.exe, I think I am good to go. I will try to run the model.

dont worry about the wrf.error. I do not let the system build a wrf.exe, i do not let swan build a swan.exe, nor a ww3.exe etc. I just make libraries, pull them all together as a coawstM.

https://www.myroms.org/forum/viewtopic.php?t=5562

Cheers,

DJ

stamenminkov commented 1 year ago

Hi John,

After dozens of long tests, I've finally established that the last issue was indeed a machine one - still don't know exactly what happens there, however I've managed to compiler ROMS + SWAN on my main machine, which was the intended purpose. I'm dealing now with further WRF issues, however we can close this thread now :)

ZHY202303 commented 8 months ago

I also met this problem,Cannot open module file ‘m_coupling.mod’,Have you ever fixed it??

stamenminkov commented 7 months ago

@ZHY202303 check all your dependencies, I figured out eventually that this sort of error appears when the program doesn't find all the necessary PATHS or variables.

jcwarner-usgs commented 7 months ago

another aspect to check is to make sure you have paths set to MCT_INCDIR and MCT_LIBDIR. if you type $MCT_INCDIR you need to get a valid path returned.

remit1 commented 5 months ago

Sorry, John, I have a similar problem to Stamen Minkov, the compilation freezes instantly

cp -f /home/ekos/libraries/include/netcdf.mod ./Build_roms
cp -f /home/ekos/libraries/include/typesizes.mod ./Build_roms
cp -p /home/ekos/make_macros.mk ./Build_roms
\
cd ./Build_roms;                                                                           \
echo "";                                                                                     \
cpp -P -traditional-cpp -w           -DMPI -DLINUX -DX86_64 -DIFORT -D'ROOT_DIR="/home/ekos/couple1/COAWST-main"' -DINLET_TEST -D'HEADER="inlet_test.h"' -D'ROMS_HEADER="/home/ekos/couple1/COAWST-main/Projects/Inlet_test/Coupled/inlet_test.h"' -DNestedGrids= -D'ANALYTICAL_DIR="/home/ekos/couple1/COAWST-main/Projects/Inlet_test/Coupled"' -D'MY_ANALYTICAL="on"' -D'GIT_URL=""' -D'GIT_REV=""' -D'SVN_URL="https://www.myroms.org/svn/src/trunk"' -D'SVN_REV="1151"' -IROMS/Include -I/home/ekos/couple1/COAWST-main/Projects/Inlet_test/Coupled -IROMS/Nonlinear -IROMS/Nonlinear/Biology -IROMS/Nonlinear/Sediment -IROMS/Nonlinear/Wec -IROMS/Nonlinear/Vegetation -IROMS/Utility -IROMS/Drivers -IROMS/Functionals -I/home/ekos/couple1/COAWST-main/Projects/Inlet_test/Coupled -IMaster -ICompilers -D'HEADER_DIR="/home/ekos/couple1/COAWST-main/Projects/Inlet_test/Coupled"'  -I/home/ekos/couple1/COAWST-main//ROMS/Include /home/ekos/couple1/COAWST-main//Master/MCT_coupler/mod_coupler_kinds.F > mod_coupler_kinds.f90; \
/home/ekos/couple1/COAWST-main//ROMS/Bin/cpp_clean mod_coupler_kinds.f90;                                               \
/opt/software/intel/oneapi/mpi/2021.5.1/bin/mpif90 -c -fp-model precise -fc=ifort -heap-arrays -ip -O3 -traceback -assume byterecl -I/home/ekos/couple1/COAWST-main/SWAN/build/mod -I/home/ekos/couple/cawo_coawst-main/MCT-LIB/include mod_coupler_kinds.f90;                                                    \
echo "";                                                                                     \
cpp -P -traditional-cpp -w           -DMPI -DLINUX -DX86_64 -DIFORT -D'ROOT_DIR="/home/ekos/couple1/COAWST-main"' -DINLET_TEST -D'HEADER="inlet_test.h"' -D'ROMS_HEADER="/home/ekos/couple1/COAWST-main/Projects/Inlet_test/Coupled/inlet_test.h"' -DNestedGrids= -D'ANALYTICAL_DIR="/home/ekos/couple1/COAWST-main/Projects/Inlet_test/Coupled"' -D'MY_ANALYTICAL="on"' -D'GIT_URL=""' -D'GIT_REV=""' -D'SVN_URL="https://www.myroms.org/svn/src/trunk"' -D'SVN_REV="1151"' -IROMS/Include -I/home/ekos/couple1/COAWST-main/Projects/Inlet_test/Coupled -IROMS/Nonlinear -IROMS/Nonlinear/Biology -IROMS/Nonlinear/Sediment -IROMS/Nonlinear/Wec -IROMS/Nonlinear/Vegetation -IROMS/Utility -IROMS/Drivers -IROMS/Functionals -I/home/ekos/couple1/COAWST-main/Projects/Inlet_test/Coupled -IMaster -ICompilers -D'HEADER_DIR="/home/ekos/couple1/COAWST-main/Projects/Inlet_test/Coupled"'  -I/home/ekos/couple1/COAWST-main//ROMS/Include /home/ekos/couple1/COAWST-main//Master/MCT_coupler/mct_coupler_params.F > mct_coupler_params.f90; \
/home/ekos/couple1/COAWST-main//ROMS/Bin/cpp_clean mct_coupler_params.f90;                                              \
/opt/software/intel/oneapi/mpi/2021.5.1/bin/mpif90 -c -fp-model precise -fc=ifort -heap-arrays -ip -O3 -traceback -assume byterecl -I/home/ekos/couple1/COAWST-main/SWAN/build/mod -I/home/ekos/couple/cawo_coawst-main/MCT-LIB/include mct_coupler_params.f90;                                                   \
echo "";                                                                                     \
cpp -P -traditional-cpp -w           -DMPI -DLINUX -DX86_64 -DIFORT -D'ROOT_DIR="/home/ekos/couple1/COAWST-main"' -DINLET_TEST -D'HEADER="inlet_test.h"' -D'ROMS_HEADER="/home/ekos/couple1/COAWST-main/Projects/Inlet_test/Coupled/inlet_test.h"' -DNestedGrids= -D'ANALYTICAL_DIR="/home/ekos/couple1/COAWST-main/Projects/Inlet_test/Coupled"' -D'MY_ANALYTICAL="on"' -D'GIT_URL=""' -D'GIT_REV=""' -D'SVN_URL="https://www.myroms.org/svn/src/trunk"' -D'SVN_REV="1151"' -IROMS/Include -I/home/ekos/couple1/COAWST-main/Projects/Inlet_test/Coupled -IROMS/Nonlinear -IROMS/Nonlinear/Biology -IROMS/Nonlinear/Sediment -IROMS/Nonlinear/Wec -IROMS/Nonlinear/Vegetation -IROMS/Utility -IROMS/Drivers -IROMS/Functionals -I/home/ekos/couple1/COAWST-main/Projects/Inlet_test/Coupled -IMaster -ICompilers -D'HEADER_DIR="/home/ekos/couple1/COAWST-main/Projects/Inlet_test/Coupled"'  -I/home/ekos/couple1/COAWST-main//ROMS/Include /home/ekos/couple1/COAWST-main//Master/MCT_coupler/mod_coupler_iounits.F > mod_coupler_iounits.f90; \
/home/ekos/couple1/COAWST-main//ROMS/Bin/cpp_clean mod_coupler_iounits.f90;                                             \
/opt/software/intel/oneapi/mpi/2021.5.1/bin/mpif90 -c -fp-model precise -fc=ifort -heap-arrays -ip -O3 -traceback -assume byterecl -I/home/ekos/couple1/COAWST-main/SWAN/build/mod -I/home/ekos/couple/cawo_coawst-main/MCT-LIB/include mod_coupler_iounits.f90;                                                  \
echo "";                                                                                     \
cpp -P -traditional-cpp -w           -DMPI -DLINUX -DX86_64 -DIFORT -D'ROOT_DIR="/home/ekos/couple1/COAWST-main"' -DINLET_TEST -D'HEADER="inlet_test.h"' -D'ROMS_HEADER="/home/ekos/couple1/COAWST-main/Projects/Inlet_test/Coupled/inlet_test.h"' -DNestedGrids= -D'ANALYTICAL_DIR="/home/ekos/couple1/COAWST-main/Projects/Inlet_test/Coupled"' -D'MY_ANALYTICAL="on"' -D'GIT_URL=""' -D'GIT_REV=""' -D'SVN_URL="https://www.myroms.org/svn/src/trunk"' -D'SVN_REV="1151"' -IROMS/Include -I/home/ekos/couple1/COAWST-main/Projects/Inlet_test/Coupled -IROMS/Nonlinear -IROMS/Nonlinear/Biology -IROMS/Nonlinear/Sediment -IROMS/Nonlinear/Wec -IROMS/Nonlinear/Vegetation -IROMS/Utility -IROMS/Drivers -IROMS/Functionals -I/home/ekos/couple1/COAWST-main/Projects/Inlet_test/Coupled -IMaster -ICompilers -D'HEADER_DIR="/home/ekos/couple1/COAWST-main/Projects/Inlet_test/Coupled"'  -I/home/ekos/couple1/COAWST-main//ROMS/Include /home/ekos/couple1/COAWST-main//Master/MCT_coupler/get_sparse_matrix.F > get_sparse_matrix.f90; \
/home/ekos/couple1/COAWST-main//ROMS/Bin/cpp_clean get_sparse_matrix.f90;                                             \
/opt/software/intel/oneapi/mpi/2021.5.1/bin/mpif90 -c -fp-model precise -fc=ifort -heap-arrays -ip -O3 -traceback -assume byterecl -I/home/ekos/couple1/COAWST-main/SWAN/build/mod -I/home/ekos/couple/cawo_coawst-main/MCT-LIB/include get_sparse_matrix.f90;

make: Nothing to be done for 'wrfclean'.
make: Nothing to be done for 'wrf'.
make: Nothing to be done for 'wrfhydroclean'.
make: Nothing to be done for 'wrfhydro'.
make: Nothing to be done for 'ww3clean'.
make: Nothing to be done for 'ww3'.
rm -rf SWAN/src_coawst;  \
cd SWAN; ls;            \
cmake -P clobber.cmake; \
echo "cleaned swan";
bin
build
clobber.cmake
cmake
CMakeFiles
CMakeLists.txt
doc
f90
lib
LICENSE
misc
README.md
src
switch.pl
tools
cleaned swan
mkdir SWAN/src_coawst;                                                                        \
cp -r SWAN/src/* SWAN/src_coawst/;                                                          \
cd SWAN/src_coawst;                                                                           \
echo "";                                                                                     \
for file in swanmain SwanSpectPart swanpre2 swancom4 swanparll swanmain2 swmod1 swanpre1 swanout1 mod_swan_kinds swanout2 waves_control swmod2 ocpids swancom2 swancom3 swanpre3 swancom1 swancom5 ocpcre swanser ocpmix swpoint waves_coupler swan_iounits; do                                                              \
mv $file.ftn $file.b;                                                                      \
/usr/bin/cpp -P -traditional-cpp -w           -DMPI -DLINUX -DX86_64 -DIFORT -D'ROOT_DIR="/home/ekos/couple1/COAWST-main"' -DINLET_TEST -D'HEADER="inlet_test.h"' -D'ROMS_HEADER="/home/ekos/couple1/COAWST-main/Projects/Inlet_test/Coupled/inlet_test.h"' -DNestedGrids= -D'ANALYTICAL_DIR="/home/ekos/couple1/COAWST-main/Projects/Inlet_test/Coupled"' -D'MY_ANALYTICAL="on"' -D'GIT_URL=""' -D'GIT_REV=""' -D'SVN_URL="https://www.myroms.org/svn/src/trunk"' -D'SVN_REV="1151"' -IROMS/Include -I/home/ekos/couple1/COAWST-main/Projects/Inlet_test/Coupled -IROMS/Nonlinear -IROMS/Nonlinear/Biology -IROMS/Nonlinear/Sediment -IROMS/Nonlinear/Wec -IROMS/Nonlinear/Vegetation -IROMS/Utility -IROMS/Drivers -IROMS/Functionals -I/home/ekos/couple1/COAWST-main/Projects/Inlet_test/Coupled -IMaster -ICompilers -D'HEADER_DIR="/home/ekos/couple1/COAWST-main/Projects/Inlet_test/Coupled"'  -I/home/ekos/couple1/COAWST-main//ROMS/Include "$file.b" > "$file.ftn";  \
/home/ekos/couple1/COAWST-main//ROMS/Bin/cpp_clean "$file.ftn";                                                        \
rm $file.b;                                                                                 \
done;                                                                                        \
echo "";                                                                                     \
for file in SwanPrintGridInfo SwanIEM SwanDispParm SwanGriddata SwanPropvelX SwanGradVel SwanCompdata SwanVTKPDataSets SwanConvAccur SwanQCM SwanFindObstacles SwanPropvelS SwanThreadBounds SwanReadGrid SwanReadTriangleGrid nctablemd SwanGridCell SwanFindPoint SwanComputeForce SwanMinOverNodes SwanInitCompGrid SwanReadfort18 fftpack51 SwanGridTopology SwanReadADCGrid serv_xnl4v5 SwanSweepSel m_fileio swn_outnc SwanMaxOverNodes SwanBraggScat SwanSumOverNodes SwanTranspAc SwanInterpolatePoint SwanCompUnstruc SwanPunCollect SwanIntgratSpc SwanCreateEdges mod_xnl4v5 SwanDiffPar agioncmd SwanGridVert SwanGSECorr m_constants SwanTranspX SwanBndStruc SdsBabanin SwanGridobjects SwanBpntlist SwanCrossObstacle SwanPrepComp SwanInterpolateOutput SwanReadEasymeshGrid SwanInterpolateAc SwanGridFace SwanPointinMesh SwanConvStopc SwanVTKWriteHeader SwanVertlist SwanVTKWriteData SwanCheckGrid SwanGradDepthorK; do                                                            \
mv $file.ftn90 $file.b;                                                                    \
/usr/bin/cpp -P -traditional-cpp -w           -DMPI -DLINUX -DX86_64 -DIFORT -D'ROOT_DIR="/home/ekos/couple1/COAWST-main"' -DINLET_TEST -D'HEADER="inlet_test.h"' -D'ROMS_HEADER="/home/ekos/couple1/COAWST-main/Projects/Inlet_test/Coupled/inlet_test.h"' -DNestedGrids= -D'ANALYTICAL_DIR="/home/ekos/couple1/COAWST-main/Projects/Inlet_test/Coupled"' -D'MY_ANALYTICAL="on"' -D'GIT_URL=""' -D'GIT_REV=""' -D'SVN_URL="https://www.myroms.org/svn/src/trunk"' -D'SVN_REV="1151"' -IROMS/Include -I/home/ekos/couple1/COAWST-main/Projects/Inlet_test/Coupled -IROMS/Nonlinear -IROMS/Nonlinear/Biology -IROMS/Nonlinear/Sediment -IROMS/Nonlinear/Wec -IROMS/Nonlinear/Vegetation -IROMS/Utility -IROMS/Drivers -IROMS/Functionals -I/home/ekos/couple1/COAWST-main/Projects/Inlet_test/Coupled -IMaster -ICompilers -D'HEADER_DIR="/home/ekos/couple1/COAWST-main/Projects/Inlet_test/Coupled"'  -I/home/ekos/couple1/COAWST-main//ROMS/Include $file.b > $file.ftn90;    \
rm $file.b;                                                                                 \
/home/ekos/couple1/COAWST-main//ROMS/Bin/cpp_clean "$file.ftn90";                                                      \
done;                                                                                        \
echo "";                                                                                     \
cd hcat;                                                                                     \
/usr/bin/cpp -P -traditional-cpp -w           -DMPI -DLINUX -DX86_64 -DIFORT -D'ROOT_DIR="/home/ekos/couple1/COAWST-main"' -DINLET_TEST -D'HEADER="inlet_test.h"' -D'ROMS_HEADER="/home/ekos/couple1/COAWST-main/Projects/Inlet_test/Coupled/inlet_test.h"' -DNestedGrids= -D'ANALYTICAL_DIR="/home/ekos/couple1/COAWST-main/Projects/Inlet_test/Coupled"' -D'MY_ANALYTICAL="on"' -D'GIT_URL=""' -D'GIT_REV=""' -D'SVN_URL="https://www.myroms.org/svn/src/trunk"' -D'SVN_REV="1151"' -IROMS/Include -I/home/ekos/couple1/COAWST-main/Projects/Inlet_test/Coupled -IROMS/Nonlinear -IROMS/Nonlinear/Biology -IROMS/Nonlinear/Sediment -IROMS/Nonlinear/Wec -IROMS/Nonlinear/Vegetation -IROMS/Utility -IROMS/Drivers -IROMS/Functionals -I/home/ekos/couple1/COAWST-main/Projects/Inlet_test/Coupled -IMaster -ICompilers -D'HEADER_DIR="/home/ekos/couple1/COAWST-main/Projects/Inlet_test/Coupled"'  -I/home/ekos/couple1/COAWST-main//ROMS/Include swanhcat.ftn > swanhcat.b;  \
mv swanhcat.b swanhcat.ftn;                                                                  \
echo "";                                                                                     \
cd ../..; mkdir build;                                                                       \
cd build;                                                                                    \
cmake .. -G "Unix Makefiles" -DUNIX=ON -DMPI=ON -DNETCDF=ON -DCMAKE_VERBOSE_MAKEFILE=ON;     \
make;                                                                                        \
echo " "; echo " ";                                                                          \
echo "";                                                                                     \
echo "-------- Finished compiling SWAN ------------"                                         \
echo ""

-- The Fortran compiler identification is IntelLLVM 2022.0.0
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Check for working Fortran compiler: /opt/software/intel/oneapi/compiler/2022.0.2/linux/bin/ifx - skipped
-- Found Perl: /usr/bin/perl (found version "5.26.3") 
-- Found NetCDF: /home/ekos/libraries/include (found version "4.7.4") found components: Fortran 
-- FindNetCDF defines targets:
--   - NetCDF_VERSION [4.7.4]
--   - NetCDF_PARALLEL [FALSE]
--   - NetCDF_C_CONFIG_EXECUTABLE [/home/ekos/libraries/bin/nc-config]
--   - NetCDF::NetCDF_C [SHARED] [Root: /home/ekos/libraries] Lib: /home/ekos/libraries/lib/libnetcdf.so 
--   - NetCDF_Fortran_CONFIG_EXECUTABLE [/home/ekos/libraries/bin/nf-config]
--   - NetCDF::NetCDF_Fortran [SHARED] [Root: /home/ekos/libraries] Lib: /home/ekos/libraries/lib/libnetcdff.so 

When I run cmake --trace in the SWAN folder, the syntax stays on the same line:

........
/home/ekos/libraries/share/cmake-3.26/Modules/FindPackageHandleStandardArgs.cmake(573):  string(APPEND DETAILS [v${${FPHSA_VERSION_VAR}}(${${_NAME}_FIND_VERSION})] )
/home/ekos/libraries/share/cmake-3.26/Modules/FindPackageHandleStandardArgs.cmake(580):  if(${_NAME}_FOUND )
/home/ekos/libraries/share/cmake-3.26/Modules/FindPackageHandleStandardArgs.cmake(581):  FIND_PACKAGE_MESSAGE(${_NAME} Found ${_NAME}: ${${_FIRST_REQUIRED_VAR}} ${VERSION_MSG} ${COMPONENT_MSG} ${DETAILS} )
/home/ekos/libraries/share/cmake-3.26/Modules/FindPackageMessage.cmake(35):  if(NOT ${pkg}_FIND_QUIETLY )
/home/ekos/libraries/share/cmake-3.26/Modules/FindPackageMessage.cmake(36):  string(REPLACE \n  details ${details} )
/home/ekos/libraries/share/cmake-3.26/Modules/FindPackageMessage.cmake(37):  set(DETAILS_VAR FIND_PACKAGE_MESSAGE_DETAILS_${pkg} )
/home/ekos/libraries/share/cmake-3.26/Modules/FindPackageMessage.cmake(38):  if(NOT ${details} STREQUAL ${${DETAILS_VAR}} )
/home/ekos/libraries/share/cmake-3.26/Modules/FindPackageMessage.cmake(40):  message(STATUS ${msg} )
-- Found Perl: /usr/bin/perl (found version "5.26.3") 
/home/ekos/libraries/share/cmake-3.26/Modules/FindPackageMessage.cmake(44):  set(${DETAILS_VAR} ${details} CACHE INTERNAL Details about finding ${pkg} )
/home/ekos/libraries/share/cmake-3.26/Modules/FindPackageHandleStandardArgs.cmake(606):  set(${_NAME}_FOUND ${${_NAME}_FOUND} PARENT_SCOPE )
/home/ekos/libraries/share/cmake-3.26/Modules/FindPackageHandleStandardArgs.cmake(607):  set(${_NAME_UPPER}_FOUND ${${_NAME}_FOUND} PARENT_SCOPE )
/home/ekos/libraries/share/cmake-3.26/Modules/FindPerl.cmake(87):  unset(FPHSA_NAME_MISMATCHED )
/home/ekos/libraries/share/cmake-3.26/Modules/FindPerl.cmake(89):  mark_as_advanced(PERL_EXECUTABLE )
/home/ekos/couple1/COAWST-main/SWAN/CMakeLists.txt(65):  if(NETCDF )
/home/ekos/couple1/COAWST-main/SWAN/CMakeLists.txt(73):  add_subdirectory(${SRC} ${LIB} )
/home/ekos/couple1/COAWST-main/SWAN/src_coawst/CMakeLists.txt(2):  if(WIN32 )
/home/ekos/couple1/COAWST-main/SWAN/src_coawst/CMakeLists.txt(4):  elseif(UNIX )
/home/ekos/couple1/COAWST-main/SWAN/src_coawst/CMakeLists.txt(5):  set(SWITCHES -unix )
/home/ekos/couple1/COAWST-main/SWAN/src_coawst/CMakeLists.txt(9):  if(MPI OR JAC )
/home/ekos/couple1/COAWST-main/SWAN/src_coawst/CMakeLists.txt(13):  if(JAC )
/home/ekos/couple1/COAWST-main/SWAN/src_coawst/CMakeLists.txt(18):  if(NETCDF )
/home/ekos/couple1/COAWST-main/SWAN/src_coawst/CMakeLists.txt(23):  if(PERL_FOUND )
/home/ekos/couple1/COAWST-main/SWAN/src_coawst/CMakeLists.txt(24):  execute_process(COMMAND ${PERL_EXECUTABLE} ${CMAKE_SOURCE_DIR}/switch.pl ${SWITCHES} ${SRC}/*.ftn ${SRC}/*.ftn90 )

After further investigation, it seems the problem lies in the following last three lines from add_subdirectory:

# find netCDF
if( NETCDF )
  # add find module for netCDF to the module path
  list( APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake" )
  # netCDF Fortran library is required
  find_package( NetCDF REQUIRED COMPONENTS Fortran )
endif()

# add the source to the library and place it in the lib folder
add_subdirectory( ${SRC} ${LIB} )

# create the SWAN executable and place it in the bin folder
add_subdirectory( ${SRC} ${BIN} )

# if desired, create the HCAT executable
add_subdirectory( ${SRC}/hcat )

Can you guide me on how to resolve this issue?

[ADDITION] However, if I run the command cmake .. from the swan folder (not from COAWST), I am following the instructions from https://gitlab.tudelft.nl/citg/wavemodels/swan on the same machine, I get the compilation process done successfully

sh-4.4$ pwd
/home/ekos/couple1/swan/build
sh-4.4$ cmake ..
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: /home/ekos/couple1/swan
sh-4.4$ ls 
bin  CMakeCache.txt  CMakeFiles  cmake_install.cmake  install_manifest.txt  lib  Makefile  mod  src
sh-4.4$ 

eko

jcwarner-usgs commented 5 months ago

you are in luck ! I have seen this one before. I have not figured out how to fix it, but the work around is this. I see you dir is ROOT_DIR="/home/ekos/couple1/COAWST-main"' If there is a '-' in the dir name, then cmake freezes. can you change the dir to something like ROOT_DIR="/home/ekos/couple1/COAWST"' and try that? If you got the code from git, then just do

mkdir COAWST cd COAWST git clone https://github.com/DOI-USGS/COAWST.git .

remit1 commented 5 months ago

Thank you, John, for the trick and explanation. Now I understand why Stamenminkov and I have similar issues, and hopefully, it can be a reference for others in futures. Furthermore, I did a re-compilation INLET_TEST.H (in folder COAWST/Projects/Inlet_test/Coupled) by performing make clean in folder COAWST, but the error produced was like this:

.......................
.......................
cd ./Build_roms; /opt/software/intel/oneapi/mpi/2021.5.1/bin/mpif90 -c -fp-model precise -fc=ifort -heap-arrays -ip -O3 -traceback -assume byterecl -I/home/ekos/couple1/COAWST/SWAN/build/mod -I/home/ekos/couple1/COAWST/MCT_LIB/Installed_MCT/include ww3_iounits.f90
ROMS/Bin/cpp_clean Build_roms/esmf_ice.f90
ROMS/Bin/cpp_clean Build_roms/esmf_roms.f90
ROMS/Bin/cpp_clean Build_roms/get_numswan_grids.f90
ROMS/Bin/cpp_clean Build_roms/read_model_inputs.f90
ROMS/Bin/cpp_clean Build_roms/get_numww3_grids.f90
cd ./Build_roms; /opt/software/intel/oneapi/mpi/2021.5.1/bin/mpif90 -c -fp-model precise -fc=ifort -heap-arrays -ip -O3 -traceback -assume byterecl -I/home/ekos/couple1/COAWST/SWAN/build/mod -I/home/ekos/couple1/COAWST/MCT_LIB/Installed_MCT/include get_numswan_grids.f90
cd ./Build_roms; /opt/software/intel/oneapi/mpi/2021.5.1/bin/mpif90 -c -fp-model precise -fc=ifort -heap-arrays -ip -O3 -traceback -assume byterecl -I/home/ekos/couple1/COAWST/SWAN/build/mod -I/home/ekos/couple1/COAWST/MCT_LIB/Installed_MCT/include mod_iounits.f90
cd ./Build_roms; /opt/software/intel/oneapi/mpi/2021.5.1/bin/mpif90 -c -fp-model precise -fc=ifort -heap-arrays -ip -O3 -traceback -assume byterecl -I/home/ekos/couple1/COAWST/SWAN/build/mod -I/home/ekos/couple1/COAWST/MCT_LIB/Installed_MCT/include mod_param.f90
cd ./Build_roms; /opt/software/intel/oneapi/mpi/2021.5.1/bin/mpif90 -c -fp-model precise -fc=ifort -heap-arrays -ip -O3 -traceback -assume byterecl -I/home/ekos/couple1/COAWST/SWAN/build/mod -I/home/ekos/couple1/COAWST/MCT_LIB/Installed_MCT/include round.f90
cd ./Build_roms; /opt/software/intel/oneapi/mpi/2021.5.1/bin/mpif90 -c -fp-model precise -fc=ifort -heap-arrays -ip -O3 -traceback -assume byterecl -I/home/ekos/couple1/COAWST/SWAN/build/mod -I/home/ekos/couple1/COAWST/MCT_LIB/Installed_MCT/include mod_eoscoef.f90
cd ./Build_roms; /opt/software/intel/oneapi/mpi/2021.5.1/bin/mpif90 -c -fp-model precise -fc=ifort -heap-arrays -ip -O3 -traceback -assume byterecl -I/home/ekos/couple1/COAWST/SWAN/build/mod -I/home/ekos/couple1/COAWST/MCT_LIB/Installed_MCT/include ludcmp.f90
cd ./Build_roms; /opt/software/intel/oneapi/mpi/2021.5.1/bin/mpif90 -c -fp-model precise -fc=ifort -heap-arrays -ip -O3 -traceback -assume byterecl -I/home/ekos/couple1/COAWST/SWAN/build/mod -I/home/ekos/couple1/COAWST/MCT_LIB/Installed_MCT/include lubksb.f90
cd ./Build_roms; /opt/software/intel/oneapi/mpi/2021.5.1/bin/mpif90 -c -fp-model precise -fc=ifort -heap-arrays -ip -O3 -traceback -assume byterecl -I/home/ekos/couple1/COAWST/SWAN/build/mod -I/home/ekos/couple1/COAWST/MCT_LIB/Installed_MCT/include mp_routines.f90
cd ./Build_roms; /opt/software/intel/oneapi/mpi/2021.5.1/bin/mpif90 -c -fp-model precise -fc=ifort -heap-arrays -ip -O3 -traceback -assume byterecl -I/home/ekos/couple1/COAWST/SWAN/build/mod -I/home/ekos/couple1/COAWST/MCT_LIB/Installed_MCT/include sqlq.f90
cd ./Build_roms; /opt/software/intel/oneapi/mpi/2021.5.1/bin/mpif90 -c -fp-model precise -fc=ifort -heap-arrays -ip -O3 -traceback -assume byterecl -I/home/ekos/couple1/COAWST/SWAN/build/mod -I/home/ekos/couple1/COAWST/MCT_LIB/Installed_MCT/include get_numww3_grids.f90
get_numswan_grids.f90(10): error #7002: Error in opening the compiled module file.  Check INCLUDE paths.   [M_COUPLING]
      USE M_COUPLING
----------^
get_numswan_grids.f90(52): error #6404: This name does not have a type, and must have an explicit type.   [NUM_SGRIDS]
          read(aline(8:12),'(i5)') NUM_SGRIDS
-----------------------------------^
compilation aborted for get_numswan_grids.f90 (code 1)
make: *** [Master/Module.mk:33: Build_roms/get_numswan_grids.o] Error 1
make: *** Waiting for unfinished jobs....

I think the issue is not because of the dash (-) anymore, because before I changed MCT_LIB to MCT-LIB, both still produced the same error. I have also ensured that MCT_INCDIR and MCT_LIBDIR are as follows:

export MCT_INCDIR=${HOME}/couple1/COAWST/MCT_LIB/Installed_MCT/include
export MCT_LIBDIR=${HOME}/couple1/COAWST/MCT_LIB/Installed_MCT/lib

Could the issue be because of mpif90 I don't think so (?) because I have mpif90 loaded through the available module, ie: ml load mpi/latest.

jcwarner-usgs commented 5 months ago

i need to see the full build log. sometimes the errors at the bottom are due to errors earlier in the build. the '-' issues is only with swan , not mct.

remit1 commented 5 months ago

Here is the required log file. FYI, I just use inlet_test.h originally (not modified) and ran it via build_coawst.sh generate.log inlet_test.txt <-- from folder Projects/Inlet_test/Coupled

eko

jcwarner-usgs commented 5 months ago

the problem is that SWAN is not being built. i see:

-- The Fortran compiler identification is Intel 2021.5.0.20211109 -- Detecting Fortran compiler ABI info -- Detecting Fortran compiler ABI info - done -- Check for working Fortran compiler: /opt/software/intel/oneapi/mpi/2021.5.1/bin/mpif90 - skipped -- Found Perl: /usr/bin/perl (found version "5.26.3") -- Found NetCDF: /home/ekos/libraries/include (found version "4.7.4") found components: Fortran -- FindNetCDF defines targets: -- - NetCDF_VERSION [4.7.4] -- - NetCDF_PARALLEL [FALSE] -- - NetCDF_C_CONFIG_EXECUTABLE [/home/ekos/libraries/bin/nc-config] -- - NetCDF::NetCDF_C [SHARED] [Root: /home/ekos/libraries] Lib: /home/ekos/libraries/lib/libnetcdf.so -- - NetCDF_Fortran_CONFIG_EXECUTABLE [/home/ekos/libraries/bin/nf-config] -- - NetCDF::NetCDF_Fortran [SHARED] [Root: /home/ekos/libraries] Lib: /home/ekos/libraries/lib/libnetcdff.so -- Configuring done (0.7s) -- Generating done (0.0s) -- Build files have been written to: /home/ekos/couple1/COAWST/SWAN/build make[1]: Entering directory '/home/ekos/couple1/COAWST/SWAN/build' /home/ekos/libraries/bin/cmake -S/home/ekos/couple1/COAWST/SWAN -B/home/ekos/couple1/COAWST/SWAN/build --check-build-system CMakeFiles/Makefile.cmake 0 /home/ekos/libraries/bin/cmake -E cmake_progress_start /home/ekos/couple1/COAWST/SWAN/build/CMakeFiles /home/ekos/couple1/COAWST/SWAN/build//CMakeFiles/progress.marks make -f CMakeFiles/Makefile2 all make[2]: Entering directory '/home/ekos/couple1/COAWST/SWAN/build' make[2]: Nothing to be done for 'all'. make[2]: Leaving directory '/home/ekos/couple1/COAWST/SWAN/build' /home/ekos/libraries/bin/cmake -E cmake_progress_start /home/ekos/couple1/COAWST/SWAN/build/CMakeFiles 0 make[1]: Leaving directory '/home/ekos/couple1/COAWST/SWAN/build'

-------- Finished compiling SWAN ------------ echo ...

jcwarner-usgs commented 5 months ago

see this issue: https://github.com/DOI-USGS/COAWST/issues/276 think you are having the same problem.