#!/bin/bash
#
# rename to SIMLIB; chmod +x; and copy to directory in $PATH
#
# script for compilation of SIMLIB/C++ model
# we expect system-wide installation of SIMLIB
# (do not forget to run ldconfig after installation)
#
SOURCE="$1"                 # source file
MODEL="${1%.cc}"            # executable name
if [ -z "$SOURCE" -o ! -f "$SOURCE" -o "$MODEL" = "$SOURCE" ]; then
  echo "Usage: " 
  echo "         SIMLIB model.cc"
  exit 1
fi
echo
echo "### Creating model $MODEL"
echo
g++ -g -O2 -o "$MODEL" "$SOURCE" -lsimlib -lm
echo

