Skip to content

Commit

Permalink
Merge pull request #118 from climbfuji/final_touches_v1p1p0_macos
Browse files Browse the repository at this point in the history
Final touches for macOS for v.1.1.0 release (stack_mac.yaml, build_esmf.sh)
  • Loading branch information
climbfuji authored Dec 2, 2020
2 parents 1cf589e + eae031d commit 902811c
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 11 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -382,9 +382,12 @@ setenv("LMOD_EXTENDED_DEFAULT", "yes")
- ESMF beta snapshot 27 does not work on macOS. `stack_mac` installs
beta 21 instead.

- NetCDF-C++ does not build with LLVM Clang. It can be disabled by setting
- NetCDF-C++ does not build with LLVM Clang. It can be disabled by setting
`disable_cxx: YES` in the stack file under the NetCDF section.

- Json-schema-validator does not build with LLVM Clang. It can be disabled
in the stack file in the json-schema-validator-section.

## Disclaimer

The United States Department of Commerce (DOC) GitHub project code is
Expand Down
9 changes: 5 additions & 4 deletions config/stack_mac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,23 @@ udunits:
hdf5:
build: YES
version: 1.10.6
shared: YES
shared: NO
enable_szip: NO
enable_zlib: YES

pnetcdf:
build: NO
version: 1.12.1
shared: YES
shared: NO

netcdf:
build: YES
shared: YES
shared: NO
enable_pnetcdf: NO
version_c: 4.7.4
version_f: 4.5.3
version_cxx: 4.3.1
disable_cxx: YES

nccmp:
build: YES
Expand All @@ -72,7 +73,7 @@ pio:
esmf:
build: YES
version: 8_1_0_beta_snapshot_21
shared: YES
shared: NO
enable_pnetcdf: NO
debug: NO

Expand Down
32 changes: 26 additions & 6 deletions libs/build_esmf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ mpi=$(echo $HPC_MPI | sed 's/\//-/g')
COMPILER=$(echo $HPC_COMPILER | cut -d/ -f1)
MPI=$(echo $HPC_MPI | cut -d/ -f1)

host=$(uname -s)

[[ $STACK_esmf_enable_pnetcdf =~ [yYtT] ]] && enable_pnetcdf=YES || enable_pnetcdf=NO
[[ ${STACK_esmf_shared} =~ [yYtT] ]] && enable_shared=YES || enable_shared=NO
[[ ${STACK_esmf_debug} =~ [yYtT] ]] && enable_debug=YES || enable_debug=NO
Expand Down Expand Up @@ -83,12 +85,18 @@ case $COMPILER in
export ESMF_F90COMPILEOPTS="-g -traceback -fp-model precise"
export ESMF_CXXCOMPILEOPTS="-g -traceback -fp-model precise"
;;
gnu|gcc )
gnu|gcc|clang )
export ESMF_COMPILER="gfortran"
export ESMF_F90COMPILEOPTS="-g -fbacktrace"
if [[ "$host" == "Darwin" ]]; then
export ESMF_CXXCOMPILEOPTS="-g -Wno-error=format-security"
else
export ESMF_CXXCOMPILEOPTS="-g"
fi
;;
clang )
export ESMF_COMPILER="gfortranclang"
;;
#clang )
# export ESMF_COMPILER="gfortranclang"
# ;;
* )
echo "Unsupported compiler = $COMPILER, ABORT!"; exit 1
;;
Expand Down Expand Up @@ -131,8 +139,19 @@ export ESMF_NETCDF_LIBPATH=$NETCDF_ROOT/lib
export ESMF_NETCDF_LIBS="-lnetcdff -lnetcdf -lhdf5_hl -lhdf5 $HDF5ExtraLibs"
export ESMF_NFCONFIG=nf-config
[[ $enable_pnetcdf =~ [yYtT] ]] && export ESMF_PNETCDF=pnetcdf-config
[[ $enable_debug =~ [yYtT] ]] && export ESMF_BOPT=g || export ESMF_BOPT=O
export ESMF_ABI=64
# Configure optimization level
if [[ $enable_debug =~ [yYtT] ]]; then
export ESMF_BOPT=g
export ESMF_OPTLEVEL="0"
else
if [[ "$host" == "Darwin" ]]; then
export ESMF_BOPT=O
export ESMF_OPTLEVEL="0"
else
export ESMF_BOPT=O
export ESMF_OPTLEVEL="2"
fi
fi

export ESMF_INSTALL_PREFIX=$prefix
export ESMF_INSTALL_BINDIR=bin
Expand All @@ -144,6 +163,7 @@ export ESMF_INSTALL_HEADERDIR=include
make info
make -j${NTHREADS:-4}
$SUDO make install
[[ $MAKE_CHECK =~ [yYtT] ]] && make check
[[ $MAKE_CHECK =~ [yYtT] ]] && make installcheck

# generate modulefile from template
Expand Down

0 comments on commit 902811c

Please sign in to comment.