#!/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 SIMLIB file first, please"
#
SIMLIB="$HOME/WORK/SIMLIB/src" # 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 " SIMLIB 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
syntax highlighted by Code2HTML, v. 0.9.1