Commit 318e2495 authored by mark's avatar mark
Browse files

STYLE: reference the location of sources via the sourceBASE variable

- in the future it may be useful to locate all the sources under a
  sub-directory instead
parent cc216185
......@@ -29,7 +29,7 @@
# Build script for ThirdParty
#
#------------------------------------------------------------------------------
# run from third-party directory only
# Run from third-party directory only
cd ${0%/*} || exit 1
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || {
echo "Error: Current directory is not \$WM_THIRD_PARTY_DIR"
......@@ -44,8 +44,7 @@ wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || {
}
. etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
# export WM settings in a form that GNU configure recognizes
# Export WM settings in a form that GNU configure recognizes
[ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
[ -n "$WM_CFLAGS" ] && export CFLAGS="$WM_CFLAGS"
......@@ -108,7 +107,7 @@ OPENMPI)
# end of configuration options
# ----------------------------
mpiPACKAGE="${MPI_ARCH_PATH##*/}"
sourceDIR=$WM_THIRD_PARTY_DIR/$mpiPACKAGE
sourceDIR=$sourceBASE/$mpiPACKAGE
buildDIR=$buildBASE/$mpiPACKAGE
cd $sourceDIR || exit 1
......@@ -151,9 +150,10 @@ MPICH)
(
# WARNING: unmaintained build code:
# ---------------------------------
set -x
cd $MPI_HOME || exit 1 # change to mpich-VERSION
sourceDIR=$sourceBASE/$MPI_HOME
cd $sourceDIR || exit 1
set -x
[ -e Makefile ] && make distclean 2>/dev/null
rm -rf $MPI_ARCH_PATH
rm -rf util/machines/machines.*
......@@ -205,9 +205,9 @@ esac
#------------------------------------------------------------------------------
# building scotch is still a bit of a pain
# Building scotch is still a bit of a pain
# get SCOTCH_VERSION, SCOTCH_ARCH_PATH
# Get SCOTCH_VERSION, SCOTCH_ARCH_PATH
if settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/scotch)
then
. $settings
......@@ -222,7 +222,9 @@ echo ========================================
echo "Build Scotch decomposition library $SCOTCH_VERSION"
echo " $SCOTCH_ARCH_PATH"
# this needs generalizing
SCOTCH_SOURCE_DIR=$sourceBASE/$SCOTCH_VERSION
# This needs generalizing, but works fairly well
scotchMakefile=../../etc/wmakeFiles/scotch/Makefile.inc.i686_pc_linux2.shlib-OpenFOAM
if [ -f $SCOTCH_ARCH_PATH/include/scotch.h \
......@@ -231,10 +233,10 @@ if [ -f $SCOTCH_ARCH_PATH/include/scotch.h \
then
echo " scotch header in $SCOTCH_ARCH_PATH/include"
echo " scotch libs in $FOAM_EXT_LIBBIN"
elif [ -d "$SCOTCH_VERSION" ]
elif [ -d "$SCOTCH_SOURCE_DIR" ]
then
(
cd $SCOTCH_VERSION/src || exit 1
cd $SCOTCH_SOURCE_DIR/src || exit 1
rm -rf $SCOTCH_ARCH_PATH
applyPatch $SCOTCH_VERSION .. # patch at parent-level
......@@ -298,18 +300,17 @@ then
echo " ptscotch libs in $FOAM_EXT_LIBBIN/$FOAM_MPI"
else
(
cd $SCOTCH_SOURCE_DIR/src || exit 1
echo
set -x
cd $SCOTCH_VERSION/src || exit 1
prefixDIR=$SCOTCH_ARCH_PATH
libDIR=$FOAM_EXT_LIBBIN/$FOAM_MPI
incDIR=$SCOTCH_ARCH_PATH/include/$FOAM_MPI
libDIR=$FOAM_EXT_LIBBIN/$FOAM_MPI
mkdir -p $prefixDIR 2>/dev/null
mkdir -p $libDIR 2>/dev/null
configOpt="prefix=$prefixDIR libdir=$libDIR includedir=$incDIR"
configOpt="prefix=$prefixDIR includedir=$incDIR libdir=$libDIR"
if [ -f $scotchMakefile ]
then
......@@ -357,16 +358,18 @@ then
. $settings
fi
METIS_SOURCE_DIR=$sourceBASE/$METIS_VERSION
if [ -f $METIS_ARCH_PATH/include/metis.h \
-a -r $FOAM_EXT_LIBBIN/libmetis.so ]
then
echo " metis header in $METIS_ARCH_PATH/include"
echo " metis libs in $FOAM_EXT_LIBBIN"
echo
elif [ -d "$METIS_VERSION" ]
elif [ -d "$METIS_SOURCE_DIR" ]
then
(
cd $METIS_VERSION || exit 1
cd $METIS_SOURCE_DIR || exit 1
rm -rf $METIS_ARCH_PATH
# Adjust metis integer size to match OpenFOAM label-size
......
......@@ -29,7 +29,7 @@
#
#------------------------------------------------------------------------------
# buildBASE, installBASE defined from tools/ThirdPartyFunctions
# sourceBASE, buildBASE, installBASE defined in tools/ThirdPartyFunctions
#
# Where things are or should be put
......@@ -46,7 +46,7 @@ setParaViewDirs()
unset ParaView_SOURCE_DIR
for i
do
ParaView_SOURCE_DIR="$WM_THIRD_PARTY_DIR/$i"
ParaView_SOURCE_DIR="$sourceBASE/$i"
[ -d "$ParaView_SOURCE_DIR" ] && break
done
......@@ -55,7 +55,7 @@ setParaViewDirs()
while [ "$#" -ge 1 ]; do echo " $1"; shift; done
echo
echo "In the directory:"
echo " WM_THIRD_PARTY_DIR=$WM_THIRD_PARTY_DIR"
echo " $sourceBASE"
echo
echo "abort build"
exit 1
......
......@@ -31,11 +31,11 @@
# Define WM_NCOMPPROCS always.
#------------------------------------------------------------------------------
# Define the normal build and prefix directories
# The normal locations for source, build and installation (prefix-dir)
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
#
# Mostly building without wmake
# - disable wmakeScheduler variables
......
......@@ -30,7 +30,7 @@
#
#------------------------------------------------------------------------------
# buildBASE, installBASE defined from tools/ThirdPartyFunctions
# sourceBASE, buildBASE, installBASE defined in tools/ThirdPartyFunctions
#
# Where things are or should be put
......@@ -47,7 +47,7 @@ setVtkDirs()
for i
do
VTK_SOURCE_DIR="$WM_THIRD_PARTY_DIR/$i"
VTK_SOURCE_DIR="$sourceBASE/$i"
[ -d "$VTK_SOURCE_DIR" ] && break
done
......@@ -56,7 +56,7 @@ setVtkDirs()
while [ "$#" -ge 1 ]; do echo " $1"; shift; done
echo
echo "In the directory:"
echo " WM_THIRD_PARTY_DIR=$WM_THIRD_PARTY_DIR"
echo " $sourceBASE"
echo
echo "abort build"
exit 1
......
......@@ -106,11 +106,11 @@ fi
#------------------------------------------------------------------------------
#
# Build ADIOS
# ADIOS_ARCH_PATH : installation directory
# ADIOS_SOURCE_DIR : location of the original sources
# ADIOS_ARCH_PATH : installation directory
ADIOS_SOURCE_DIR=$sourceBASE/$adiosPACKAGE
ADIOS_ARCH_PATH=$installBASE/$adiosPACKAGE
ADIOS_SOURCE_DIR=$WM_THIRD_PARTY_DIR/$adiosPACKAGE
: ${FOAM_MPI:=dummy}
......
......@@ -104,8 +104,8 @@ done
[ -d "$ccmioPACKAGE" ] || die "missing source directory '$ccmioPACKAGE'"
#------------------------------------------------------------------------------
CCMIO_SOURCE_DIR=$sourceBASE/$ccmioPACKAGE
CCMIO_ARCH_PATH=$installBASE/$ccmioPACKAGE
CCMIO_SOURCE_DIR=$WM_THIRD_PARTY_DIR/$ccmioPACKAGE
#
# Build LIBCCMIO
......
......@@ -170,7 +170,7 @@ fi
# BOOST_ARCH_PATH : installation directory
# BOOST_SOURCE_DIR : location of the original sources
BOOST_SOURCE_DIR=$WM_THIRD_PARTY_DIR/$boostPACKAGE
BOOST_SOURCE_DIR=$sourceBASE/$boostPACKAGE
: ${BOOST_ARCH_PATH:=$installBASE/$boostPACKAGE} # Fallback
boostInc="$BOOST_ARCH_PATH/include"
......@@ -257,7 +257,7 @@ SUMMARY
# CGAL_BINARY_DIR : location of the build
# CGAL_ARCH_PATH : installation directory
CGAL_SOURCE_DIR=$WM_THIRD_PARTY_DIR/$cgalPACKAGE
CGAL_SOURCE_DIR=$sourceBASE/$cgalPACKAGE
CGAL_BINARY_DIR=$buildBASE/$cgalPACKAGE
: ${CGAL_ARCH_PATH:=$installBASE/$cgalPACKAGE} # Fallback
......
......@@ -89,11 +89,11 @@ done
#------------------------------------------------------------------------------
#
# Build CMAKE
# CMAKE_ARCH_PATH : installation directory
# CMAKE_SOURCE_DIR : location of the original sources
# CMAKE_ARCH_PATH : installation directory
CMAKE_SOURCE_DIR=$sourceBASE/$cmakePACKAGE
CMAKE_ARCH_PATH=$installBASE/$cmakePACKAGE
CMAKE_SOURCE_DIR=$WM_THIRD_PARTY_DIR/$cmakePACKAGE
if [ -d "$CMAKE_ARCH_PATH" -a -r "$CMAKE_ARCH_PATH/bin/cmake" ]
then
......
......@@ -114,11 +114,11 @@ fi
# - Third-Party builds into 'lib64'
# - system is normally built into 'lib64'
#
# FFTW_ARCH_PATH : installation directory
# FFTW_SOURCE_DIR : location of the original sources
# FFTW_ARCH_PATH : installation directory
FFTW_SOURCE_DIR=$sourceBASE/$fftwPACKAGE
FFTW_ARCH_PATH=$installBASE/$fftwPACKAGE
FFTW_SOURCE_DIR=$WM_THIRD_PARTY_DIR/$fftwPACKAGE
if [ -r "$FFTW_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libfftw3.so" ]
then
......
......@@ -180,7 +180,7 @@ else
echo "Starting build: $gmpPACKAGE"
echo
(
sourceDIR=$WM_THIRD_PARTY_DIR/$gmpPACKAGE
sourceDIR=$sourceBASE/$gmpPACKAGE
buildDIR=$buildBASE/$gmpPACKAGE
cd $sourceDIR || exit 1
......@@ -232,7 +232,7 @@ else
echo "Starting build: $mpfrPACKAGE"
echo
(
sourceDIR=$WM_THIRD_PARTY_DIR/$mpfrPACKAGE
sourceDIR=$sourceBASE/$mpfrPACKAGE
buildDIR=$buildBASE/$mpfrPACKAGE
cd $sourceDIR || exit 1
......@@ -288,7 +288,7 @@ else
echo "Starting build: $mpcPACKAGE"
echo
(
sourceDIR=$WM_THIRD_PARTY_DIR/$mpcPACKAGE
sourceDIR=$sourceBASE/$mpcPACKAGE
buildDIR=$buildBASE/$mpcPACKAGE
cd $sourceDIR || exit 1
......@@ -344,7 +344,7 @@ else
echo "Starting build: $gccPACKAGE"
echo
(
sourceDIR=$WM_THIRD_PARTY_DIR/$gccPACKAGE
sourceDIR=$sourceBASE/$gccPACKAGE
buildDIR=$buildBASE/$gccPACKAGE
cd $sourceDIR || exit 1
......
......@@ -106,9 +106,8 @@ fi
#
# Build gperftools
#
# build/install without compiler name
GPERFTOOLS_SOURCE_DIR=$sourceBASE/$gperftoolsPACKAGE
GPERFTOOLS_ARCH_PATH=$installBASE/$gperftoolsPACKAGE
GPERFTOOLS_SOURCE_DIR=$WM_THIRD_PARTY_DIR/$gperftoolsPACKAGE
echo "---------------"
if [ -d "$GPERFTOOLS_ARCH_PATH" ]
......
......@@ -121,7 +121,7 @@ done
[ -n "$llvmPACKAGE" ] || die "The llvm-VERSION was not specified"
#------------------------------------------------------------------------------
# build/install without compiler name
# Build/install locations without a compiler name
buildBASE=$WM_THIRD_PARTY_DIR/build/$WM_ARCH$WM_COMPILER_ARCH
installBASE=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH
......@@ -131,7 +131,7 @@ installBASE=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH
# LLVM_ARCH_PATH : location of the installed program
# - Strip any trailing '.src' from the proper names
LLVM_SOURCE_DIR=$WM_THIRD_PARTY_DIR/$llvmPACKAGE
LLVM_SOURCE_DIR=$sourceBASE/$llvmPACKAGE
LLVM_BINARY_DIR=$buildBASE/${llvmPACKAGE%%.src}
LLVM_ARCH_PATH=$installBASE/${llvmPACKAGE%%.src}
......
......@@ -136,9 +136,10 @@ fi
# - MESA itself will normally build into 'lib64'.
#
# MESA_SOURCE_DIR : location of the original sources
# MESA_ARCH_DIR : installation directory
MESA_SOURCE_DIR=$sourceBASE/$mesaPACKAGE
MESA_ARCH_PATH=$installBASE/$mesaPACKAGE
MESA_SOURCE_DIR=$WM_THIRD_PARTY_DIR/$mesaPACKAGE
(
# configuration options:
......
......@@ -104,8 +104,8 @@ fi
#
# Build QT
QT_SOURCE_DIR=$sourceBASE/$qtPACKAGE
QT_ARCH_PATH=$installBASE/qt-$qtVERSION
QT_SOURCE_DIR=$WM_THIRD_PARTY_DIR/$qtPACKAGE
echo
echo ========================================
......
......@@ -142,7 +142,7 @@ fi
# TECIO_BINARY_DIR : location of the build
# TECIO_ARCH_PATH : location of the installed program
TECIO_SOURCE_DIR=$WM_THIRD_PARTY_DIR/$tecioPACKAGE/teciosrc
TECIO_SOURCE_DIR=$sourceBASE/$tecioPACKAGE/teciosrc
TECIO_BINARY_DIR=$buildBASE/$tecioPACKAGE
TECIO_ARCH_PATH=$installBASE/$tecioPACKAGE
......
......@@ -34,7 +34,7 @@
# To use the VTK source from the ParaView source tree, simply make an
# appropriate link first. For example,
#
# ln -s ParaView-v5.2.0/VTK VTK-7.1.0
# (cd $WM_THIRD_PARTY_DIR && ln -s ParaView-v5.2.0/VTK VTK-7.1.0)
#
#------------------------------------------------------------------------------
# Run from third-party directory only
......@@ -120,7 +120,6 @@ For finer control, the build stages can be selected or deselected individually:
USAGE
exit 1
}
#------------------------------------------------------------------------------
# Ensure CMake gets the correct C/C++ compiler
[ -n "$WM_CC" ] && export CC="$WM_CC"
......
......@@ -85,7 +85,8 @@ do
if [ -n "$min" ]
then
echo "${min%.0}" $dir # With trailing ".0 removed
# Remove trailing ".0" from version
echo "${min%.0}" "${dir#sources/}"
fi
done \
......
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