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

Commit

Permalink
Fixed issues with build scripts and the build directory
Browse files Browse the repository at this point in the history
  • Loading branch information
MintoDA1 authored and MintoDA1 committed Aug 11, 2023
1 parent 88e40e5 commit 2124551
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 8 deletions.
20 changes: 15 additions & 5 deletions buildscripts/build_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
# Determine the platform and architecture
SCRIPT_DIR=$(realpath $(dirname $0))
ROOT_DIR=$(realpath ${SCRIPT_DIR}/..)
BUILD_DIR=$(realpath ${ROOT_DIR}/build)
BUILD_DIR="${ROOT_DIR}/build"
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 Down Expand Up @@ -54,19 +55,28 @@ case $OS in
exit 0
else
echo "Docker not detected"
if [ "$ARCH" = "x86_64" ]; then
COMPILER="Intel"
else
COMPILER="GNU"
fi
fi
;;
MacOSX)
COMPILER="GNU"
;;
*)
echo "Swiftest is currently not configured to build for platform ${OS}-${ARCH}"
exit 1
;;
esac

${SCRIPT_DIR}/fetch_dependencies.sh
${SCRIPT_DIR}/make_build_environment.sh
${SCRIPT_DIR}/build_dependencies.sh
${SCRIPT_DIR}/build_swiftest.sh
/bin/bash -lic "${SCRIPT_DIR}/fetch_dependencies.sh"
if [ "$COMPILER"="GNU" ]; then
/bin/bash -lic "${SCRIPT_DIR}/make_build_environment.sh"
conda activate swiftest-build-env
fi
/bin/bash -lic "${SCRIPT_DIR}/build_dependencies.sh $COMPILER"
/bin/bash -lic "${SCRIPT_DIR}/build_swiftest.sh $COMPILER"


6 changes: 4 additions & 2 deletions buildscripts/fetch_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@
# You should have received a copy of the GNU General Public License along with Swiftest.
# If not, see: https://www.gnu.org/licenses.
SCRIPT_DIR=$(realpath $(dirname $0))
BUILD_DIR=$(realpath ${SCRIPT_DIR}/../build)

ROOT_DIR=$(realpath ${SCRIPT_DIR}/..)
BUILD_DIR="${ROOT_DIR}/build"
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

echo "Files downloaded to ${BUILD_DIR}"
8 changes: 7 additions & 1 deletion buildscripts/make_build_environment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,13 @@ else
$INSTALL_DIR/condabin/$CONDABIN init $MYSHELL
fi
$INSTALL_DIR/condabin/$CONDABIN init bash
source ~/.bashrc
if [ -f ~/.bashrc ]; then
source ~/.bashrc
fi
if [ -f ~/.bash_profile ]; then
source ~/.bash_profile
fi

export PATH=${INSTALL_DIR}/bin:$PATH
fi
cd $SCRIPT_DIR
Expand Down

0 comments on commit 2124551

Please sign in to comment.