build_coupled_nek.sh 749 Bytes
Newer Older
Ron Rahaman's avatar
Ron Rahaman committed
1
#!/usr/bin/env bash
2

3 4 5
NEK_CASENAME="$(basename $(pwd))"
NEK_SOURCE_DIR="$(dirname $(dirname $(pwd)))/Nek5000"

6 7 8 9 10 11
JOBS=4
while getopts ":j:" opt; do
  case $opt in
    j ) JOBS=$OPTARG ;;
  esac
done
12

13 14 15 16 17
# MOOSE issues a warning if these directories do not exist.
# Creating these dirs will suppress that warning
mkdir -p src
mkdir -p include/base

18 19 20 21 22 23
SCH_FILE="$NEK_CASENAME.sch"
if [ -e $SCH_FILE ]; then
  echo "Deleting $SCH_FILE..."
  rm -f $SCH_FILE
fi

24
echo "Creating SESSON.NAME..."
25 26
echo "$NEK_CASENAME" > SESSION.NAME && pwd >> SESSION.NAME

27
echo "Building Nek5000 objects..."
28 29
$NEK_SOURCE_DIR/core/makenek $NEK_CASENAME $NEK_SOURCE_DIR

30 31
echo "Building libNek5000.so..."
make -j $JOBS -f makefile.nek lib
32

33 34
echo "Building MOON driver..."
make -j $JOBS