[SciPy-Dev] Bundling Boost?

Scott Lasley slasley at space.umd.edu
Sun Oct 7 15:40:47 EDT 2012


On Oct 7, 2012, at 12:48 PM, Pauli Virtanen <pav at iki.fi> wrote:

> 07.10.2012 19:21, Charles R Harris kirjoitti:
> [clip]
>> I think using the boost library is a good idea. It is well tested and
>> looks to support quad precision, something we will probably want at some
>> point. It also looks to be highly templated and tightly integrated, so I
>> suspect getting it properly interfaced might be non-trivial. The same
>> holds for the distributions, but we have done much the same. It might be
>> worth looking over the boost classes for some ideas.
>> 
>> As to the size of the code, the current scipy/special library is ~40MB
>> and I expect we can get rid of some of that. We should check for LLVM
>> compatibility to make sure Apple isn't a problem, but it looks like most
>> other C++ compilers will work, Boost does try hard for universality.
>> 
>> Compile times will probably increase if we keep all the templates.
> 
> Integrating it is actually not so hard, it's here if someone wants to
> try (e.g. if it works at all on OSX):
> 
> 	https://github.com/pv/scipy-work/commits/special-boost
> 
> and you get `scipy.special._ufuncs_cxx.jv`.
> 
> -- 
> Pauli Virtanen



I was able to build it with clang 4.1 under OS X 10.8.2.  I don't see any *_ufuncs_cxx.jv files, but I do see these _ufunc files in ./build
./build/lib.macosx-10.7-intel-2.7/scipy/special/_ufuncs.so
./build/lib.macosx-10.7-intel-2.7/scipy/special/_ufuncs_cxx.so
./build/lib.macosx-10.7-intel-2.7/scipy/special/generate_ufuncs.py
./build/temp.macosx-10.7-intel-2.7/scipy/special/_ufuncs.o
./build/temp.macosx-10.7-intel-2.7/scipy/special/_ufuncs_cxx.o

I see scipy.special._ufuncs which is not in scipy-0.12.0.dev_941351d from github

In [2]: print dir(scipy.special._ufuncs)
['__builtins__', '__doc__', '__file__', '__name__', '__package__', '__test__', '_eval_chebyt', '_lambertw', 'airy', 'airye', 'bdtr', 'bdtrc', 'bdtri', 'bdtrik', 'bdtrin', 'bei', 'beip', 'ber', 'berp', 'besselpoly', 'beta', 'betainc', 'betaincinv', 'betaln', 'btdtr', 'btdtri', 'btdtria', 'btdtrib', 'cbrt', 'chdtr', 'chdtrc', 'chdtri', 'chdtriv', 'chndtr', 'chndtridf', 'chndtrinc', 'chndtrix', 'cosdg', 'cosm1', 'cotdg', 'dawsn', 'ellipe', 'ellipeinc', 'ellipj', 'ellipkinc', 'ellipkm1', 'erf', 'erfc', 'errprint', 'exp1', 'exp10', 'exp2', 'expi', 'expit', 'expm1', 'expn', 'fdtr', 'fdtrc', 'fdtri', 'fdtridfd', 'fresnel', 'gamma', 'gammainc', 'gammaincc', 'gammainccinv', 'gammaincinv', 'gammaln', 'gdtr', 'gdtrc', 'gdtria', 'gdtrib', 'gdtrix', 'hankel1', 'hankel1e', 'hankel2', 'hankel2e', 'hyp1f1', 'hyp1f2', 'hyp2f0', 'hyp2f1', 'hyp3f0', 'hyperu', 'i0', 'i0e', 'i1', 'i1e', 'it2i0k0', 'it2j0y0', 'it2struve0', 'itairy', 'iti0k0', 'itj0y0', 'itmodstruve0', 'itstruve0', 'iv', 'ive', 'j0', 'j1', 'jn', 'jv', 'jve', 'k0', 'k0e', 'k1', 'k1e', 'kei', 'keip', 'kelvin', 'ker', 'kerp', 'kn', 'kolmogi', 'kolmogorov', 'kv', 'kve', 'log1p', 'log_ndtr', 'logit', 'lpmv', 'mathieu_a', 'mathieu_b', 'mathieu_cem', 'mathieu_modcem1', 'mathieu_modcem2', 'mathieu_modsem1', 'mathieu_modsem2', 'mathieu_sem', 'modfresnelm', 'modfresnelp', 'modstruve', 'nbdtr', 'nbdtrc', 'nbdtri', 'nbdtrik', 'nbdtrin', 'ncfdtr', 'ncfdtri', 'ncfdtridfd', 'ncfdtridfn', 'ncfdtrinc', 'nctdtr', 'nctdtridf', 'nctdtrinc', 'nctdtrit', 'ndtr', 'ndtri', 'nrdtrimn', 'nrdtrisd', 'obl_ang1', 'obl_ang1_cv', 'obl_cv', 'obl_rad1', 'obl_rad1_cv', 'obl_rad2', 'obl_rad2_cv', 'pbdv', 'pbvv', 'pbwa', 'pdtr', 'pdtrc', 'pdtri', 'pdtrik', 'pro_ang1', 'pro_ang1_cv', 'pro_cv', 'pro_rad1', 'pro_rad1_cv', 'pro_rad2', 'pro_rad2_cv', 'psi', 'radian', 'rgamma', 'round', 'shichi', 'sici', 'sindg', 'smirnov', 'smirnovi', 'spence', 'stdtr', 'stdtridf', 'stdtrit', 'struve', 'tandg', 'tklmbda', 'wofz', 'y0', 'y1', 'yn', 'yv', 'yve', 'zeta', 'zetac']

In [3]: scipy.special.test('full')
Running unit tests for scipy.special
NumPy version 1.8.0.dev-3f10c36
NumPy is installed in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy-1.8.0.dev_3f10c36-py2.7-macosx-10.7-intel.egg/numpy
SciPy version 0.12.0.dev-ccbfd79
SciPy is installed in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scipy-0.12.0.dev_ccbfd79-py2.7-macosx-10.7-intel.egg/scipy
Python version 2.7.3 (default, Jun 24 2012, 10:45:32) [GCC 4.2.1 Compatible Apple Clang 4.0 ((tags/Apple/clang-421.10.42))]
nose version 1.1.2
..................E...................................................K.K.............................................................................................................................................................................................................................................................................................................................................................................................K........K..............SSSSSSSS............................
======================================================================
ERROR: test_iv_cephes_vs_amos_mass_test (test_basic.TestBessel)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scipy-0.12.0.dev_ccbfd79-py2.7-macosx-10.7-intel.egg/scipy/special/tests/test_basic.py", line 1643, in test_iv_cephes_vs_amos_mass_test
    v[imsk] = v.astype(int)
ValueError: NumPy boolean array indexing assignment cannot assign 1000000 input values to the 125035 output values where the mask is true

----------------------------------------------------------------------
Ran 514 tests in 1.993s

FAILED (KNOWNFAIL=4, SKIP=8, errors=1)
Out[3]: <nose.result.TextTestResult run=514 errors=1 failures=0>


The same test fails in scipy-0.12.0.dev_941351d


More information about the SciPy-Dev mailing list