Clean up mpi.h inclusion on Windows
[charm.git] / src / libs / ck-libs / ampi / ampiCC
blob2944e1150532e2f497e53f14ebf52c1f6dafbd63
1 #!/bin/sh
2 CHARMBIN=`dirname $0`
4 [ -z "$AMPICC_MODE" ] && AMPICC_MODE='ampi'
5 STANDALONE=''
6 ROMIO_CONFIGURE=''
7 MPITEST=''
9 ARGS=''
11 processArgs() {
12 while [ ! $# -eq 0 ]
14 arg="$1"
15 case "$arg" in
16 -show)
17 echo "charmc"
18 exit 0
20 -standalone)
21 STANDALONE='true'
24 # These arguments manage compilation of ROMIO's configure tests.
25 # Simple environment tests will be compiled as standalone binaries,
26 # while MPI tests will be compiled with AMPI.
27 -ampi-romio-configure) # Strictly for internal use.
28 ROMIO_CONFIGURE='true'
30 mpitest*) # mpitest.c, mpitest1.c, mpitest.f, etc
31 ARGS="$ARGS \"$arg\""
32 MPITEST='true'
36 ARGS="$ARGS \"$arg\""
38 esac
39 shift
40 done
43 eval processArgs "$@"
45 [ -n "$ROMIO_CONFIGURE" -a -z "$MPITEST" ] && STANDALONE='true'
47 [ -n "$STANDALONE" ] && ARGS="$ARGS -standalone"
49 [ -f $CHARMBIN/../lib/libampiromio.a -a -z "$STANDALONE" -a -z "$ROMIO_CONFIGURE" ] && ROMIO='-lampiromio'
51 $CHARMBIN/charmc -language $AMPICC_MODE -default-to-aout $ARGS $ROMIO
52 status=$?
54 # Copy ampirun, but do not overwrite it if it already exists.
55 [ $status -eq 0 ] && cp -n $CHARMBIN/ampirun .
57 exit $status