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

Update develop branch: new versions, packages, package locations, fixes #525

Open
wants to merge 30 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
2936398
update met, metplus builds
Jul 4, 2023
4b3c53f
update build_metplus.sh
Jul 14, 2023
08c47b5
added building scotch library and modulefiles
Jul 14, 2023
84933cd
added openblas library build
Jul 14, 2023
ac15367
updated build_nceplibs.sh, for crtm build
Jul 14, 2023
e3f1f6c
added COMPILER and MPI options parsing options
Jul 14, 2023
0942607
modulefiles for additional compiler and mpi name options
Jul 14, 2023
7adb82e
updated and added stack configuration files
Jul 14, 2023
d2a2823
update build scripts for met, metplus, scotch
Aug 2, 2023
c269bc5
Update README.md
natalie-perlin Aug 3, 2023
4b991e2
Merge branch 'NOAA-EPIC:develop' into update_develop
natalie-perlin Aug 3, 2023
deff3fc
met and metplus builds scripts for higher versions, met/11.0.2 and me…
Aug 4, 2023
4782760
load python module only if needed in build_met.sh
Aug 4, 2023
b4a0b27
update libpng.lua module to allow for lib64 library directory name
Aug 4, 2023
52522c7
Update remote-tracking branch 'origin/update_develop' into update_dev…
Aug 4, 2023
5970f47
update build_scotch.sh script, add install_as variable
Aug 14, 2023
25bd0fb
Update build_scotch.sh
natalie-perlin Aug 14, 2023
0812c4f
Update build_nceplibs.sh to build higher versions of prod_util
Aug 15, 2023
28706e9
Merge remote-tracking branch 'origin/update_develop' into update_develop
Aug 15, 2023
3df7e85
Updated recipe for staging CRTM/2.4.0 fix files
Aug 16, 2023
44af00b
update permissions to the script files placed in ./bin
Aug 18, 2023
398559b
update met, metplus for use with mpi
Sep 2, 2023
39e59fe
corrections in build_wgrib2.sh
Sep 2, 2023
8b357e0
Update build_nceplibs.sh
natalie-perlin Oct 3, 2023
df607ef
Revert "Update build_nceplibs.sh"
Oct 12, 2023
6205a3a
update libs/build_nceplibs.sh to create nested directories with mkdir -p
Oct 12, 2023
596d15d
updates for MacOS netcdf build and configurations
Oct 20, 2023
89e169c
cleaning build_wgrib2.sh
Oct 23, 2023
1f47d35
update config_macos_gnu.sh, compile options for MacOS
Oct 31, 2023
6f9e40d
Merge pull request #14 from natalie-perlin/update_develop
natalie-perlin Nov 1, 2023
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ S4 | David Huber

## Contributors

Mark Potts, Steve Lawrence, Ed Hartnett, Guoqing Ge, Raffaele Montuoro, David Huber
Mark Potts, Steve Lawrence, Ed Hartnett, Guoqing Ge, Raffaele Montuoro, David Huber, Natalie Perlin

## Prerequisites:

Expand Down
2 changes: 2 additions & 0 deletions build_stack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ build_lib sqlite
build_lib libtiff
build_lib proj
build_lib geos
build_lib openblas

# Also build serial versions of HDF5 and netCDF, if using MODULES
if $MODULES; then
Expand Down Expand Up @@ -262,6 +263,7 @@ build_lib metplus
# UFS 3rd party dependencies

build_lib esmf
build_lib scotch
build_lib fms
build_lib cmakemodules
build_lib esma_cmake
Expand Down
14 changes: 9 additions & 5 deletions config/config_macos_gnu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ LMOD=$(brew --prefix lmod)
source $LMOD/init/profile

# Compiler/MPI combination
export HPC_COMPILER="gnu/11.3.0"
export HPC_MPI="openmpi/4.1.2"
export HPC_PYTHON="python/3.9.13"
export HPC_COMPILER="gnu/12.3.0"
export HPC_MPI="openmpi/4.1.5"
export HPC_PYTHON="python/3.11.6"

# Build options
export USE_SUDO=N
export PKGDIR=pkg
export LOGDIR=log
export OVERWRITE=N
export NTHREADS=8
export NTHREADS=4
export MAKE_CHECK=N
export MAKE_VERBOSE=Y
export MAKE_CLEAN=N
Expand All @@ -24,8 +24,12 @@ export WGET="wget -nv "

#
# gfortran-10 needs the following
export STACK_FFLAGS="-fallow-argument-mismatch -fallow-invalid-boz"
export STACK_FFLAGS="-fallow-argument-mismatch -fallow-invalid-boz -march=native "
export STACK_CFLAGS="-march=native"
export STACK_CXXFLAGS="-march=native"
export STACK_mpi_FFLAGS="-fopenmp"
export STACK_mpi_CFLAGS="-fopenmp"
export STACK_mpi_CXXFLAGS="-fopenmp"

BREW=$(brew --prefix)

Expand Down
2 changes: 2 additions & 0 deletions libs/build_esmf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ compiler=$(echo $HPC_COMPILER | sed 's/\//-/g')
mpi=$(echo $HPC_MPI | sed 's/\//-/g')

COMPILER=$(echo $HPC_COMPILER | cut -d/ -f1)
[[ "$COMPILER" = *"intel"* ]] && COMPILER="intel"
MPI=$(echo $HPC_MPI | cut -d/ -f1)
[[ "$MPI" = *"oneapi-mpi"* ]] && MPI="impi"

host=$(uname -s)
abi64=$(uname -m)
Expand Down
27 changes: 19 additions & 8 deletions libs/build_met.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,19 @@ set -eux
name="met"
version=${1:-${STACK_met_version}}
release_date=${2:-${STACK_met_release_date}}
install_as=${STACK_met_install_as:-${version}}

# Hyphenated version used for install prefix
compiler=$(echo $HPC_COMPILER | sed 's/\//-/g')
mpi=$(echo $HPC_MPI | sed 's/\//-/g')

[[ ${STACK_met_enable_python:-} =~ [yYtT] ]] && enable_python=YES || enable_python=NO

if $MODULES; then
set +x
source $MODULESHOME/init/bash
module load hpc-$HPC_COMPILER
module load hpc-$HPC_PYTHON
[[ ! -z $mpi ]] && module load hpc-$HPC_MPI
[[ ${STACK_met_enable_python:-} =~ [yYtT] ]] && module load hpc-$HPC_PYTHON
module load gsl
module load bufr
module load zlib
Expand All @@ -29,6 +30,8 @@ if $MODULES; then
set -x

prefix="${PREFIX:-"/opt/modules"}/$compiler/$name/$version"
[[ ! -z $mpi ]] && prefix="${PREFIX:-"/opt/modules"}/$compiler/$mpi/$name/$version"

if [[ -d $prefix ]]; then
if [[ $OVERWRITE =~ [yYtT] ]]; then
echo "WARNING: $prefix EXISTS: OVERWRITING!"
Expand All @@ -44,20 +47,27 @@ else

fi

if [[ ! -z $mpi ]]; then
export FC=$MPI_FC
export CC=$MPI_CC
export CXX=$MPI_CXX
else
export FC=$SERIAL_FC
export CC=$SERIAL_CC
export CXX=$SERIAL_CXX
fi

cd ${HPC_STACK_ROOT}/${PKGDIR:-"pkg"}
software=MET-$version
software=$name-$version.$release_date
pkg_name=$name-$version
URL="https://github.com/dtcenter/MET/releases/download/v$version/$software.tar.gz"
[[ -d $software ]] || ( $WGET $URL; tar -xf $software.tar.gz )
[[ -d $pkg_name || -f $software.tar.gz ]] || ( $WGET $URL )
[[ -d $pkg_name ]] || tar -xf $software.tar.gz
[[ ${DOWNLOAD_ONLY} =~ [yYtT] ]] && exit 0

export MET_BASE=$prefix/share/met

export FC=$SERIAL_FC
export CC=$SERIAL_CC
export CXX=$SERIAL_CXX

export F77=$FC
export FFLAGS="${STACK_FFLAGS:-} ${STACK_met_FFLAGS:-}"
export CFLAGS="${STACK_CFLAGS:-} ${STACK_met_CFLAGS:-}"
Expand Down Expand Up @@ -119,5 +129,6 @@ make
$SUDO make install

# generate modulefile from template
$MODULES && update_modules compiler $name $install_as
[[ -z $mpi ]] && modpath=compiler || modpath=mpi
$MODULES && update_modules $modpath $name $version
echo $name $version $URL >> ${HPC_STACK_ROOT}/hpc-stack-contents.log
121 changes: 121 additions & 0 deletions libs/build_met.sh_11.0.2
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
#!/bin/bash

set -eux

name="met"
version=${1:-${STACK_met_version}}
install_as=${STACK_met_install_as:-${version}}

# Hyphenated version used for install prefix
compiler=$(echo $HPC_COMPILER | sed 's/\//-/g')

[[ ${STACK_met_enable_python:-} =~ [yYtT] ]] && enable_python=YES || enable_python=NO

if $MODULES; then
set +x
source $MODULESHOME/init/bash
module load hpc-$HPC_COMPILER
[[ ${STACK_met_enable_python:-} =~ [yYtT] ]] && module load hpc-$HPC_PYTHON
module load gsl
module load bufr
module load zlib
module load jasper
module try-load libpng
module load g2c
module load hdf5
module load netcdf
module list
set -x

prefix="${PREFIX:-"/opt/modules"}/$compiler/$name/$version"
if [[ -d $prefix ]]; then
if [[ $OVERWRITE =~ [yYtT] ]]; then
echo "WARNING: $prefix EXISTS: OVERWRITING!"
$SUDO rm -rf $prefix
else
echo "WARNING: $prefix EXISTS, SKIPPING"
exit 0
fi
fi
else

prefix=${MET_ROOT:-"/usr/local"}

fi


cd ${HPC_STACK_ROOT}/${PKGDIR:-"pkg"}
software=MET-$version
URL="https://github.com/dtcenter/MET/archive/refs/tags/v$version.tar.gz"
[[ -d $software ]] || ( $WGET $URL; tar -xf v$version.tar.gz )
[[ ${DOWNLOAD_ONLY} =~ [yYtT] ]] && exit 0

export MET_BASE=$prefix/share/met

export FC=$SERIAL_FC
export CC=$SERIAL_CC
export CXX=$SERIAL_CXX

export F77=$FC
export FFLAGS="${STACK_FFLAGS:-} ${STACK_met_FFLAGS:-}"
export CFLAGS="${STACK_CFLAGS:-} ${STACK_met_CFLAGS:-}"

export CFLAGS+="-D__64BIT__"
export CXXFLAGS+="-D__64BIT__"

export MET_NETCDF=${NETCDF_ROOT}
export MET_HDF5=${HDF5_ROOT}

bufr_libdir=`find ${bufr_ROOT:-${BUFR_ROOT}} -name libbufr_4.a -exec dirname {} \;`
export MET_BUFRLIB=$bufr_libdir
g2c_libdir=`find ${g2c_ROOT:-${G2C_ROOT}} -name libg2c.a -exec dirname {} \;`
export MET_GRIB2CLIB=$g2c_libdir
export MET_GRIB2CINC=${G2C_ROOT:-${g2c_ROOT}}/include
export MET_GSL=${GSL_ROOT}
export BUFRLIB_NAME=-lbufr_4
export GRIB2CLIB_NAME=-lg2c
jasper_libdir=`find ${JASPER_ROOT} -name libjasper.a -exec dirname {} \;`
export LIB_JASPER=$jasper_libdir

export LIB_LIBPNG=${PNG_LIBRARIES}
export LIB_Z=${ZLIB_ROOT}/lib

if [[ $enable_python =~ [yYtT] ]]; then
export MET_PYTHON=${MET_PYTHON:-`which python3`}

if [[ -z ${MET_PYTHON_CC+x} ]]; then
#export MET_PYTHON_CC=`$MET_PYTHON_CONFIG --cflags`
echo "Set MET_PYTHON_CC to include 'Python.h' usually found through 'python3-config --cflfags'"
exit 1
fi

if [[ -z ${MET_PYTHON_LD+x} ]]; then
#export MET_PYTHON_LD=`$MET_PYTHON_CONFIG --ldflags`
echo "Set MET_PYTHON_LD to to link to libpython found through 'python3-config --ldflags"
exit 1
fi
fi

LDFLAGS2="-L${MET_NETCDF}/lib -L${MET_HDF5}/lib -L${MET_BUFRLIB}"
LDFLAGS3="-L${MET_GRIB2CLIB} -L${MET_GSL}/lib"
LDFLAGS4="-L${LIB_JASPER} -L${MET_HDF5}/lib -L${LIB_LIBPNG} -L${LIB_Z}"

export LDFLAGS="-fPIE ${LDFLAGS2:-} ${LDFLAGS3:-} ${LDFLAGS4:-}"
export LIBS="-lhdf5_hl -lhdf5 -lz -ldl"

[[ -d $software ]] && cd $software || ( echo "$software does not exist, ABORT!"; exit 1 )

cd ${HPC_STACK_ROOT}/${PKGDIR:-"pkg"}/${software}
curr_dir=$(pwd)

extra_flags="--enable-grib2 "
[[ $enable_python =~ [yYtT] ]] && extra_flags+="--enable-python "
./configure --prefix=$prefix BUFRLIB_NAME=${BUFRLIB_NAME} GRIB2CLIB_NAME=${GRIB2CLIB_NAME} ${extra_flags:-}

make
[[ $MAKE_CHECK =~ [yYtT] ]] && make check
$SUDO make install

# generate modulefile from template
$MODULES && update_modules compiler $name $install_as
echo $name $version $URL >> ${HPC_STACK_ROOT}/hpc-stack-contents.log
24 changes: 18 additions & 6 deletions libs/build_metplus.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,30 @@ version=${1:-${STACK_metplus_version}}

# Hyphenated version used for install prefix
compiler=$(echo $HPC_COMPILER | sed 's/\//-/g')
mpi=$(echo $HPC_MPI | sed 's/\//-/g')

cd ${HPC_STACK_ROOT}/${PKGDIR:-"pkg"}
software="v"$version
pkg_name=METplus-$version
met_version=${1:-${STACK_met_version}}
URL="https://github.com/dtcenter/METplus/archive/$software.tar.gz"
[[ -d $software ]] || ( $WGET $URL; tar -xf $software.tar.gz )
[[ -d $software || -f $software.tar.gz ]] || ( $WGET $URL )
[[ -d $software ]] || tar -xf $software.tar.gz
[[ -d $pkg_name ]] && cd $pkg_name || ( echo "$pkg_name does not exist, ABORT!"; exit 1 )

if $MODULES; then
prefix="${PREFIX:-"/opt/modules"}/$compiler/$name/$version"
met_prefix="${PREFIX:-"/opt/modules"}/$compiler"
source $MODULESHOME/init/bash
module load hpc-$HPC_COMPILER
[[ ! -z $mpi ]] && module load hpc-$HPC_MPI
module try-load met
echo "Using module met version (none if blank) = ${MET_VERSION:-:}"
if [[ -z $mpi ]]; then
prefix="${PREFIX:-"/opt/modules"}/$compiler/$name/$version"
met_prefix=${MET_ROOT:-"${PREFIX:-"/opt/modules"}/$compiler"}
else
prefix="${PREFIX:-"/opt/modules"}/$compiler/$mpi/$name/$version"
met_prefix=${MET_ROOT:-"${PREFIX:-"/opt/modules"}/$compiler/$mpi"}
fi
else
prefix=${MET_ROOT:-"/usr/local"}
met_prefix=$prefix
Expand All @@ -43,12 +55,12 @@ curr_dir=$(pwd)

# Update the path to the MET tools for the users
cd ${curr_dir}/parm/metplus_config
cat metplus_system.conf | \
cat defaults.conf | \
sed "s%MET_INSTALL_DIR = /path/to%MET_INSTALL_DIR = $met_prefix/met/$met_version%g" \
> metplus_system_new.conf
mv metplus_system_new.conf metplus_system.conf


# generate modulefile from template
$MODULES && update_modules compiler $name $version
[[ -z $mpi ]] && modpath=compiler || modpath=mpi
$MODULES && update_modules $modpath $name $version
echo $name $version $URL >> ${HPC_STACK_ROOT}/hpc-stack-contents.log
58 changes: 58 additions & 0 deletions libs/build_metplus.sh_5.0.2
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#!/bin/bash

set -eux

name="metplus"
version=${1:-${STACK_metplus_version}}

# Hyphenated version used for install prefix
compiler=$(echo $HPC_COMPILER | sed 's/\//-/g')

cd ${HPC_STACK_ROOT}/${PKGDIR:-"pkg"}
software="v"$version
pkg_name=METplus-$version
met_version=${1:-${STACK_met_version}}
URL="https://github.com/dtcenter/METplus/archive/$software.tar.gz"
[[ -d $software ]] || ( $WGET $URL; tar -xf $software.tar.gz )
[[ -d $pkg_name ]] && cd $pkg_name || ( echo "$pkg_name does not exist, ABORT!"; exit 1 )

if $MODULES; then
source $MODULESHOME/init/bash
module load hpc-$HPC_COMPILER
module try-load met
echo "Using module met version (none if blank) = ${MET_VERSION:-:}"
prefix="${PREFIX:-"/opt/modules"}/$compiler/$name/$version"
met_prefix=${MET_ROOT:-"${PREFIX:-"/opt/modules"}/$compiler"}
else
prefix=${MET_ROOT:-"/usr/local"}
met_prefix=$prefix
fi

if [[ -d $prefix ]]; then
if [[ $OVERWRITE =~ [yYtT] ]]; then
echo "WARNING: $prefix EXISTS: OVERWRITING!"
$SUDO rm -rf $prefix
else
echo "WARNING: $prefix EXISTS, SKIPPING"
exit 0
fi
fi

mkdir -p $prefix

# Install is simply copying over the unpacked package to the install location
cp -r ${HPC_STACK_ROOT}/${PKGDIR:-"pkg"}/${pkg_name}/* $prefix
cd $prefix
curr_dir=$(pwd)

# Update the path to the MET tools for the users
cd ${curr_dir}/parm/metplus_config
cat defaults.conf | \
sed "s%MET_INSTALL_DIR = /path/to%MET_INSTALL_DIR = $met_prefix/met/$met_version%g" \
> metplus_system_new.conf
mv metplus_system_new.conf metplus_system.conf


# generate modulefile from template
$MODULES && update_modules compiler $name $version
echo $name $version $URL >> ${HPC_STACK_ROOT}/hpc-stack-contents.log
Loading
Loading