-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgfortranwrapper
More file actions
executable file
·31 lines (25 loc) · 834 Bytes
/
gfortranwrapper
File metadata and controls
executable file
·31 lines (25 loc) · 834 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/sh
# $Id: gfortranwrapper,v 1.1 2014/01/16 09:32:24 eha Exp eha $
# Copyright 2014 Eric Hameleers, Eindhoven, NL
# Copyright 2018 Ben Stern <[email protected]>
# Distributed under the GNU General Public License, version 2, as published by
# the Free Software Foundation.
# Find the stub gfortran's directory:
STUBPATH=$(cd $(dirname $0); pwd)
# Now find the "real" gfortran
REALFC=$(PATH="$(echo $PATH | sed "s#\(.*\):\?$STUBPATH/\?:\?#\1#")" which $(basename $0))
# Filter out -m32 from $@ (this is sometimes added even though we specify -m64)
declare -a Arguments
for i; do
case "$i" in
-m32)
;;
*)
Arguments[${#Arguments[@]}]="$i"
;;
esac
done
# Compiling a 64-bit program requires we call gfortran with -m64
$REALFC -m64 "${Arguments[@]}"
# Exit with $REALFC's exit code
exit $?