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

Print usage if machine name is not passed to lmod-setup.sh/csh. #262

Merged
Merged
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
4 changes: 2 additions & 2 deletions devbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ if [ -z "${COMPILER}" ] ; then
wcoss2) COMPILER=intel ;;
cheyenne) COMPILER=intel ;;
macos,singularity) COMPILER=gnu ;;
odin) COMPILER=intel ;;
odin,noaacloud) COMPILER=intel ;;
*)
COMPILER=intel
printf "WARNING: Setting default COMPILER=intel for new platform ${PLATFORM}\n" >&2;
Expand Down Expand Up @@ -249,7 +249,7 @@ if [ "${VERBOSE}" = true ]; then
fi

# Before we go on load modules, we first need to activate Lmod for some systems
source ${SRW_DIR}/etc/lmod-setup.sh
source ${SRW_DIR}/etc/lmod-setup.sh $MACHINE

# source the module file for this platform/compiler combination, then build the code
printf "... Load MODULE_FILE and create BUILD directory ...\n"
Expand Down
2 changes: 1 addition & 1 deletion docs/INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ source etc/lmod-setup.sh PLATFORM
# From here on, we can assume Lmod is loaded and ready to go. Then we load the specific
# module for a given PLATFORM and COMPILER as follows

module use modulefiles
module use $PWD/modulefiles #full path to modulefiles directory
module load build_[PLATFORM]_[COMPILER]

# Supported CMake flags:
Expand Down
9 changes: 8 additions & 1 deletion etc/lmod-setup.csh
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
#!/bin/csh

if ( $# == 0 ) then
set L_MACHINE=${MACHINE}
cat << EOF_USAGE
Usage: source etc/lmod-setup.csh PLATFORM

OPTIONS:
PLATFORM - name of machine you are building on
(e.g. cheyenne | hera | jet | orion | wcoss_dell_p3)
EOF_USAGE
exit 1
else
set L_MACHINE=$1
endif
Expand Down
8 changes: 8 additions & 0 deletions etc/lmod-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

if [ $# = 0 ]; then
L_MACHINE=${MACHINE}
cat << EOF_USAGE
Usage: source etc/lmod-setup.sh PLATFORM

OPTIONS:
PLATFORM - name of machine you are building on
(e.g. cheyenne | hera | jet | orion | wcoss_dell_p3)
EOF_USAGE
exit 1
else
L_MACHINE=$1
fi
Expand Down
14 changes: 12 additions & 2 deletions modulefiles/build_macos_gnu
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ proc ModulesHelp { } {
module-whatis "Loads libraries needed for building SRW on Hera"

if { [module-info mode load] } {
system "ulimit -S -s unlimited;"
puts "ulimit -S -s unlimited;"
}

# This path should point to your HPCstack installation directory
Expand Down Expand Up @@ -79,5 +79,15 @@ setenv CMAKE_Fortran_COMPILER $env(MPI_FC)
setenv CMAKE_Platform macos.gnu

setenv CMAKE_Fortran_COMPILER_ID "GNU"
setenv LDFLAGS "-L$env(MPI_ROOT)/lib"
setenv FFLAGS "-DNO_QUAD_PRECISION -fallow-argument-mismatch "

#leave setting LDFLAGS to user because MPI_ROOT does not have
#valid value before this modulefile is fully loaded.
set shell [module-info shelltype]
if {$shell == "sh"} {
puts stderr {Please execute this command:
> export LDFLAGS=-L$MPI_ROOT/lib}
} else {
puts stderr {Please execute this command:
> setenv LDFLAGS -L$MPI_ROOT/lib}
}
5 changes: 4 additions & 1 deletion modulefiles/wflow_macos
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ setenv CMAKE_Platform macos
#
setenv VENV "/Users/username/venv/regional_workflow"
if { [module-info mode load] } {
system "source $env(VENV)/bin/activate;"
puts "source $env(VENV)/bin/activate;"
}
if { [module-info mode remove] } {
puts "deactivate;"
}

# Uncomment if Rocoto workflow manager is used
Expand Down
2 changes: 1 addition & 1 deletion test/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function usage() {
exit 1
}

machines=( hera jet cheyenne orion wcoss_cray wcoss_dell_p3 gaea odin singularity )
machines=( hera jet cheyenne orion wcoss2 wcoss_dell_p3 gaea odin singularity macos noaacloud )

[[ $# -eq 2 ]] && usage

Expand Down