2011-04-02 00:36:49 +08:00
|
|
|
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
|
2013-04-30 14:23:46 +08:00
|
|
|
# License: BSD 3 clause
|
2012-05-06 04:46:10 +08:00
|
|
|
import os
|
|
|
|
|
from os.path import join
|
2011-01-03 01:06:47 +08:00
|
|
|
|
|
|
|
|
import numpy
|
|
|
|
|
|
2012-07-26 17:45:20 +08:00
|
|
|
from sklearn._build_utils import get_blas_info
|
2012-08-10 18:06:42 +08:00
|
|
|
|
2011-05-17 09:52:06 +08:00
|
|
|
|
2011-01-03 01:06:47 +08:00
|
|
|
def configuration(parent_package='', top_path=None):
|
|
|
|
|
from numpy.distutils.misc_util import Configuration
|
2012-07-21 06:45:26 +08:00
|
|
|
|
2012-07-25 18:34:04 +08:00
|
|
|
cblas_libs, blas_info = get_blas_info()
|
2012-07-21 06:45:26 +08:00
|
|
|
|
2012-05-06 04:46:10 +08:00
|
|
|
libraries = []
|
|
|
|
|
if os.name == 'posix':
|
|
|
|
|
cblas_libs.append('m')
|
|
|
|
|
libraries.append('m')
|
2011-10-10 16:23:52 +08:00
|
|
|
|
2011-12-19 17:48:57 +08:00
|
|
|
config = Configuration('cluster', parent_package, top_path)
|
2015-01-25 08:05:59 +08:00
|
|
|
config.add_extension('_dbscan_inner',
|
|
|
|
|
sources=['_dbscan_inner.cpp'],
|
|
|
|
|
include_dirs=[numpy.get_include()],
|
|
|
|
|
language="c++")
|
|
|
|
|
|
2011-09-21 02:45:42 +08:00
|
|
|
config.add_extension('_hierarchical',
|
2013-09-22 15:47:09 +08:00
|
|
|
sources=['_hierarchical.cpp'],
|
|
|
|
|
language="c++",
|
2012-05-06 04:46:10 +08:00
|
|
|
include_dirs=[numpy.get_include()],
|
|
|
|
|
libraries=libraries)
|
2011-09-21 02:45:42 +08:00
|
|
|
|
2011-10-10 16:23:52 +08:00
|
|
|
config.add_extension(
|
|
|
|
|
'_k_means',
|
|
|
|
|
libraries=cblas_libs,
|
|
|
|
|
sources=['_k_means.c'],
|
|
|
|
|
include_dirs=[join('..', 'src', 'cblas'),
|
|
|
|
|
numpy.get_include(),
|
|
|
|
|
blas_info.pop('include_dirs', [])],
|
|
|
|
|
extra_compile_args=blas_info.pop('extra_compile_args', []),
|
|
|
|
|
**blas_info
|
|
|
|
|
)
|
2012-10-18 15:15:16 +08:00
|
|
|
|
2011-01-03 01:06:47 +08:00
|
|
|
return config
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
|
from numpy.distutils.core import setup
|
|
|
|
|
setup(**configuration(top_path='').todict())
|