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() diff --git a/setup.py b/setup.py index 105461deb7..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__)) @@ -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: 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"