From c9b736aa015505ed94b9597005683888a0d163b7 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Wed, 2 Dec 2020 06:18:13 -0700 Subject: [PATCH 1/3] Build static packages by default on macOS, turn off json-schema-validator and several jedi packages --- config/stack_mac.yaml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/config/stack_mac.yaml b/config/stack_mac.yaml index c14f1610..ccb7ddf0 100644 --- a/config/stack_mac.yaml +++ b/config/stack_mac.yaml @@ -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 @@ -72,7 +73,7 @@ pio: esmf: build: YES version: 8_1_0_beta_snapshot_21 - shared: YES + shared: NO enable_pnetcdf: NO debug: NO @@ -241,25 +242,25 @@ json: version: 3.9.1 json_schema_validator: - build: YES + build: NO version: 2.1.0 ecbuild: - build: YES + build: NO version: release-stable repo: jcsda eckit: - build: YES + build: NO version: release-stable repo: jcsda fckit: - build: YES + build: NO version: release-stable repo: jcsda atlas: - build: YES + build: NO version: release-stable repo: jcsda From 4f4692a49443dd6a3296ff50b3abc250b4412865 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Wed, 2 Dec 2020 06:20:35 -0700 Subject: [PATCH 2/3] Update libs/build_esmf.sh with correct compiler flags for macOS and other platforms --- libs/build_esmf.sh | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/libs/build_esmf.sh b/libs/build_esmf.sh index e85769ba..006aad23 100755 --- a/libs/build_esmf.sh +++ b/libs/build_esmf.sh @@ -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 @@ -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 ;; @@ -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 @@ -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 From eae031d7497c80967add7619af5668f6fc1e2307 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Wed, 2 Dec 2020 07:34:13 -0700 Subject: [PATCH 3/3] Address reviewer comments --- README.md | 5 ++++- config/stack_mac.yaml | 10 +++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 1c1b7a67..28f74e88 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/config/stack_mac.yaml b/config/stack_mac.yaml index ccb7ddf0..28fb7b9a 100644 --- a/config/stack_mac.yaml +++ b/config/stack_mac.yaml @@ -242,25 +242,25 @@ json: version: 3.9.1 json_schema_validator: - build: NO + build: YES version: 2.1.0 ecbuild: - build: NO + build: YES version: release-stable repo: jcsda eckit: - build: NO + build: YES version: release-stable repo: jcsda fckit: - build: NO + build: YES version: release-stable repo: jcsda atlas: - build: NO + build: YES version: release-stable repo: jcsda