-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathsetup.py
More file actions
71 lines (64 loc) · 1.69 KB
/
setup.py
File metadata and controls
71 lines (64 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
"""Setup script."""
# pylint: disable=protected-access
import os
import platform
from glob import glob
import setuptools
from pybind11.setup_helpers import Pybind11Extension, build_ext
with open("README.md", "r", encoding="Latin-1") as fh:
long_description = fh.read()
__version__ = "1.2.0"
if platform.system() in ("Linux", "Darwin"):
os.environ["CC"] = "g++"
os.environ["CXX"] = "g++"
c_flags = [
"-O3",
"-fno-math-errno",
"-funroll-loops",
"-ftree-vectorize",
]
l_flags = [
"-flto",
]
if platform.system() == "Darwin":
c_flags.append("-mmacosx-version-min=10.15")
else:
c_flags.extend([
"-march=native",
"-mtune=native",
])
else:
c_flags = ["/O2"]
l_flags = []
ext = Pybind11Extension(
"modcma.c_maes.cmaescpp",
[x for x in glob("src/*cpp") if "main" not in x],
include_dirs=["include", "external"],
cxx_std=17,
extra_link_args=l_flags,
extra_compile_args=c_flags
)
setuptools.setup(
name="modcma",
version=__version__,
author="Jacob de Nobel",
author_email="jacobdenobel@gmail.com",
description="Package Containing Modular CMA-ES optimizer",
long_description=long_description,
long_description_content_type="text/markdown",
packages=setuptools.find_packages(),
cmdclass={"build_ext": build_ext},
ext_modules=[ext],
python_requires=">=3.8",
install_requires=[
"configspace",
"numpy",
"scipy",
"ioh"
],
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
)