2012-05-06 21:30:59 +08:00
|
|
|
import os
|
2010-09-06 22:15:53 +08:00
|
|
|
from os.path import join
|
|
|
|
|
|
2019-10-25 20:42:18 +08:00
|
|
|
from sklearn._build_utils import gen_from_templates
|
|
|
|
|
|
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)
|
|
|
|
|
|
2012-05-06 21:30:59 +08:00
|
|
|
libraries = []
|
|
|
|
|
if os.name == 'posix':
|
|
|
|
|
libraries.append('m')
|
|
|
|
|
|
2019-02-21 02:23:34 +08:00
|
|
|
config.add_extension('sparsefuncs_fast',
|
|
|
|
|
sources=['sparsefuncs_fast.pyx'],
|
2012-12-22 20:02:50 +08:00
|
|
|
libraries=libraries)
|
2011-12-19 22:57:07 +08:00
|
|
|
|
2019-02-02 00:39:04 +08:00
|
|
|
config.add_extension('_cython_blas',
|
|
|
|
|
sources=['_cython_blas.pyx'],
|
|
|
|
|
libraries=libraries)
|
|
|
|
|
|
2010-09-06 22:15:53 +08:00
|
|
|
config.add_extension('arrayfuncs',
|
2016-11-02 19:57:04 +08:00
|
|
|
sources=['arrayfuncs.pyx'],
|
2019-02-21 02:23:34 +08:00
|
|
|
include_dirs=[numpy.get_include()],
|
|
|
|
|
libraries=libraries)
|
2011-09-07 05:12:26 +08:00
|
|
|
|
2016-11-02 19:57:04 +08:00
|
|
|
config.add_extension('murmurhash',
|
|
|
|
|
sources=['murmurhash.pyx', join(
|
|
|
|
|
'src', 'MurmurHash3.cpp')],
|
|
|
|
|
include_dirs=['src'])
|
2012-01-16 08:40:47 +08:00
|
|
|
|
2011-08-05 10:43:31 +08:00
|
|
|
config.add_extension('graph_shortest_path',
|
2016-11-02 19:57:04 +08:00
|
|
|
sources=['graph_shortest_path.pyx'],
|
2012-12-22 20:02:50 +08:00
|
|
|
include_dirs=[numpy.get_include()])
|
2011-08-05 10:43:31 +08:00
|
|
|
|
2019-10-14 12:36:36 +08:00
|
|
|
config.add_extension('_fast_dict',
|
|
|
|
|
sources=['_fast_dict.pyx'],
|
2013-07-25 14:52:18 +08:00
|
|
|
language="c++",
|
|
|
|
|
include_dirs=[numpy.get_include()],
|
|
|
|
|
libraries=libraries)
|
|
|
|
|
|
2019-10-17 20:38:14 +08:00
|
|
|
config.add_extension('_openmp_helpers',
|
|
|
|
|
sources=['_openmp_helpers.pyx'],
|
|
|
|
|
libraries=libraries)
|
|
|
|
|
|
2019-10-25 20:42:18 +08:00
|
|
|
# generate _seq_dataset from template
|
|
|
|
|
templates = ['sklearn/utils/_seq_dataset.pyx.tp',
|
|
|
|
|
'sklearn/utils/_seq_dataset.pxd.tp']
|
|
|
|
|
gen_from_templates(templates, top_path)
|
2019-02-27 18:14:29 +08:00
|
|
|
|
2019-10-13 20:36:57 +08:00
|
|
|
config.add_extension('_seq_dataset',
|
|
|
|
|
sources=['_seq_dataset.pyx'],
|
2012-12-22 20:02:50 +08:00
|
|
|
include_dirs=[numpy.get_include()])
|
2012-03-08 03:09:05 +08:00
|
|
|
|
2019-10-13 20:36:57 +08:00
|
|
|
config.add_extension('_weight_vector',
|
|
|
|
|
sources=['_weight_vector.pyx'],
|
2019-02-21 02:23:34 +08:00
|
|
|
include_dirs=[numpy.get_include()],
|
|
|
|
|
libraries=libraries)
|
2012-02-16 04:30:36 +08:00
|
|
|
|
2013-12-08 09:41:18 +08:00
|
|
|
config.add_extension("_random",
|
2016-11-02 19:57:04 +08:00
|
|
|
sources=["_random.pyx"],
|
2012-12-22 21:29:59 +08:00
|
|
|
include_dirs=[numpy.get_include()],
|
|
|
|
|
libraries=libraries)
|
2012-12-20 17:31:05 +08:00
|
|
|
|
2013-07-23 20:24:45 +08:00
|
|
|
config.add_extension("_logistic_sigmoid",
|
2016-11-02 19:57:04 +08:00
|
|
|
sources=["_logistic_sigmoid.pyx"],
|
2013-07-23 20:24:45 +08:00
|
|
|
include_dirs=[numpy.get_include()],
|
|
|
|
|
libraries=libraries)
|
|
|
|
|
|
2016-02-04 02:39:50 +08:00
|
|
|
config.add_subpackage('tests')
|
|
|
|
|
|
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())
|