summaryrefslogtreecommitdiff
path: root/numpy/core/setup.py
diff options
context:
space:
mode:
authorMatthew Brett <matthew.brett@gmail.com>2022-06-29 20:06:44 +0100
committerMatthew Brett <matthew.brett@gmail.com>2022-06-29 21:28:29 +0100
commit0fa10479209618f09febb6dc49cc79266d8aea88 (patch)
tree0b3a3d472394b03655fa78aa6b5437053b8d0b0a /numpy/core/setup.py
parent2c79206d6048886635d5548721de0017c3fd9e74 (diff)
downloadnumpy-0fa10479209618f09febb6dc49cc79266d8aea88.tar.gz
Fix lib flags for librandom
Add the voltbl fix to librandom. Remove SSE flag for GCC on 32-bit Windows, it's the default.
Diffstat (limited to 'numpy/core/setup.py')
-rw-r--r--numpy/core/setup.py20
1 files changed, 2 insertions, 18 deletions
diff --git a/numpy/core/setup.py b/numpy/core/setup.py
index 543b6ae39..4917f8f9a 100644
--- a/numpy/core/setup.py
+++ b/numpy/core/setup.py
@@ -9,6 +9,7 @@ import glob
from os.path import join
from numpy.distutils import log
+from numpy.distutils.msvccompiler import lib_opts_if_msvc
from distutils.dep_util import newer
from sysconfig import get_config_var
from numpy.compat import npy_load_module
@@ -771,29 +772,12 @@ def configuration(parent_package='',top_path=None):
join('src', 'npymath', 'halffloat.c')
]
- def opts_if_msvc(build_cmd):
- """ Add flags if we are using MSVC compiler
-
- We can't see `build_cmd` in our scope, because we have not initialized
- the distutils build command, so use this deferred calculation to run
- when we are building the library.
- """
- if build_cmd.compiler.compiler_type != 'msvc':
- return []
- # Explicitly disable whole-program optimization.
- flags = ['/GL-']
- # Disable voltbl section for vc142 to allow link using mingw-w64; see:
- # https://github.com/matthew-brett/dll_investigation/issues/1#issuecomment-1100468171
- if build_cmd.compiler_opt.cc_test_flags(['-d2VolatileMetadata-']):
- flags.append('-d2VolatileMetadata-')
- return flags
-
config.add_installed_library('npymath',
sources=npymath_sources + [get_mathlib_info],
install_dir='lib',
build_info={
'include_dirs' : [], # empty list required for creating npy_math_internal.h
- 'extra_compiler_args': [opts_if_msvc],
+ 'extra_compiler_args': [lib_opts_if_msvc],
})
config.add_npy_pkg_config("npymath.ini.in", "lib/npy-pkg-config",
subst_dict)