Commit 1e75ef58 authored by mark's avatar mark
Browse files

ENH: update building of ADIOS

- ADIOS source packages now include mxml, which means that it doesn't
  need to be built separately.

- Use OpenFOAM config.sh/ADIOS (if it exists), or explicitly define
  the version to compile. Eg, ./makeADIOS ADIOS-1.10.0
parent 7623d184
......@@ -2,7 +2,7 @@
#
#+TITLE: OpenFOAM Third-Party packages
#+AUTHOR: The OpenFOAM Foundation / OpenCFD Ltd.
#+DATE: 2016-06-28
#+DATE: 2016-10-14
#+LINK: http://www.openfoam.org
#+OPTIONS: author:nil ^:{}
# Copyright (c) 2014-2016 OpenFOAM Foundation.
......@@ -18,6 +18,7 @@
*** Optional Build Components:
+ makeLLVM (Replaces makeGcc in the above description
- to use clang as compiler)
+ makeADIOS (Only required for ADIOS support)
+ makeCCMIO (Only required for conversion of STAR-CCM+ meshes)
+ Allclean (Only required to save disk space)
* Versions and locations to download the third party packages
......@@ -40,6 +41,8 @@
+ ParaView-4.4.0 http://www.paraview.org/files/v4.4/ParaView-v4.4.0-source.tar.gz
+ ParaView-5.0.1 http://www.paraview.org/files/v5.0/ParaView-v5.0.1-source.tar.gz
but may need patching to compile (See [[Notes]]).
*** ADIOS
+ https://github.com/ornladios/ADIOS/archive/v1.10.0.tar.gz
*** CGAL
+ CGAL https://github.com/CGAL/cgal/releases/download/releases%2FCGAL-4.8/CGAL-4.8.tar.xz
+ CGAL https://github.com/CGAL/cgal/releases/download/releases%2FCGAL-4.8.1/CGAL-4.8.1.tar.xz
......@@ -48,6 +51,9 @@
+ FFTW http://www.fftw.org/fftw-3.3.4.tar.gz
+ libccmio http://portal.nersc.gov/svn/visit/trunk/third_party/libccmio-2.6.1.tar.gz
* Notes
*** Building Scotch
+ The zlib library and zlib development headers are required.
* Notes
*** Building ParaView-4.3.1/4.4.0/5.0.0/5.0.1
The ParaView-4.3.1/4.4.0/5.0.0 source-pack provided by KitWare will not
build and install correctly without a minor correction: lines 653-656
......
......@@ -26,11 +26,16 @@
# makeADIOS
#
# Description
# Build script for ADIOS (and MXML)
# Build script for ADIOS
#
#------------------------------------------------------------------------------
adiosPACKAGE=adios-git
mxmlPACKAGE=mxml-2.9
# Get version info
. $WM_PROJECT_DIR/etc/config.sh/functions
unset -f _foamAddPath _foamAddLib _foamAddMan # get settings only
_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/ADIOS)
adiosPACKAGE=${adios_version:-adios-none}
#------------------------------------------------------------------------------
# run from third-party directory only
......@@ -48,24 +53,24 @@ usage() {
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE
usage: ${0##*/} [OPTION] [adios-VERSION] [mxml-VERSION]
usage: ${0##*/} [OPTION] [adios-VERSION]
options:
-gcc Force gcc/g++ instead of the values from \$WM_CC, \$WM_CXX
-help
* Build ADIOS+MXML
* Build ADIOS
$adiosPACKAGE
$mxmlPACKAGE
USAGE
exit 1
}
#------------------------------------------------------------------------------
# ensure configure gets the correct C/C++ compiler
[ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
# 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"
[ -n "$WM_CXXFLAGS" ] && export CXXFLAGS="$WM_CXXFLAGS"
# parse options
while [ "$#" -gt 0 ]
......@@ -78,12 +83,9 @@ do
export CC=gcc # use gcc/g++
export CXX=g++
;;
adios-[1-9]* | adios-git)
ADIOS-[1-9]* | adios-[1-9]* | ADIOS-git | adios-git)
adiosPACKAGE="${1%%/}"
;;
mxml-[1-9]*)
mxmlPACKAGE="${1%%/}"
;;
*)
die "unknown option/argument: '$1'"
;;
......@@ -91,71 +93,38 @@ do
shift
done
#------------------------------------------------------------------------------
MXML_ARCH_PATH=$installBASE/$mxmlPACKAGE
ADIOS_ARCH_PATH=$installBASE/$adiosPACKAGE
[ -n "$adiosPACKAGE" ] || die "The adios-VERSION was not specified"
# build MXML - not needed with more recent ADIOS
if false
# nothing to build
if _foamIsNone "$adiosPACKAGE"
then
echo
echo ========================================
echo "Build mxml library $mxmlPACKAGE"
echo
if [ -f $MXML_ARCH_PATH/include/mxml.h \
-a -r $FOAM_EXT_LIBBIN/libmxml.so ]
then
echo " MXML header in $MXML_ARCH_PATH/include"
echo " MXML libs in $FOAM_EXT_LIBBIN"
echo
else
(
# use mxml packaged with adios (if possible)
# or revert to top-level
sourceDIR=$WM_THIRD_PARTY_DIR/$adiosPACKAGE/src/mxml/$mxmlPACKAGE
[ -d "$sourceDIR" ] || sourceDIR=$WM_THIRD_PARTY_DIR/$mxmlPACKAGE
cd $sourceDIR || exit 1
echo "Using adios-none (skip ThirdParty build of ADIOS)"
exit 0
elif _foamIsSystem "$adiosPACKAGE"
then
echo "Using adios-system"
exit 0
fi
# Remove any existing build folder and recreate
\rm -rf $buildDIR 2>/dev/null
mkdir -p $buildDIR
#------------------------------------------------------------------------------
#
# Build ADIOS
[ -e Makefile ] && make clean 2>/dev/null # for safety
mkdir -p $FOAM_EXT_LIBBIN 2>/dev/null
ADIOS_ARCH_PATH=$installBASE/$adiosPACKAGE
ADIOS_SOURCE_DIR=$WM_THIRD_PARTY_DIR/$adiosPACKAGE
# handle non-gcc compilers
unset configEnv
if [ "${WM_CC:-gcc}" != gcc ]
then
export CC=$WM_CC
export CCS=$WM_CC
fi
: ${FOAM_MPI:=dummy}
# installs into lib64/
cd $buildDIR && \
$sourceDIR/configure --prefix=$MXML_ARCH_PATH \
&& make -j $WM_NCOMPPROCS all \
&& make install \
&& echo "Built: $mxmlPACKAGE" \
&& rsync -a $MXML_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/*.so* $FOAM_EXT_LIBBIN/
) || {
echo "Error building: $mxmlPACKAGE"
}
fi
fi
# build ADIOS
echo
echo ========================================
echo "Build adios library $adiosPACKAGE"
echo "Build adios library $adiosPACKAGE for $FOAM_MPI"
echo
# Needs future adjustment for shared library, for mpi-specific library location
# Needs future adjustment
# - for shared library
# - for mpi-specific library locations
if [ -f $ADIOS_ARCH_PATH/include/adios.h \
-a -r $FOAM_EXT_LIBBIN/$FOAM_MPI/libadios.so ]
-a -r $ADIOS_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libadios_${FOAM_MPI}.a ]
then
echo " ADIOS header in $ADIOS_ARCH_PATH/include"
echo " ADIOS libs in $FOAM_EXT_LIBBIN"
......@@ -163,43 +132,61 @@ then
else
(
# configuration options:
# Start with GridEngine support - builds without external libraries
unset configOpt
# Add InfiniBand support
ibDir=/usr/local/ofed
if [ -d "$ibDir/include" ]
if [ -d "$ibDir" ]
then
configOpt="$configOpt --with-infiniband=$ibDir"
fi
## $configOpt="$configOpt --with-hdf5=..."
# for externally compiled MXML
# configOpt="$configOpt --with-mxml=$MXML_ARCH_PATH"
# Transport layers
if [ -f "/usr/include/bzlib.h" ]
then
configOpt="$configOpt --with-bzip2=/usr"
fi
if [ -f "/usr/include/zlib.h" ]
then
configOpt="$configOpt --with-zlib=/usr"
fi
# Other types of support
## $configOpt="$configOpt --with-hdf5=..."
## $configOpt="$configOpt --with-lustre=..."
configOpt="$configOpt --enable-research-transports"
# end of configuration options
# ----------------------------
sourceDIR=$WM_THIRD_PARTY_DIR/$adiosPACKAGE
buildDIR=$buildBASE/$adiosPACKAGE
cd $sourceDIR || exit 1
export GIT_DIR=$sourceDIR/.git
cd $ADIOS_SOURCE_DIR || exit 1
[ -e Makefile ] && make distclean 2>/dev/null
export GIT_DIR=$ADIOS_SOURCE_DIR/.git
# Remove any existing build folder and recreate
\rm -rf $buildDIR 2>/dev/null
rm -rf $ADIOS_ARCH_DIR
rm -rf $buildDIR 2>/dev/null
mkdir -p $buildDIR
[ -e Makefile ] && make clean 2>/dev/null # for safety
[ -f configure ] || {
echo "no configure for $adiosPACKAGE ... trying autogen"
./autogen.sh
}
# May not work properly with FOAM_MPI = dummy
if [ "$FOAM_MPI" = dummy ]
then
configOpt="$configOpt --without-mpi"
else
CC=mpicc
CXX=mpicxx
fi
# installs into lib64/
cd $buildDIR && \
CC=mpicc CXX=mpicxx CFLAGS="-fPIC" $sourceDIR/configure \
cd $buildDIR && $ADIOS_SOURCE_DIR/configure \
--prefix=$ADIOS_ARCH_PATH \
--disable-fortran \
--with-pic \
......@@ -208,7 +195,25 @@ else
&& make -j $WM_NCOMPPROCS all \
&& make install \
&& echo "Built: $adiosPACKAGE" \
&& rsync -a --no-r $ADIOS_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/ $FOAM_EXT_LIBBIN/$FOAM_MPI/
&& cd $ADIOS_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH && \
{
# Rename according to FOAM_MPI
if [ "$FOAM_MPI" != dummy ]
then
\mv -f libadios.a libadios_$FOAM_MPI.a
\mv -f libadiosread.a libadiosread_$FOAM_MPI.a
fi
\mv -f libadios_nompi.a libadios_dummy.a
\mv -f libadiosread_nompi.a libadiosread_dummy.a
echo
echo "ADIOS library renamed to libadios_$FOAM_MPI"
echo
} && cd $ADIOS_ARCH_PATH/bin && \
{
# We don't need/use XML things
\rm -f adios_lint
} && $ADIOS_ARCH_PATH/bin/adios_config -m
) || {
echo "Error building: $adiosPACKAGE"
}
......
Supports Markdown
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