From bfab391dbea5567ba4a21b044da408dbe4815328 Mon Sep 17 00:00:00 2001 From: Ray Donnelly Date: Fri, 25 Nov 2016 12:40:56 +0000 Subject: [PATCH 1/4] Include stdint.h via gpuarray/config.h Because for Visual Studio < 2010, we use a bundled version instead and the compile-guards that implement that logic are in gpuarray/config.h --- src/util/integerfactoring.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/util/integerfactoring.c b/src/util/integerfactoring.c index e58763761e..cb785bb080 100644 --- a/src/util/integerfactoring.c +++ b/src/util/integerfactoring.c @@ -1,6 +1,7 @@ /* Includes */ #include #include +#include #include #include "integerfactoring.h" From ebf5edd3ac67a2bfc232c17e7f01ee4f7cdabc38 Mon Sep 17 00:00:00 2001 From: Ray Donnelly Date: Fri, 25 Nov 2016 12:53:15 +0000 Subject: [PATCH 2/4] Win32: Use -W4, not -Wall on MSVC --- CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f6ec583a54..382c064e9c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,13 @@ PROJECT(libgpuarray C) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/CMakeModules/") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") +# -Wall is unbelieveably noisy with Visual Studio: +# http://stackoverflow.com/q/4001736/3257826 +if(MSVC) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -W4") +else() + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") +endif() enable_testing() From 6d1bdbdf9f6be0b272564b2040d83b158539e7cf Mon Sep 17 00:00:00 2001 From: Ray Donnelly Date: Fri, 25 Nov 2016 14:24:56 +0000 Subject: [PATCH 3/4] Win32: Actually print default_bin_dir in exception --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 105461deb7..767e4cf5f3 100644 --- a/setup.py +++ b/setup.py @@ -84,7 +84,7 @@ def __init__(self, *args, **kwargs): default_bin_dir = os.path.join(current_dir, 'lib', 'Release') if not os.path.isdir(default_bin_dir): - raise RuntimeError('default binary dir {} does not exist, you may need to build the C library in release mode') + raise RuntimeError('default binary dir {} does not exist, you may need to build the C library in release mode'.format(default_bin_dir)) library_dirs += [default_bin_dir] with open('pygpu/version.py', 'w') as f: From 9226f57fc408b8125e3a2ae5add035515d74fef9 Mon Sep 17 00:00:00 2001 From: Ray Donnelly Date: Fri, 25 Nov 2016 14:25:29 +0000 Subject: [PATCH 4/4] Win32 + conda: Remove default binary dir hack --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 767e4cf5f3..f1150de5c9 100644 --- a/setup.py +++ b/setup.py @@ -76,7 +76,7 @@ def __init__(self, *args, **kwargs): include_dirs = [np.get_include()] library_dirs = [] -if sys.platform == 'win32': +if sys.platform == 'win32' and not os.getenv('CONDA_BUILD'): # This is a hack so users don't need to do many steps for windows install # Just use the default location. current_dir = os.path.abspath(os.path.dirname(__file__))