Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
another fix to avoid issues with .f or .F in f77
authordegomme <augustin.degomme@unibas.ch>
Wed, 20 Jan 2016 18:32:53 +0000 (19:32 +0100)
committerdegomme <augustin.degomme@unibas.ch>
Wed, 20 Jan 2016 18:37:30 +0000 (19:37 +0100)
src/smpi/smpiff.in

index 9cfa9fb..90e0140 100644 (file)
@@ -31,7 +31,6 @@ filter_and_compile() {
     list_add TMPFILES "${TMPFILE}"
     #replace "program main_name by subroutine user\_main (and the end clause as well)"
     sed 's/[[:space:]]\{6\}[[:space:]]*\(end \)\{0,1\}program[[:space:]]*\([a-zA-Z0-9\-\_]*\)/      \1subroutine user_main /gI;s/[[:space:]]*use[[:space:]]*mpi/\include \"mpif\.h\" /gI' "${ARG}" > "${TMPFILE}"
-    ORIGFILE="${ARG}"
     SRCFILE="${TMPFILE}"
     list_add CMDLINE "${SRCFILE}"
 }
@@ -50,10 +49,12 @@ while [ $# -gt 0 ]; do
             ;;
         *.f)
             TMPFILE=$(mymktemp "${ARG}" ".f")
+            ORIGFILE="${ARG%.f}"
             filter_and_compile
             ;;
         *.F)
             TMPFILE=$(mymktemp "${ARG}" ".F")
+            ORIGFILE="${ARG%.F}"
             filter_and_compile
             ;;
         '-version' | '--version')
@@ -78,7 +79,7 @@ while [ $# -gt 0 ]; do
 done
 
 if [ $NEEDS_OUTPUT -ne 0 ]; then
-   list_add CMDLINE "-o${ORIGFILE%.f}.o"     
+   list_add CMDLINE "-o${ORIGFILE}.o"     
 fi
 
 list_add_not_empty CMDLINE ${INCLUDEARGS}