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

Commit

Permalink
Fixed some issues with the build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Feb 16, 2024
1 parent 7a6ae2d commit 66150cd
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 91 deletions.
11 changes: 5 additions & 6 deletions buildscripts/_build_getopts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ set -a
SCRIPT_DIR=$(realpath $(dirname $0))
ROOT_DIR=$(realpath ${SCRIPT_DIR}/..)

echo "Getting the OS and ARCH values"
# Get platform and architecture
read -r OS ARCH < <($SCRIPT_DIR/get_platform.sh)
echo "Gotem! OS: $OS, ARCH: $ARCH"
OS=$(uname -s)
ARCH=$(uname -m)

# Parse arguments
USTMT="Usage: ${0} [-d /path/to/dependency/source] [-p /prefix/path] [-m MACOSX_DEPLOYMENT_TARGET]"
Expand Down Expand Up @@ -57,16 +56,16 @@ DEPENDENCY_DIR=${DEPENDENCY_DIR:-${BUILD_DIR}}


case $OS in
Linux-gnu|Linux-ifx|Linux-ifort|Linux-mpiifort|MacOSX)
Linux*)
. ${SCRIPT_DIR}/set_environment_linux.sh
;;
MacOSX)
MacOSX|Darwin)
. ${SCRIPT_DIR}/set_environment_macos.sh
;;

*)
printf "Unknown compiler type: ${OS}\n"
echo "Valid options are Linux-gnu, Linux-ifort, Linux-ifx, or MacOSX"
echo "Valid options are Linux, MacOSX, or Darwin"
printf $USTMT
exit 1
;;
Expand Down
80 changes: 0 additions & 80 deletions buildscripts/get_platform.sh

This file was deleted.

60 changes: 55 additions & 5 deletions buildscripts/set_compilers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,67 @@
# If not, see: https://www.gnu.org/licenses.
SCRIPT_DIR=$(realpath $(dirname $0))
ROOT_DIR=$(realpath ${SCRIPT_DIR}/..)
case "$OS" in
Linux-gnu|Linux-ifx|Linux-ifort|Linux-mpiifort|MacOSX)

# Get platform and architecture
OS=$(uname -s)
ARCH=$(uname -m)

case $ARCH in
x86_64)
;;
amd64)
ARCH="x86_64"
;;
arm64)
if [ "$OS" = "Linux" ]; then
ARCH="aarch64"
fi
;;
aarch64)
if [ "$OS" = "Darwin" ]; then
ARCH="arm64"
fi
;;
*)
echo "Unknown compiler type: $OS"
echo "Valid options are Linux-gnu, Linux-ifort, Linux-ifx, or MacOSX"
echo $USTMT
echo "Swiftest is currently not configured to build for platform ${OS}-${ARCH}"
exit 1
;;
esac

case $OS in
Darwin)
OS="MacOSX"
;;
*MSYS*)
OS="Windows"
;;
*)
echo "Swiftest is currently not configured to build for platform ${OS}-${ARCH}"
exit 1
;;
esac

if [[ $OS == "Linux" ]]; then
# Check if FC is set yet, and if so, use it instead of the default
# Currently ifx support is not great
case $FC in
*ifx)
OS="Linux-ifx"
;;
*mpiifort)
OS="Linux-mpiifort"
;;
*ifort)
OS="Linux-ifort"
;;
*gfortran)
OS="Linux-gnu"
;;
*)
OS="Linux-gnu"
;;
esac
fi
set -a
case $OS in
Linux-gnu)
Expand Down

0 comments on commit 66150cd

Please sign in to comment.