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

Commit

Permalink
More tweaks to the build scripts to get the right libraries into the …
Browse files Browse the repository at this point in the history
…right place
  • Loading branch information
MintoDA1 authored and MintoDA1 committed Aug 30, 2023
1 parent 0d7c712 commit 4ac2275
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 32 deletions.
30 changes: 6 additions & 24 deletions buildscripts/build_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,33 +67,15 @@ printf "Installing to ${PREFIX}\n"
printf "\n"

set -e
if [ ! -f ${PREFIX}/lib/libz.a ]; then
${SCRIPT_DIR}/build_zlib.sh ${ARGS}
else
echo "Found: ${PREFIX}/lib/libz.a"
fi

if [ ! -f ${PREFIX}/lib/libhdf5.a ]; then
${SCRIPT_DIR}/build_hdf5.sh ${ARGS}
else
echo "Found: ${PREFIX}/lib/libhdf5.a"
fi


if [ ! -f ${PREFIX}/lib/libnetcdf.a ]; then
${SCRIPT_DIR}/build_netcdf-c.sh ${ARGS}
else
echo "Found: ${PREFIX}/lib/libnetcdf.a"
fi

if [ ! -f ${PREFIX}/lib/libnetcdff.a ]; then
${SCRIPT_DIR}/build_netcdf-fortran.sh ${ARGS}
else
echo "Found: ${PREFIX}/lib/libnetcdff.a"
fi
${SCRIPT_DIR}/build_zlib.sh ${ARGS}
${SCRIPT_DIR}/build_hdf5.sh ${ARGS}
${SCRIPT_DIR}/build_netcdf-c.sh ${ARGS}
${SCRIPT_DIR}/build_netcdf-fortran.sh ${ARGS}

printf "\n"
printf "*********************************************************\n"
printf "* DEPENDENCIES ARE BUILT *\n"
printf "*********************************************************\n"
printf "Dependencys are installed to: ${PREFIX}\n\n"


3 changes: 2 additions & 1 deletion buildscripts/build_hdf5.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ if [ $OS = "MacOSX" ]; then
printf "echo arm-apple-darwin" > bin/config.sub
fi
fi
#COPTS="--disable-shared --enable-build-mode=production --enable-tests=no --enable-tools=no --disable-fortran --disable-java --disable-cxx --prefix=${PREFIX} --with-zlib=${PREFIX}"
COPTS="--enable-build-mode=production --enable-tests=no --enable-tools=no --disable-fortran --disable-java --disable-cxx --prefix=${PREFIX} --with-zlib=${PREFIX}"
./configure ${COPTS}
make
Expand All @@ -45,6 +44,8 @@ else
sudo make install
fi

rsync -va ${PREFIX}/lib/libhdf5* ${ROOT_DIR}/lib/

if [ $? -ne 0 ]; then
printf "hdf5 could not be compiled.\n"
exit 1
Expand Down
5 changes: 1 addition & 4 deletions buildscripts/build_netcdf-c.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,7 @@ printf "HDF5_ROOT: ${HDF5_ROOT}\n"
printf "*********************************************************\n"

cd ${DEPENDENCY_DIR}/netcdf-c-*
#COPTS="--disable-shared --disable-dap --disable-byterange --disable-testsets --prefix=${PREFIX}"
COPTS="--disable-testsets --prefix=${PREFIX}"
#if [ ! $OS = "MacOSX" ]; then
# COPTS="${COPTS} --disable-libxml2"
#fi
printf "COPTS: ${COPTS}\n"
./configure $COPTS
make && make check
Expand All @@ -44,6 +40,7 @@ if [ -w ${PREFIX} ]; then
else
sudo make install
fi
rsync -va ${PREFIX}/lib/libnetcdf* ${ROOT_DIR}/lib/

if [ $? -ne 0 ]; then
printf "netcdf-c could not be compiled."\n
Expand Down
3 changes: 2 additions & 1 deletion buildscripts/build_netcdf-fortran.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,15 @@ printf "LDFLAGS: ${LDFLAGS}\n"
printf "*********************************************************\n"

cd ${DEPENDENCY_DIR}/netcdf-fortran-*
#./configure --disable-shared --with-pic --disable-zstandard-plugin --enable-large-file-tests=no --enable-filter-test=no --prefix=${PREFIX}
./configure --enable-large-file-tests=no --enable-filter-test=no --prefix=${PREFIX}
make && make check i
if [ -w ${PREFIX} ]; then
make install
else
sudo make install
fi
rsync -a ${PREFIX}/lib/libnetcdff* ${ROOT_DIR}/lib/
rsync -a ${PREFIX}/include/netcdf.mod ${ROOT_DIR}/include/

if [ $? -ne 0 ]; then
printf "netcdf-fortran could not be compiled.\n"
Expand Down
9 changes: 8 additions & 1 deletion buildscripts/build_swiftest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,20 @@ read -rsn1 -p"Press any key to continue";echo

${SCRIPT_DIR}/build_dependencies.sh ${ARGS}


if [ $OS = "Linux" ]; then
cibuildwheel --platform linux
else
SKBUILD_CONFIGURE_OPTIONS="-DBUILD_SHARED_LIBS=ON -DUSE_SIMD=OFF"
SKBUILD_CONFIGURE_OPTIONS="${SKBUILD_CONFIGURE_OPTIONS} -DMACHINE_CODE_VALUE=\"generic\""
OMPROOT=${DEVTOOLDIR}/MacOSX${MACOSX_DEPLOYMENT_TARGET}/${ARCH}/usr/local
rsync -a ${OMPROOT}/lib/libgfortran*dylib ${ROOT_DIR}/lib/
rsync -a ${OMPROOT}/lib/libgomp*dylib ${ROOT_DIR}/lib/
rsync -a ${OMPROOT}/lib/libomp*dylib ${ROOT_DIR}/lib/
rsync -a ${OMPROOT}/lib/libquadmath*dylib ${ROOT_DIR}/lib/

NETCDF_FORTRAN_HOME=${ROOT_DIR}
NETCDF_INCLUDE=${ROOT_DIR}/include

CPPFLAGS="${CPPFLAGS} -Xclang -fopenmp"
LIBS="${LIBS} -lomp"
LDFLAGS="-Wl,-rpath,${OMPROOT}/lib -Wl,-rpath,${ROOT_DIR}/lib"
Expand Down
2 changes: 1 addition & 1 deletion buildscripts/build_zlib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ printf "LDFLAGS: ${LDFLAGS}\n"
printf "*********************************************************\n"

cd ${DEPENDENCY_DIR}/zlib-*
#./configure --prefix=${PREFIX} --static
./configure --prefix=${PREFIX}
make
if [ -w ${PREFIX} ]; then
make install
else
sudo make install
fi
rsync -va ${PREFIX}/lib/libz* ${ROOT_DIR}/lib/

if [ $? -ne 0 ]; then
printf "zlib could not be compiled.\n"
Expand Down

0 comments on commit 4ac2275

Please sign in to comment.