1#!/usr/local/bin/bash
2
3if test @MPICC@;
4 then echo; \
5      echo "Building for parallel computing:"; \
6      echo;
7 else echo "Package was built without MPI support: Exiting."; \
8 exit 1;
9fi;
10
11rm -f model.c
12rm -f $2
13
14echo "Creating model.c file from $1 ..."
15mod $1
16
17shopt -s extglob
18
19if test $2;
20 then target=$2;
21 else target=mcsim.${1%.mod?('el')};
22fi;
23
24if test -f model.c; then \
25
26	echo; \
27	echo "Compiling and linking model with MPI..."; \
28	@MPICC@ -DUSEMPI -O3 -w -I@prefix@/include model.c @prefix@/share/mcsim/sim/*.c -o $target @LIBS@ -Wall; \
29
30fi;
31
32if test -f $target; then \
33
34	echo "Cleaning up ..."; \
35	rm -f model.c; \
36
37	echo "Created executable $target with MPI support."; \
38	echo; \
39
40fi;
41