From 37c7ca9a5091783887bd6bf8488f054b13fccba8 Mon Sep 17 00:00:00 2001 From: MintoDA1 <51412913+MintoDA1@users.noreply.github.com> Date: Thu, 7 Sep 2023 10:57:10 -0400 Subject: [PATCH] Fixed some remaining issues with the Linux build scripts --- buildscripts/build_dependencies.sh | 41 ---------------------------- buildscripts/build_hdf5.sh | 23 ++++++++++++++++ buildscripts/build_netcdf-c.sh | 13 +++++++++ buildscripts/build_netcdf-fortran.sh | 10 ++++++- buildscripts/build_zlib.sh | 13 +++++++++ pyproject.toml | 3 +- 6 files changed, 60 insertions(+), 43 deletions(-) diff --git a/buildscripts/build_dependencies.sh b/buildscripts/build_dependencies.sh index 5fc544450..645465d22 100755 --- a/buildscripts/build_dependencies.sh +++ b/buildscripts/build_dependencies.sh @@ -17,47 +17,6 @@ set -a ARGS=$@ . ${SCRIPT_DIR}/_build_getopts.sh ${ARGS} -ZLIB_VER="1.3" -HDF5_VER="1_14_2" -NC_VER="4.9.2" -NF_VER="4.6.1" - -printf "*********************************************************\n" -printf "* FETCHING DEPENCENCY SOURCES *\n" -printf "*********************************************************\n" -printf "Copying files to ${DEPENDENCY_DIR}\n" -mkdir -p ${DEPENDENCY_DIR} -if [ ! -d ${DEPENDENCY_DIR}/zlib-${ZLIB_VER} ]; then - [ -d ${DEPENDENCY_DIR}/zlib-* ] && rm -rf ${DEPENDENCY_DIR}/zlib-* - curl -L https://github.com/madler/zlib/releases/download/v${ZLIB_VER}/zlib-${ZLIB_VER}.tar.gz | tar xvz -C ${DEPENDENCY_DIR} -fi - -printf "Checking if HDF5 source exists\n" -if [[ (-d ${DEPENDENCY_DIR}/hdfsrc) && (-f ${DEPENDENCY_DIR}/hdfsrc/README.md) ]]; then - OLDVER=$(grep version ${DEPENDENCY_DIR}/hdfsrc/README.md | awk '{print $3}' | sed 's/\./_/g') - printf "Existing copy of HDF5 source detected\n" - printf "Existing version : ${OLDVER}\n" - printf "Requested version: ${HDF5_VER}\n" - if [ "$OLDVER" != "${HDF5_VER}" ]; then - printf "Existing version of HDF5 source doesn't match requested. Deleting\n" - rm -rf ${DEPENDENCY_DIR}/hdfsrc - fi -fi - -if [ ! -d ${DEPENDENCY_DIR}/hdfsrc ]; then - curl -s -L https://github.com/HDFGroup/hdf5/releases/download/hdf5-${HDF5_VER}/hdf5-${HDF5_VER}.tar.gz | tar xvz -C ${DEPENDENCY_DIR} -fi - -if [ ! -d ${DEPENDENCY_DIR}/netcdf-c-${NC_VER} ]; then - [ -d ${DEPENDENCY_DIR}/netcdf-c-* ] && rm -rf ${DEPENDENCY_DIR}/netcdf-c-* - curl -s -L https://github.com/Unidata/netcdf-c/archive/refs/tags/v${NC_VER}.tar.gz | tar xvz -C ${DEPENDENCY_DIR} -fi - -if [ ! -d ${DEPENDENCY_DIR}/netcdf-fortran-${NF_VER} ]; then - [ -d ${DEPENDENCY_DIR}/netcdf-fortran-* ] && rm -rf ${DEPENDENCY_DIR}/netcdf-fortran-* - curl -s -L https://github.com/Unidata/netcdf-fortran/archive/refs/tags/v${NF_VER}.tar.gz | tar xvz -C ${DEPENDENCY_DIR} -fi - cd $ROOT_DIR printf "*********************************************************\n" printf "* STARTING DEPENDENCY BUILD *\n" diff --git a/buildscripts/build_hdf5.sh b/buildscripts/build_hdf5.sh index 4fa633582..d351bd47d 100755 --- a/buildscripts/build_hdf5.sh +++ b/buildscripts/build_hdf5.sh @@ -15,6 +15,29 @@ set -a ARGS=$@ . ${SCRIPT_DIR}/_build_getopts.sh ${ARGS} +HDF5_VER="1_14_2" +printf "*********************************************************\n" +printf "* FETCHING HDF5 SOURCE *\n" +printf "*********************************************************\n" +printf "Copying files to ${DEPENDENCY_DIR}\n" + +printf "Checking if HDF5 source exists\n" +if [[ (-d ${DEPENDENCY_DIR}/hdfsrc) && (-f ${DEPENDENCY_DIR}/hdfsrc/README.md) ]]; then + OLDVER=$(grep version ${DEPENDENCY_DIR}/hdfsrc/README.md | awk '{print $3}' | sed 's/\./_/g') + printf "Existing copy of HDF5 source detected\n" + printf "Existing version : ${OLDVER}\n" + printf "Requested version: ${HDF5_VER}\n" + if [ "$OLDVER" != "${HDF5_VER}" ]; then + printf "Existing version of HDF5 source doesn't match requested. Deleting\n" + rm -rf ${DEPENDENCY_DIR}/hdfsrc + fi +fi + +if [ ! -d ${DEPENDENCY_DIR}/hdfsrc ]; then + curl -s -L https://github.com/HDFGroup/hdf5/releases/download/hdf5-${HDF5_VER}/hdf5-${HDF5_VER}.tar.gz | tar xvz -C ${DEPENDENCY_DIR} +fi + + printf "\n" printf "*********************************************************\n" printf "* BUILDING HDF5 LIBRARY *\n" diff --git a/buildscripts/build_netcdf-c.sh b/buildscripts/build_netcdf-c.sh index d11f39126..8f692fac1 100755 --- a/buildscripts/build_netcdf-c.sh +++ b/buildscripts/build_netcdf-c.sh @@ -16,6 +16,19 @@ set -a ARGS=$@ . ${SCRIPT_DIR}/_build_getopts.sh ${ARGS} + +NC_VER="4.9.2" + +printf "*********************************************************\n" +printf "* FETCHING NETCDF-C SOURCE *\n" +printf "*********************************************************\n" +printf "Copying files to ${DEPENDENCY_DIR}\n" + +if [ ! -d ${DEPENDENCY_DIR}/netcdf-c-${NC_VER} ]; then + [ -d ${DEPENDENCY_DIR}/netcdf-c-* ] && rm -rf ${DEPENDENCY_DIR}/netcdf-c-* + curl -s -L https://github.com/Unidata/netcdf-c/archive/refs/tags/v${NC_VER}.tar.gz | tar xvz -C ${DEPENDENCY_DIR} +fi + printf "\n" printf "*********************************************************\n" printf "* BUILDING NETCDF-C LIBRARY *\n" diff --git a/buildscripts/build_netcdf-fortran.sh b/buildscripts/build_netcdf-fortran.sh index 064903224..aea5e71aa 100755 --- a/buildscripts/build_netcdf-fortran.sh +++ b/buildscripts/build_netcdf-fortran.sh @@ -15,7 +15,15 @@ set -a ARGS=$@ . ${SCRIPT_DIR}/_build_getopts.sh ${ARGS} -LIBS="$(${PREFIX}/bin/nc-config --libs --static)" +NF_VER="4.6.1" +printf "*********************************************************\n" +printf "* FETCHING NETCDF-FORTRAN SOURCE *\n" +printf "*********************************************************\n" +printf "Copying files to ${DEPENDENCY_DIR}\n" +if [ ! -d ${DEPENDENCY_DIR}/netcdf-fortran-${NF_VER} ]; then + [ -d ${DEPENDENCY_DIR}/netcdf-fortran-* ] && rm -rf ${DEPENDENCY_DIR}/netcdf-fortran-* + curl -s -L https://github.com/Unidata/netcdf-fortran/archive/refs/tags/v${NF_VER}.tar.gz | tar xvz -C ${DEPENDENCY_DIR} +fi printf "\n" printf "*********************************************************\n" diff --git a/buildscripts/build_zlib.sh b/buildscripts/build_zlib.sh index 99571d8f3..e21b75b47 100755 --- a/buildscripts/build_zlib.sh +++ b/buildscripts/build_zlib.sh @@ -15,6 +15,19 @@ set -a ARGS=$@ . ${SCRIPT_DIR}/_build_getopts.sh ${ARGS} + +ZLIB_VER="1.3" + +printf "*********************************************************\n" +printf "* FETCHING ZLIB SOURCE *\n" +printf "*********************************************************\n" +printf "Copying files to ${DEPENDENCY_DIR}\n" +mkdir -p ${DEPENDENCY_DIR} +if [ ! -d ${DEPENDENCY_DIR}/zlib-${ZLIB_VER} ]; then + [ -d ${DEPENDENCY_DIR}/zlib-* ] && rm -rf ${DEPENDENCY_DIR}/zlib-* + curl -L https://github.com/madler/zlib/releases/download/v${ZLIB_VER}/zlib-${ZLIB_VER}.tar.gz | tar xvz -C ${DEPENDENCY_DIR} +fi + printf "*********************************************************\n" printf "* BUILDING ZLIB LIBRARY *\n" printf "*********************************************************\n" diff --git a/pyproject.toml b/pyproject.toml index eb4616479..433dfbcda 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -65,5 +65,6 @@ build-verbosity = 1 repair-wheel-command = "auditwheel repair -w {dest_dir} {wheel}" environment = {NETCDF_FORTRAN_HOME="/usr/local", NETCDF_INCLUDE="/usr/local/include", LD_LIBRARY_PATH="/usr/local/lib:/project/lib", CPATH="/usr/local/include:/project/include"} before-all = [ - "yum install -y epel-release && yum install -y netcdf-fortran netcdf-devel || apt-get install -y netcdf-fortran", + "yum install doxygen libxml2-devel libcurl-devel -y", + "buildscripts/build_dependencies.sh -p /usr/local" ]