build commands Linux: use python or python2

master
david.verelst 12 years ago
parent 542a4d16c8
commit 5e173c9fd2

@ -4,6 +4,7 @@ f2py c_library.pyf c_functions.c -c
See also http://www.scipy.org/Cookbook/CompilingExtensionsOnWindowsWithMinGW See also http://www.scipy.org/Cookbook/CompilingExtensionsOnWindowsWithMinGW
""" """
import os import os
import sys
def which(program): def which(program):
""" """
@ -37,29 +38,33 @@ def which(program):
def f2py_call_str(): def f2py_call_str():
# regardless of platform, try to figure out which f2py call is in the path # regardless of platform, try to figure out which f2py call is in the path
# define possible options # define possible options
f2py_call_list = ('f2py','f2py2.6','f2py2.7','f2py.py',)
no_f2py = True # on Arch Linux, python and f2py are the calls corresponding to python 3
for k in f2py_call_list: # and python2/f2py2 for python 2
# if the call command exists in the path, it will return the path as # other Linux versions might still use python/f2py for python 2
# a string, otherwise it will return None if os.path.basename(sys.executable).endswith('2'):
f2py_path = which(k) for k in ('f2py2','f2py2.6','f2py2.7',):
no_f2py = not f2py_path # if we found the f2py path, no need to look further
if no_f2py: if which(k):
# didn't find the current call k, continue looking f2py_call = k
pass f2py_path = which(k)
else: break
# current call k is in the path # on Windows and other Linux using python/f2py
f2py_call = k
break
# raise exception if f2py is not found
if no_f2py:
raise UserWarning, \
'Couldn\'t locate f2py. Should be part of NumPy installation.'
else: else:
for k in ('f2py','f2py2.6','f2py2.7','f2py.py',):
# if we found the f2py path, no need to look further
if which(k):
f2py_call = k
f2py_path = which(k)
break
try:
print 'found f2py in:', f2py_path print 'found f2py in:', f2py_path
return f2py_call return f2py_call
# raise exception if f2py is not found, f2py_path variable will not exist
except NameError:
raise UserWarning, \
'Couldn\'t locate f2py. Should be part of NumPy installation.'
# # this might vary among specific cases: f2py, f2py2.7, f2py3.2, ... # # this might vary among specific cases: f2py, f2py2.7, f2py3.2, ...
# # TODO: more robust approach, find out what f2py is in the users path # # TODO: more robust approach, find out what f2py is in the users path
# if os.name == 'posix': # if os.name == 'posix':

@ -5,6 +5,7 @@ gfortran -W -Wall -pedantic-errors -fbounds-check -Werror -c dsvdc.f mregmodule.
""" """
import os import os
import sys
def which(program): def which(program):
""" """
@ -38,29 +39,33 @@ def which(program):
def f2py_call_str(): def f2py_call_str():
# regardless of platform, try to figure out which f2py call is in the path # regardless of platform, try to figure out which f2py call is in the path
# define possible options # define possible options
f2py_call_list = ('f2py','f2py2.6','f2py2.7','f2py.py',)
# on Arch Linux, python and f2py are the calls corresponding to python 3
no_f2py = True # and python2/f2py2 for python 2
for k in f2py_call_list: # other Linux versions might still use python/f2py for python 2
# if the call command exists in the path, it will return the path as if os.path.basename(sys.executable).endswith('2'):
# a string, otherwise it will return None for k in ('f2py2','f2py2.6','f2py2.7',):
f2py_path = which(k) # if we found the f2py path, no need to look further
no_f2py = not f2py_path if which(k):
if no_f2py: f2py_call = k
# didn't find the current call k, continue looking f2py_path = which(k)
pass break
else: # on Windows and other Linux using python/f2py
# current call k is in the path
f2py_call = k
break
# raise exception if f2py is not found
if no_f2py:
raise UserWarning, \
'Couldn\'t locate f2py. Should be part of NumPy installation.'
else: else:
for k in ('f2py','f2py2.6','f2py2.7','f2py.py',):
# if we found the f2py path, no need to look further
if which(k):
f2py_call = k
f2py_path = which(k)
break
try:
print 'found f2py in:', f2py_path print 'found f2py in:', f2py_path
return f2py_call return f2py_call
# raise exception if f2py is not found, f2py_path variable will not exist
except NameError:
raise UserWarning, \
'Couldn\'t locate f2py. Should be part of NumPy installation.'
# # this might vary among specific cases: f2py, f2py2.7, f2py3.2, ... # # this might vary among specific cases: f2py, f2py2.7, f2py3.2, ...
# # TODO: more robust approach, find out what f2py is in the users path # # TODO: more robust approach, find out what f2py is in the users path
# if os.name == 'posix': # if os.name == 'posix':

@ -2,6 +2,7 @@
builds mvn.pyd builds mvn.pyd
""" """
import os import os
import sys
def which(program): def which(program):
""" """
@ -36,29 +37,33 @@ def which(program):
def f2py_call_str(): def f2py_call_str():
# regardless of platform, try to figure out which f2py call is in the path # regardless of platform, try to figure out which f2py call is in the path
# define possible options # define possible options
f2py_call_list = ('f2py','f2py2.6','f2py2.7','f2py.py',)
no_f2py = True # on Arch Linux, python and f2py are the calls corresponding to python 3
for k in f2py_call_list: # and python2/f2py2 for python 2
# if the call command exists in the path, it will return the path as # other Linux versions might still use python/f2py for python 2
# a string, otherwise it will return None if os.path.basename(sys.executable).endswith('2'):
f2py_path = which(k) for k in ('f2py2','f2py2.6','f2py2.7',):
no_f2py = not f2py_path # if we found the f2py path, no need to look further
if no_f2py: if which(k):
# didn't find the current call k, continue looking f2py_call = k
pass f2py_path = which(k)
else: break
# current call k is in the path # on Windows and other Linux using python/f2py
f2py_call = k
break
# raise exception if f2py is not found
if no_f2py:
raise UserWarning, \
'Couldn\'t locate f2py. Should be part of NumPy installation.'
else: else:
for k in ('f2py','f2py2.6','f2py2.7','f2py.py',):
# if we found the f2py path, no need to look further
if which(k):
f2py_call = k
f2py_path = which(k)
break
try:
print 'found f2py in:', f2py_path print 'found f2py in:', f2py_path
return f2py_call return f2py_call
# raise exception if f2py is not found, f2py_path variable will not exist
except NameError:
raise UserWarning, \
'Couldn\'t locate f2py. Should be part of NumPy installation.'
# # this might vary among specific cases: f2py, f2py2.7, f2py3.2, ... # # this might vary among specific cases: f2py, f2py2.7, f2py3.2, ...
# # TODO: more robust approach, find out what f2py is in the users path # # TODO: more robust approach, find out what f2py is in the users path
# if os.name == 'posix': # if os.name == 'posix':

@ -2,6 +2,7 @@
builds mvnprdmod.pyd builds mvnprdmod.pyd
""" """
import os import os
import sys
def which(program): def which(program):
""" """
@ -36,29 +37,33 @@ def which(program):
def f2py_call_str(): def f2py_call_str():
# regardless of platform, try to figure out which f2py call is in the path # regardless of platform, try to figure out which f2py call is in the path
# define possible options # define possible options
f2py_call_list = ('f2py','f2py2.6','f2py2.7','f2py.py',)
no_f2py = True # on Arch Linux, python and f2py are the calls corresponding to python 3
for k in f2py_call_list: # and python2/f2py2 for python 2
# if the call command exists in the path, it will return the path as # other Linux versions might still use python/f2py for python 2
# a string, otherwise it will return None if os.path.basename(sys.executable).endswith('2'):
f2py_path = which(k) for k in ('f2py2','f2py2.6','f2py2.7',):
no_f2py = not f2py_path # if we found the f2py path, no need to look further
if no_f2py: if which(k):
# didn't find the current call k, continue looking f2py_call = k
pass f2py_path = which(k)
else: break
# current call k is in the path # on Windows and other Linux using python/f2py
f2py_call = k
break
# raise exception if f2py is not found
if no_f2py:
raise UserWarning, \
'Couldn\'t locate f2py. Should be part of NumPy installation.'
else: else:
for k in ('f2py','f2py2.6','f2py2.7','f2py.py',):
# if we found the f2py path, no need to look further
if which(k):
f2py_call = k
f2py_path = which(k)
break
try:
print 'found f2py in:', f2py_path print 'found f2py in:', f2py_path
return f2py_call return f2py_call
# raise exception if f2py is not found, f2py_path variable will not exist
except NameError:
raise UserWarning, \
'Couldn\'t locate f2py. Should be part of NumPy installation.'
# # this might vary among specific cases: f2py, f2py2.7, f2py3.2, ... # # this might vary among specific cases: f2py, f2py2.7, f2py3.2, ...
# # TODO: more robust approach, find out what f2py is in the users path # # TODO: more robust approach, find out what f2py is in the users path
# if os.name == 'posix': # if os.name == 'posix':

@ -6,6 +6,7 @@ http://www.scipy.org/Cookbook/CompilingExtensionsOnWindowsWithMinGW
""" """
import os import os
import sys
def which(program): def which(program):
""" """
@ -39,29 +40,33 @@ def which(program):
def f2py_call_str(): def f2py_call_str():
# regardless of platform, try to figure out which f2py call is in the path # regardless of platform, try to figure out which f2py call is in the path
# define possible options # define possible options
f2py_call_list = ('f2py','f2py2.6','f2py2.7','f2py.py',)
no_f2py = True # on Arch Linux, python and f2py are the calls corresponding to python 3
for k in f2py_call_list: # and python2/f2py2 for python 2
# if the call command exists in the path, it will return the path as # other Linux versions might still use python/f2py for python 2
# a string, otherwise it will return None if os.path.basename(sys.executable).endswith('2'):
f2py_path = which(k) for k in ('f2py2','f2py2.6','f2py2.7',):
no_f2py = not f2py_path # if we found the f2py path, no need to look further
if no_f2py: if which(k):
# didn't find the current call k, continue looking f2py_call = k
pass f2py_path = which(k)
else: break
# current call k is in the path # on Windows and other Linux using python/f2py
f2py_call = k
break
# raise exception if f2py is not found
if no_f2py:
raise UserWarning, \
'Couldn\'t locate f2py. Should be part of NumPy installation.'
else: else:
for k in ('f2py','f2py2.6','f2py2.7','f2py.py',):
# if we found the f2py path, no need to look further
if which(k):
f2py_call = k
f2py_path = which(k)
break
try:
print 'found f2py in:', f2py_path print 'found f2py in:', f2py_path
return f2py_call return f2py_call
# raise exception if f2py is not found, f2py_path variable will not exist
except NameError:
raise UserWarning, \
'Couldn\'t locate f2py. Should be part of NumPy installation.'
# # this might vary among specific cases: f2py, f2py2.7, f2py3.2, ... # # this might vary among specific cases: f2py, f2py2.7, f2py3.2, ...
# # TODO: more robust approach, find out what f2py is in the users path # # TODO: more robust approach, find out what f2py is in the users path
# if os.name == 'posix': # if os.name == 'posix':

Loading…
Cancel
Save