-
Notifications
You must be signed in to change notification settings - Fork 661
Add CMake build to WW3 #533
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
JessicaMeixner-NOAA
merged 199 commits into
NOAA-EMC:develop
from
kgerheiser:feature/cmake
Feb 24, 2022
Merged
Changes from all commits
Commits
Show all changes
199 commits
Select commit
Hold shift + click to select a range
233175e
Ignore .DS_Store
kgerheiser 573fbb6
Create first CMakeLists.txt and associated files
kgerheiser ce6b375
Create JSON file to hold switch information
kgerheiser 21902e7
Merge branch 'develop' of https://github.com/NOAA-EMC/WW3 into featur…
kgerheiser b1c2dd9
Convert to array of objects
kgerheiser b74de4e
Finish filling out and make valid-options an array
kgerheiser ddf6851
Formatting
kgerheiser 4800678
Move switches.json into bin
kgerheiser 14f254c
Open and read switches.json from CMake
kgerheiser 4b5962a
Ignore build directory
kgerheiser c377818
Fix some switches
kgerheiser 32be750
Add FindMETIS/FindParMETIS modules
kgerheiser 47f003c
Add CMake functionality
kgerheiser 652bc7d
Handle NCEP2, PDLIB, and SCRIP switch libraries
kgerheiser 2248199
Fix typo in filename
kgerheiser ed5c4b3
Add switch dependencies and conflicts through requires_any, requires_…
kgerheiser 5775465
Use generic routine nint instead of Intel extension knint
kgerheiser eb4fd5d
Add checks for conflicting and required dependent switches
kgerheiser 186a0d1
Add CMake package config
kgerheiser bc42b4a
Document CMake build
kgerheiser 2d3501d
Move FindESMF into SCRIP block
kgerheiser 025d685
Comment out list switches string in w3initmd while I figure out how t…
kgerheiser a70b317
Cleanup switches.json
kgerheiser 023e030
Revert changes to w3_setup
kgerheiser 4cf9d3b
Add comments to CMakeLists
kgerheiser 7d3913b
Update to correct VERSION
kgerheiser 587b820
Add newline at end of .gitignore to satisfy Gtihub
kgerheiser 16bf040
Add checks for number of switches per category
kgerheiser 49747fe
Cleanup switches.json
kgerheiser b67d433
Search for and link to ParMETIS when PDLIB is enabled
kgerheiser bae8d3c
Find and link to OpenMP when OMPG is enabled
kgerheiser 8bc34ba
Use target_compile_options for flags
kgerheiser 4a29d5b
Fix compile options with spaces in them
kgerheiser 209c028
Move Apple common symbol check into Intel compiler
kgerheiser 92ce56d
Make check_switches a function to reduce verbosity in main CMakeLists…
kgerheiser 03971c2
Fix NetCDF executable logic
kgerheiser 042669e
Put executables in CMAKE_BINARY_DIR/bin
kgerheiser 8007e46
Change ww3 library name to be different than target name
kgerheiser d6b06e7
Cleanup NetCDF logic
kgerheiser 88f5daf
Fix PDLIB build
kgerheiser f599b91
Make Release default build type
kgerheiser 7833fdd
Create Github Action
kgerheiser 45c56f2
Move spack.yaml
kgerheiser d584ceb
Move spack.yaml into repo
kgerheiser a701b7b
Fix spack.yaml
kgerheiser 2a35016
Allow switch file to be a full path
kgerheiser 1e923ab
Add Intel compiler to environment
kgerheiser 02ffac3
Find external packages
kgerheiser 8f3bf7d
Find compilers
kgerheiser 61154d1
test ifort
kgerheiser 909fbf8
Fix name
kgerheiser 330f078
Install Intel OneAPI using Spack
kgerheiser 79beab1
Cache Spack
kgerheiser f22261c
Fix typo
kgerheiser 3958115
use Spack again with --dirty so Intel compilers work
kgerheiser 81e9507
Spack compiler find
kgerheiser ba2f012
Test build cache
kgerheiser a13ab25
Add ci-build through Github Actions
kgerheiser 218bd4f
updates to regtest to test cmake
JessicaMeixner-NOAA 977aa77
Merge remote-tracking branch 'origin/feature/cmake' into feature/cmak…
JessicaMeixner-NOAA aef91a3
Build ww3_multi
kgerheiser 0dc79bf
Merge remote-tracking branch 'EMC/develop' into feature/cmakeregtests
JessicaMeixner-NOAA 9a548f4
Merge remote-tracking branch 'KG/feature/cmake' into feature/cmakereg…
JessicaMeixner-NOAA a078598
updates to regtests for cmake
JessicaMeixner-NOAA 39caaab
Add build_files for SMC
kgerheiser 4e856f8
Build ww3_systrk
kgerheiser 3639257
Fix ww3_prnc and tide build
kgerheiser 7176a51
Merge remote-tracking branch 'KG/feature/cmake' into feature/cmakereg…
JessicaMeixner-NOAA 58fc120
Merge remote-tracking branch 'EMC/develop' into feature/cmakeregtests
JessicaMeixner-NOAA 305c89a
Merge branch 'develop' of https://github.com/NOAA-EMC/WW3 into featur…
kgerheiser d2f7359
code changes needed for cmake to pass
JessicaMeixner-NOAA cbbcb33
run_cmake_test updates
JessicaMeixner-NOAA 27d57fe
changes to cmake file lists and updates to include full file with ext…
JessicaMeixner-NOAA d43a421
Merge pull request #2 from JessicaMeixner-NOAA/feature/cmakeregtests
kgerheiser 41ccfde
Fix target_link_libraries signature
kgerheiser 81774cc
removing BT2 which is not used
JessicaMeixner-NOAA 0b0e0cb
updates to cmake -- cleanup of file lists and adding prtide to prog list
JessicaMeixner-NOAA 7da3579
updates to regtests
JessicaMeixner-NOAA 2831a8a
update to have prtide added to program list only
JessicaMeixner-NOAA bf80b83
Merge branch 'NOAA-EMC:develop' into feature/cmake
kgerheiser c8452c4
Find and link to OASIS
kgerheiser 4bfc176
Copy switch file to build directory
kgerheiser cef91d4
Fix switch string in w3initmd
kgerheiser c39ea6e
Set WW3_SWITCHES just for w3initmd
kgerheiser b664a80
Install switch file
kgerheiser 6bf6a8a
Merge branch 'NOAA-EMC:develop' into feature/cmakeregtests
JessicaMeixner-NOAA 1e5684b
Merge remote-tracking branch 'KG/feature/cmake' into feature/cmakereg…
JessicaMeixner-NOAA ca775be
Cleanup switch handling
kgerheiser 7083fd5
Add PGI compiler flags
kgerheiser 7b1d908
Merge remote-tracking branch 'KG/feature/cmake' into feature/cmakereg…
JessicaMeixner-NOAA 66fa836
Merge remote-tracking branch 'EMC/develop' into feature/cmakeregtests
JessicaMeixner-NOAA 7dcfb1c
run prnc with no mpi
JessicaMeixner-NOAA 6e8d4bc
Merge branch 'NOAA-EMC:develop' into feature/cmake
kgerheiser fbb2c85
Merge pull request #3 from JessicaMeixner-NOAA/feature/cmakeregtests
kgerheiser 388d5c7
Merge branch 'NOAA-EMC:develop' into feature/cmake
kgerheiser 8eae040
Create CMake wrapper for OASIS build and update FindOASIS.cmake
kgerheiser 943250f
Remove extra -I for NetCDF include
kgerheiser 72c71af
Separate dependency build and model build in CI
kgerheiser 88cbdf2
Update cache key
kgerheiser a6e064c
Fix CI
kgerheiser 98633cc
Have CMake message the switch its building with
kgerheiser d4f0e3a
Fix cache name
kgerheiser 18a8623
Workflow fixes
kgerheiser 7f3f23c
Add some test switches
kgerheiser a23a573
Fix cache name
kgerheiser 21eefae
Don't checkout Intel compiler in setup step if nothing to build
kgerheiser 85c17a7
Run using matrix os
kgerheiser 2b32f6a
Build OASIS
kgerheiser 8dd6d3c
Create README for CI dir
kgerheiser 2c86c8b
Fix syntax
kgerheiser a43b39c
Fix build order
kgerheiser a1cdf59
Add WWATCH3_DIR env variable for OASIS build
kgerheiser 9c544d6
Remove custom command and custom target
kgerheiser 9717ccd
Use make instead of gmake
kgerheiser 92331a6
Enable fail fast
kgerheiser cf68f8d
Add description to SWITCH option
kgerheiser aa62a25
Debug oasis build
kgerheiser 10ff2ab
Disable spack
kgerheiser ff26f90
Build with Spack
kgerheiser 8b1095e
Disable ESMF
kgerheiser 71c236e
Add debug commands
kgerheiser 0edf779
Fix whitespace in Makefile
kgerheiser cd71c7f
Ignore OASIS build artifacts
kgerheiser 92a03d9
Change how NetCDF is included
kgerheiser e54a381
Revert Makefile to original form
kgerheiser cf5fd9e
Fix switch name
kgerheiser 0925d4f
Remove add_dependencies
kgerheiser eccab34
Fix name again
kgerheiser 6808be4
Re-enable ESMF
kgerheiser 88559ed
Cleanup workflow file
kgerheiser ee6a025
Add GNU CI build
kgerheiser 731498c
Cleanup Action code
kgerheiser ff45494
Use runner.os
kgerheiser 6df4cb0
Make verbose
kgerheiser bdde8f2
make verbose
kgerheiser e03b8fd
Debug GNU build
kgerheiser 9b2c6e9
Use gcc-10
kgerheiser 241e01f
Pass FCFLAGS to MCT build for gfortran-10 compatability flags
kgerheiser bd44a63
Remove unnecessary flags for GCC-10
kgerheiser 185d46d
Enable libraries
kgerheiser a25aa6f
Start with a fresh cache
kgerheiser bbdcfe5
Make verbose
kgerheiser 7ff226b
Change OASIS/NetCDF link order
kgerheiser 6f0309b
Include FindPackageHandleStandardArgs
kgerheiser 31369b3
Add MULTI_ESMF option to build libww3_multi_esmf
kgerheiser 2c7efff
CI switches dir
kgerheiser 24ab910
Add MULTI_ESMF build test in CI
kgerheiser 106699e
Fix switch format
kgerheiser 4d8be57
New cache key
kgerheiser 2ff0d13
Merge branch 'NOAA-EMC:develop' into feature/cmake
kgerheiser 2161b42
Create CMake README
kgerheiser 115c58e
Merge branch 'feature/cmake' of github.com:kgerheiser/WW3 into featur…
kgerheiser 923a24d
Cleanup documentation
kgerheiser 9ebc054
Update README.md
kgerheiser 98f7839
Update README.md
kgerheiser 9216100
Explain CMake command path
kgerheiser 5ac810b
Add comments
kgerheiser 82836e3
Merge branch 'develop' of https://github.com/NOAA-EMC/WW3 into featur…
kgerheiser 9aad563
Update docs
kgerheiser 4652896
Update README.md
kgerheiser 146023e
Update README.md
kgerheiser 65a5505
Build OASIS before running CMake for regtests
kgerheiser 457ccee
Merge branch 'feature/cmake' of github.com:kgerheiser/WW3 into featur…
kgerheiser 30efff5
Update README.md
kgerheiser 0469c38
Fix FindNetCDF in OASIS build
kgerheiser 8aced96
Merge branch 'feature/cmake' of github.com:kgerheiser/WW3 into featur…
kgerheiser 77a3c94
Create work dir before building OASIS
kgerheiser f9d0a06
Build OASIS in source
kgerheiser d9d9efc
Fix GNU flag being used for ifort
1a99cec
Fix NetCDF flags
4d58e1c
Merge branch 'develop' of https://github.com/NOAA-EMC/WW3 into featur…
kgerheiser fdd6817
Remove old cmake in esmf folder and update for grib (#4)
JessicaMeixner-NOAA 9219a7d
Add ability to build WW3 as UFS submodule
kgerheiser 72b710f
Merge branch 'feature/cmake' of github.com:kgerheiser/WW3 into featur…
kgerheiser 72a6edf
Merge branch 'NOAA-EMC:develop' into feature/cmake
kgerheiser 4c1e509
Refer to official WW3 repo in CMake docs
kgerheiser 98a3c44
Add NetCDF option to CMake build
kgerheiser 7fb02e9
Merge branch 'feature/cmake' of github.com:kgerheiser/WW3 into featur…
kgerheiser 674291e
Document NetCDF option
kgerheiser 83370a9
non interactive ww3_from_ftp.sh #603
mickaelaccensi 27f3479
uniformize regtests output by setting a global output type in the mat…
mickaelaccensi 600b952
ww3_doxy_tmpl.md: clarify MODULE markup (#606)
MatthewMasarik-NOAA afc4ccc
update cmake module files and a little clean up
JessicaMeixner-NOAA 9aec81a
update run_cmake_test with update from run_test
JessicaMeixner-NOAA 0f30457
namelist feature for program ww3_bound (#610)
mickaelaccensi 349ad98
doxygen: remove existing doxygen errors prior to markup (#611)
MatthewMasarik-NOAA d1a343c
update cmake file list for new bound namelist
JessicaMeixner-NOAA 2ef6f9a
add matrix cmake for datarmor hpc
mickaelaccensi 19e4fbb
Create matrix_cmake_datarmor
kgerheiser 75f5ad4
Add -ffree-line-length-none to OASIS build for GNU
kgerheiser dfb5e00
fix grib build (#7)
JessicaMeixner-NOAA f4de739
Merge branch 'develop' into cmake
mickaelaccensi ddcbb13
update prep_env and CMakeLists.txt for cmake compilation
mickaelaccensi f1a7239
update run_cmake_test
JessicaMeixner-NOAA a2f0bf0
make matrix.comp work
JessicaMeixner-NOAA 538dfad
Merge branch 'feature/cmake' of https://github.com/kgerheiser/WW3 int…
mickaelaccensi facd263
Merge pull request #9 from JessicaMeixner-NOAA/feature/cmake
kgerheiser c6f2906
fix matrix.comp
JessicaMeixner-NOAA df7a663
Merge pull request #10 from JessicaMeixner-NOAA/feature/cmake
kgerheiser File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,103 @@ | ||
| name: GNU Linux Build | ||
| on: [push, pull_request] | ||
|
|
||
| env: | ||
| cache_key: gnu3 | ||
| CC: gcc-10 | ||
| FC: gfortran-10 | ||
| CXX: g++-10 | ||
|
|
||
| # Split into a steup step, and a WW3 build step which | ||
| # builds multiple switches in a matrix. The setup is run once and | ||
| # the environment is cached so each build of WW3 can share the dependencies. | ||
|
|
||
| jobs: | ||
| setup: | ||
| runs-on: ubuntu-20.04 | ||
|
|
||
| steps: | ||
| # Cache spack, OASIS, and compiler | ||
| # No way to flush Action cache, so key may have # appended | ||
| - name: cache-env | ||
| id: cache-env | ||
| uses: actions/cache@v2 | ||
| with: | ||
| path: | | ||
| spack | ||
| ~/.spack | ||
| work_oasis3-mct | ||
| key: spack-${{ runner.os }}-${{ env.cache_key }} | ||
|
|
||
| - name: checkout-ww3 | ||
| if: steps.cache-env.outputs.cache-hit != 'true' | ||
| uses: actions/checkout@v2 | ||
| with: | ||
| path: ww3 | ||
|
|
||
| # Build WW3 spack environment | ||
| - name: install-dependencies-with-spack | ||
| if: steps.cache-env.outputs.cache-hit != 'true' | ||
| run: | | ||
| # Install NetCDF, ESMF, g2, etc using Spack | ||
| git clone -c feature.manyFiles=true https://github.com/spack/spack.git | ||
| source spack/share/spack/setup-env.sh | ||
| spack env create ww3-gnu ww3/model/ci/spack.yaml | ||
| spack env activate ww3-gnu | ||
| spack compiler find | ||
| spack external find m4 cmake pkgconf openssl | ||
| spack add mpich@3.4.2 | ||
| spack concretize | ||
| spack install --dirty -v | ||
|
|
||
| - name: build-oasis | ||
| if: steps.cache-env.outputs.cache-hit != 'true' | ||
| run: | | ||
| source spack/share/spack/setup-env.sh | ||
| spack env activate ww3-gnu | ||
| export WWATCH3_DIR=${GITHUB_WORKSPACE}/ww3/model | ||
| cd ww3/regtests/ww3_tp2.14/input/oasis3-mct/util/make_dir | ||
| mkdir build && cd build | ||
| cmake .. | ||
| make VERBOSE=1 | ||
| cp -r ${GITHUB_WORKSPACE}/ww3/regtests/ww3_tp2.14/work_oasis3-mct ${GITHUB_WORKSPACE} | ||
|
|
||
| build: | ||
| needs: setup | ||
| strategy: | ||
| matrix: | ||
| switch: [Ifremer1, NCEP_st2, NCEP_st4, ite_pdlib, NCEP_st4sbs, NCEP_glwu, OASACM, UKMO, MULTI_ESMF] | ||
| runs-on: ubuntu-20.04 | ||
|
|
||
| steps: | ||
| - name: checkout-ww3 | ||
| uses: actions/checkout@v2 | ||
| with: | ||
| path: ww3 | ||
|
|
||
| - name: cache-env | ||
| id: cache-env | ||
| uses: actions/cache@v2 | ||
| with: | ||
| path: | | ||
| spack | ||
| ~/.spack | ||
| work_oasis3-mct | ||
| key: spack-${{ runner.os }}-${{ env.cache_key }} | ||
|
|
||
| - name: build-ww3 | ||
| run: | | ||
| source spack/share/spack/setup-env.sh | ||
| spack env activate ww3-gnu | ||
| cd ww3 | ||
| export CC=mpicc | ||
| export FC=mpif90 | ||
| export OASISDIR=${GITHUB_WORKSPACE}/work_oasis3-mct | ||
| mkdir build && cd build | ||
| if [[ ${{ matrix.switch }} == "MULTI_ESMF" ]]; then | ||
| cmake .. -DMULTI_ESMF=ON -DSWITCH=multi_esmf | ||
| else | ||
| cmake .. -DSWITCH=${{ matrix.switch }} | ||
| fi | ||
| make -j2 VERBOSE=1 | ||
|
|
||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,128 @@ | ||
| name: Intel Linux Build | ||
| on: [push, pull_request] | ||
|
|
||
| # Use custom shell with -l so .bash_profile is sourced which loads intel/oneapi/setvars.sh | ||
| # without having to do it in manually every step | ||
| defaults: | ||
| run: | ||
| shell: bash -leo pipefail {0} | ||
|
|
||
| # Set I_MPI_CC/F90 so Intel MPI wrapper uses icc/ifort instead of gcc/gfortran | ||
| env: | ||
| cache_key: intel4 | ||
| CC: icc | ||
| FC: ifort | ||
| CXX: icpc | ||
| I_MPI_CC: icc | ||
| I_MPI_F90: ifort | ||
|
|
||
| # Split into a dependency build step, and a WW3 build step which | ||
| # builds multiple switches in a matrix. The setup is run once and | ||
| # the environment is cached so each build of WW3 can share the dependencies. | ||
|
|
||
| jobs: | ||
| setup: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| # Cache spack, OASIS, and compiler | ||
| # No way to flush Action cache, so key may have # appended | ||
| - name: cache-env | ||
| id: cache-env | ||
| uses: actions/cache@v2 | ||
| with: | ||
| path: | | ||
| spack | ||
| ~/.spack | ||
| work_oasis3-mct | ||
| /opt/intel | ||
| key: spack-${{ runner.os }}-${{ env.cache_key }} | ||
|
|
||
| - name: install-intel-compilers | ||
| if: steps.cache-env.outputs.cache-hit != 'true' | ||
| run: | | ||
| wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | ||
| sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | ||
| echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list | ||
| sudo apt-get update | ||
| sudo apt-get install intel-oneapi-dev-utilities intel-oneapi-mpi-devel intel-oneapi-openmp intel-oneapi-compiler-fortran intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic | ||
| echo "source /opt/intel/oneapi/setvars.sh" >> ~/.bash_profile | ||
|
|
||
| - name: checkout-ww3 | ||
| if: steps.cache-env.outputs.cache-hit != 'true' | ||
| uses: actions/checkout@v2 | ||
| with: | ||
| path: ww3 | ||
|
|
||
| # Build WW3 spack environment | ||
| - name: install-dependencies-with-spack | ||
| if: steps.cache-env.outputs.cache-hit != 'true' | ||
| run: | | ||
| # Install NetCDF, ESMF, g2, etc using Spack | ||
| git clone -c feature.manyFiles=true https://github.com/spack/spack.git | ||
| source spack/share/spack/setup-env.sh | ||
| spack env create ww3-intel ww3/model/ci/spack.yaml | ||
| spack env activate ww3-intel | ||
| spack compiler find | ||
| spack external find m4 cmake pkgconf openssl | ||
| spack add intel-oneapi-mpi | ||
| spack concretize | ||
| spack install --dirty -v | ||
|
|
||
| - name: build-oasis | ||
| if: steps.cache-env.outputs.cache-hit != 'true' | ||
| run: | | ||
| source spack/share/spack/setup-env.sh | ||
| spack env activate ww3-intel | ||
| export WWATCH3_DIR=${GITHUB_WORKSPACE}/ww3/model | ||
| cd ww3/regtests/ww3_tp2.14/input/oasis3-mct/util/make_dir | ||
| mkdir build && cd build | ||
| cmake .. | ||
| make | ||
| cp -r ${GITHUB_WORKSPACE}/ww3/regtests/ww3_tp2.14/work_oasis3-mct ${GITHUB_WORKSPACE} | ||
|
|
||
| build: | ||
| needs: setup | ||
| strategy: | ||
| matrix: | ||
| switch: [Ifremer1, NCEP_st2, NCEP_st4, ite_pdlib, NCEP_st4sbs, NCEP_glwu, OASACM, UKMO, MULTI_ESMF] | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: checkout-ww3 | ||
| uses: actions/checkout@v2 | ||
| with: | ||
| path: ww3 | ||
|
|
||
| - name: install-intel | ||
| run: | | ||
| echo "source /opt/intel/oneapi/setvars.sh" >> ~/.bash_profile | ||
|
|
||
| - name: cache-env | ||
| id: cache-env | ||
| uses: actions/cache@v2 | ||
| with: | ||
| path: | | ||
| spack | ||
| ~/.spack | ||
| work_oasis3-mct | ||
| /opt/intel | ||
| key: spack-${{ runner.os }}-${{ env.cache_key }} | ||
|
|
||
| - name: build-ww3 | ||
| run: | | ||
| source spack/share/spack/setup-env.sh | ||
| spack env activate ww3-intel | ||
| cd ww3 | ||
| export CC=mpicc | ||
| export FC=mpif90 | ||
| export OASISDIR=${GITHUB_WORKSPACE}/work_oasis3-mct | ||
| mkdir build && cd build | ||
| if [[ ${{ matrix.switch }} == "MULTI_ESMF" ]]; then | ||
| cmake .. -DMULTI_ESMF=ON -DSWITCH=multi_esmf | ||
| else | ||
| cmake .. -DSWITCH=${{ matrix.switch }} | ||
| fi | ||
| make -j2 | ||
|
|
||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -169,3 +169,5 @@ model/bin/wwatch3.env | |
| */.*.swp | ||
| */*/.*.swp | ||
| */*/*/.*.swp | ||
| .DS_Store | ||
| build | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| # CMake build written by Kyle Gerheiser | ||
|
|
||
| # Requires CMake 3.19 for JSON strings | ||
| cmake_minimum_required(VERSION 3.19) | ||
|
|
||
| # Get VERSION from VERSION file | ||
| file(STRINGS "VERSION" pVersion) | ||
|
|
||
| project( | ||
| WW3 | ||
| VERSION ${pVersion} | ||
| LANGUAGES C Fortran) | ||
|
|
||
| set(MULTI_ESMF OFF CACHE BOOL "Build ww3_multi_esmf library") | ||
| set(NETCDF ON CACHE BOOL "Build NetCDF programs (requires NetCDF)") | ||
|
|
||
| # Make Find modules visible to CMake | ||
| list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") | ||
|
|
||
| # Set switch file on command line when running CMake | ||
| set(SWITCH "" CACHE STRING "Switch file, either full path, relative path from location of top-level WW3/ dir, or a switch in model/bin") | ||
|
|
||
| # Search for switch file as a full path or in model/bin | ||
| if(EXISTS ${SWITCH}) | ||
| set(switch_file ${SWITCH}) | ||
| else() | ||
| set(switch_file ${CMAKE_CURRENT_SOURCE_DIR}/model/bin/switch_${SWITCH}) | ||
| if(NOT EXISTS ${switch_file}) | ||
| message(FATAL_ERROR "Switch file '${switch_file}' does not exist, set switch with -DSWITCH=<switch>") | ||
| endif() | ||
| endif() | ||
|
|
||
| message(STATUS "Build with switch: ${switch_file}") | ||
| # Copy switch file to build dir | ||
| configure_file(${switch_file} ${CMAKE_BINARY_DIR}/switch COPYONLY) | ||
|
|
||
| # Re-configure CMake when switch changes | ||
| set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${CMAKE_BINARY_DIR}/switch) | ||
|
|
||
| if(NOT CMAKE_BUILD_TYPE MATCHES "^(Debug|Release|RelWithDebInfo|MinSizeRel)$") | ||
| message(STATUS "Setting build type to 'Release' as none was specified.") | ||
| set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Build type" FORCE) | ||
| set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo") | ||
| endif() | ||
|
|
||
| add_subdirectory(model) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 7.14 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.