@@ -45,15 +45,21 @@ def blosc_extension():
45
45
if 'sse2' in cpu_info ['flags' ]:
46
46
print ('[zarr] SSE2 detected' )
47
47
extra_compile_args .append ('-DSHUFFLE_SSE2_ENABLED' )
48
- extra_compile_args .append ('-msse2' )
49
48
blosc_sources += [f for f in glob ('c-blosc/blosc/*.c' ) if 'sse2' in f ]
49
+ if os .name == 'posix' :
50
+ extra_compile_args .append ('-msse2' )
51
+ elif os .name == 'nt' :
52
+ define_macros += [('__SSE2__' , 1 )]
50
53
51
54
# AVX2
52
55
if 'avx2' in cpu_info ['flags' ]:
53
56
print ('[zarr] AVX2 detected' )
54
57
extra_compile_args .append ('-DSHUFFLE_AVX2_ENABLED' )
55
- extra_compile_args .append ('-mavx2' )
56
58
blosc_sources += [f for f in glob ('c-blosc/blosc/*.c' ) if 'avx2' in f ]
59
+ if os .name == 'posix' :
60
+ extra_compile_args .append ('-mavx2' )
61
+ elif os .name == 'nt' :
62
+ define_macros += [('__AVX2__' , 1 )]
57
63
58
64
if have_cython :
59
65
sources = ['zarr/blosc.pyx' ]
@@ -93,13 +99,15 @@ class ve_build_ext(build_ext):
93
99
def run (self ):
94
100
try :
95
101
build_ext .run (self )
96
- except DistutilsPlatformError :
102
+ except DistutilsPlatformError as e :
103
+ print ('[zarr] ERROR' , e , file = sys .stderr )
97
104
raise BuildFailed ()
98
105
99
106
def build_extension (self , ext ):
100
107
try :
101
108
build_ext .build_extension (self , ext )
102
- except ext_errors :
109
+ except ext_errors as e :
110
+ print ('[zarr] ERROR' , e , file = sys .stderr )
103
111
raise BuildFailed ()
104
112
105
113
@@ -166,13 +174,14 @@ def run_setup(with_extensions):
166
174
167
175
if __name__ == '__main__' :
168
176
is_pypy = hasattr (sys , 'pypy_translation_info' )
169
- is_posix = os .name == 'posix'
170
177
171
178
try :
172
- run_setup (is_posix and not is_pypy )
179
+ run_setup (not is_pypy )
173
180
except BuildFailed :
174
- print ('[zarr]' + ('*' * 75 ))
175
- print ('[zarr] WARNING compilation of the Blosc C extension failed.' )
176
- print ('[zarr] Retrying installation without C extensions...' )
177
- print ('[zarr]' + ('*' * 75 ))
181
+ print ('[zarr]' + ('*' * 75 ), file = sys .stderr )
182
+ print ('[zarr] WARNING compilation of the Blosc C extension failed.' ,
183
+ file = sys .stderr )
184
+ print ('[zarr] Retrying installation without C extensions...' ,
185
+ file = sys .stderr )
186
+ print ('[zarr]' + ('*' * 75 ), file = sys .stderr )
178
187
run_setup (False )
0 commit comments