-
Notifications
You must be signed in to change notification settings - Fork 4
/
compilef90.py
21 lines (20 loc) · 1.1 KB
/
compilef90.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
import os
s1 = str()
s1 += 'initialisation.f90 '
s1 += 'set_bnd.f90 '
#
fcompiler = " --fcompiler='intelem' "
# fcompiler = " --fcompiler='gnu95' "
if 'gnu95' in fcompiler:
# f90flags = "--f90flags='-mcmodel=medium -funroll-loops -fdefault-real-8' --opt='-O3' "
# f90flags = "--f90flags='-mcmodel=medium -funroll-loops -fdefault-real-8' --opt='-flto -O3' "
f90flags = "--f90flags='-mcmodel=medium -funroll-loops -fdefault-real-8' --opt='-Ofast' "
# f90flags = "--f90flags='-mcmodel=medium -funroll-loops -fdefault-real-8' "
elif 'intel' in fcompiler :
f90flags = "--f90flags='-mcmodel=medium -funroll-loops -r8' --opt='-ipo -O3'"
# f90flags = " --f90flags='-mcmodel=medium -funroll-loops -r8' --opt='-ipo -O3'"#"--f90flags='-mcmodel=medium -funroll-loops -fdefault-real-8' --opt='-O3'"
options = fcompiler + f90flags
tn = 'f_init'
exec_str = 'f2py -m %s -c %s %s' % (tn, s1, options)
os.system(exec_str)