#!/bin/sh
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2016 OpenCFD Ltd.
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenFOAM. If not, see .
#
# Script
# makeADIOS
#
# Description
# Build script for ADIOS
#
#------------------------------------------------------------------------------
# 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
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || {
echo "Error: Current directory is not \$WM_THIRD_PARTY_DIR"
echo " The environment variables are inconsistent with the installation."
echo " Check the OpenFOAM entries in your dot-files and source them."
exit 1
}
. etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
usage() {
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat</dev/null
export GIT_DIR=$ADIOS_SOURCE_DIR/.git
# Remove any existing build folder and recreate
rm -rf $ADIOS_ARCH_DIR
rm -rf $buildDIR 2>/dev/null
mkdir -p $buildDIR
[ -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
# Install into lib64/
cd $buildDIR && $ADIOS_SOURCE_DIR/configure \
--prefix=$ADIOS_ARCH_PATH \
--libdir=$ADIOS_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH \
--disable-fortran \
--with-pic \
--without-fastbit \
$configOpt \
&& make -j $WM_NCOMPPROCS all \
&& make install \
&& echo "Built: $adiosPACKAGE" \
&& 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 2>/dev/null || \
echo "Warning: Problems running adios_config"
}
) || {
echo "Error building: $adiosPACKAGE"
}
fi
# ----------------------------------------------------------------- end-of-file