2012-05-06 04:46:10 +08:00
|
|
|
import os
|
2010-09-01 01:14:28 +08:00
|
|
|
from os.path import join
|
2012-05-06 04:46:10 +08:00
|
|
|
|
2010-09-01 01:14:28 +08:00
|
|
|
import numpy
|
|
|
|
|
|
2012-07-26 17:45:20 +08:00
|
|
|
from sklearn._build_utils import get_blas_info
|
2011-11-21 04:24:11 +08:00
|
|
|
|
2012-08-26 03:05:27 +08:00
|
|
|
|
2010-09-01 01:14:28 +08:00
|
|
|
def configuration(parent_package='', top_path=None):
|
|
|
|
|
from numpy.distutils.misc_util import Configuration
|
2012-07-21 06:45:26 +08:00
|
|
|
|
2010-11-25 21:53:55 +08:00
|
|
|
config = Configuration('linear_model', parent_package, top_path)
|
2010-09-01 01:14:28 +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
|
|
|
if os.name == 'posix':
|
|
|
|
|
cblas_libs.append('m')
|
2010-09-01 01:14:28 +08:00
|
|
|
|
2016-11-02 19:57:04 +08:00
|
|
|
config.add_extension('cd_fast', sources=['cd_fast.pyx'],
|
2012-12-22 20:02:50 +08:00
|
|
|
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)
|
2010-09-01 01:14:28 +08:00
|
|
|
|
2010-12-01 18:18:04 +08:00
|
|
|
config.add_extension('sgd_fast',
|
2016-11-02 19:57:04 +08:00
|
|
|
sources=['sgd_fast.pyx'],
|
2014-07-23 20:32:43 +08:00
|
|
|
include_dirs=[join('..', 'src', 'cblas'),
|
|
|
|
|
numpy.get_include(),
|
|
|
|
|
blas_info.pop('include_dirs', [])],
|
|
|
|
|
libraries=cblas_libs,
|
|
|
|
|
extra_compile_args=blas_info.pop('extra_compile_args',
|
|
|
|
|
[]),
|
|
|
|
|
**blas_info)
|
2010-09-01 01:14:28 +08:00
|
|
|
|
2014-10-30 19:00:11 +08:00
|
|
|
config.add_extension('sag_fast',
|
2016-11-02 19:57:04 +08:00
|
|
|
sources=['sag_fast.pyx'],
|
2014-10-30 19:00:11 +08:00
|
|
|
include_dirs=numpy.get_include())
|
|
|
|
|
|
2010-09-01 18:05:15 +08:00
|
|
|
# add other directories
|
2010-09-01 02:49:21 +08:00
|
|
|
config.add_subpackage('tests')
|
2010-09-01 01:14:28 +08:00
|
|
|
|
|
|
|
|
return config
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
|
from numpy.distutils.core import setup
|
|
|
|
|
setup(**configuration(top_path='').todict())
|