Skip to content

Commit

Permalink
Patch setup.py to disable AVX2
Browse files Browse the repository at this point in the history
Prevent AVX2 opcodes in wheels
  • Loading branch information
tomkooij committed Apr 20, 2018
1 parent baab1fa commit 45933ee
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ before_install:
install:
# Maybe get and clean and patch source
- clean_code $REPO_DIR $BUILD_COMMIT
# Patch pytables to disable AVX2 in built-in C-BLOSC
- patch -p0 $REPO_DIR/setup.py <noavx2.patch
- build_wheel $REPO_DIR $PLAT

script:
Expand Down
20 changes: 20 additions & 0 deletions noavx2.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
diff --git a/setup.py b/setup.py
index b5c55ba..d8671b4 100755
--- a/setup.py
+++ b/setup.py
@@ -848,15 +848,6 @@ if 'BLOSC' not in optional_libs:
CFLAGS.append('-msse2')
blosc_sources += [f for f in glob.glob('c-blosc/blosc/*.c')
if 'sse2' in f]
- # AVX2
- # Detection code for AVX2 only works for gcc/clang, not for MSVC yet
- if ('avx2' in cpu_flags and
- compiler_has_flags(compiler, ["-mavx2"])):
- print('AVX2 detected')
- CFLAGS.append('-DSHUFFLE_AVX2_ENABLED')
- CFLAGS.append('-mavx2')
- blosc_sources += [f for f in glob.glob('c-blosc/blosc/*.c')
- if 'avx2' in f]
else:
ADDLIBS += ['blosc']

0 comments on commit 45933ee

Please sign in to comment.