Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Fixed some remaining issues with the Linux build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
MintoDA1 authored and MintoDA1 committed Sep 7, 2023
1 parent 2eba89b commit 37c7ca9
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 43 deletions.
41 changes: 0 additions & 41 deletions buildscripts/build_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
23 changes: 23 additions & 0 deletions buildscripts/build_hdf5.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
13 changes: 13 additions & 0 deletions buildscripts/build_netcdf-c.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
10 changes: 9 additions & 1 deletion buildscripts/build_netcdf-fortran.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
13 changes: 13 additions & 0 deletions buildscripts/build_zlib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]

0 comments on commit 37c7ca9

Please sign in to comment.