Skip to content

Commit

Permalink
Set linker language to Fortran
Browse files Browse the repository at this point in the history
  • Loading branch information
mathomp4 committed Dec 10, 2024
1 parent 9377220 commit efcf218
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,18 @@ ecbuild_add_executable (
SOURCES GEOSgcm.F90
LIBS GEOSgcm_GridComp ESMF::ESMF OpenMP::OpenMP_Fortran
)
# NOTE Due to Gigatraj being a C++ code, CMake apparently
# gets confused if building with it and thinks GEOSgcm.x
# is a C++ code and tries to link as C++. This will fail.
# To fix this, we explicitly set the linker language to Fortran.
set_target_properties (GEOSgcm.x PROPERTIES LINKER_LANGUAGE Fortran)

ecbuild_add_executable (
TARGET idfupd.x
SOURCES idfupd.F90
LIBS GEOSgcm_GridComp ESMF::ESMF
)
set_target_properties (idfupd.x PROPERTIES LINKER_LANGUAGE Fortran)

set (CMAKE_Fortran_FLAGS_RELEASE "${GEOS_Fortran_FLAGS_VECT}")

Expand Down

0 comments on commit efcf218

Please sign in to comment.