2016-02-26 01:00:12 +05:30
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
cat README
|
2016-02-26 21:38:25 +05:30
|
|
|
echo
|
2016-03-06 13:58:20 +05:30
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
BUILDROOT=$DAMASK_ROOT/build
|
|
|
|
BUILDDIR=spectral
|
2016-02-26 01:00:12 +05:30
|
|
|
|
|
|
|
# prepare building directory
|
2016-02-26 21:38:25 +05:30
|
|
|
# structure:
|
|
|
|
# BUILD_DIR
|
|
|
|
# |-BUILD_SPECTRAL
|
|
|
|
# |-BUILD_FEM
|
|
|
|
# |-BUILD_MARC
|
2016-03-06 13:58:20 +05:30
|
|
|
if [ ! -d $BUILDROOT ]; then
|
|
|
|
mkdir $BUILDROOT
|
2016-02-26 21:38:25 +05:30
|
|
|
fi
|
2016-03-06 13:58:20 +05:30
|
|
|
cd $BUILDROOT
|
|
|
|
if [ -d $BUILDDIR ] ; then
|
|
|
|
rm -rf $BUILDDIR
|
2016-02-26 01:00:12 +05:30
|
|
|
fi
|
2016-03-06 13:58:20 +05:30
|
|
|
mkdir $BUILDDIR
|
|
|
|
cd $BUILDDIR
|
2016-02-26 01:00:12 +05:30
|
|
|
|
2016-02-26 02:10:10 +05:30
|
|
|
##
|
|
|
|
# CMake call
|
2016-03-06 04:05:34 +05:30
|
|
|
# PETSC_DIR | PETSC directory
|
|
|
|
# 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-18 20:44:32 +05:30
|
|
|
# BUILDCMD_PRE | Compiler prefix
|
|
|
|
# BUILDCMD_POST | Compiler suffix,
|
2016-04-16 01:56:43 +05:30
|
|
|
# | e.g. DAMASK_SUFFIX="-Wl,--verbose"
|
2016-03-15 01:27:19 +05:30
|
|
|
cmake -D PETSC_DIR=${PETSC_DIR} \
|
|
|
|
-D CMAKE_BUILD_TYPE=RELEASE \
|
2016-04-16 01:56:43 +05:30
|
|
|
-D CMAKE_VERBOSE_MAKEFILE=OFF \
|
2016-03-15 01:27:19 +05:30
|
|
|
-D OPENMP=ON \
|
|
|
|
-D OPTIMIZATION=DEFENSIVE \
|
|
|
|
-D DAMASK_DRIVER=SPECTRAL \
|
|
|
|
-D DAMASK_INSTALL=${HOME}/bin \
|
2016-04-18 20:44:32 +05:30
|
|
|
-D BUILDCMD_PRE="" \
|
|
|
|
-D BUILDCMD_POST="-Wl,--verbose" \
|
2016-03-04 21:48:38 +05:30
|
|
|
../..
|
|
|
|
|
2016-04-19 04:02:08 +05:30
|
|
|
echo "Start compiling DAMASK_spectral"
|
|
|
|
make
|
|
|
|
make install
|