|
| 1 | +# (C) Copyright 2017-2020 UCAR |
| 2 | +# |
| 3 | +# This software is licensed under the terms of the Apache Licence Version 2.0 |
| 4 | +# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. |
| 5 | + |
| 6 | +# |
| 7 | +# MPAS/JEDI bundle |
| 8 | +# |
| 9 | + |
| 10 | +cmake_minimum_required( VERSION 3.12 ) |
| 11 | +project( mpas-bundle VERSION 1.0.0 LANGUAGES C CXX Fortran ) |
| 12 | + |
| 13 | +## ECBuild integration |
| 14 | +include(GNUInstallDirs) |
| 15 | +set( INSTALL_LIB_DIR ${CMAKE_INSTALL_LIBDIR} CACHE STRING "Library installation directory" FORCE ) #Force ecbuild to use the default platform lib install location |
| 16 | +set( ECBUILD_DEFAULT_BUILD_TYPE Release CACHE STRING "ECBuild default build type" FORCE) |
| 17 | +set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin ) |
| 18 | +set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib ) |
| 19 | +set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib ) |
| 20 | +find_package( ecbuild 3.5 REQUIRED HINTS ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../ecbuild ) |
| 21 | +include( ecbuild_bundle ) |
| 22 | +ecbuild_bundle_initialize() |
| 23 | + |
| 24 | +ecbuild_bundle( PROJECT jedicmake GIT "https://github.com/JCSDA-internal/jedi-cmake.git" TAG afb8655 ) |
| 25 | +include( jedicmake/cmake/Functions/git_functions.cmake ) |
| 26 | + |
| 27 | +option(BUNDLE_SKIP_ECKIT "Don't build eckit" "ON" ) # Skip eckit build unless user passes -DBUNDLE_SKIP_ECKIT=OFF |
| 28 | +option(BUNDLE_SKIP_FCKIT "Don't build fckit" "ON" ) # Skip eckit build unless user passes -DBUNDLE_SKIP_FCKIT=OFF |
| 29 | +option(BUNDLE_SKIP_ATLAS "Don't build eckit" "ON" ) # Skip atlas build unless user passes -DBUNDLE_SKIP_ATLAS=OFF |
| 30 | +ecbuild_bundle( PROJECT eckit GIT "https://github.com/ecmwf/eckit.git" TAG 1.18.2 ) |
| 31 | +ecbuild_bundle( PROJECT fckit GIT "https://github.com/ecmwf/fckit.git" TAG 0.9.5 ) |
| 32 | +ecbuild_bundle( PROJECT atlas GIT "https://github.com/ecmwf/atlas.git" TAG 0.29.0 ) |
| 33 | + |
| 34 | +#TODO: When mpas-bundle becomes a public repo, consider changing the default value of BUNDLE_SKIP_ROPP-UFO to "ON" |
| 35 | +option(BUNDLE_SKIP_ROPP-UFO "Don't build ROPP-UFO" "OFF") # Build ropp-ufo unless user passes -DBUNDLE_SKIP_ROPP-UFO=ON |
| 36 | +ecbuild_bundle( PROJECT ropp-ufo GIT "https://github.com/JCSDA-internal/ropp-test.git" TAG 96a0397 ) |
| 37 | +ecbuild_bundle( PROJECT crtm GIT "https://github.com/JCSDA-internal/crtm.git" TAG e630e33 ) |
| 38 | +option(BUNDLE_SKIP_RTTOV "Don't build rttov" "ON") # Skip rttov build unless user passes -DBUNDLE_SKIP_RTTOV=OFF |
| 39 | +ecbuild_bundle( PROJECT rttov GIT "https://github.com/JCSDA-internal/rttov.git" TAG 5f8b36b ) |
| 40 | + |
| 41 | +ecbuild_bundle( PROJECT oops GIT "https://github.com/JCSDA-internal/oops.git" TAG e7335ff ) |
| 42 | +ecbuild_bundle( PROJECT saber GIT "https://github.com/JCSDA-internal/saber.git" TAG 1203356 ) |
| 43 | +ecbuild_bundle( PROJECT ioda GIT "https://github.com/JCSDA-internal/ioda.git" TAG 9a40bd0 ) |
| 44 | +ecbuild_bundle( PROJECT ufo GIT "https://github.com/JCSDA-internal/ufo.git" TAG 87d299b ) |
| 45 | + |
| 46 | +# ioda and ufo test data |
| 47 | +#--------------------------------- |
| 48 | + |
| 49 | +# If IODA branch is being built set GIT_BRANCH_FUNC to IODA's current branch. |
| 50 | +# If a tagged version of IODA is being built set GIT_TAG_FUNC to ioda's current tag. In this case, |
| 51 | +# IODA test files will be download from UCAR DASH and ioda-data repo will not be cloned. |
| 52 | +# When LOCAL_PATH_JEDI_TESTFILES is set to the directory of IODA test files stored |
| 53 | +# in a local directory, ioda-data repo will not be cloned |
| 54 | + |
| 55 | +find_branch_name(REPO_DIR_NAME ioda) |
| 56 | +# When LOCAL_PATH_JEDI_TESTFILES is set to the directory of IODA test files stored |
| 57 | +# in a local directory, ioda-data repo will not be cloned |
| 58 | +if( NOT DEFINED ENV{LOCAL_PATH_JEDI_TESTFILES} AND NOT DEFINED ${GIT_TAG_FUNC} ) |
| 59 | + ecbuild_bundle( PROJECT ioda-data GIT "https://github.com/JCSDA-internal/ioda-data.git" TAG 3b4c1ba ) |
| 60 | +endif() |
| 61 | + |
| 62 | +# If IODA's current branch is available in ioda-data repo, that branch will be checked out |
| 63 | +branch_checkout (REPO_DIR_NAME ioda-data |
| 64 | + BRANCH ${GIT_BRANCH_FUNC} ) |
| 65 | + |
| 66 | +# same procedure for ufo-data |
| 67 | +find_branch_name(REPO_DIR_NAME ufo) |
| 68 | +if( NOT DEFINED ENV{LOCAL_PATH_JEDI_TESTFILES} AND NOT DEFINED ${GIT_TAG_FUNC} ) |
| 69 | + ecbuild_bundle( PROJECT ufo-data GIT "https://github.com/JCSDA-internal/ufo-data.git" TAG 87702a2 ) |
| 70 | +endif() |
| 71 | + |
| 72 | +# If UFO's current branch is available in ioda-data repo, that branch will be checked out |
| 73 | +branch_checkout (REPO_DIR_NAME ufo-data |
| 74 | + BRANCH ${GIT_BRANCH_FUNC}) |
| 75 | + |
| 76 | + |
| 77 | +set(MPAS_DOUBLE_PRECISION "ON" CACHE STRING "MPAS-Model: Use double precision 64-bit Floating point.") |
| 78 | +set(MPAS_CORES init_atmosphere atmosphere CACHE STRING "MPAS-Model: cores to build.") |
| 79 | +ecbuild_bundle( PROJECT MPAS GIT "https://github.com/JCSDA-internal/MPAS-Model.git" TAG 2a41bf1 ) |
| 80 | +ecbuild_bundle( PROJECT mpas-jedi GIT "https://github.com/JCSDA-internal/mpas-jedi" TAG cb20c34 ) |
| 81 | + |
| 82 | +# same procedure for mpas-jedi-data |
| 83 | +find_branch_name(REPO_DIR_NAME mpas-jedi) |
| 84 | +if( NOT DEFINED ENV{LOCAL_PATH_JEDI_TESTFILES} AND NOT DEFINED ${GIT_TAG_FUNC} ) |
| 85 | + ecbuild_bundle( PROJECT mpas-jedi-data GIT "https://github.com/JCSDA-internal/mpas-jedi-data.git" TAG 8b5ab19 ) |
| 86 | +endif() |
| 87 | + |
| 88 | +# If mpas-jedi's current branch is available in mpas-jedi-data repo, that branch will be checked out |
| 89 | +branch_checkout (REPO_DIR_NAME mpas-jedi-data |
| 90 | + BRANCH ${GIT_BRANCH_FUNC} ) |
| 91 | + |
| 92 | + |
| 93 | +ecbuild_bundle_finalize() |
0 commit comments