~ubuntu-branches/ubuntu/raring/simgrid/raring

« back to all changes in this revision

Viewing changes to src/smpi/smpif90.in

  • Committer: Package Import Robot
  • Author(s): Martin Quinson
  • Date: 2013-01-31 00:24:51 UTC
  • mfrom: (10.1.6 sid)
  • Revision ID: package-import@ubuntu.com-20130131002451-krejhf7w7h24lpsc
Tags: 3.9~rc1-1
* New upstream release: the "Grasgory" release. Major changes:
  - Gras was completely removed from this version.
  - Documentation reorganization to ease browsing it.
  - New default value for the TCP_gamma parameter: 4MiB

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/bash
 
2
 
 
3
CC=@CMAKE_Fortran_Compiler@
 
4
 
 
5
INCLUDEARGS="@includeflag@"
 
6
CMAKE_LINKARGS="-L@libdir@"
 
7
 
 
8
FFLAGS="-ff2c "
 
9
LINKARGS="-lsimgrid -lsmpi -lm -lgfortran"
 
10
main_name=main
 
11
TMPFILE=$(mktemp).f90
 
12
CMDLINE=""
 
13
while [ -n "$1" ]; do
 
14
  ARG="$1"
 
15
  shift
 
16
  case "${ARG}" in
 
17
   -c)
 
18
      CMAKE_LINKARGS=""
 
19
      LINKARGS=""
 
20
      CMDLINE="${CMDLINE} -c "
 
21
      ;;
 
22
   *.f90|*.F90)
 
23
      SRCFILE="$(readlink -f ${ARG} 2>/dev/null)"
 
24
      if [ -z $SRCFILE ] ; then
 
25
         SRCFILE="$ARG"
 
26
      fi
 
27
      #replace "program main_name by subroutine user\_main (and the end clause as well)"
 
28
      sed 's/[[:space:]]*program[[:space:]]*\([a-zA-Z0-9\-\_]*\)/subroutine user\_main /g'  ${ARG} > ${TMPFILE}
 
29
      SRCFILE="${TMPFILE}"
 
30
      CMDLINE="${CMDLINE} ${SRCFILE} "
 
31
      ;;
 
32
   *)
 
33
      CMDLINE="${CMDLINE} ${ARG} "
 
34
      ;;
 
35
  esac
 
36
done
 
37
 
 
38
CMDLINE="${CC} ${FFLAGS} ${CMDLINE} ${INCLUDEARGS} ${CMAKE_LINKARGS} ${LINKARGS}"
 
39
 
 
40
echo "${CMDLINE}"
 
41
${CMDLINE}
 
42
 
 
43
if [ -f ${TMPFILE} ];then
 
44
  rm ${TMPFILE}
 
45
fi