Skip to content

Commit bb811d3

Browse files
numpy v2.0.1 (#322)
automerged PR by conda-forge/automerge-action
2 parents 10b2fa5 + 2e9a807 commit bb811d3

8 files changed

+225
-22
lines changed

.ci_support/linux_64_numpy1.22python3.10.____cpythonpython_implcpython.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ c_compiler_version:
55
c_stdlib:
66
- sysroot
77
c_stdlib_version:
8-
- '2.12'
8+
- '2.17'
99
cdt_name:
10-
- cos6
10+
- cos7
1111
channel_sources:
1212
- conda-forge
1313
channel_targets:

.ci_support/linux_64_numpy1.22python3.9.____cpythonpython_implcpython.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ c_compiler_version:
55
c_stdlib:
66
- sysroot
77
c_stdlib_version:
8-
- '2.12'
8+
- '2.17'
99
cdt_name:
10-
- cos6
10+
- cos7
1111
channel_sources:
1212
- conda-forge
1313
channel_targets:

.ci_support/linux_64_numpy1.23python3.11.____cpythonpython_implcpython.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ c_compiler_version:
55
c_stdlib:
66
- sysroot
77
c_stdlib_version:
8-
- '2.12'
8+
- '2.17'
99
cdt_name:
10-
- cos6
10+
- cos7
1111
channel_sources:
1212
- conda-forge
1313
channel_targets:

.ci_support/linux_64_numpy1.26python3.12.____cpythonpython_implcpython.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ c_compiler_version:
55
c_stdlib:
66
- sysroot
77
c_stdlib_version:
8-
- '2.12'
8+
- '2.17'
99
cdt_name:
10-
- cos6
10+
- cos7
1111
channel_sources:
1212
- conda-forge
1313
channel_targets:

.scripts/build_steps.sh

-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

recipe/meta.yaml

+33-13
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% set version = "2.0.0" %}
1+
{% set version = "2.0.1" %}
22
{% set dev = "" %}
33
# numpy will by default use the ABI feature level for the first numpy version
44
# that added support for the oldest currently-supported CPython version; see
@@ -10,18 +10,36 @@ package:
1010
version: {{ version }}{{ dev }}
1111

1212
source:
13-
- url: https://github.com/numpy/numpy/releases/download/v{{ version }}{{ dev }}/numpy-{{ version }}{{ dev }}.tar.gz
14-
sha256: cf5d1c9e6837f8af9f92b6bd3e86d513cdc11f60fd62185cc49ec7d1aba34864
15-
# the sources by upstream themselves (as opposed to automated by github) contain the
16-
# svml submodule (which isn't in github tarball due to dear-github/dear-github#214);
17-
# keep this for reference & debugging when necessary; for exact commit, see:
18-
# https://github.com/numpy/numpy/tree/v{{ version }}/numpy/core/src/umath
19-
# - git_url: https://github.com/numpy/SVML.git
20-
# git_rev: 1c5260a61e7dce6be48073dfa96291edb0a11d79
21-
# folder: numpy/core/src/umath/svml
22-
# - git_url: https://github.com/intel/x86-simd-sort.git
23-
# git_rev: 6283f2491cebe2332795943e30e31828178e5efd
24-
# folder: numpy/core/src/npysort/x86-simd-sort
13+
# The sdist distributed by numpy contains submodules; by taking the tarball
14+
# from github we can everything pythran ourselves, but manually need to include
15+
# the submodules (not in tarball due to dear-github/dear-github#214); for the
16+
# list of modules see https://github.com/numpy/numpy/blob/main/.gitmodules
17+
- url: https://github.com/numpy/numpy/archive/refs/tags/v{{ version }}{{ dev }}.tar.gz
18+
sha256: 06da9d00e00344acbb49a003679adbb033d69b51de90481ab56e5d2d617ba77e
19+
# https://github.com/numpy/numpy/tree/v{{ version }}/numpy/_core/src
20+
- folder: numpy/_core/src/highway
21+
git_url: https://github.com/google/highway.git
22+
git_rev: 1dbb1180e05c55b648f2508d3f97bf26c6f926a8
23+
# https://github.com/numpy/numpy/tree/v{{ version }}/numpy/_core/src/npysort
24+
- folder: numpy/_core/src/npysort/x86-simd-sort
25+
git_url: https://github.com/intel/x86-simd-sort.git
26+
git_rev: 9a1b616d5cd4eaf49f7664fb86ccc1d18bad2b8d
27+
# https://github.com/numpy/numpy/tree/v{{ version }}/numpy/_core/src/umath
28+
- folder: numpy/_core/src/umath/svml
29+
git_url: https://github.com/numpy/SVML.git
30+
git_rev: 32bf2a98420762a63ab418aaa0a7d6e17eb9627a
31+
# https://github.com/numpy/numpy/tree/v{{ version }}/numpy/fft
32+
- folder: numpy/fft/pocketfft
33+
git_url: https://github.com/mreineck/pocketfft.git
34+
git_rev: 33ae5dc94c9cdc7f1c78346504a85de87cadaa12
35+
# https://github.com/numpy/numpy/tree/v{{ version }}/vendored-meson
36+
- folder: vendored-meson/meson
37+
git_url: https://github.com/numpy/meson.git
38+
git_rev: 31161eef3fc8cf0bf834edc1dd29e490fc6d7713
39+
patches:
40+
# backport https://github.com/mesonbuild/meson/pull/13411 + follow-up
41+
- patches/0001-fix-sanity-check-for-d-cross-compilation.patch # required precursor
42+
- patches/0002-Make-sure-machine_info_can_run-isn-t-called-on-incom.patch # fix + follow-up
2543

2644
build:
2745
number: 0
@@ -74,6 +92,8 @@ requirements:
7492
{% set tests_to_skip = tests_to_skip + " or test_new_policy" %} # [build_platform != target_platform]
7593
# emulation problems (apparently) on aarch
7694
{% set tests_to_skip = tests_to_skip + " or (test_basic_property and float32)" %} # [aarch64]
95+
# https://github.com/numpy/numpy/issues/27045
96+
{% set tests_to_skip = tests_to_skip + " or (test_regression and test_gh25784)" %} # [osx]
7797

7898
test:
7999
requires:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
From 3180f3c4fb03128ff474da7a2425dfddb220a35b Mon Sep 17 00:00:00 2001
2+
From: Axel Ricard <axel.ricard@allegrodvt.com>
3+
Date: Tue, 21 May 2024 14:22:40 +0200
4+
Subject: [PATCH 1/2] fix sanity check for d cross-compilation
5+
6+
---
7+
mesonbuild/compilers/d.py | 14 ++++++++++++--
8+
mesonbuild/compilers/detect.py | 3 ++-
9+
2 files changed, 14 insertions(+), 3 deletions(-)
10+
11+
diff --git a/mesonbuild/compilers/d.py b/mesonbuild/compilers/d.py
12+
index de344c057..46cffdd0f 100644
13+
--- a/mesonbuild/compilers/d.py
14+
+++ b/mesonbuild/compilers/d.py
15+
@@ -443,10 +443,18 @@ class DCompiler(Compiler):
16+
output_name = os.path.join(work_dir, 'dtest')
17+
with open(source_name, 'w', encoding='utf-8') as ofile:
18+
ofile.write('''void main() { }''')
19+
- pc = subprocess.Popen(self.exelist + self.get_output_args(output_name) + self._get_target_arch_args() + [source_name], cwd=work_dir)
20+
+
21+
+ compile_cmdlist = self.exelist + self.get_output_args(output_name) + self._get_target_arch_args() + [source_name]
22+
+
23+
+ # If cross-compiling, we can't run the sanity check, only compile it.
24+
+ if environment.need_exe_wrapper(self.for_machine) and not environment.has_exe_wrapper():
25+
+ compile_cmdlist += self.get_compile_only_args()
26+
+
27+
+ pc = subprocess.Popen(compile_cmdlist, cwd=work_dir)
28+
pc.wait()
29+
if pc.returncode != 0:
30+
raise EnvironmentException('D compiler %s cannot compile programs.' % self.name_string())
31+
+
32+
if environment.need_exe_wrapper(self.for_machine):
33+
if not environment.has_exe_wrapper():
34+
# Can't check if the binaries run so we have to assume they do
35+
@@ -545,7 +553,9 @@ class DCompiler(Compiler):
36+
# LDC2 on Windows targets to current OS architecture, but
37+
# it should follow the target specified by the MSVC toolchain.
38+
if self.info.is_windows():
39+
- if self.arch == 'x86_64':
40+
+ if self.is_cross:
41+
+ return [f'-mtriple={self.arch}-windows-msvc']
42+
+ elif self.arch == 'x86_64':
43+
return ['-m64']
44+
return ['-m32']
45+
return []
46+
diff --git a/mesonbuild/compilers/detect.py b/mesonbuild/compilers/detect.py
47+
index 90a3ac597..62187b9c2 100644
48+
--- a/mesonbuild/compilers/detect.py
49+
+++ b/mesonbuild/compilers/detect.py
50+
@@ -1161,7 +1161,8 @@ def detect_d_compiler(env: 'Environment', for_machine: MachineChoice) -> Compile
51+
52+
return cls(
53+
exelist, version, for_machine, info, arch,
54+
- full_version=full_version, linker=linker, version_output=out)
55+
+ full_version=full_version, linker=linker,
56+
+ is_cross=is_cross, version_output=out)
57+
elif 'gdc' in out:
58+
cls = d.GnuDCompiler
59+
linker = guess_nix_linker(env, exelist, cls, version, for_machine)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
From d83327354463953adabbca4c68d316142f82f9c7 Mon Sep 17 00:00:00 2001
2+
From: Christoph Reiter <reiter.christoph@gmail.com>
3+
Date: Fri, 12 Jul 2024 07:17:12 +0200
4+
Subject: [PATCH 2/2] Make sure machine_info_can_run() isn't called on
5+
incomplete MachineInfo
6+
7+
If need_exe_wrapper() is called while figuring out the language compiler,
8+
the MachineInfo isn't complete yet, so machine_info_can_run() would return
9+
False despite not cross compiling.
10+
11+
Make sure this fails loudly.
12+
---
13+
mesonbuild/backend/backends.py | 3 ++-
14+
mesonbuild/compilers/cuda.py | 4 ++--
15+
mesonbuild/compilers/d.py | 4 ++--
16+
mesonbuild/compilers/mixins/clike.py | 4 ++--
17+
mesonbuild/compilers/rust.py | 2 +-
18+
mesonbuild/environment.py | 1 +
19+
6 files changed, 10 insertions(+), 8 deletions(-)
20+
21+
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py
22+
index 740f349e4..bea8c7e85 100644
23+
--- a/mesonbuild/backend/backends.py
24+
+++ b/mesonbuild/backend/backends.py
25+
@@ -568,7 +568,8 @@ class Backend:
26+
else:
27+
extra_paths = []
28+
29+
- if self.environment.need_exe_wrapper(exe_for_machine):
30+
+ is_cross_built = not self.environment.machines.matches_build_machine(exe_for_machine)
31+
+ if is_cross_built and self.environment.need_exe_wrapper():
32+
if not self.environment.has_exe_wrapper():
33+
msg = 'An exe_wrapper is needed but was not found. Please define one ' \
34+
'in cross file and check the command and/or add it to PATH.'
35+
diff --git a/mesonbuild/compilers/cuda.py b/mesonbuild/compilers/cuda.py
36+
index 3761019b9..eaea5c846 100644
37+
--- a/mesonbuild/compilers/cuda.py
38+
+++ b/mesonbuild/compilers/cuda.py
39+
@@ -551,7 +551,7 @@ class CudaCompiler(Compiler):
40+
flags += self.get_ccbin_args(env.coredata.options)
41+
42+
# If cross-compiling, we can't run the sanity check, only compile it.
43+
- if env.need_exe_wrapper(self.for_machine) and not env.has_exe_wrapper():
44+
+ if self.is_cross and not env.has_exe_wrapper():
45+
# Linking cross built apps is painful. You can't really
46+
# tell if you should use -nostdlib or not and for example
47+
# on OSX the compiler binary is the same but you need
48+
@@ -573,7 +573,7 @@ class CudaCompiler(Compiler):
49+
raise EnvironmentException(f'Compiler {self.name_string()} cannot compile programs.')
50+
51+
# Run sanity check (if possible)
52+
- if env.need_exe_wrapper(self.for_machine):
53+
+ if self.is_cross:
54+
if not env.has_exe_wrapper():
55+
return
56+
else:
57+
diff --git a/mesonbuild/compilers/d.py b/mesonbuild/compilers/d.py
58+
index 46cffdd0f..c478c040b 100644
59+
--- a/mesonbuild/compilers/d.py
60+
+++ b/mesonbuild/compilers/d.py
61+
@@ -447,7 +447,7 @@ class DCompiler(Compiler):
62+
compile_cmdlist = self.exelist + self.get_output_args(output_name) + self._get_target_arch_args() + [source_name]
63+
64+
# If cross-compiling, we can't run the sanity check, only compile it.
65+
- if environment.need_exe_wrapper(self.for_machine) and not environment.has_exe_wrapper():
66+
+ if self.is_cross and not environment.has_exe_wrapper():
67+
compile_cmdlist += self.get_compile_only_args()
68+
69+
pc = subprocess.Popen(compile_cmdlist, cwd=work_dir)
70+
@@ -455,7 +455,7 @@ class DCompiler(Compiler):
71+
if pc.returncode != 0:
72+
raise EnvironmentException('D compiler %s cannot compile programs.' % self.name_string())
73+
74+
- if environment.need_exe_wrapper(self.for_machine):
75+
+ if self.is_cross:
76+
if not environment.has_exe_wrapper():
77+
# Can't check if the binaries run so we have to assume they do
78+
return
79+
diff --git a/mesonbuild/compilers/mixins/clike.py b/mesonbuild/compilers/mixins/clike.py
80+
index d273015bc..434ec9fe7 100644
81+
--- a/mesonbuild/compilers/mixins/clike.py
82+
+++ b/mesonbuild/compilers/mixins/clike.py
83+
@@ -278,7 +278,7 @@ class CLikeCompiler(Compiler):
84+
mode = CompileCheckMode.LINK
85+
if self.is_cross:
86+
binname += '_cross'
87+
- if environment.need_exe_wrapper(self.for_machine) and not environment.has_exe_wrapper():
88+
+ if not environment.has_exe_wrapper():
89+
# Linking cross built C/C++ apps is painful. You can't really
90+
# tell if you should use -nostdlib or not and for example
91+
# on OSX the compiler binary is the same but you need
92+
@@ -308,7 +308,7 @@ class CLikeCompiler(Compiler):
93+
if pc.returncode != 0:
94+
raise mesonlib.EnvironmentException(f'Compiler {self.name_string()} cannot compile programs.')
95+
# Run sanity check
96+
- if environment.need_exe_wrapper(self.for_machine):
97+
+ if self.is_cross:
98+
if not environment.has_exe_wrapper():
99+
# Can't check if the binaries run so we have to assume they do
100+
return
101+
diff --git a/mesonbuild/compilers/rust.py b/mesonbuild/compilers/rust.py
102+
index ce1079190..f89d83fd9 100644
103+
--- a/mesonbuild/compilers/rust.py
104+
+++ b/mesonbuild/compilers/rust.py
105+
@@ -86,7 +86,7 @@ class RustCompiler(Compiler):
106+
if pc.returncode != 0:
107+
raise EnvironmentException(f'Rust compiler {self.name_string()} cannot compile programs.')
108+
self._native_static_libs(work_dir, source_name)
109+
- if environment.need_exe_wrapper(self.for_machine):
110+
+ if self.is_cross:
111+
if not environment.has_exe_wrapper():
112+
# Can't check if the binaries run so we have to assume they do
113+
return
114+
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py
115+
index 19b9e81b5..a86f47b7e 100644
116+
--- a/mesonbuild/environment.py
117+
+++ b/mesonbuild/environment.py
118+
@@ -505,6 +505,7 @@ def machine_info_can_run(machine_info: MachineInfo):
119+
if machine_info.system != detect_system():
120+
return False
121+
true_build_cpu_family = detect_cpu_family({})
122+
+ assert machine_info.cpu_family is not None, 'called on incomplete machine_info'
123+
return \
124+
(machine_info.cpu_family == true_build_cpu_family) or \
125+
((true_build_cpu_family == 'x86_64') and (machine_info.cpu_family == 'x86')) or \

0 commit comments

Comments
 (0)