diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 91db19cf6..6088ae8d2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -178,7 +178,7 @@ jobs: cache_suffix: "${{ matrix.build_type }}-${{ env.CACHE_SUFFIX }}" recreate_cache: ${{ matrix.caching == false }} dependencies: | - ecmwf/ecbuild + awnawab/ecbuild@feature/purge-compiler-flags ecmwf/eccodes ecmwf/fckit@refs/tags/0.13.0 ecmwf-ifs/fiat@refs/tags/1.4.1 diff --git a/CMakeLists.txt b/CMakeLists.txt index c7d1dbc71..0b22febe0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,6 @@ if( NOT ECWAM_PROJECT_NAME ) endif() string( TOUPPER ${ECWAM_PROJECT_NAME} PNAME ) -set( ${PNAME}_ECBUILD_COMPILE_FLAGS ${CMAKE_CURRENT_SOURCE_DIR}/cmake/ecwam_init_flags.cmake CACHE FILEPATH "") project( ${ECWAM_PROJECT_NAME} LANGUAGES Fortran C CXX ) include( ecwam_macros ) @@ -143,7 +142,13 @@ ecbuild_add_option( FEATURE GPU_AWARE_MPI ### Sources -include(ecwam_compile_flags) +# Trigger the use of _LANG_FLAGS in ecbuild +ecbuild_init_overrideable_compiler_flags( + LANGUAGES Fortran + CAPTURE_BUNDLE_FLAGS + COMPILE_FLAGS ${CMAKE_CURRENT_SOURCE_DIR}/cmake/ecwam_compile_flags.cmake +) + add_subdirectory(src) add_subdirectory(share) diff --git a/cmake/ecwam_compile_flags.cmake b/cmake/ecwam_compile_flags.cmake index 5e2292da2..ff5185730 100644 --- a/cmake/ecwam_compile_flags.cmake +++ b/cmake/ecwam_compile_flags.cmake @@ -6,11 +6,6 @@ # granted to it by virtue of its status as an intergovernmental organisation # nor does it submit to any jurisdiction. -# Capture ecbuild defaults and/or flags set by a toolchain -set( ${PNAME}_Fortran_FLAGS "${${PNAME}_Fortran_FLAGS} ${ECBUILD_Fortran_FLAGS}" ) -set( ${PNAME}_Fortran_FLAGS_BIT "${${PNAME}_Fortran_FLAGS_BIT} ${ECBUILD_Fortran_FLAGS_BIT}" ) -set( ${PNAME}_Fortran_FLAGS_DEBUG "${${PNAME}_Fortran_FLAGS_DEBUG} ${ECBUILD_Fortran_FLAGS_DEBUG}" ) - if(CMAKE_Fortran_COMPILER_ID MATCHES "Cray") set(autopromote_flags "-sreal64") set(checkbounds_flags "-Rb") diff --git a/cmake/ecwam_init_flags.cmake b/cmake/ecwam_init_flags.cmake deleted file mode 100644 index 12d93af36..000000000 --- a/cmake/ecwam_init_flags.cmake +++ /dev/null @@ -1,9 +0,0 @@ -# (C) Copyright 2022- ECMWF. -# -# This software is licensed under the terms of the Apache Licence Version 2.0 -# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. -# In applying this licence, ECMWF does not waive the privileges and immunities -# granted to it by virtue of its status as an intergovernmental organisation -# nor does it submit to any jurisdiction. - -# Empty file to trigger ecbuild to use ${PNAME}__FLAGS \ No newline at end of file diff --git a/package/bundle/bundle.yml b/package/bundle/bundle.yml index a882fc081..900bfe2c0 100644 --- a/package/bundle/bundle.yml +++ b/package/bundle/bundle.yml @@ -13,8 +13,8 @@ cmake : CMAKE_LINK_DEPENDS_NO_SHARED=ON projects : - ecbuild : - git : https://github.com/ecmwf/ecbuild - version : master + git : https://github.com/awnawab/ecbuild.git + version : feature/purge-compiler-flags bundle : false - eccodes :