From 38ae98c9fec11a22a9e25dc06c47aec7767a8e59 Mon Sep 17 00:00:00 2001 From: Tuomo Kalliokoski Date: Tue, 18 Feb 2025 11:36:51 +0200 Subject: [PATCH 1/5] Update setup.py to windows compatible --- setup.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 155f2f7..9d4a1e1 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ #!/usr/bin/env python - +import platform from distutils.core import setup, Extension @@ -8,7 +8,10 @@ ckde = Extension( name='kde.kde', sources=['kde/kde.c'], - extra_compile_args=['-Wall', '-O3', '-fPIC', '-Werror'] + if platform.system()=='Windows': + extra_compile_args=['-Wall', '-O2'] + else: + extra_compile_args=['-Wall', '-O3', '-fPIC', '-Werror'] ) setup( From ed6f981da1918bc847b6a06ddf65a80543138828 Mon Sep 17 00:00:00 2001 From: Tuomo Kalliokoski Date: Tue, 18 Feb 2025 11:39:05 +0200 Subject: [PATCH 2/5] Update README.md for Windows install --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index ce40ef1..919d89b 100644 --- a/README.md +++ b/README.md @@ -26,3 +26,10 @@ To install with references to the source code where it is downloaded (so that changes in the sourcecode are reflected immediately): $ pip install -e [cuda] --user + +For windows installation install all required software with pip or conda and run +following in the kde-directory while in your prefered python environment + +$ pip install ".[cuda]" + + From ecb5f3e3d436a40d42d4922ebc4134c203493d00 Mon Sep 17 00:00:00 2001 From: Tuomo Kalliokoski Date: Tue, 18 Feb 2025 11:49:34 +0200 Subject: [PATCH 3/5] Update kde.c for compilation with MS VC --- kde/kde.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/kde/kde.c b/kde/kde.c index e78c529..e6230ac 100644 --- a/kde/kde.c +++ b/kde/kde.c @@ -27,8 +27,15 @@ #include #include + +#ifdef _MSC_VER +#include + +#else #include +#endif + #include #define _USE_MATH_DEFINES #include From d404b2c1930109e180198f9806a61ffa8f9a4aef Mon Sep 17 00:00:00 2001 From: Tuomo Kalliokoski Date: Tue, 18 Feb 2025 13:32:57 +0200 Subject: [PATCH 4/5] fix embarassing typo --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 9d4a1e1..0902889 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ ckde = Extension( name='kde.kde', sources=['kde/kde.c'], - if platform.system()=='Windows': + if(platform.system()=='Windows'): extra_compile_args=['-Wall', '-O2'] else: extra_compile_args=['-Wall', '-O3', '-fPIC', '-Werror'] From 1b25064a9815085208e7302d825fbb2406851c88 Mon Sep 17 00:00:00 2001 From: Tuomo Kalliokoski Date: Tue, 18 Feb 2025 13:43:04 +0200 Subject: [PATCH 5/5] more embarassing fix after realising the true error --- setup.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index 0902889..a6705b1 100644 --- a/setup.py +++ b/setup.py @@ -5,13 +5,15 @@ if __name__ == "__main__": + if(platform.system()=='Windows'): + extra_compile_args=['-Wall', '-O2'] + else: + extra_compile_args=['-Wall', '-O3', '-fPIC', '-Werror'] + ckde = Extension( name='kde.kde', sources=['kde/kde.c'], - if(platform.system()=='Windows'): - extra_compile_args=['-Wall', '-O2'] - else: - extra_compile_args=['-Wall', '-O3', '-fPIC', '-Werror'] + extra_compile_args=extra_compile_args ) setup(