summaryrefslogtreecommitdiff
path: root/numpy/core/setup.py
diff options
context:
space:
mode:
authorSebastian Berg <sebastian@sipsolutions.net>2022-02-11 14:35:19 -0600
committerSebastian Berg <sebastian@sipsolutions.net>2022-02-11 14:53:01 -0600
commit0457cc7da06d98cc818a0ae1d3cc98ea93a1893d (patch)
tree49ce408981c79c7546dca44f783c527267b32891 /numpy/core/setup.py
parentf69ddd7111048111a7e486a2d7d008bd231af33d (diff)
downloadnumpy-0457cc7da06d98cc818a0ae1d3cc98ea93a1893d.tar.gz
MAINT: Remove the RELAXED_STRIDES_CHECKING env variable
An error is for now raised in `setup.py` if this is set, eventually we should just delete that.
Diffstat (limited to 'numpy/core/setup.py')
-rw-r--r--numpy/core/setup.py17
1 files changed, 7 insertions, 10 deletions
diff --git a/numpy/core/setup.py b/numpy/core/setup.py
index f087c8826..af35b1322 100644
--- a/numpy/core/setup.py
+++ b/numpy/core/setup.py
@@ -17,6 +17,10 @@ from setup_common import * # noqa: F403
# Set to True to enable relaxed strides checking. This (mostly) means
# that `strides[dim]` is ignored if `shape[dim] == 1` when setting flags.
NPY_RELAXED_STRIDES_CHECKING = (os.environ.get('NPY_RELAXED_STRIDES_CHECKING', "1") != "0")
+if not NPY_RELAXED_STRIDES_CHECKING:
+ raise SystemError(
+ "Support for NPY_RELAXED_STRIDES_CHECKING=0 has been remove as of "
+ "NumPy 1.23. This error will eventually be removed entirely.")
# Put NPY_RELAXED_STRIDES_DEBUG=1 in the environment if you want numpy to use a
# bogus value for affected strides in order to help smoke out bad stride usage
@@ -481,13 +485,9 @@ def configuration(parent_package='',top_path=None):
if can_link_svml():
moredefs.append(('NPY_CAN_LINK_SVML', 1))
- # Use relaxed stride checking
- if NPY_RELAXED_STRIDES_CHECKING:
- moredefs.append(('NPY_RELAXED_STRIDES_CHECKING', 1))
- else:
- moredefs.append(('NPY_RELAXED_STRIDES_CHECKING', 0))
-
- # Use bogus stride debug aid when relaxed strides are enabled
+ # Use bogus stride debug aid to flush out bugs where users use
+ # strides of dimensions with length 1 to index a full contiguous
+ # array.
if NPY_RELAXED_STRIDES_DEBUG:
moredefs.append(('NPY_RELAXED_STRIDES_DEBUG', 1))
else:
@@ -583,9 +583,6 @@ def configuration(parent_package='',top_path=None):
moredefs.extend(cocache.check_ieee_macros(config_cmd)[1])
moredefs.extend(cocache.check_complex(config_cmd, mathlibs)[1])
- if NPY_RELAXED_STRIDES_CHECKING:
- moredefs.append(('NPY_RELAXED_STRIDES_CHECKING', 1))
-
if NPY_RELAXED_STRIDES_DEBUG:
moredefs.append(('NPY_RELAXED_STRIDES_DEBUG', 1))