Skip to content

Commit 305dc58

Browse files
committed
Add check for 'flags' in cpu_info
1 parent 53546fe commit 305dc58

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

setup.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,12 @@ def cmake_bool(cond):
8181
['-DUSE_SYSTEM_BLOSC:BOOL=ON'] if int(os.environ.get('USE_SYSTEM_BLOSC', '0'))
8282
else [
8383
'-DUSE_SYSTEM_BLOSC:BOOL=OFF',
84-
'-DDEACTIVATE_SSE2:BOOL=%s' % cmake_bool(('DISABLE_BLOSC_SSE2' in os.environ) or (cpu_info is None) or ('sse2' not in cpu_info['flags'])),
85-
'-DDEACTIVATE_AVX2:BOOL=%s' % cmake_bool(('DISABLE_BLOSC_AVX2' in os.environ) or (cpu_info is None) or ('avx2' not in cpu_info['flags'])),
84+
'-DDEACTIVATE_SSE2:BOOL=%s' % cmake_bool(('DISABLE_BLOSC_SSE2' in os.environ) or
85+
(cpu_info is None) or
86+
('flags' in cpu_info and 'sse2' not in cpu_info['flags'])),
87+
'-DDEACTIVATE_AVX2:BOOL=%s' % cmake_bool(('DISABLE_BLOSC_AVX2' in os.environ) or
88+
(cpu_info is None) or
89+
('flags' in cpu_info and 'avx2' not in cpu_info['flags'])),
8690
'-DDEACTIVATE_LZ4:BOOL=%s' % cmake_bool(not int(os.environ.get('INCLUDE_LZ4', '1'))),
8791
# Snappy is disabled by default
8892
'-DDEACTIVATE_SNAPPY:BOOL=%s' % cmake_bool(not int(os.environ.get('INCLUDE_SNAPPY', '0'))),

0 commit comments

Comments
 (0)