A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
have the smpif90 file replace the main program clause by our own for f90
[simgrid.git]
/
src
/
smpi
/
smpif90.in
diff --git
a/src/smpi/smpif90.in
b/src/smpi/smpif90.in
index
e86bd38
..
3724e84
100644
(file)
--- a/
src/smpi/smpif90.in
+++ b/
src/smpi/smpif90.in
@@
-1,14
+1,14
@@
#! /bin/bash
#! /bin/bash
-CC=@CMAKE_
REAL_
Fortran_Compiler@
+CC=@CMAKE_Fortran_Compiler@
INCLUDEARGS="@includeflag@"
CMAKE_LINKARGS="-L@libdir@"
INCLUDEARGS="@includeflag@"
CMAKE_LINKARGS="-L@libdir@"
-FFLAGS="-O2 -
cpp -Dprogram=subroutine -Dmain=user_main -
ff2c "
+FFLAGS="-O2 -ff2c "
LINKARGS="-lsimgrid -lsmpi -lm -lgfortran"
LINKARGS="-lsimgrid -lsmpi -lm -lgfortran"
-
-
+main_name=main
+TMPFILE=smpi_temp.f90
CMDLINE=""
while [ -n "$1" ]; do
ARG="$1"
CMDLINE=""
while [ -n "$1" ]; do
ARG="$1"
@@
-24,6
+24,9
@@
while [ -n "$1" ]; do
if [ -z $SRCFILE ] ; then
SRCFILE="$ARG"
fi
if [ -z $SRCFILE ] ; then
SRCFILE="$ARG"
fi
+ #replace "program main_name by subroutine user\_main (and the end clause as well)"
+ sed 's/[[:space:]]*program[[:space:]]*\([a-zA-Z0-9\-\_]*\)/subroutine user\_main /g' ${ARG} > ${TMPFILE}
+ SRCFILE="./${TMPFILE}"
CMDLINE="${CMDLINE} ${SRCFILE} "
;;
*)
CMDLINE="${CMDLINE} ${SRCFILE} "
;;
*)
@@
-34,5
+37,9
@@
done
CMDLINE="${CC} ${FFLAGS} ${CMDLINE} ${INCLUDEARGS} ${CMAKE_LINKARGS} ${LINKARGS}"
CMDLINE="${CC} ${FFLAGS} ${CMDLINE} ${INCLUDEARGS} ${CMAKE_LINKARGS} ${LINKARGS}"
-
#
echo "${CMDLINE}"
+echo "${CMDLINE}"
${CMDLINE}
${CMDLINE}
+
+if [ -f ${TMPFILE} ];then
+ rm ${TMPFILE}
+fi