3 # Copyright (c) 2012-2014. The SimGrid Team.
6 # This program is free software; you can redistribute it and/or modify it
7 # under the terms of the license (GNU LGPL) which comes with this package.
9 SIMGRID_VERSION="@SIMGRID_VERSION_STRING@"
13 INCLUDEARGS="@includeflag@"
14 CMAKE_LINKARGS="-L@libdir@"
18 list_set FFLAGS "-ff2c" "-fno-second-underscore"
19 list_set LINKARGS "-lsimgrid" "-lm" "-lgfortran"
24 eval $(list_get TMPFILES)
29 list_set CMDLINE "${F90}"
30 list_add_not_empty CMDLINE "${FFLAGS}"
31 while [ $# -gt 0 ]; do
41 TMPFILE=$(mymktemp "${ARG}" ".f90")
42 list_add TMPFILES "${TMPFILE}"
43 #replace "program main_name by subroutine user\_main (and the end clause as well)"
44 sed 's/[[:space:]]*program[[:space:]]*\([a-zA-Z0-9\-\_]*\)/ subroutine user\_main /gI;s/[[:space:]]*use[[:space:]]*mpi/\include \"mpif\.h\" /gI' "${ARG}" > "${TMPFILE}"
46 list_add CMDLINE "${SRCFILE}"
48 '-version' | '--version')
49 printf '%b\n' "$SIMGRID_VERSION"
52 '-compiler-version' | '--compiler-version')
56 list_add CMDLINE "${ARG}"
61 list_add_not_empty CMDLINE ${INCLUDEARGS}
62 list_add_not_empty CMDLINE ${CMAKE_LINKARGS}
63 list_add_not_empty CMDLINE "${LINKARGS}"
65 eval $(list_get CMDLINE)