From 50e6e8120fbd1d3019c46faa67b5de6e28bd5488 Mon Sep 17 00:00:00 2001 From: Tieqiong Zhang Date: Sat, 1 Feb 2025 19:31:12 -0500 Subject: [PATCH 1/2] srreal windows support --- requirements/conda.txt | 1 + setup.py | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/requirements/conda.txt b/requirements/conda.txt index f4e764d..dbaae37 100644 --- a/requirements/conda.txt +++ b/requirements/conda.txt @@ -6,3 +6,4 @@ diffpy.structure gsl # periodictable # pyobjcryst (up to py3.11 for mac) +# dlfcn-win32 (for windows) diff --git a/setup.py b/setup.py index 6c322f3..784b57c 100644 --- a/setup.py +++ b/setup.py @@ -47,14 +47,21 @@ def get_boost_config(): lib = Path(conda_prefix) / "lib" return {"include_dirs": [str(inc)], "library_dirs": [str(lib)]} +if os.name == "nt": + compile_args = ["/std:c++14"] + macros = [("_USE_MATH_DEFINES", None)] +else: + compile_args = ["-std=c++11"] + macros = [] boost_cfg = get_boost_config() ext_kws = { "libraries": ["diffpy"] + get_boost_libraries(), - "extra_compile_args": ["-std=c++11"], + "extra_compile_args": compile_args, "extra_link_args": [], "include_dirs": [numpy.get_include()] + boost_cfg["include_dirs"], "library_dirs": boost_cfg["library_dirs"], + "define_macros": macros, } From b83ee8fa121043b94d2e3f3900bd1cb540eddd26 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 2 Feb 2025 00:35:19 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit hooks --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 784b57c..f5b929f 100644 --- a/setup.py +++ b/setup.py @@ -47,6 +47,7 @@ def get_boost_config(): lib = Path(conda_prefix) / "lib" return {"include_dirs": [str(inc)], "library_dirs": [str(lib)]} + if os.name == "nt": compile_args = ["/std:c++14"] macros = [("_USE_MATH_DEFINES", None)]