In trying to build FMS 2024.01 with GNU 13.2 and Open MPI 4.1.6 with -DCMAKE_BUILD_TYPE=Debug I ran into an error:
[ 85%] Building Fortran object CMakeFiles/fms_r8_f.dir/coupler/coupler_types.F90.o
/discover/swdev/gmao_SIteam/Baselibs/ESMA-Baselibs-8.0.2/src/FMS/coupler/coupler_types.F90:4207:37:
4207 | var%bc(n)%field(m)%id_rest = fms_io_register_restart_field(rest_file,&
| 1
Error: There is no specific function for the generic 'register_restart_field' at (1)
/discover/swdev/gmao_SIteam/Baselibs/ESMA-Baselibs-8.0.2/src/FMS/coupler/coupler_types.F90:4175:37:
4175 | var%bc(n)%field(m)%id_rest = fms_io_register_restart_field(bc_rest_files(f),&
| 1
Error: There is no specific function for the generic 'register_restart_field' at (1)
/discover/swdev/gmao_SIteam/Baselibs/ESMA-Baselibs-8.0.2/src/FMS/coupler/coupler_types.F90:4120:37:
4120 | var%bc(n)%field(m)%id_rest = fms_io_register_restart_field(rest_file,&
| 1
Error: There is no specific function for the generic 'register_restart_field' at (1)
/discover/swdev/gmao_SIteam/Baselibs/ESMA-Baselibs-8.0.2/src/FMS/coupler/coupler_types.F90:4086:37:
4086 | var%bc(n)%field(m)%id_rest = fms_io_register_restart_field(bc_rest_files(f),&
| 1
Error: There is no specific function for the generic 'register_restart_field' at (1)
gmake[4]: *** [CMakeFiles/fms_r8_f.dir/build.make:231: CMakeFiles/fms_r8_f.dir/coupler/coupler_types.F90.o] Error 1
gmake[4]: Leaving directory '/gpfsm/dswdev/gmao_SIteam/Baselibs/ESMA-Baselibs-8.0.2/src/FMS/build'
gmake[3]: *** [CMakeFiles/Makefile2:198: CMakeFiles/fms_r8_f.dir/all] Error 2
gmake[3]: Leaving directory '/gpfsm/dswdev/gmao_SIteam/Baselibs/ESMA-Baselibs-8.0.2/src/FMS/build'
gmake[2]: *** [Makefile:136: all] Error 2
gmake[2]: Leaving directory '/gpfsm/dswdev/gmao_SIteam/Baselibs/ESMA-Baselibs-8.0.2/src/FMS/build'
make[1]: *** [GNUmakefile:981: FMS.install] Error 2
make[1]: Leaving directory '/gpfsm/dswdev/gmao_SIteam/Baselibs/ESMA-Baselibs-8.0.2/src'
Note that building without a -DCMAKE_BUILD_TYPE (aka Release) does not have this error.
Describe the bug
In trying to build FMS 2024.01 with GNU 13.2 and Open MPI 4.1.6 with
-DCMAKE_BUILD_TYPE=Debug
I ran into an error:Note that building without a
-DCMAKE_BUILD_TYPE
(akaRelease
) does not have this error.To Reproduce
I built FMS with:
inside of ESMA-Baselibs. I do not think the netCDF stuff matters for this (see error above), so it should be reproducible...I hope.
Expected behavior
I expect FMS to build. 😄
System Environment Describe the system environment, include:
-D32BIT=ON -D64BIT=ON -DFPIC=ON -DCONSTANTS=GEOS -DUSE_DEPRECATED_IO=ON -DCMAKE_BUILD_TYPE=Debug
Additional context
I believe this might be related to #1417 that @climbfuji filed last year. Why? Well, #1417 produced this error:
which is quite familiar.
So, I went into my build and did
make install VERBOSE=1
and what I saw was this:As you'll note, this is building
fms_r8
and there is something missing here:Much like what @climbfuji saw in https://github.com/NOAA-GFDL/FMS/issues/1417#issuecomment-1822033644, I think this code:
https://github.com/NOAA-GFDL/FMS/blob/98e2ebdd1b443b4ba47e41b8ece676b457e15b23/CMakeLists.txt#L357-L366
is overwriting the REAL64 flags in CMake, and so we end up with the same issue.
I'm trying to test a possible patch now.