From 0ced837862b736184ed63fdf339ad8288c91a18c Mon Sep 17 00:00:00 2001 From: Natalie Perlin <68030316+natalie-perlin@users.noreply.github.com> Date: Wed, 27 Apr 2022 12:03:29 -0400 Subject: [PATCH] Added functionality for MacOS X (#242) * Added functionality for MacOS X Functionality for MacOS, updated module list in srw_common * Update build_macos_gnu.env * Update srw_common * Update build_macos_gnu.env The env/build_mac_gnu.env does not load srw_common module, but instead loads individual HPC-stack modules built locally on the Mac that contain higher-versions of some packages. This avoids conflicts with SRW builds for other platforms. * Update srw_common corrected the version of the gftl-shared * Update build_macos_gnu.env No need to load libpng module found in srw_common, as this is not being built as a part of the hpc-stack on MacOS X, rather installed system-wide. Co-authored-by: Natalie Perlin --- env/build_macos_gccgfortran.env | 23 --------- env/build_macos_gnu.env | 85 +++++++++++++++++++++++++++++++++ env/wflow_macos.env | 18 +++++++ 3 files changed, 103 insertions(+), 23 deletions(-) delete mode 100644 env/build_macos_gccgfortran.env create mode 100644 env/build_macos_gnu.env create mode 100644 env/wflow_macos.env diff --git a/env/build_macos_gccgfortran.env b/env/build_macos_gccgfortran.env deleted file mode 100644 index de07614ef8..0000000000 --- a/env/build_macos_gccgfortran.env +++ /dev/null @@ -1,23 +0,0 @@ -#Setup instructions for macOS Mojave or Catalina using gcc-10.2.0 + gfortran-10.2.0 - -# This path should point to your NCEPLIBS install directory -export NCEPLIBS=/usr/local/NCEPLIBS-ufs-v2.0.0 - -# Need this environment script to be executable -chmod +x ${NCEPLIBS}/bin/setenv_nceplibs.sh -${NCEPLIBS}/bin/setenv_nceplibs.sh - -export CC=gcc-10 -export FC=gfortran-10 -export CXX=g++-10 -ulimit -S -s unlimited - -export NETCDF=${NCEPLIBS} -export ESMFMKFILE=${NCEPLIBS}/lib/esmf.mk -export CMAKE_PREFIX_PATH=${NCEPLIBS} - -export CMAKE_C_COMPILER=mpicc -export CMAKE_CXX_COMPILER=mpicxx -export CMAKE_Fortran_COMPILER=mpifort -export CMAKE_Platform=macosx.gnu - diff --git a/env/build_macos_gnu.env b/env/build_macos_gnu.env new file mode 100644 index 0000000000..e735e6d82c --- /dev/null +++ b/env/build_macos_gnu.env @@ -0,0 +1,85 @@ +# Setup instructions for macOS Big Sur (Darwin20) +# Compilers: gcc-11.2.0 including gfortran-11.2.0 +# MPI: openmpi/4.2.1 +# Option 1 (default) : M1 chip, arm64, running natively (not using Rosetta) +# Option 2 (uncomment if needed) Intel chip, x86_64 +# +# Option 1 (default): +export BASH_ENV=/opt/homebrew/opt/lmod/init/bash +# Option 2 (uncomment if needed): +#export BASH_ENV=/usr/local/opt/lmod/init/bash +source $BASH_ENV + +# This path should point to your HPCstack installation directory +export HPCstack=/Users/username/hpc-stack/install + +# This path should point to your SRW Application directory +export SRW=/Users/username/ufs-srweather-app + +module purge +# Load HPC stack +module use ${HPCstack}/modulefiles/stack +module load hpc +module load hpc-python +# +module load hpc-gnu +module load openmpi +module load hpc-openmpi + +module use ${SRW}/env +#module load srw_common +module load jasper/2.0.25 +module load zlib/1.2.11 + +module load hdf5/1.10.6 +module load netcdf/4.7.4 +module load pio/2.5.3 +module load esmf/8_2_0 +module load fms/2021.04 + +module load bacio/2.4.1 +module load crtm/2.3.0 +module load g2/3.4.5 +module load g2tmpl/1.10.0 +module load ip/3.3.3 +module load sp/2.3.3 +module load w3nco/2.4.1 +module load upp/10.0.10 + +module load gftl-shared/v1.3.6 +module load yafyaml/v0.5.1 +module load mapl/2.12.2-esmf-8_2_0 +module load gfsio/1.4.1 +module load landsfcutil/2.4.1 +module load nemsio/2.5.4 +module load nemsiogfs/2.5.3 +module load sfcio/1.4.1 +module load sigio/2.3.2 +module load w3emc/2.9.2 +module load wgrib2/2.0.8 +module list + +# Option 1 compiler paths: +export CC=/opt/homebrew/bin/gcc +export FC=/opt/homebrew/bin/gfortran +export CXX=/opt/homebrew/bin/g++ + +# Option 2 compiler paths: +#export CC=/usr/local/bin/gcc +#export FC=/usr/local/bin/gfortran +#export CXX=/usr/local/bin/g++ + +ulimit -S -s unlimited + +export MPI_CC=mpicc +export MPI_CXX=mpicxx +export MPI_FC=mpif90 + +export CMAKE_C_COMPILER=${MPI_CC} +export CMAKE_CXX_COMPILER=${MPI_CXX} +export CMAKE_Fortran_COMPILER=${MPI_FC} +export CMAKE_Platform=macos.gnu + +export CMAKE_Fortran_COMPILER_ID="GNU" +export LDFLAGS="-L${MPI_ROOT}/lib" +export FFLAGS="-DNO_QUAD_PRECISION -fallow-argument-mismatch " diff --git a/env/wflow_macos.env b/env/wflow_macos.env new file mode 100644 index 0000000000..a353faa9c1 --- /dev/null +++ b/env/wflow_macos.env @@ -0,0 +1,18 @@ +# Prepare environment for generating and running SRW workflow +# (wflow_macos.env) + +export CMAKE_Platform=macos + +# This path should point to your python virtual environment directory, +# `regional_workflow`, created earlier for +# +export VENV=/Users/username/venv/regional_workflow +source $VENV/bin/activate + +# Uncomment if Rocoto workflow manager is used +# This path should point to your Rocoto module location +# ROCOTOmod=/Users/username/modules +# module use ${ROCOTOmod} +# module load rocoto +# module list +