DAMASK_EICMD/build_spectral.sh

64 lines
1.8 KiB
Bash
Raw Normal View History

#!/bin/bash
cat README
echo
if [ "$OSTYPE" == "linux-gnu" ] || [ "$OSTYPE" == 'linux' ]; then
DAMASK_ROOT=$(readlink -f "`dirname $BASH_SOURCE`")
else
[[ "${BASH_SOURCE::1}" == "/" ]] && BASE="" || BASE="`pwd`/"
STAT=$(stat "`dirname $BASE$BASH_SOURCE`")
DAMASK_ROOT=${STAT##* }
fi
DAMASKVERSION=$(cat VERSION)
BUILDROOT=$DAMASK_ROOT/build
BUILDDIR=spectral
# prepare building directory
# structure:
# BUILD_DIR
# |-BUILD_SPECTRAL
# |-BUILD_FEM
# |-BUILD_MARC
if [ ! -d $BUILDROOT ]; then
mkdir $BUILDROOT
fi
cd $BUILDROOT
if [ -d $BUILDDIR ] ; then
rm -rf $BUILDDIR
fi
mkdir $BUILDDIR
cd $BUILDDIR
##
# CMake call
2016-03-06 04:05:34 +05:30
# PETSC_DIR | PETSC directory
# DAMASK_V | DAMASK current revision
# CMAKE_BUILD_TYPE | Default set to release (no debugging output)
2016-04-16 01:56:43 +05:30
# CMAKE_VERBOSE_MAKEFILE | [ON/OFF] toggle makefile verbose output
2016-03-06 04:05:34 +05:30
# OPENMP | [ON/OFF]
# OPTIMIZATION | [OFF,DEFENSIVE,AGGRESSIVE,ULTRA]
# DAMASK_DRIVER | [SPECTRAL, FEM]
# DAMASK_INSTALL | Directory to install binary output
2016-04-16 01:56:43 +05:30
# DAMASK_PREFIX | Compiler prefix
# DAMASK_SUFFIX | Compiler suffix,
# | e.g. DAMASK_SUFFIX="-Wl,--verbose"
cmake -D PETSC_DIR=${PETSC_DIR} \
-D DAMASK_V=${DAMASKVERSION} \
-D CMAKE_BUILD_TYPE=RELEASE \
2016-04-16 01:56:43 +05:30
-D CMAKE_VERBOSE_MAKEFILE=OFF \
-D OPENMP=ON \
-D OPTIMIZATION=DEFENSIVE \
-D DAMASK_DRIVER=SPECTRAL \
-D DAMASK_INSTALL=${HOME}/bin \
2016-04-16 01:56:43 +05:30
-D DAMASK_PREFIX="" \
-D DAMASK_SUFFIX="-Wl,--verbose" \
2016-03-04 21:48:38 +05:30
../..
echo
echo "Please move to the build directory using"
echo " cd build/spectral"
2016-03-04 21:48:38 +05:30
echo "Using the following command to build DAMASK spectral solver"
echo " make clean all install"