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

Commit

Permalink
More refinements to buildscripts
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Aug 17, 2023
1 parent 9eb9c5d commit 3cad5ef
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 18 deletions.
21 changes: 5 additions & 16 deletions buildscripts/build_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,16 @@
# Determine the platform and architecture
SCRIPT_DIR=$(realpath $(dirname $0))
ROOT_DIR=$(realpath ${SCRIPT_DIR}/..)
BUILD_DIR="${ROOT_DIR}/build"
DEPENDENCY_DIR="${ROOT_DIR}/_dependencies"
PREFIX=/usr/local

# Parse arguments
USTMT="Usage: ${0} [-d {./build}|/path/to/build] [-p {/usr/local}|/prefix/path]"
IFORT=false
PREFIX=/usr/local
USTMT="Usage: ${0} [-d /path/to/dependancy/build] [-p {/usr/local}|/prefix/path]"
COMPILER=""
while getopts ":c:d:" ARG; do
while getopts ":d:p:" ARG; do
case "${ARG}" in
d)
BUILD_DIR="${OPTARG}"
DEPENDENCY_DIR="${OPTARG}"
;;
p)
PREFIX="${OPTARG}"
Expand All @@ -41,7 +39,6 @@ while getopts ":c:d:" ARG; do
esac
done

mkdir -p ${BUILD_DIR}
read -r OS ARCH < <($SCRIPT_DIR/get_platform.sh)

# Determine if we are in the correct directory (the script can either be run from the Swiftest project root directory or the
Expand All @@ -52,7 +49,6 @@ if [ ! -f "${ROOT_DIR}/setup.py" ]; then
fi
cd ${ROOT_DIR}
VERSION=$( cat version.txt )
echo "Building Swiftest version ${VERSION} for ${OS}-${ARCH}"

case $OS in
MacOSX)
Expand All @@ -66,14 +62,7 @@ case $OS in
;;
esac

mkdir -p ${BUILD_DIR}
cd $BUILD_DIR
wget -qO- https://www.zlib.net/zlib-1.2.13.tar.gz | tar xvz
wget -qO- https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.14/hdf5-1.14.1/src/hdf5-1.14.1-2.tar.gz | tar xvz
wget -qO- https://github.com/Unidata/netcdf-c/archive/refs/tags/v4.9.2.tar.gz | tar xvz
wget -qO- https://github.com/Unidata/netcdf-fortran/archive/refs/tags/v4.6.1.tar.gz | tar xvz

${SCRIPT_DIR}/build_dependencies.sh -c $COMPILER -p ${PREFIX} && \
${SCRIPT_DIR}/build_dependencies.sh -p ${PREFIX} -d ${DEPENDENCY_DIR}
${SCRIPT_DIR}/build_swiftest.sh -c $COMPILER -p ${PREFIX}


Expand Down
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ requires = [
build-backend = "setuptools.build_meta"

[tool.cibuildwheel.linux]
environment = {SKBUILD_CONFIGURE_OPTIONS="-DBUILD_SHARED_LIBS=OFF", FFLAGS="${FFLAGS} -fPIC"}
environment = {SKBUILD_CONFIGURE_OPTIONS="-DBUILD_SHARED_LIBS=OFF", FFLAGS="${FFLAGS} -fPIC", CFLAGS="${CFLAGS} -fPIC", LDFLAGS="${LDFLAGS} -fPIE"}
before-all = [
"yum install wget m4 doxygen -y",
"buildscripts/build_dependencies.sh",
"buildscripts/build_swiftest.sh -c GNU-Linux -p /usr/local"
]

0 comments on commit 3cad5ef

Please sign in to comment.