Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ed4ed00

Browse files
authored
Merge pull request #18903 from seiko2plus/issue_18297
MAINT, CI: treats _SIMD module build warnings as errors through CI only
2 parents 7990423 + 77c87d5 commit ed4ed00

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

numpy/core/src/_simd/_simd.dispatch.c.src

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*@targets $werror #simd_test*/
1+
/*@targets #simd_test*/
22
#include "_simd.h"
33
#include "_simd_inc.h"
44

tools/travis-test.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ setup_base()
3636
sysflags="$($PYTHON -c "from distutils import sysconfig; \
3737
print (sysconfig.get_config_var('CFLAGS'))")"
3838
export CFLAGS="$sysflags $werrors -Wlogical-op -Wno-sign-compare"
39+
# SIMD extensions that need to be tested on both runtime and compile-time via (test_simd.py)
40+
# any specified features will be ignored if they're not supported by compiler or platform
41+
# note: it almost the same default value of --simd-test execpt adding policy `$werror` to treat all
42+
# warnings as errors
43+
simd_test="\$werror BASELINE SSE2 SSE42 XOP FMA4 (FMA3 AVX2) AVX512F AVX512_SKX VSX VSX2 VSX3 NEON ASIMD"
3944
# We used to use 'setup.py install' here, but that has the terrible
4045
# behaviour that if a copy of the package is already installed in the
4146
# install location, then the new copy just gets dropped on top of it.
@@ -53,11 +58,11 @@ setup_base()
5358
# #if !HAVE_FFI_PREP_CIF_VAR && defined(__arm64__) && defined(__APPLE__)
5459
#
5560
export CFLAGS="$CFLAGS -Werror=undef"
56-
$PIP install -v . 2>&1 | tee log
61+
$PYTHON setup.py build --simd-test "$simd_test" install 2>&1 | tee log
5762
else
5863
# The job run with USE_DEBUG=1 on travis needs this.
5964
export CFLAGS=$CFLAGS" -Wno-maybe-uninitialized"
60-
$PYTHON setup.py build build_src --verbose-cfg build_ext --inplace 2>&1 | tee log
65+
$PYTHON setup.py build --simd-test "$simd_test" build_src --verbose-cfg build_ext --inplace 2>&1 | tee log
6166
fi
6267
grep -v "_configtest" log \
6368
| grep -vE "ld returned 1|no files found matching" \

0 commit comments

Comments
 (0)