Skip to content

Commit 359b601

Browse files
committed
CI: Add option to set MacOS deployment target if building on MacOS
1 parent aee0302 commit 359b601

File tree

3 files changed

+95
-77
lines changed

3 files changed

+95
-77
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ manually as detailed in
6666
| USE_PROXY | YES, NO | NO | Sandia specific -- use proxy when downloading tar files |
6767
| DEBUG | YES, NO | NO | Build debug executable; default is optimized
6868
| SHARED | YES, NO | YES | Build shared libraries if YES, archive (.a) if NO |
69+
| OSX_TARGET | version | default | If on MacOS, the minimum version the binaries are to be deployed on |
6970
| CRAY | YES, NO | YES | Is this a Cray system (special parallel options) |
7071
| NEEDS_ZLIB | YES, NO | NO | If system does not have zlib installed, download and install it (HDF5 compression). |
7172
| USE\_ZLIB\_NG | YES, NO | NO | Should the improved [zlib-ng](https://github.com/zlib-ng/zlib-ng) library be used to provide ZLIB capability |

cmake-config

Lines changed: 37 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -80,17 +80,17 @@ FMT_PATH=${FMT_PATH:-${INSTALL_PATH}}
8080
if [ "${MPI}" = "" ]
8181
then
8282
if [[ -f "$NETCDF_PATH/bin/nc-config" ]]; then
83-
netcdf_parallel=$($NETCDF_PATH/bin/nc-config --has-parallel)
84-
if [ "${netcdf_parallel}" == "yes" ]
85-
then
86-
MPI=YES
87-
else
88-
MPI=NO
89-
fi
83+
netcdf_parallel=$($NETCDF_PATH/bin/nc-config --has-parallel)
84+
if [ "${netcdf_parallel}" == "yes" ]
85+
then
86+
MPI=YES
87+
else
88+
MPI=NO
89+
fi
9090
else
91-
echo "Unable to determine whether netCDF is parallel or serial. Assuming serial"
92-
echo "Set either \"NETCDF_PATH\" or \"MPI\" manually if the assumption is incorrect."
93-
MPI=NO
91+
echo "Unable to determine whether netCDF is parallel or serial. Assuming serial"
92+
echo "Set either \"NETCDF_PATH\" or \"MPI\" manually if the assumption is incorrect."
93+
MPI=NO
9494
fi
9595
fi
9696

@@ -195,10 +195,10 @@ then
195195
else
196196
SUBSET_OPTIONS="-DSeacas_ENABLE_ALL_PACKAGES:BOOL=OFF \
197197
-DSeacas_ENABLE_ALL_OPTIONAL_PACKAGES:BOOL=OFF \
198-
-DSeacas_ENABLE_SECONDARY_TESTED_CODE:BOOL=OFF \
198+
-DSeacas_ENABLE_SECONDARY_TESTED_CODE:BOOL=OFF \
199199
-DSeacas_ENABLE_SEACASIoss:BOOL=ON \
200-
-DSeacas_ENABLE_SEACASExodus:BOOL=ON \
201-
-DSeacas_ENABLE_SEACASExodus_for:BOOL=ON \
200+
-DSeacas_ENABLE_SEACASExodus:BOOL=ON \
201+
-DSeacas_ENABLE_SEACASExodus_for:BOOL=ON \
202202
-DSeacas_ENABLE_SEACASExoIIv2for32:BOOL=ON"
203203

204204
if [ "${APPLICATIONS}" == "YES" ]
@@ -220,10 +220,10 @@ then
220220
-DSeacas_ENABLE_SEACASNemspread:BOOL=ON"
221221

222222
if [ "${FORTRAN}" == "YES" ]
223-
then
224-
SUBSET_OPTIONS="${SUBSET_OPTIONS} \
225-
-DSeacas_ENABLE_SEACASExplore:BOOL=ON \
226-
-DSeacas_ENABLE_SEACASGrepos:BOOL=ON"
223+
then
224+
SUBSET_OPTIONS="${SUBSET_OPTIONS} \
225+
-DSeacas_ENABLE_SEACASExplore:BOOL=ON \
226+
-DSeacas_ENABLE_SEACASGrepos:BOOL=ON"
227227
fi
228228

229229
elif [ "${LEGACY}" == "YES" ] && [ "${FORTRAN}" == "YES" ]
@@ -293,13 +293,13 @@ if [ ! -z ${DEBUG+x} ]
293293
then
294294
if [ "${DEBUG}" == "ON" ] || [ "${DEBUG}" == "YES" ] || [ "${DEBUG}" == "on" ] || [ "${DEBUG}" == "yes" ]
295295
then
296-
BUILD_TYPE="DEBUG"
296+
BUILD_TYPE="DEBUG"
297297
elif [ "${DEBUG}" == "OFF" ] || [ "${DEBUG}" == "NO" ] || [ "${DEBUG}" == "off" ] || [ "${DEBUG}" == "no" ]
298298
then
299-
BUILD_TYPE="RELEASE"
299+
BUILD_TYPE="RELEASE"
300300
else
301-
echo "${txtred}\nERROR: Invalid value for DEBUG ('$DEBUG') -- Must be ON, YES, NO, or OFF\n${txtrst}" >& 2
302-
exit
301+
echo "${txtred}\nERROR: Invalid value for DEBUG ('$DEBUG') -- Must be ON, YES, NO, or OFF\n${txtrst}" >& 2
302+
exit
303303
fi
304304
fi
305305

@@ -319,9 +319,9 @@ function check_enable()
319319
local path=$1
320320
if [ -e "${path}" ]
321321
then
322-
echo "YES"
322+
echo "YES"
323323
else
324-
echo "NO"
324+
echo "NO"
325325
fi
326326
}
327327

@@ -379,9 +379,9 @@ OS=$(uname -s)
379379
if [ "$SHARED" == "YES" ]
380380
then
381381
if [ "$OS" == "Darwin" ] ; then
382-
LD_EXT="dylib"
382+
LD_EXT="dylib"
383383
else
384-
LD_EXT="so"
384+
LD_EXT="so"
385385
fi
386386
else
387387
# NOTE: Some systems may need `curl` added to Seacas_EXTRA_LINK_FLAGS`
@@ -394,9 +394,9 @@ fi
394394
if [ "${HAVE_KOKKOS}" == "YES" ]
395395
then
396396
KOKKOS_SYMBOLS="-DKOKKOS_SRC_PATH:PATH=${INSTALL_PATH}/TPL/kokkos/kokkos \
397-
-DTPL_Kokkos_LIBRARY_DIRS:PATH=${KOKKOS_PATH}/lib \
398-
-DTPL_Kokkos_INCLUDE_DIRS:PATH=${KOKKOS_PATH}/include \
399-
-DTPL_Kokkos_LIBRARIES=${KOKKOS_PATH}/lib/libkokkoscore.${LD_EXT}"
397+
-DTPL_Kokkos_LIBRARY_DIRS:PATH=${KOKKOS_PATH}/lib \
398+
-DTPL_Kokkos_INCLUDE_DIRS:PATH=${KOKKOS_PATH}/include \
399+
-DTPL_Kokkos_LIBRARIES=${KOKKOS_PATH}/lib/libkokkoscore.${LD_EXT}"
400400
fi
401401

402402
if [ "$HAVE_FAODEL" == "YES" ]
@@ -417,7 +417,11 @@ then
417417
fi
418418

419419
if [ "$OS" == "Darwin" ] ; then
420-
DARWIN_OPT="-D CMAKE_MACOSX_RPATH:BOOL=ON -D TPL_X11_INCLUDE_DIRS:PATH=/opt/X11/include"
420+
OSX_TARGET=${OSX_TARGET:-}
421+
if [ "$OSX_TARGET" != "" ] ; then
422+
OSX_TARGET_OPT="-DCMAKE_OSX_DEPLOYMENT_TARGET=${OSX_TARGET}"
423+
fi
424+
DARWIN_OPT="-D CMAKE_MACOSX_RPATH:BOOL=ON -D TPL_X11_INCLUDE_DIRS:PATH=/opt/X11/include ${OSX_TARGET_OPT}"
421425
else
422426
DARWIN_OPT=""
423427
fi
@@ -430,7 +434,7 @@ if [[ "$DOXYGEN" == "NO" && "$OS" == "Darwin" && "$MPI" == "NO" ]] ; then
430434
branch=$(git branch |grep \* |cut -c3-)
431435
USER=$(id -nu)
432436
if [ "$USER" == "gdsjaar" ] && [ "$branch" == "master" ]; then
433-
DOXYGEN=YES
437+
DOXYGEN=YES
434438
fi
435439
fi
436440

@@ -588,6 +592,9 @@ echo " FAODEL: ${HAVE_FAODEL}"
588592
echo " GTEST: ${HAVE_GTEST}"
589593
echo " CATCH2: ${HAVE_CATCH2}"
590594
echo " DOXYGEN: ${DOXYGEN}"
595+
if [ "$OSX_TARGET" != "" ] ; then
596+
echo " OSX_TARGET: ${OSX_TARGET}"
597+
fi
591598
echo ""
592599

593600
if [ "${TRAVIS}" == "true" ]

install-tpl.sh

Lines changed: 57 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,13 @@ else
185185
LD_EXT="a"
186186
fi
187187

188+
if [ "$OS" == "Darwin" ] ; then
189+
OSX_TARGET=${OSX_TARGET:-}
190+
if [ "$OSX_TARGET" != "" ] ; then
191+
export MACOS_DEPLOYMENT_TARGET=${OSX_TARGET}
192+
fi
193+
fi
194+
188195
if [ $# -gt 0 ]; then
189196
if [ "$1" == "--help" ]; then
190197
echo "${txtcyn}Environment Variables used in the script and their default values:"
@@ -201,6 +208,9 @@ if [ $# -gt 0 ]; then
201208
echo " SHARED = ${SHARED}"
202209
echo " DEBUG = ${DEBUG}"
203210
echo " USE_PROXY = ${USE_PROXY}"
211+
if [ "$OS" == "Darwin" ] ; then
212+
echo " OSX_TARGET = ${OSX_TARGET:-default}"
213+
fi
204214
echo ""
205215
echo " NETCDF = ${NETCDF}"
206216
echo " PNETCDF = ${PNETCDF}"
@@ -415,43 +425,43 @@ if [ "$HDF5" == "YES" ]
415425
then
416426
if [ "$FORCE" == "YES" ] || [ "$FORCE_HDF5" == "YES" ] || ! [ -e $INSTALL_PATH/lib/libhdf5.${LD_EXT} ]
417427
then
418-
hdf_suffix=""
419-
if [ "${H5VERSION}" == "V110" ]; then
420-
hdf_version="hdf5-1_10_11"
421-
elif [ "${H5VERSION}" == "V112" ]; then
428+
hdf_suffix=""
429+
if [ "${H5VERSION}" == "V110" ]; then
430+
hdf_version="hdf5-1_10_11"
431+
elif [ "${H5VERSION}" == "V112" ]; then
422432
hdf_version="hdf5-1_12_3"
423-
elif [ "${H5VERSION}" == "V114" ]; then
433+
elif [ "${H5VERSION}" == "V114" ]; then
424434
hdf_version="hdf5_1.14.6"
425-
elif [ "${H5VERSION}" == "develop" ]; then
435+
elif [ "${H5VERSION}" == "develop" ]; then
426436
hdf_version="develop"
427-
else
437+
else
428438
echo 1>&2 ${txtred}Invalid HDF5 version specified: ${H5VERSION}. Must be one of V110, V112, or V114 [default]. exiting.${txtrst}
429439
exit 1
430-
fi
431-
432-
echo "${txtgrn}+++ HDF5 ${hdf_version}${txtrst}"
433-
434-
cd $ACCESS || exit
435-
cd TPL/hdf5 || exit
436-
if [ "$DOWNLOAD" == "YES" ]
437-
then
440+
fi
441+
442+
echo "${txtgrn}+++ HDF5 ${hdf_version}${txtrst}"
443+
444+
cd $ACCESS || exit
445+
cd TPL/hdf5 || exit
446+
if [ "$DOWNLOAD" == "YES" ]
447+
then
438448
echo "${txtgrn}+++ Downloading...${txtrst}"
439449
rm -rf hdf5-${hdf_version}${hdf_suffix}
440450
rm -f hdf5-${hdf_version}${hdf_suffix}.tar.bz2
441451
if [ "${H5VERSION}" == "develop" ]; then
442-
git clone --depth=1 https://github.com/HDFGroup/hdf5.git hdf5-develop
452+
git clone --depth=1 https://github.com/HDFGroup/hdf5.git hdf5-develop
443453
else
444-
curl -O -L --insecure https://github.com/HDFGroup/hdf5/archive/refs/tags/${hdf_version}.tar.gz
454+
curl -O -L --insecure https://github.com/HDFGroup/hdf5/archive/refs/tags/${hdf_version}.tar.gz
445455
fi
446456
if [ "${H5VERSION}" != "develop" ]
447457
then
448-
tar -zxf ${hdf_version}.tar.gz
449-
rm -f ${hdf_version}.tar.gz
458+
tar -zxf ${hdf_version}.tar.gz
459+
rm -f ${hdf_version}.tar.gz
450460
fi
451-
fi
452-
453-
if [ "$BUILD" == "YES" ]
454-
then
461+
fi
462+
463+
if [ "$BUILD" == "YES" ]
464+
then
455465
echo "${txtgrn}+++ Configuring, Building, and Installing...${txtrst}"
456466
cd hdf5-${hdf_version} || exit
457467
rm -rf build
@@ -461,23 +471,23 @@ then
461471
#CRAY=${CRAY} H5VERSION=${H5VERSION} DEBUG=${DEBUG} SHARED=${SHARED} NEEDS_ZLIB=${NEEDS_ZLIB} NEEDS_SZIP=${NEEDS_SZIP} MPI=${MPI} bash ../runconfigure.sh
462472
if [[ $? != 0 ]]
463473
then
464-
echo 1>&2 ${txtred}couldn\'t configure hdf5. exiting.${txtrst}
465-
exit 1
474+
echo 1>&2 ${txtred}couldn\'t configure hdf5. exiting.${txtrst}
475+
exit 1
466476
fi
467477
make -j${JOBS} && ${SUDO} make "V=${VERBOSE}" install
468478
if [[ $? != 0 ]]
469479
then
470-
echo 1>&2 ${txtred}couldn\'t build hdf5. exiting.${txtrst}
471-
exit 1
480+
echo 1>&2 ${txtred}couldn\'t build hdf5. exiting.${txtrst}
481+
exit 1
472482
fi
473-
fi
474-
# Create default plugin directory...
475-
mkdir ${INSTALL_PATH}/lib
476-
mkdir ${INSTALL_PATH}/lib/hdf5
477-
mkdir ${INSTALL_PATH}/lib/hdf5/lib
478-
mkdir ${INSTALL_PATH}/lib/hdf5/lib/plugin
483+
fi
484+
# Create default plugin directory...
485+
mkdir ${INSTALL_PATH}/lib
486+
mkdir ${INSTALL_PATH}/lib/hdf5
487+
mkdir ${INSTALL_PATH}/lib/hdf5/lib
488+
mkdir ${INSTALL_PATH}/lib/hdf5/lib/plugin
479489
else
480-
echo "${txtylw}+++ HDF5 already installed. Skipping download and installation.${txtrst}"
490+
echo "${txtylw}+++ HDF5 already installed. Skipping download and installation.${txtrst}"
481491
fi
482492
fi
483493

@@ -554,7 +564,7 @@ then
554564

555565
if [ "$netcdf_version" == "v4.9.3" ]
556566
then
557-
PREFIX="NETCDF_"
567+
PREFIX="NETCDF_"
558568
fi
559569

560570
if [ "$BUILD" == "YES" ]
@@ -564,10 +574,10 @@ then
564574
rm -rf build
565575
mkdir build
566576
cd build || exit
567-
if [ "$HDF5" == "YES" ]
568-
then
577+
if [ "$HDF5" == "YES" ]
578+
then
569579
export HDF5_PLUGIN_PATH=${INSTALL_PATH}/lib/hdf5/lib/plugin
570-
fi
580+
fi
571581
PREFIX=${PREFIX} CRAY=${CRAY} SHARED=${SHARED} DEBUG=${DEBUG} HDF5=${HDF5} NEEDS_ZLIB=${NEEDS_ZLIB} MPI=${MPI} bash -x ../../runcmake.sh
572582
if [[ $? != 0 ]]
573583
then
@@ -591,7 +601,7 @@ if [ "$CGNS" == "YES" ] && [ "$HDF5" == "YES" ]
591601
then
592602
if [ "$FORCE" == "YES" ] || [ "$FORCE_CGNS" == "YES" ] || ! [ -e $INSTALL_PATH/lib/libcgns.${LD_EXT} ]
593603
then
594-
cgns_version="v4.5.0"
604+
cgns_version="v4.5.0"
595605
echo "${txtgrn}+++ CGNS ${cgns_version} ${txtrst}"
596606
cd $ACCESS || exit
597607
cd TPL/cgns || exit
@@ -861,15 +871,15 @@ if [ "$ADIOS2" == "YES" ]
861871
then
862872
if [ "$FORCE" == "YES" ] || [ "$FORCE_ADIOS2" == "YES" ] || ! [ -e $INSTALL_PATH/lib/libadios2_c.${LD_EXT} ]
863873
then
864-
adios2_version="v2.10.2"
874+
adios2_version="v2.10.2"
865875
echo "${txtgrn}+++ ADIOS2 ${adios2_version} ${txtrst}"
866876
cd $ACCESS || exit
867877
cd TPL/adios2 || exit
868878
if [ "$DOWNLOAD" == "YES" ]
869879
then
870880
echo "${txtgrn}+++ Downloading...${txtrst}"
871881
rm -rf ADIOS2
872-
git clone --depth 1 --branch ${adios2_version} https://github.com/ornladios/ADIOS2.git
882+
git clone --depth 1 --branch ${adios2_version} https://github.com/ornladios/ADIOS2.git
873883
fi
874884

875885
if [ "$BUILD" == "YES" ]
@@ -1075,15 +1085,15 @@ then
10751085
BOOST_VER="1_82_0"
10761086
if [ "$DOWNLOAD" == "YES" ]
10771087
then
1078-
curl -O -L --insecure "https://boostorg.jfrog.io/artifactory/main/release/1.82.0/source/boost_${BOOST_VER}.tar.bz2"
1079-
tar xf boost_${BOOST_VER}.tar.bz2
1088+
curl -O -L --insecure "https://boostorg.jfrog.io/artifactory/main/release/1.82.0/source/boost_${BOOST_VER}.tar.bz2"
1089+
tar xf boost_${BOOST_VER}.tar.bz2
10801090
fi
10811091
if [ "$BUILD" == "YES" ]
10821092
then
1083-
echo "${txtgrn}+++ Configuring, Building, and Installing...${txtrst}"
1084-
cd boost_${BOOST_VER}
1085-
./bootstrap.sh --prefix=${INSTALL_PATH}
1086-
./b2 -a install
1093+
echo "${txtgrn}+++ Configuring, Building, and Installing...${txtrst}"
1094+
cd boost_${BOOST_VER}
1095+
./bootstrap.sh --prefix=${INSTALL_PATH}
1096+
./b2 -a install
10871097
fi
10881098
else
10891099
echo "${txtylw}+++ Boost already installed. Skipping download and installation.${txtrst}"

0 commit comments

Comments
 (0)