2012-05-06 04:46:10 +08:00
|
|
|
import os
|
2010-09-01 01:14:28 +08:00
|
|
|
import numpy
|
|
|
|
|
|
2019-10-25 20:42:18 +08:00
|
|
|
from sklearn._build_utils import gen_from_templates
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
2019-02-21 02:23:34 +08:00
|
|
|
libraries = []
|
2012-05-06 04:46:10 +08:00
|
|
|
if os.name == "posix":
|
2019-02-21 02:23:34 +08:00
|
|
|
libraries.append("m")
|
2021-06-18 02:21:09 +08:00
|
|
|
|
2019-10-23 21:34:26 +08:00
|
|
|
config.add_extension(
|
|
|
|
|
"_cd_fast",
|
|
|
|
|
sources=["_cd_fast.pyx"],
|
2019-02-21 02:23:34 +08:00
|
|
|
include_dirs=numpy.get_include(),
|
|
|
|
|
libraries=libraries,
|
|
|
|
|
)
|
2021-06-18 02:21:09 +08:00
|
|
|
|
2019-10-23 21:34:26 +08:00
|
|
|
config.add_extension(
|
|
|
|
|
"_sgd_fast",
|
|
|
|
|
sources=["_sgd_fast.pyx"],
|
2019-02-21 02:23:34 +08:00
|
|
|
include_dirs=numpy.get_include(),
|
|
|
|
|
libraries=libraries,
|
|
|
|
|
)
|
2010-09-01 01:14:28 +08:00
|
|
|
|
2019-02-27 18:14:29 +08:00
|
|
|
# generate sag_fast from template
|
2019-10-25 20:42:18 +08:00
|
|
|
templates = ["sklearn/linear_model/_sag_fast.pyx.tp"]
|
2021-08-10 03:43:56 +08:00
|
|
|
gen_from_templates(templates)
|
2019-02-27 18:14:29 +08:00
|
|
|
|
2019-10-23 21:34:26 +08:00
|
|
|
config.add_extension(
|
2014-10-30 19:00:11 +08:00
|
|
|
"_sag_fast", sources=["_sag_fast.pyx"], include_dirs=numpy.get_include()
|
2021-06-18 02:21:09 +08:00
|
|
|
)
|
2014-10-30 19:00:11 +08:00
|
|
|
|
2010-09-01 18:05:15 +08:00
|
|
|
# add other directories
|
2010-09-01 02:49:21 +08:00
|
|
|
config.add_subpackage("tests")
|
2020-03-04 21:08:24 +08:00
|
|
|
config.add_subpackage("_glm")
|
|
|
|
|
config.add_subpackage("_glm/tests")
|
2010-09-01 01:14:28 +08:00
|
|
|
|
|
|
|
|
return config
|
|
|
|
|
|
2019-02-21 02:23:34 +08:00
|
|
|
|
2010-09-01 01:14:28 +08:00
|
|
|
if __name__ == "__main__":
|
|
|
|
|
from numpy.distutils.core import setup
|
2021-06-18 02:21:09 +08:00
|
|
|
|
2010-09-01 01:14:28 +08:00
|
|
|
setup(**configuration(top_path="").todict())
|