|
|
@ -39,16 +39,17 @@ def which(program):
|
|
|
|
|
|
|
|
|
|
|
|
def f2py_call_str():
|
|
|
|
def f2py_call_str():
|
|
|
|
'''Return which f2py callable is in the path regardless of platform'''
|
|
|
|
'''Return which f2py callable is in the path regardless of platform'''
|
|
|
|
|
|
|
|
|
|
|
|
# define possible options:
|
|
|
|
# define possible options:
|
|
|
|
# on Arch Linux, python and f2py are the calls corresponding to python 3
|
|
|
|
# on Arch Linux, python and f2py are the calls corresponding to python 3
|
|
|
|
# and python2/f2py2 for python 2
|
|
|
|
# and python2/f2py2 for python 2
|
|
|
|
# other Linux versions might still use python/f2py for python 2
|
|
|
|
# other Linux versions might still use python/f2py for python 2
|
|
|
|
|
|
|
|
|
|
|
|
if os.path.basename(sys.executable).endswith('2'):
|
|
|
|
if os.path.basename(sys.executable).endswith('2'):
|
|
|
|
options = ('f2py2', 'f2py2.6', 'f2py2.7',)
|
|
|
|
options = ('f2py2', 'f2py2.6', 'f2py2.7',)
|
|
|
|
else: # on Windows and other Linux using python/f2py
|
|
|
|
else: # on Windows and other Linux using python/f2py
|
|
|
|
options = ('f2py.bat', 'f2py', 'f2py2.6', 'f2py2.7', 'f2py.py',)
|
|
|
|
options = ('f2py.exe', 'f2py.bat', 'f2py', 'f2py2.6', 'f2py2.7',
|
|
|
|
|
|
|
|
'f2py.py',)
|
|
|
|
for k in options:
|
|
|
|
for k in options:
|
|
|
|
if which(k):
|
|
|
|
if which(k):
|
|
|
|
# Found the f2py path, no need to look further
|
|
|
|
# Found the f2py path, no need to look further
|
|
|
@ -62,4 +63,3 @@ def f2py_call_str():
|
|
|
|
except NameError:
|
|
|
|
except NameError:
|
|
|
|
raise UserWarning('Couldn\'t locate f2py. '
|
|
|
|
raise UserWarning('Couldn\'t locate f2py. '
|
|
|
|
'Should be part of NumPy installation.')
|
|
|
|
'Should be part of NumPy installation.')
|
|
|
|
|
|
|
|
|
|
|
|