2012-05-06 21:30:59 +08:00
|
|
|
import os
|
|
|
|
|
|
2011-04-01 06:08:30 +08:00
|
|
|
import numpy
|
2011-09-26 17:29:30 +08:00
|
|
|
from numpy.distutils.misc_util import Configuration
|
2011-04-01 06:08:30 +08:00
|
|
|
|
2011-10-05 16:16:51 +08:00
|
|
|
|
2011-09-26 17:29:30 +08:00
|
|
|
def configuration(parent_package="", top_path=None):
|
|
|
|
|
config = Configuration("tree", parent_package, top_path)
|
2012-05-06 21:30:59 +08:00
|
|
|
libraries = []
|
|
|
|
|
if os.name == "posix":
|
|
|
|
|
libraries.append("m")
|
2011-09-26 17:29:30 +08:00
|
|
|
config.add_extension(
|
|
|
|
|
"_tree",
|
2016-11-02 19:57:04 +08:00
|
|
|
sources=["_tree.pyx"],
|
2012-05-06 18:41:37 +08:00
|
|
|
include_dirs=[numpy.get_include()],
|
2013-07-10 19:52:50 +08:00
|
|
|
libraries=libraries,
|
2022-02-26 00:54:54 +08:00
|
|
|
language="c++",
|
2013-07-22 21:20:44 +08:00
|
|
|
extra_compile_args=["-O3"],
|
|
|
|
|
)
|
2015-09-09 03:07:30 +08:00
|
|
|
config.add_extension(
|
|
|
|
|
"_splitter",
|
2016-11-02 19:57:04 +08:00
|
|
|
sources=["_splitter.pyx"],
|
2015-09-09 03:07:30 +08:00
|
|
|
include_dirs=[numpy.get_include()],
|
|
|
|
|
libraries=libraries,
|
|
|
|
|
extra_compile_args=["-O3"],
|
|
|
|
|
)
|
|
|
|
|
config.add_extension(
|
|
|
|
|
"_criterion",
|
2016-11-02 19:57:04 +08:00
|
|
|
sources=["_criterion.pyx"],
|
2015-09-09 03:07:30 +08:00
|
|
|
include_dirs=[numpy.get_include()],
|
|
|
|
|
libraries=libraries,
|
|
|
|
|
extra_compile_args=["-O3"],
|
|
|
|
|
)
|
2013-11-22 22:33:59 +08:00
|
|
|
config.add_extension(
|
|
|
|
|
"_utils",
|
2016-11-02 19:57:04 +08:00
|
|
|
sources=["_utils.pyx"],
|
2013-11-22 22:33:59 +08:00
|
|
|
include_dirs=[numpy.get_include()],
|
|
|
|
|
libraries=libraries,
|
|
|
|
|
extra_compile_args=["-O3"],
|
|
|
|
|
)
|
2011-04-01 06:08:30 +08:00
|
|
|
|
2011-09-26 17:29:30 +08:00
|
|
|
config.add_subpackage("tests")
|
2011-08-02 18:28:05 +08:00
|
|
|
|
2011-04-01 06:08:30 +08:00
|
|
|
return config
|
|
|
|
|
|
2021-06-18 02:21:09 +08:00
|
|
|
|
2011-09-26 17:29:30 +08:00
|
|
|
if __name__ == "__main__":
|
2011-04-01 06:08:30 +08:00
|
|
|
from numpy.distutils.core import setup
|
2021-06-18 02:21:09 +08:00
|
|
|
|
2011-09-26 17:29:30 +08:00
|
|
|
setup(**configuration().todict())
|