Permalink
Browse files

Merge pull request #2447 from rgommers/fix-bento-build

BLD: Fix Bento build
  • Loading branch information...
pv committed May 5, 2013
2 parents c5b9533 + 273ef91 commit bf1bfd0400015d8a0a2a8cedfe18029ee0bb16da
View
@@ -1,19 +1,30 @@
No-frill version:
* Clone bento::
* Clone bento::
git clone git://github.com/cournape/Bento.git bento-git
$ git clone git://github.com/cournape/Bento.git bento
* Bootstrap bento::
* Bootstrap bento::
cd bento-git && python bootstrap.py
$ cd bento && python bootstrap.py
* Download waf (version 1.6.4 or 1.6.5 should work)
* In the bento_waf_branch of scipy:
* Clone Waf::
export WAFDIR=ROOT_OF_WAF_SVN_TRUNK # WAFDIR should be such as $WAFDIR/waflib exists
$BENTO_ROOT/bentomaker build -j 4 # 4 threads in parallel
git clone https://code.google.com/p/waf/
* Set the WAFDIR environment variable to the base dir of the waf repo you
just created (in your bash_login for example if you're going to build with
Bento often). This is unfortunately needed, Waf is not installable like a
regular Python package::
$ export WAFDIR=ROOT_OF_WAF_REPO
# WAFDIR should be such as $WAFDIR/waflib exists
* Build scipy with Bento::
$ BENTO_ROOT/bentomaker build -j 4 # 4 threads in parallel
# or with progress bar
$BENTO_ROOT/bentomaker build -p
$ BENTO_ROOT/bentomaker build -p
# or with verbose output
$BENTO_ROOT/bentomaker build -v
$ BENTO_ROOT/bentomaker build -v
View
@@ -1,5 +1,5 @@
Name: scipy
Version: 0.10.0
Version: 0.13.0
Summary: SciPy: Scientific Library for Python
Url: http://www.scipy.org
DownloadUrl: http://sourceforge.net/project/showfiles.php?group_id=27747&package_id=19531
View
46 bscript
@@ -23,6 +23,10 @@ from bento.commands import hooks
import waflib
from waflib import Options
# Importing setup.py needed to get version info
import setup
# FIXME: add this to numpy so that we can reuse it
class CTemplateTask(waflib.Task.Task):
color = 'BLUE'
@@ -125,11 +129,14 @@ def _set_mangling_var(conf, u, du, case, f2pycompat=True):
env.DEFINES.extend(macros)
def _generate_cython():
print("Cythonizing sources")
cwd = os.path.abspath(os.path.dirname(__file__))
subprocess.call([sys.executable,
os.path.join(cwd, 'tools', 'cythonize.py'),
'scipy'],
cwd=cwd)
p = subprocess.call([sys.executable,
os.path.join(cwd, 'tools', 'cythonize.py'),
'scipy'],
cwd=cwd)
if p != 0:
raise RuntimeError("Running cythonize failed!")
@hooks.post_configure
def post_configure(context):
@@ -174,17 +181,35 @@ def post_configure(context):
if not (conf.env.HAS_BLAS and conf.env.HAS_LAPACK):
raise waflib.Errors.ConfigurationError("You need blas and lapack")
blas_lapack.check_cblas(context)
blas_lapack.check_blas_lapack(context)
npymath_info = get_pkg_info("npymath")
conf.parse_flags(npymath_info.cflags() + " " + npymath_info.libs(), "NPYMATH")
_generate_cython()
FULLVERSION, GIT_REVISION = setup.get_version_info()
version_file_content = """\
# THIS FILE IS GENERATED FROM SCIPY BSCRIPT
short_version = '%(version)s'
version = '%(version)s'
full_version = '%(full_version)s'
git_revision = '%(git_revision)s'
release = %(isrelease)s
if not release:
version = full_version
""" % {'version': setup.VERSION,
'full_version' : FULLVERSION,
'git_revision' : GIT_REVISION,
'isrelease': str(setup.ISRELEASED)}
@hooks.pre_build
def pre_build(context):
bld = context.waf_context
_generate_cython()
context.register_category("gen_pymodule")
bld(features="gen_pymodule",
target="scipy/__config__.py",
@@ -193,13 +218,10 @@ def show():
pass
""",
always=True)
bld(features="gen_pymodule",
target="scipy/version.py",
content="""\
version = '0.9.0'
short_version = version
is_released = True
""",
content=version_file_content,
always=True)
@hooks.options
@@ -34,5 +34,7 @@ Library:
Sources: _odepackmodule.c
Extension: vode
Sources: vode.pyf
Extension: lsoda
Sources: lsoda.pyf
Extension: _dop
Sources: dop.pyf
View
@@ -2,8 +2,16 @@ from bento.commands import hooks
@hooks.pre_build
def pre_build(context):
context.tweak_extension("_quadpack", use="quadpack linpack_lite mach FBLAS CLIB")
context.tweak_extension("_odepack", use="odepack linpack_lite mach FBLAS CLIB")
context.tweak_extension("vode", features="c cshlib pyext bento f2py",
use="odepack linpack_lite mach FBLAS CLIB")
context.tweak_extension("_dop", features="c fc cshlib pyext bento f2py", use="dop FBLAS CLIB")
context.tweak_extension("_quadpack",
use="quadpack linpack_lite mach BLAS CLIB")
context.tweak_extension("_odepack",
use="odepack linpack_lite mach BLAS CLIB")
context.tweak_extension("vode",
features="c cshlib pyext bento f2py",
use="odepack linpack_lite mach BLAS CLIB")
context.tweak_extension("lsoda",
features="c cshlib pyext bento f2py",
use="odepack linpack_lite mach BLAS CLIB")
context.tweak_extension("_dop",
features="c fc cshlib pyext bento f2py",
use="dop BLAS CLIB")
View
@@ -14,7 +14,7 @@ def pre_build(context):
return default_builder(extension,
features="c fc pyext bento cshlib f2py",
source=source,
use="FBLAS CLIB")
use="BLAS CLIB")
context.register_builder("fblas", fblas_builder)
def cblas_builder(extension):
View
@@ -5,7 +5,7 @@ def pre_build(context):
default_builder = context.default_builder
context.tweak_extension("flapack", features="c fc pyext bento cshlib f2py",
use="FLAPACK")
use="LAPACK")
def clapack_builder(extension):
kw = {"features": "c fc pyext bento cshlib f2py"}
@@ -18,4 +18,4 @@ def pre_build(context):
context.tweak_extension("calc_lwork",
features="c fc pyext bento cshlib f2py f2py_fortran",
use="FLAPACK CLIB")
use="LAPACK CLIB")
View
@@ -6,7 +6,6 @@ from bento.commands import hooks
def pre_build(context):
default_builder = context.default_builder
bld = context.waf_context
f2py = bld.tools["f2py"]
def fblas_builder(extension):
source = extension.sources[:]
@@ -16,7 +15,7 @@ def pre_build(context):
return default_builder(extension,
features="c fc pyext bento cshlib f2py",
source=source,
use="FBLAS CLIB")
use="BLAS CLIB")
context.register_builder("_fblas", fblas_builder)
def cblas_builder(extension):
@@ -26,8 +25,9 @@ def pre_build(context):
use="CBLAS")
context.register_builder("_cblas", cblas_builder)
context.tweak_extension("_flapack", features="c fc pyext bento cshlib f2py",
use="FLAPACK CLIB")
context.tweak_extension("_flapack",
features="c fc pyext bento cshlib f2py",
use="LAPACK CLIB")
def builder(extension):
if bld.env.HAS_CLAPACK:
@@ -36,7 +36,9 @@ def pre_build(context):
use="CLAPACK")
context.register_builder("_clapack", builder)
context.tweak_extension("_flinalg", features="c fc pyext bento cshlib f2py f2py_fortran",
use="FLAPACK CLIB")
context.tweak_extension("calc_lwork", features="c fc pyext bento cshlib f2py f2py_fortran",
use="FLAPACK CLIB")
context.tweak_extension("_flinalg",
features="c fc pyext bento cshlib f2py f2py_fortran",
use="LAPACK CLIB")
context.tweak_extension("calc_lwork",
features="c fc pyext bento cshlib f2py f2py_fortran",
use="LAPACK CLIB")
View
@@ -1,3 +1,11 @@
Library:
Extension: _nd_image
Sources: src/*.c
Sources: src/nd_image.c,
src/ni_filters.c,
src/ni_fourier.c,
src/ni_interpolation.c,
src/ni_measure.c,
src/ni_morphology.c,
src/ni_support.c
Extension: _ni_label
Sources: src/_ni_label.c
View
@@ -4,4 +4,4 @@ from bento.commands import hooks
def pre_build(context):
context.tweak_extension("__odrpack",
features="c fc pyext bento cshlib",
use="odrpack FBLAS CLIB")
use="odrpack BLAS CLIB")
View
@@ -4,7 +4,7 @@ from bento.commands import hooks
def pre_build(context):
features="c fc pyext bento cshlib"
f2py_features = "c fc pyext bento cshlib f2py"
use = "minpack rootfind FLAPACK CLIB"
use = "minpack rootfind LAPACK CLIB"
context.tweak_extension("_lbfgsb", features=f2py_features, use=use)
context.tweak_extension("_cobyla", features=f2py_features, use=use)
@@ -4,7 +4,7 @@ from bento.commands import hooks
def pre_build(context):
default_builder = context.default_builder
context.tweak_extension("_superlu", use="superlu_src FLAPACK")
context.tweak_extension("_superlu", use="superlu_src LAPACK")
def st_builder(extension):
return default_builder(extension,
@@ -26,4 +26,4 @@ def pre_build(context):
context.register_compiled_library_builder("arpack", builder)
context.tweak_extension("_arpack", features="c fc pyext cshlib f2py bento",
use="arpack FLAPACK CLIB")
use="arpack LAPACK CLIB")
@@ -20,5 +20,5 @@ def pre_build(context):
return default_builder(extension,
features="c pyext fc bento cshlib f2py",
source=sources,
use="FLAPACK CLIB")
use="LAPACK CLIB")
context.register_builder("_iterative", builder)
View
@@ -2,5 +2,5 @@ from bento.commands import hooks
@hooks.pre_build
def pre_build(context):
context.tweak_extension("qhull", use="FLAPACK CLIB",
context.tweak_extension("qhull", use="LAPACK CLIB",
defines=['qh_QHpointer=1'])

0 comments on commit bf1bfd0

Please sign in to comment.