Skip to content
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

Rename dirs and make executable dir switchable to meet NCO standards #216

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ ENDFUNCTION()
enable_testing()
include(CTest)

# Build in this subdirectory.
#add_subdirectory(src)

#####
# Configure and print the ufs-srweather-app.settings file.
#####
Expand Down Expand Up @@ -91,6 +88,12 @@ SET(host_os "${osrel}")
SET(abs_top_builddir "${CMAKE_CURRENT_BINARY_DIR}")
SET(abs_top_srcdir "${CMAKE_CURRENT_SOURCE_DIR}")

# Executable directory name (exec_bin): exec or bin
SET(exec_bin "bin")
IF(EMC_EXEC_DIR)
SET(exec_bin "exec")
ENDIF()
Comment on lines +91 to +95
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be necessary.


SET(CC_VERSION "${CMAKE_C_COMPILER}")

# Set values for .settings file.
Expand Down Expand Up @@ -119,7 +122,7 @@ MESSAGE(${UFS-SRWEATHER-APP_SETTINGS})
# Install ufs_srweather_app.settings file into same location
# as the app.
INSTALL(FILES "${CMAKE_BINARY_DIR}/ufs_srweather_app.settings"
DESTINATION bin)
DESTINATION ${exec_bin})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use ${CMAKE_INSTALL_BINDIR}


#####
# Create 'ufs_srweather_app_meta.h' include file.
Expand All @@ -130,4 +133,4 @@ configure_file(

FILE(COPY "${CMAKE_CURRENT_BINARY_DIR}/ufs_srweather_app_meta.h" DESTINATION include)

add_subdirectory(src)
add_subdirectory(sorc)
14 changes: 8 additions & 6 deletions Externals.cfg
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
[regional_workflow]
protocol = git
repo_url = https://github.com/ufs-community/regional_workflow
#repo_url = https://github.com/ufs-community/regional_workflow
repo_url = https://github.com/chan-hoo/regional_workflow
# Specify either a branch name or a hash but not both.
#branch = develop
hash = e5d5c38
branch = feature/move_wflow_env
#hash = e5d5c38
local_path = regional_workflow
required = True

Expand All @@ -13,7 +15,7 @@ repo_url = https://github.com/ufs-community/UFS_UTILS
# Specify either a branch name or a hash but not both.
#branch = develop
hash = f30740e
local_path = src/UFS_UTILS
local_path = sorc/UFS_UTILS
required = True

[ufs-weather-model]
Expand All @@ -22,16 +24,16 @@ repo_url = https://github.com/ufs-community/ufs-weather-model
# Specify either a branch name or a hash but not both.
#branch = develop
hash = 805421d
local_path = src/ufs-weather-model
local_path = sorc/ufs-weather-model
required = True

[UPP]
protocol = git
repo_url = https://github.com/NOAA-EMC/UPP
# Specify either a branch name or a hash but not both.
#branch = develop
hash = 4a16052
local_path = src/UPP
hash = 30fcea8
local_path = sorc/UPP
required = True

[externals_description]
Expand Down
11 changes: 6 additions & 5 deletions devbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ usage_error () {
# default settings
LCL_PID=$$
SRC_DIR=$(cd "$(dirname "$(readlink -f -n "${BASH_SOURCE[0]}" )" )" && pwd -P)
MACHINE_SETUP=${SRC_DIR}/src/UFS_UTILS/sorc/machine-setup.sh
MACHINE_SETUP=${SRC_DIR}/sorc/UFS_UTILS/sorc/machine-setup.sh
BUILD_DIR=${SRC_DIR}/build
INSTALL_DIR=${SRC_DIR}
COMPILER=""
Expand All @@ -89,12 +89,12 @@ CCPP=""
ENABLE_OPTIONS=""
DISABLE_OPTIONS=""
BUILD_TYPE="RELEASE"
BUILD_JOBS=4
BUILD_JOBS=8
CLEAN=false
CONTINUE=false
VERBOSE=false
# detect PLATFORM (MACHINE)
source ${SRC_DIR}/env/detect_machine.sh
source ${SRC_DIR}/test/detect_machine.sh

# process required arguments
if [[ ("$1" == "--help") || ("$1" == "-h") ]]; then
Expand Down Expand Up @@ -161,7 +161,7 @@ if [ "${VERBOSE}" = true ] ; then
fi

# set ENV_FILE for this platform/compiler combination
ENV_FILE="${SRC_DIR}/env/build_${PLATFORM}_${COMPILER}.env"
ENV_FILE="${SRC_DIR}/modulefiles/build_${PLATFORM}_${COMPILER}.env"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you're going to name this directory modulefiles then all of the *.env files should be converted to actual module files and should be loaded with, for example, module load build_hera_intel rather than sourced. This would also remove the user's shell from the equation as the module load would work regardless of the shell the user is using.

Copy link
Collaborator Author

@chan-hoo chan-hoo Feb 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@christopherwharrop-noaa, I agree. This will be my next PR. I don't want to put several topics into one PR. I'll modify the env files into the regular module files in another PR.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@christopherwharrop-noaa, if you want this change in this PR, I'll do it soon.

if [ ! -f "${ENV_FILE}" ]; then
printf "ERROR: environment file does not exist for platform/compiler\n" >&2
printf " ENV_FILE=${ENV_FILE}\n" >&2
Expand Down Expand Up @@ -210,6 +210,7 @@ fi
# cmake settings
CMAKE_SETTINGS="-DCMAKE_INSTALL_PREFIX=${INSTALL_DIR}"
CMAKE_SETTINGS="${CMAKE_SETTINGS} -DCMAKE_BUILD_TYPE=${BUILD_TYPE}"
#CMAKE_SETTINGS="${CMAKE_SETTINGS} -DEMC_EXEC_DIR=ON"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead use
-DCMAKE_INSTALL_BINDIR=exec
where exec is desired.

if [ ! -z "${APPLICATION}" ]; then
CMAKE_SETTINGS="${CMAKE_SETTINGS} -DAPP=${APPLICATION}"
fi
Expand All @@ -231,7 +232,7 @@ fi

# source the environment file for this platform/compiler combination, then build the code
printf "... Source ENV_FILE and create BUILD directory ...\n"
module use ${SRC_DIR}/env
module use ${SRC_DIR}/modulefiles
. ${ENV_FILE}
module list
mkdir -p ${BUILD_DIR}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions docs/UsersGuide/README → doc/UsersGuide/README
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ Steps to build and use the Sphinx documentation tool:
https://sphinxcontrib-bibtex.readthedocs.io/en/latest/quickstart.html#installation

2) Create a Sphinx documentation root directory:
% mkdir docs
% cd docs
% mkdir doc
% cd doc

3) Initialize your Sphinx project (set up an initial directory structure) using
% sphinx-quickstart
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ scripts are presented in parentheses. Some directories have been removed for br
ufs-srweather-app
├── (bin)
├── (build)
├── docs
├── doc
│ └── UsersGuide
├── (include)
├── (lib)
Expand All @@ -91,7 +91,7 @@ scripts are presented in parentheses. Some directories have been removed for br
│ ├── templates
│ └── wrappers
├── (share)
└── src
└── sorc
├── UPP
│ ├── parm
│ └── sorc
Expand Down Expand Up @@ -122,7 +122,7 @@ contents of these sub-directories are described in :numref:`Table %s <Subdirecto
+-------------------------+---------------------------------------------------------+
| **Directory Name** | **Description** |
+=========================+=========================================================+
| docs | Users' Guide Documentation |
| doc | Users' Guide Documentation |
+-------------------------+---------------------------------------------------------+
| jobs | J-job scripts launched by Rocoto |
+-------------------------+---------------------------------------------------------+
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 0 additions & 6 deletions env/wflow_cheyenne.env

This file was deleted.

7 changes: 0 additions & 7 deletions env/wflow_hera.env

This file was deleted.

7 changes: 0 additions & 7 deletions env/wflow_jet.env

This file was deleted.

7 changes: 0 additions & 7 deletions env/wflow_orion.env

This file was deleted.

10 changes: 0 additions & 10 deletions env/wflow_wcoss_cray.env

This file was deleted.

9 changes: 0 additions & 9 deletions env/wflow_wcoss_dell_p3.env

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
20 changes: 17 additions & 3 deletions src/CMakeLists.txt → sorc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
include(ExternalProject)

##### CMAKE Arguments depending on exec_bin #########################

list(APPEND COMP_ARGS "-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}")
if(${exec_bin} STREQUAL "exec")
list(APPEND COMP_ARGS "-DEMC_EXEC_DIR=ON")
endif()

##### UFS_UTILS #####################################################

ExternalProject_Add(UFS_UTILS
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/UFS_UTILS
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/UFS_UTILS
INSTALL_DIR ${CMAKE_INSTALL_PREFIX}
CMAKE_ARGS "-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}"
CMAKE_ARGS ${COMP_ARGS}
BUILD_ALWAYS TRUE
)

##### ufs-weather-model #############################################

if(NOT CCPP_SUITES)
set(CCPP_SUITES "FV3_CPT_v0,FV3_GFS_2017_gfdlmp,FV3_GFS_2017_gfdlmp_regional,FV3_GSD_SAR,FV3_GSD_v0,FV3_GFS_v15p2,FV3_GFS_v16,FV3_RRFS_v1beta,FV3_HRRR,FV3_RRFS_v1alpha,FV3_GFS_v15_thompson_mynn_lam3km")
endif()
Expand Down Expand Up @@ -58,14 +69,17 @@ ExternalProject_Add(ufs-weather-model
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ufs-weather-model
INSTALL_DIR ${CMAKE_INSTALL_PREFIX}
CMAKE_ARGS ${UFS_WEATHER_MODEL_ARGS}
INSTALL_COMMAND mkdir -p ${CMAKE_INSTALL_PREFIX}/bin && cp ${CMAKE_CURRENT_BINARY_DIR}/ufs-weather-model/src/ufs-weather-model-build/ufs_model ${CMAKE_INSTALL_PREFIX}/bin/
INSTALL_COMMAND mkdir -p ${CMAKE_INSTALL_PREFIX}/${exec_bin} && cp ${CMAKE_CURRENT_BINARY_DIR}/ufs-weather-model/src/ufs-weather-model-build/ufs_model ${CMAKE_INSTALL_PREFIX}/${exec_bin}/
BUILD_ALWAYS TRUE
)

##### UPP ###########################################################

ExternalProject_Add(UPP
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/UPP
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/UPP
INSTALL_DIR ${CMAKE_INSTALL_PREFIX}
CMAKE_ARGS "-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}"
CMAKE_ARGS ${COMP_ARGS}
BUILD_ALWAYS TRUE
)

File renamed without changes.