Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
MPI_Comm_split is back to life.
[simgrid.git] / src / smpi / smpicc.in
1 #! /bin/bash
2 #FIXME: .. paths...
3 prefix="@prefix@"
4 exec_prefix="@exec_prefix@"
5
6 CC="gcc"
7 CFLAGS="-O2 -Dmain=smpi_simulated_main"
8
9 #FIXME: probably only want the last two pairs after 'make install'
10 INCLUDEARGS="-I@top_srcdir@/include -I@top_srcdir@/include/smpi -I@includedir@ -I@includedir@/smpi"
11 CMAKE_LINKARGS="-L@CMAKE_LINKARGS@"
12 LINKARGS="-L@top_builddir@/src/.libs -L@libdir@ -lsimgrid -lsmpi "
13
14 CMDLINE=""
15 while [ -n "$1" ]; do
16   ARG="$1"
17   shift
18   if [ "${ARG}" = "-c" ]; then
19       LINKARGS=""
20       CMDLINE="${CMDLINE} -c "
21   elif [ "${ARG%.c}" != "${ARG}" ]; then
22     SRCFILE="$(readlink -f ${ARG} 2>/dev/null)"
23     if [ -z $SRCFILE ] ; then
24       SRCFILE="$ARG"
25     fi
26     CMDLINE="${CMDLINE} ${SRCFILE} "
27   else
28     CMDLINE="${CMDLINE} ${ARG} "
29   fi
30 done
31
32 CMDLINE="${CC} ${INCLUDEARGS} ${CFLAGS} ${CMDLINE} ${CMAKE_LINKARGS} ${LINKARGS}"
33
34 #echo "${CMDLINE}"
35 ${CMDLINE}