forked from NOAA-EMC/global-workflow
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request NOAA-EMC#264 from NOAA-EMC/feature/cmake
Build workflow utilities with CMake.
- Loading branch information
Showing
30 changed files
with
1,021 additions
and
108 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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,29 @@ | ||
#%Module##################################################### | ||
## Workflow Utilities - hera | ||
############################################################# | ||
|
||
module load cmake/3.16.1 | ||
|
||
module use /scratch2/NCEPDEV/nwprod/hpc-stack/libs/hpc-stack/modulefiles/stack | ||
module load hpc/1.1.0 | ||
module load hpc-intel/18.0.5.274 | ||
module load hpc-impi/2018.0.4 | ||
|
||
module load jasper/2.0.25 | ||
module load zlib/1.2.11 | ||
module load png/1.6.35 | ||
|
||
module load bacio/2.4.1 | ||
module load w3nco/2.4.1 | ||
module load w3emc/2.7.3 | ||
module load sp/2.3.3 | ||
module load ip/3.3.3 | ||
module load nemsio/2.5.2 | ||
module load nemsiogfs/2.5.3 | ||
#module load ncio/1.0.0 | ||
module load sigio/2.3.2 | ||
module load g2/3.4.1 | ||
module load bufr/11.4.0 | ||
|
||
module load hdf5/1.10.6 | ||
module load netcdf/4.7.4 |
This file contains 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,29 @@ | ||
#%Module##################################################### | ||
## Workflow Utilities - orion | ||
############################################################# | ||
|
||
module load cmake/3.17.3 | ||
|
||
module use /apps/contrib/NCEP/libs/hpc-stack/modulefiles/stack | ||
module load hpc/1.1.0 | ||
module load hpc-intel/2018.4 | ||
module load hpc-impi/2018.4 | ||
|
||
module load jasper/2.0.25 | ||
module load zlib/1.2.11 | ||
module load png/1.6.35 | ||
|
||
module load bacio/2.4.1 | ||
module load w3nco/2.4.1 | ||
module load w3emc/2.7.3 | ||
module load sp/2.3.3 | ||
module load ip/3.3.3 | ||
module load nemsio/2.5.2 | ||
module load nemsiogfs/2.5.3 | ||
#module load ncio/1.0.0 | ||
module load sigio/2.3.2 | ||
module load g2/3.4.1 | ||
module load bufr/11.4.0 | ||
|
||
module load hdf5/1.10.6 | ||
module load netcdf/4.7.4 |
This file contains 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,29 @@ | ||
#%Module##################################################### | ||
## Workflow Utilities - wcoss_dell_p3 | ||
############################################################# | ||
|
||
module load cmake/3.16.2 | ||
|
||
module use /usrx/local/nceplibs/dev/hpc-stack/libs/hpc-stack/modulefiles/stack | ||
module load hpc/1.1.0 | ||
module load hpc-ips/18.0.1.163 | ||
module load hpc-impi/18.0.1 | ||
|
||
module load jasper/2.0.25 | ||
module load zlib/1.2.11 | ||
module load png/1.6.35 | ||
|
||
module load bacio/2.4.1 | ||
module load w3nco/2.4.1 | ||
module load w3emc/2.7.3 | ||
module load sp/2.3.3 | ||
module load ip/3.3.3 | ||
module load nemsio/2.5.2 | ||
module load nemsiogfs/2.5.3 | ||
#module load ncio/1.0.0 | ||
module load sigio/2.3.2 | ||
module load g2/3.4.1 | ||
module load bufr/11.4.0 | ||
|
||
module load hdf5/1.10.6 | ||
module load netcdf/4.7.4 |
This file contains 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,72 @@ | ||
cmake_minimum_required(VERSION 3.15) | ||
|
||
# Get the version from the VERSION file. | ||
#file(STRINGS "VERSION" pVersion) | ||
set(pVersion 1.0.0) | ||
|
||
project( | ||
workflow_utils | ||
VERSION ${pVersion} | ||
LANGUAGES Fortran) | ||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") | ||
|
||
include(GNUInstallDirs) | ||
|
||
# User options. | ||
option(OPENMP "use OpenMP threading" ON) | ||
|
||
# Build type | ||
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 "Choose the type of build." FORCE) | ||
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" | ||
"MinSizeRel" "RelWithDebInfo") | ||
endif() | ||
|
||
# Set compiler flags. | ||
if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") | ||
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -g -traceback") | ||
set(CMAKE_Fortran_FLAGS_RELEASE "-O3") | ||
set(CMAKE_Fortran_FLAGS_DEBUG "-O0 -check -check noarg_temp_created -check nopointer -fp-stack-check -fstack-protector-all -fpe0 -debug -ftrapuv") | ||
elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") | ||
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -g -fbacktrace") | ||
set(CMAKE_Fortran_FLAGS_RELEASE "-O3") | ||
set(CMAKE_Fortran_FLAGS_DEBUG "-O0 -ggdb -fno-unsafe-math-optimizations -frounding-math -fsignaling-nans -ffpe-trap=invalid,zero,overflow -fbounds-check") | ||
endif() | ||
|
||
# Find packages. | ||
find_package(MPI REQUIRED) | ||
find_package(NetCDF REQUIRED Fortran) | ||
|
||
if(OPENMP) | ||
find_package(OpenMP REQUIRED COMPONENTS Fortran) | ||
endif() | ||
|
||
find_package(bacio REQUIRED) | ||
find_package(w3nco REQUIRED) | ||
find_package(w3emc REQUIRED) | ||
find_package(sp REQUIRED) | ||
find_package(ip REQUIRED) | ||
find_package(ncio REQUIRED) | ||
find_package(nemsio REQUIRED) | ||
find_package(nemsiogfs REQUIRED) | ||
find_package(sigio REQUIRED) | ||
find_package(g2 REQUIRED) | ||
find_package(bufr REQUIRED) | ||
|
||
add_subdirectory(enkf_chgres_recenter.fd) | ||
add_subdirectory(enkf_chgres_recenter_nc.fd) | ||
add_subdirectory(fv3nc2nemsio.fd) | ||
add_subdirectory(regrid_nemsio.fd) | ||
add_subdirectory(gaussian_sfcanl.fd) | ||
add_subdirectory(gfs_bufr.fd) | ||
add_subdirectory(tocsbufr.fd) | ||
add_subdirectory(fbwndgfs.fd) | ||
add_subdirectory(vint.fd) | ||
add_subdirectory(tave.fd) | ||
add_subdirectory(syndat_qctropcy.fd) | ||
add_subdirectory(syndat_maksynrc.fd) | ||
add_subdirectory(syndat_getjtbul.fd) | ||
add_subdirectory(supvit.fd) |
This file contains 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
This file contains 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,48 @@ | ||
#!/bin/bash | ||
set -eux | ||
|
||
[[ $(uname -s) == Darwin ]] && cmd=$(which greadlink) || cmd=$(which readlink) | ||
readonly UTILS_DIR=$(cd "$(dirname "$($cmd -f -n "${BASH_SOURCE[0]}" )" )" && pwd -P) | ||
|
||
# Adapt for global-workflow structure. | ||
target=${target:-"NULL"} | ||
modulefile=${UTILS_DIR}/../modulefiles/workflow_utils.$target | ||
if [[ -f $modulefile ]]; then | ||
set +x | ||
source ${UTILS_DIR}/machine-setup.sh > /dev/null 2>&1 | ||
source $modulefile | ||
module list | ||
set -x | ||
fi | ||
# End adaptation | ||
|
||
# Begin hack | ||
# In place until nceplibs-ncio is in hpc-stack and available as a module | ||
# After nceplibs-ncio is in hpc-stack, add the following line to | ||
# ${UTILS_DIR}/../modulefiles/workflow_utils.<platform> | ||
# "module load ncio/<ncio-version>" | ||
# and remove this hack | ||
|
||
[[ -d nceplibs-ncio ]] && rm -rf nceplibs-ncio | ||
git clone -b develop https://github.com/noaa-emc/nceplibs-ncio | ||
cd nceplibs-ncio | ||
mkdir -p build && cd build | ||
cmake -DCMAKE_INSTALL_PREFIX=../install .. | ||
make -j ${BUILD_JOBS:-4} VERBOSE=${BUILD_VERBOSE:-} | ||
make install | ||
cd ../.. | ||
export ncio_ROOT=$PWD/nceplibs-ncio/install | ||
# End hack | ||
|
||
BUILD_DIR=${BUILD_DIR:-${UTILS_DIR}/build} | ||
[[ -d $BUILD_DIR ]] && rm -rf $BUILD_DIR | ||
mkdir -p ${BUILD_DIR} | ||
cd $BUILD_DIR | ||
|
||
INSTALL_DIR=${INSTALL_DIR:-${UTILS_DIR}/install} | ||
|
||
CMAKE_FLAGS+=" -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR" | ||
|
||
cmake ${UTILS_DIR} ${CMAKE_FLAGS} | ||
make -j ${BUILD_JOBS:-4} VERBOSE=${BUILD_VERBOSE:-} | ||
make install |
Oops, something went wrong.