2012-05-06 21:30:59 +08:00
|
|
|
import os
|
2010-09-06 22:15:53 +08:00
|
|
|
from os.path import join
|
|
|
|
|
|
2012-07-26 17:45:20 +08:00
|
|
|
from sklearn._build_utils import get_blas_info
|
2010-09-06 22:15:53 +08:00
|
|
|
|
2012-08-10 18:06:42 +08:00
|
|
|
|
2011-05-17 16:26:46 +08:00
|
|
|
def configuration(parent_package='', top_path=None):
|
2010-08-27 21:39:56 +08:00
|
|
|
import numpy
|
|
|
|
|
from numpy.distutils.misc_util import Configuration
|
|
|
|
|
|
|
|
|
|
config = Configuration('utils', parent_package, top_path)
|
|
|
|
|
config.add_subpackage('sparsetools')
|
|
|
|
|
|
2012-07-25 18:34:04 +08:00
|
|
|
cblas_libs, blas_info = get_blas_info()
|
2010-09-06 22:15:53 +08:00
|
|
|
|
2012-05-06 21:30:59 +08:00
|
|
|
libraries = []
|
|
|
|
|
if os.name == 'posix':
|
|
|
|
|
libraries.append('m')
|
|
|
|
|
cblas_libs.append('m')
|
|
|
|
|
|
2011-11-18 02:22:31 +08:00
|
|
|
config.add_extension('arraybuilder',
|
2011-11-21 04:18:41 +08:00
|
|
|
sources=['arraybuilder.c'])
|
2011-11-18 02:22:31 +08:00
|
|
|
|
2011-12-19 22:57:07 +08:00
|
|
|
config.add_extension('sparsefuncs',
|
2012-05-06 18:41:37 +08:00
|
|
|
sources=['sparsefuncs.c'],
|
2012-05-06 21:30:59 +08:00
|
|
|
libraries=libraries)
|
2011-12-19 22:57:07 +08:00
|
|
|
|
2010-09-06 22:15:53 +08:00
|
|
|
config.add_extension('arrayfuncs',
|
2011-11-21 04:18:41 +08:00
|
|
|
sources=['arrayfuncs.c'],
|
|
|
|
|
depends=[join('src', 'cholesky_delete.c')],
|
|
|
|
|
libraries=cblas_libs,
|
|
|
|
|
include_dirs=[join('..', 'src', 'cblas'),
|
|
|
|
|
numpy.get_include(),
|
|
|
|
|
blas_info.pop('include_dirs', [])],
|
|
|
|
|
extra_compile_args=blas_info.pop('extra_compile_args', []),
|
|
|
|
|
**blas_info
|
|
|
|
|
)
|
2011-09-07 05:12:26 +08:00
|
|
|
|
2012-01-16 08:40:47 +08:00
|
|
|
config.add_extension(
|
|
|
|
|
'murmurhash',
|
2012-01-16 15:11:50 +08:00
|
|
|
sources=['murmurhash.c', join('src', 'MurmurHash3.cpp')],
|
2012-01-16 08:40:47 +08:00
|
|
|
include_dirs=['src'])
|
|
|
|
|
|
2011-08-05 10:43:31 +08:00
|
|
|
config.add_extension('graph_shortest_path',
|
2011-11-21 04:18:41 +08:00
|
|
|
sources=['graph_shortest_path.c'],
|
|
|
|
|
include_dirs=[numpy.get_include()])
|
2011-08-05 10:43:31 +08:00
|
|
|
|
2012-03-08 03:09:05 +08:00
|
|
|
config.add_extension('seq_dataset',
|
|
|
|
|
sources=['seq_dataset.c'],
|
|
|
|
|
include_dirs=[numpy.get_include()])
|
|
|
|
|
|
|
|
|
|
config.add_extension('weight_vector',
|
|
|
|
|
sources=['weight_vector.c'],
|
2012-05-06 18:41:37 +08:00
|
|
|
include_dirs=[numpy.get_include()],
|
2012-05-06 21:30:59 +08:00
|
|
|
libraries=libraries)
|
2012-02-16 04:30:36 +08:00
|
|
|
|
2010-08-27 21:39:56 +08:00
|
|
|
return config
|
2012-01-16 15:11:50 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
|
from numpy.distutils.core import setup
|
|
|
|
|
setup(**configuration(top_path='').todict())
|