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

Commit

Permalink
Adjusted Mac build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Aug 28, 2023
1 parent e7c27a4 commit f8c8651
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
5 changes: 3 additions & 2 deletions buildscripts/_build_getopts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ SCRIPT_DIR=$(realpath $(dirname $0))
ROOT_DIR=$(realpath ${SCRIPT_DIR}/..)

# Parse arguments
USTMT="Usage: ${0} <-d /path/to/dependency/source> [-p /prefix/path|{/usr/local}] [-m MACOSX_DEPLOYMENT_TARGET|{11.0}]"
USTMT="Usage: ${0} <-d /path/to/dependency/source> [-p /prefix/path|{/usr/local}] [-m MACOSX_DEPLOYMENT_TARGET|{10.9}]"
PREFIX=/usr/local
DEPENDENCY_DIR="${ROOT_DIR}/_dependencies"
MACOSX_DEPLOYMENT_TARGET="13.0"
MACOSX_DEPLOYMENT_TARGET="10.9"
while getopts ":d:p:m:h" ARG; do
case "${ARG}" in
d)
Expand Down Expand Up @@ -62,6 +62,7 @@ if [ -z ${DEPENDENCY_ENV_VARS+x} ]; then
NCDIR="${PREFIX}"
NFDIR="${PREFIX}"
NETCDF_FORTRAN_HOME=${NFDIR}
NETCDF_INCLUDE=${NFDIR}/include
NETCDF_HOME=${NCDIR}

DEPENDENCY_ENV_VARS=true
Expand Down
1 change: 1 addition & 0 deletions buildscripts/build_swiftest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ printf "CPATH: ${CPATH}\n"
printf "LD_LIBRARY_PATH: ${LD_LIBRARY_PATH}\n"
printf "LDFLAGS: ${LDFLAGS}\n"
printf "NETCDF_FORTRAN_HOME: ${NETCDF_FORTRAN_HOME}\n"
printf "NETCDF_INCLUDE: ${NETCDF_INCLUDE}\n"
printf "SKBUILD_CONFIGURE_OPTIONS: ${SKBUILD_CONFIGURE_OPTIONS}\n"
if [ $OS = "MacOSX" ]; then
printf "MACOSX_DEPLOYMENT_TARGET: ${MACOSX_DEPLOYMENT_TARGET}\n"
Expand Down
6 changes: 3 additions & 3 deletions buildscripts/set_compilers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ case $OS in
CFLAGS="-mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET} -Wno-deprecated-non-prototype ${CFLAGS}"
else
if $(brew --version &> /dev/null); then
brew install gcc
brew install gcc libomp
else
echo \"Please install Homebrew first\"
exit 1
Expand All @@ -129,9 +129,9 @@ case $OS in
RANLIB=${RANLIB:-${COMPILER_PREFIX}/bin/gcc-ranlib-13}
FC=${FC:-${COMPILER_PREFIX}/bin/gfortran-13}
LD_LIBRARY_PATH="${COMPILER_PREFIX}/lib/gcc/13:${LD_LIBRARY_PATH}"
LDFLAGS="-L${HOMEBREW_PREFIX}/opt/llvm/lib/c++ -Wl,-rpath,${HOMEBREW_PREFIX}/opt/llvm/lib/c+ -Wl,-no_compact_unwind"
LDFLAGS="-L${HOMEBREW_PREFIX}/opt/llvm/lib/c++ -Wl,-rpath,${HOMEBREW_PREFIX}/opt/llvm/lib/c+ -L${HOMEBREW_PREFIX}/opt/libomp/lib -Wl,-no_compact_unwind"
CPPFLAGS="-isystem ${HOMEBREW_PREFIX}/opt/libomp/include"
LIBS="-lgomp ${LIBS}"
LIBS="-lomp ${LIBS}"
CPATH="${FROOT}/include:${CPATH}"
CXXFLAGS="${CFLAGS} ${CXXFLAGS}"
FCFLAGS="${CFLAGS} ${FCFLAGS}"
Expand Down

0 comments on commit f8c8651

Please sign in to comment.