#!/bin/bash
#
# rename to SIMLIB
# script for compilation of SIMLIB/C++ model 
# Only if the library is not installed system-wide
# (for Linux/bash)
#
echo "Edit the $0 file first, please"
#
SIMLIB="$HOME/WORK/SIMLIB/src"  # EDIT: home of SIMLIB library and header files
SOURCE="$1"                 # source file
MODEL="${1%.cc}"            # executable name
if [ -z "$SOURCE" -o ! -f "$SOURCE" -o "$MODEL" = "$SOURCE" ]; then
  echo "Usage: " 
  echo "         $0 model.cc"
  exit 1
fi
echo
echo "### Creating model $MODEL"
echo
#static: g++ -static -I$SIMLIB -o "$MODEL" "$SOURCE" $SIMLIB/simlib.a -lm
g++ -g -I$SIMLIB -o "$MODEL" "$SOURCE" $SIMLIB/simlib.so -lm
echo

