Commit 6d7ef8dc authored by Mark Olesen's avatar Mark Olesen

COMP: adjust make scripts for systems with .dylib instead of .so

parent 455551b4
......@@ -19,6 +19,9 @@
# ----------------------------------------------
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
#------------------------------------------------------------------------------
# Dynamic library endings (default is .so)
[ "$(uname -s)" = Darwin ] && SO=dylib || SO=so
# Run from third-party directory only
cd ${0%/*} && wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
......@@ -92,8 +95,8 @@ SCOTCH_SOURCE_DIR=$sourceBASE/$SCOTCH_VERSION
scotchMakefile=../../etc/makeFiles/scotch/Makefile.inc.i686_pc_linux2.shlib-OpenFOAM
if [ -f $SCOTCH_ARCH_PATH/include/scotch.h \
-a -r $FOAM_EXT_LIBBIN/libscotch.so \
-a -r $FOAM_EXT_LIBBIN/libscotcherrexit.so ]
-a -r $FOAM_EXT_LIBBIN/libscotch.$SO \
-a -r $FOAM_EXT_LIBBIN/libscotcherrexit.$SO ]
then
echo " scotch include: $SCOTCH_ARCH_PATH/include"
echo " scotch library: $FOAM_EXT_LIBBIN"
......@@ -154,7 +157,7 @@ fi
# and normal scotch was built (has include and library)
if [ "${FOAM_MPI:-dummy}" != dummy ] && \
[ -f $SCOTCH_ARCH_PATH/include/scotch.h \
-a -r $FOAM_EXT_LIBBIN/libscotch.so ] || \
-a -r $FOAM_EXT_LIBBIN/libscotch.$SO ] || \
{
# Report that the above tests failed and pass-through the failure
echo
......@@ -168,8 +171,8 @@ then
echo " $SCOTCH_ARCH_PATH"
if [ -f $SCOTCH_ARCH_PATH/include/$FOAM_MPI/ptscotch.h \
-a -r $FOAM_EXT_LIBBIN/$FOAM_MPI/libptscotch.so \
-a -r $FOAM_EXT_LIBBIN/$FOAM_MPI/libptscotcherrexit.so ]
-a -r $FOAM_EXT_LIBBIN/$FOAM_MPI/libptscotch.$SO \
-a -r $FOAM_EXT_LIBBIN/$FOAM_MPI/libptscotcherrexit.$SO ]
then
echo " ptscotch include: $SCOTCH_ARCH_PATH/include/$FOAM_MPI"
echo " ptscotch library: $FOAM_EXT_LIBBIN/$FOAM_MPI"
......
......@@ -24,6 +24,9 @@ sourceBASE=$WM_THIRD_PARTY_DIR
buildBASE=$WM_THIRD_PARTY_DIR/build/$WM_ARCH$WM_COMPILER
installBASE=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER
# Dynamic library endings (default is .so)
[ "$(uname -s)" = Darwin ] && SO=dylib || SO=so
unset BUILD_SUFFIX
#------------------------------------------------------------------------------
# Export WM compiler settings (and flags) for CMake/configure
......@@ -52,7 +55,10 @@ exportCompiler()
# Export WM linker settings for CMake/configure
exportLinker()
{
[ -n "$WM_LDFLAGS" ] && export LDFLAGS="$WM_LDFLAGS"
if [ -n "$WM_LDFLAGS" ]
then
export LDFLAGS="$WM_LDFLAGS"
fi
}
# Force use of gcc/g++
......@@ -161,19 +167,18 @@ setBuildSuffix()
# - use max number of cores for building
#
unset WM_HOSTS WM_SCHEDULER
if [ -r /proc/cpuinfo ]
then
WM_NCOMPPROCS=$(egrep "^processor" /proc/cpuinfo | wc -l)
else
WM_NCOMPPROCS=1
fi
WM_NCOMPPROCS=$(egrep -c "^processor" /proc/cpuinfo 2>/dev/null) || \
WM_NCOMPPROCS=$(getconf _NPROCESSORS_ONLN 2>/dev/null) || \
WM_NCOMPPROCS=1
: ${WM_NCOMPPROCS:=1}
export WM_NCOMPPROCS
#
# If WM_CONTINUE_ON_ERROR not set activate the shell option "stop on error"
#
if [ -z "${WM_CONTINUE_ON_ERROR}" ]
if [ -z "$WM_CONTINUE_ON_ERROR" ]
then
set -e
fi
......@@ -383,7 +388,7 @@ pkgconfigNewPrefix()
if [ -f "$i" -a ! -L "$i" ]
then
nfiles="x$nfiles"
sed -i -e 's@^\(prefix=\).*$@\1'"$dir@" $i
sed -i~ -e 's@^\(prefix=\).*$@\1'"$dir@" $i
fi
done
echo " $libdir/*.pc (edited ${#nfiles})"
......@@ -431,7 +436,7 @@ pkgconfigAdjust()
if [ -f "$i" -a ! -L "$i" ]
then
nfiles="x$nfiles"
sed -i \
sed -i~ \
-e 's@^\(includedir=\)'"$dir/"'@\1${prefix}/@' \
-e 's@^\(libdir=\)'"$dir/"'@\1${prefix}/@' \
-e 's@\(_location=\)'"$dir/"'@\1${prefix}/@' \
......
......@@ -19,6 +19,9 @@
# ----------------------------------------------
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
#------------------------------------------------------------------------------
# Dynamic library endings (default is .so)
[ "$(uname -s)" = Darwin ] && SO=dylib || SO=so
# Run from third-party directory only
cd ${0%/*} && wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
......@@ -124,7 +127,7 @@ echo
export GIT_DIR=$PWD/.git # Mask seeing our own git-repo
rm -rf $CCMIO_ARCH_PATH
rm -f $FOAM_EXT_LIBBIN/libccmio.so
rm -f $FOAM_EXT_LIBBIN/libccmio.$SO
libdir=$CCMIO_ARCH_PATH/lib
......
......@@ -25,12 +25,15 @@
# ----------------------------------------------
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
#------------------------------------------------------------------------------
# Dynamic library endings (default is .so)
[ "$(uname -s)" = Darwin ] && SO=dylib || SO=so
# Short-circuit test for an installation
if [ "$1" = "-test" ]
then
[ "$#" -eq 3 ] || { echo "${0##*/} -test : needs 2 argument"; exit 1; }
dir="$2" # <- CGAL_ARCH_PATH
if [ -d "$dir/include" -a -r "$dir/lib$WM_COMPILER_LIB_ARCH/libCGAL.so" ]
if [ -d "$dir/include" -a -r "$dir/lib$WM_COMPILER_LIB_ARCH/libCGAL.$SO" ]
then
echo " CGAL include: $dir/include"
echo " CGAL library: $dir/lib$WM_COMPILER_LIB_ARCH"
......@@ -39,7 +42,7 @@ then
for root in "$dir" /usr
do
if [ -d "$root/include/boost" \
-a -r "$root/lib$WM_COMPILER_LIB_ARCH/libboost_system.so" ]
-a -r "$root/lib$WM_COMPILER_LIB_ARCH/libboost_system.$SO" ]
then
echo " boost include: $root/include"
echo " boost library: $root/lib$WM_COMPILER_LIB_ARCH"
......@@ -450,10 +453,10 @@ fi
configBoost=$(cat <<CMAKE_OPTIONS
-DBoost_INCLUDE_DIR=$boostInc
-DBoost_LIBRARY_DIRS=$boostLib
-DBoost_THREAD_LIBRARY=$boostLib/libboost_thread.so
-DBoost_THREAD_LIBRARY_RELEASE=$boostLib/libboost_thread.so
-DBoost_SYSTEM_LIBRARY=$boostLib/libboost_system.so
-DBoost_SYSTEM_LIBRARY_RELEASE=$boostLib/libboost_system.so
-DBoost_THREAD_LIBRARY=$boostLib/libboost_thread.$SO
-DBoost_THREAD_LIBRARY_RELEASE=$boostLib/libboost_thread.$SO
-DBoost_SYSTEM_LIBRARY=$boostLib/libboost_system.$SO
-DBoost_SYSTEM_LIBRARY_RELEASE=$boostLib/libboost_system.$SO
-DBoost_VERSION=$BOOST_VERSION
CMAKE_OPTIONS
)
......@@ -475,12 +478,12 @@ CMAKE_OPTIONS
$GMP_ARCH_PATH/lib \
;
do
if [ -f "$libdir/libgmp.so" ]
if [ -f "$libdir/libgmp.$SO" ]
then
configGmp=$(cat <<CMAKE_OPTIONS
-DGMP_INCLUDE_DIR=$GMP_ARCH_PATH/include
-DGMP_LIBRARIES_DIR=$libdir
-DGMP_LIBRARIES=$libdir/libgmp.so
-DGMP_LIBRARIES=$libdir/libgmp.$SO
CMAKE_OPTIONS
)
break
......@@ -506,12 +509,12 @@ CMAKE_OPTIONS
$MPFR_ARCH_PATH/lib \
;
do
if [ -f "$libdir/libmpfr.so" ]
if [ -f "$libdir/libmpfr.$SO" ]
then
configMpfr=$(cat <<CMAKE_OPTIONS
-DMPFR_INCLUDE_DIR=$MPFR_ARCH_PATH/include
-DMPFR_LIBRARIES_DIR=$libdir
-DMPFR_LIBRARIES=$libdir/libmpfr.so
-DMPFR_LIBRARIES=$libdir/libmpfr.$SO
CMAKE_OPTIONS
)
break
......
......@@ -19,12 +19,15 @@
# ----------------------------------------------
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
#------------------------------------------------------------------------------
# Dynamic library endings (default is .so)
[ "$(uname -s)" = Darwin ] && SO=dylib || SO=so
# Short-circuit test for an installation
if [ "$1" = "-test" ]
then
[ "$#" -eq 2 ] || { echo "${0##*/} -test : needs 1 argument"; exit 1; }
dir="$2" # <- FFTW_ARCH_PATH
if [ -d "$dir/include" -a -r "$dir/lib$WM_COMPILER_LIB_ARCH/libfftw3.so" ]
if [ -d "$dir/include" -a -r "$dir/lib$WM_COMPILER_LIB_ARCH/libfftw3.$SO" ]
then
echo " fftw include: $dir/include"
echo " fftw library: $dir/lib$WM_COMPILER_LIB_ARCH"
......@@ -115,7 +118,7 @@ fi
FFTW_SOURCE_DIR=$sourceBASE/$fftwPACKAGE
FFTW_ARCH_PATH=$installBASE/$fftwPACKAGE
if [ -r "$FFTW_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libfftw3.so" ]
if [ -r "$FFTW_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libfftw3.$SO" ]
then
echo "Already has FFTW shared library"
else
......
......@@ -19,6 +19,9 @@
# ----------------------------------------------
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
#------------------------------------------------------------------------------
# Dynamic library endings (default is .so)
[ "$(uname -s)" = Darwin ] && SO=dylib || SO=so
# Short-circuit test for an installation
if [ "$1" = "-test" ]
then
......@@ -27,11 +30,11 @@ then
if [ -d "$dir/include" ]
then
for lib in \
$FOAM_EXT_LIBBIN/libkahip.so \
$FOAM_EXT_LIBBIN/libkahip.$SO \
$dir/lib/libkahip.a \
$dir/lib/libkahip.so \
$dir/lib/libkahip.$SO \
$dir/lib$WM_COMPILER_LIB_ARCH/libkahip.a \
$dir/lib$WM_COMPILER_LIB_ARCH/libkahip.so \
$dir/lib$WM_COMPILER_LIB_ARCH/libkahip.$SO \
;
do
if [ -r "$lib" ]
......@@ -162,7 +165,7 @@ echo
export GIT_DIR=$KAHIP_SOURCE_DIR/.git # Mask seeing our own git-repo
rm -rf $KAHIP_ARCH_PATH
rm -f $FOAM_EXT_LIBBIN/libkahip.so
rm -f $FOAM_EXT_LIBBIN/libkahip.$SO
libdir=$KAHIP_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH
......
......@@ -19,6 +19,9 @@
# ----------------------------------------------
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
#------------------------------------------------------------------------------
# Dynamic library endings (default is .so)
[ "$(uname -s)" = Darwin ] && SO=dylib || SO=so
# Short-circuit test for an installation
if [ "$1" = "-test" ]
then
......@@ -27,11 +30,11 @@ then
if [ -d "$dir/include" ]
then
for lib in \
$FOAM_EXT_LIBBIN/libmetis.so \
$FOAM_EXT_LIBBIN/libmetis.$SO \
$dir/lib/libmetis.a \
$dir/lib/libmetis.so \
$dir/lib/libmetis.$SO \
$dir/lib$WM_COMPILER_LIB_ARCH/libmetis.a \
$dir/lib$WM_COMPILER_LIB_ARCH/libmetis.so \
$dir/lib$WM_COMPILER_LIB_ARCH/libmetis.$SO \
;
do
if [ -r "$lib" ]
......@@ -143,10 +146,10 @@ install()
if [ "$targetType" = libso ]
then
\mv $libdir/libmetis.so $FOAM_EXT_LIBBIN
\mv $libdir/libmetis.$SO $FOAM_EXT_LIBBIN
rmdir $libdir 2>/dev/null # Failed rmdir is uncritical
echo "Installing: $FOAM_EXT_LIBBIN/libmetis.so"
echo "Installing: $FOAM_EXT_LIBBIN/libmetis.$SO"
fi
return 0
}
......@@ -165,7 +168,7 @@ echo
export GIT_DIR=$PWD/.git # Mask seeing our own git-repo
rm -rf $METIS_ARCH_PATH
rm -f $FOAM_EXT_LIBBIN/libmetis.so
rm -f $FOAM_EXT_LIBBIN/libmetis.$SO
# Adjust metis integer size to match OpenFOAM label-size
sed -i -e 's=\(#define IDXTYPEWIDTH\).*=\1 '$WM_LABEL_SIZE'=' \
......
......@@ -19,12 +19,15 @@
# ----------------------------------------------
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
#------------------------------------------------------------------------------
# Dynamic library endings (default is .so)
[ "$(uname -s)" = Darwin ] && SO=dylib || SO=so
# Short-circuit test for an installation
if [ "$1" = "-test" ]
then
[ "$#" -eq 2 ] || { echo "${0##*/} -test : needs 1 argument"; exit 1; }
dir="$2" # <- MPI_ARCH_PATH
if [ -r "$dir/lib$WM_COMPILER_LIB_ARCH/libmpich.so" ]
if [ -r "$dir/lib$WM_COMPILER_LIB_ARCH/libmpich.$SO" ]
then
echo "Have mpich shared library (${dir##*/})"
exit 0
......@@ -122,7 +125,7 @@ fi
MPI_SOURCE_DIR=$sourceBASE/$mpiPACKAGE
MPI_ARCH_PATH=$installBASE/$mpiPACKAGE
if [ -r "$MPI_ARCH_PATH/lib_ARCH/libmpi.so" ]
if [ -r "$MPI_ARCH_PATH/lib_ARCH/libmpi.$SO" ]
then
echo "Already has shared library"
elif [ -r "$MPI_ARCH_PATH/lib/libmpi.a" ]
......
......@@ -19,12 +19,15 @@
# ----------------------------------------------
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
#------------------------------------------------------------------------------
# Dynamic library endings (default is .so)
[ "$(uname -s)" = Darwin ] && SO=dylib || SO=so
# Short-circuit test for an installation
if [ "$1" = "-test" ]
then
[ "$#" -eq 2 ] || { echo "${0##*/} -test : needs 1 argument"; exit 1; }
dir="$2" # <- MPI_ARCH_PATH
if [ -r "$dir/lib$WM_COMPILER_LIB_ARCH/libmpi.so" ]
if [ -r "$dir/lib$WM_COMPILER_LIB_ARCH/libmpi.$SO" ]
then
echo " Have openmpi shared library (${dir##*/})"
exit 0
......@@ -130,7 +133,7 @@ fi
MPI_SOURCE_DIR=$sourceBASE/$mpiPACKAGE
MPI_ARCH_PATH=$installBASE/$mpiPACKAGE
if [ -r "$MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmpi.so" ]
if [ -r "$MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmpi.$SO" ]
then
echo "Already has shared library: $MPI_ARCH_PATH"
elif [ -r "$MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmpi.a" ]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment