https://github.com/Blosc/python-blosc/commit/70226a70907072be607caee3da472e37a4683bae https://github.com/Blosc/python-blosc/issues/227 https://bugs.gentoo.org/732178 From: Graham Inggs Date: Tue, 3 Aug 2021 17:11:51 +0200 Subject: [PATCH] Deactivate SSE2 and AVX2 if a CPU has no flags (#242) Fixes #277 --- a/setup.py +++ b/setup.py @@ -90,8 +90,8 @@ def cmake_bool(cond): platforms = ['any'], cmake_args = [ '-DBLOSC_DIR:PATH=%s' % os.environ.get('BLOSC_DIR', ''), - '-DDEACTIVATE_SSE2:BOOL=%s' % cmake_bool(('DISABLE_BLOSC_SSE2' in os.environ) or (cpu_info is None) or ('sse2' not in cpu_info['flags'])), - '-DDEACTIVATE_AVX2:BOOL=%s' % cmake_bool(('DISABLE_BLOSC_AVX2' in os.environ) or (cpu_info is None) or ('avx2' not in cpu_info['flags'])), + '-DDEACTIVATE_SSE2:BOOL=%s' % cmake_bool(('DISABLE_BLOSC_SSE2' in os.environ) or (cpu_info is None) or ('flags' not in cpu_info) or ('sse2' not in cpu_info['flags'])), + '-DDEACTIVATE_AVX2:BOOL=%s' % cmake_bool(('DISABLE_BLOSC_AVX2' in os.environ) or (cpu_info is None) or ('flags' not in cpu_info) or ('avx2' not in cpu_info['flags'])), '-DDEACTIVATE_LZ4:BOOL=%s' % cmake_bool(not int(os.environ.get('INCLUDE_LZ4', '1'))), # Snappy is disabled by default '-DDEACTIVATE_SNAPPY:BOOL=%s' % cmake_bool(not int(os.environ.get('INCLUDE_SNAPPY', '0'))),