Skip to content

Commit 0a006fc

Browse files
author
JJ Guerrette
authored
Release 25JAN2023 (#190)
### Description This PR establishes `build/CMakeLists.txt` and provides build instructions in `README.md` ### Issue closed Related to #188, but does not fully close it.
1 parent bde0c89 commit 0a006fc

File tree

2 files changed

+120
-1
lines changed

2 files changed

+120
-1
lines changed

README.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,32 @@ It is required to set the `work` and `run` directories in $HOME/.cylc/global.rc
4949
the cylc `work` and `run` directories, as long as you also modify `cylcWorkDir` in `drive.csh`. It is
5050
recommended to set `job name length maximum` to a large value.
5151

52+
Build
53+
-----
54+
At this time the workflow does not build MPAS-Model or JEDI-MPAS. Users must acquire source
55+
code from either [JCSDA/mpas-bundle](https://github.com/JCSDA/mpas-bundle/) or
56+
[JCSDA-internal/mpas-bundle](https://github.com/JCSDA-internal/mpas-bundle/). Then they must
57+
follow the build instructions in the corresponding repository. Tagged releases of MPAS-Workflow
58+
starting with 25JAN2023 are accompanied by an mpas-bundle CMakeLists.txt (`build/CMakeLists.txt`)
59+
with fixed source code repository tags/hashes that are consistent with the released workflow
60+
version. Users can copy that file into their mpas-bundle source code directory before executing
61+
`ecbuild` in order to download the currect repository versions.
62+
63+
Periodically the `develop` branch of MPAS-Workflow will be consistent with the source code
64+
`develop` branches, usually every 1-2 months. As often as is feasible, that is when a new tagged
65+
release of MPAS-Workflow will be generated.
66+
67+
As such, the current `develop` branch of MPAS-Workflow may or may not be backward compatible to
68+
those source code tags. For developers, unless they are absolutely sure that their workflow branch
69+
is consistent with a particular set of source code `develop` branches, it is strongly recommended
70+
that they start their development process from the tagged source code hashes stored in
71+
`build/CMakeLists.txt`. After checking out those specific source code hashes (via `ecbuild`), it is
72+
simple to generate their own feature or bugfix branches using, e.g.,
73+
`git checkout -b feature/CustomFeature`.
74+
75+
Please contact [JJ Guerrette](mailto:[email protected]?subject=[GitHub]%20MPAS-Worflow) with any
76+
questions. The MPAS-Worklfow release procedure is subject to change in the future, which will be
77+
documented here.
5278

5379
Configuration Files
5480
-------------------
@@ -58,7 +84,7 @@ entire workflow. Some files are designed to be modified by users, and others mo
5884

5985
### User-modifiable configuration
6086

61-
`config/builds.csh`: describes the build directories for critical applications
87+
`config/builds.csh`: describes external build directories for critical applications
6288

6389
`config/scenario.csh`: selection of a particular experiment scenario
6490

build/CMakeLists.txt

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
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

Comments
 (0)