From 50e6e8120fbd1d3019c46faa67b5de6e28bd5488 Mon Sep 17 00:00:00 2001 From: Tieqiong Zhang Date: Sat, 1 Feb 2025 19:31:12 -0500 Subject: [PATCH] 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, }