Skip to content

Commit

Permalink
Merge pull request #64 from regro-cf-autotick-bot/rebuild-numpy2-0-1_…
Browse files Browse the repository at this point in the history
…hc6f1cc

Rebuild for numpy 2.0
  • Loading branch information
duncanmmacleod authored Jul 23, 2024
2 parents ea66782 + 131d848 commit 68e0878
Show file tree
Hide file tree
Showing 13 changed files with 127 additions and 51 deletions.
2 changes: 1 addition & 1 deletion .azure-pipelines/azure-pipelines-osx.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions .ci_support/linux_64_.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ c_compiler_version:
c_stdlib:
- sysroot
c_stdlib_version:
- '2.12'
- '2.17'
cdt_name:
- cos6
- cos7
channel_sources:
- conda-forge
channel_targets:
Expand All @@ -23,11 +23,11 @@ mpi:
mpich:
- '4'
numpy:
- '2.0'
- '2.0'
- '2.0'
- '1.22'
- '1.23'
- '1.26'
- '1.22'
- '1.22'
- '2.0'
openmpi:
- '4'
pin_run_as_build:
Expand Down
8 changes: 4 additions & 4 deletions .ci_support/linux_aarch64_.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ mpi:
mpich:
- '4'
numpy:
- '2.0'
- '2.0'
- '2.0'
- '1.22'
- '1.23'
- '1.26'
- '1.22'
- '1.22'
- '2.0'
openmpi:
- '4'
pin_run_as_build:
Expand Down
8 changes: 4 additions & 4 deletions .ci_support/linux_ppc64le_.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ mpi:
mpich:
- '4'
numpy:
- '2.0'
- '2.0'
- '2.0'
- '1.22'
- '1.23'
- '1.26'
- '1.22'
- '1.22'
- '2.0'
openmpi:
- '4'
pin_run_as_build:
Expand Down
48 changes: 48 additions & 0 deletions .ci_support/migrations/numpy2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
__migrator:
build_number: 1
kind: version
commit_message: |
Rebuild for numpy 2.0
TL;DR: The way we build against numpy has changed as of numpy 2.0. This bot
PR has updated the recipe to account for the changes (see below for details).
The biggest change is that we no longer need to use the oldest available numpy
version at build time in order to support old numpy version at runtime - numpy
will by default use a compatible ABI for the oldest still-supported numpy versions.
Additionally, we no longer need to use `{{ pin_compatible("numpy") }}` as a
run requirement - this has been handled for more than two years now by a
run-export on the numpy package itself. The migrator will therefore remove
any occurrences of this.
However, by default, building against numpy 2.0 will assume that the package
is compatible with numpy 2.0, which is not necessarily the case. You should
check that the upstream package explicitly supports numpy 2.0, otherwise you
need to add a `- numpy <2.0dev0` run requirement until that happens (check numpy
issue 26191 for an overview of the most important packages).
### To-Dos:
* [ ] Match run-requirements for numpy (i.e. check upstream `pyproject.toml` or however the project specifies numpy compatibility)
* If upstream is not yet compatible with numpy 2.0, add `numpy <2.0dev0` upper bound under `run:`.
* If upstream is already compatible with numpy 2.0, nothing else should be necessary in most cases.
* If upstream requires a minimum numpy version newer than 1.19, you can add `numpy >=x.y` under `run:`.
* [ ] Remove any remaining occurrences of `{{ pin_compatible("numpy") }}` that the bot may have missed.
PS. If the build does not compile anymore, this is almost certainly a sign that
the upstream project is not yet ready for numpy 2.0; do not close this PR until
a version compatible with numpy 2.0 has been released upstream and on this
feedstock (in the meantime, you can keep the bot from reopening this PR in
case of git conflicts by marking it as a draft).
migration_number: 1

# needs to match length of zip {python, python_impl, numpy}
# as it is in global CBC in order to override it
numpy:
- 1.22 # no py38 support for numpy 2.0
- 2.0
- 2.0
- 2.0
- 2.0
migrator_ts: 1713572489.295986
14 changes: 8 additions & 6 deletions .ci_support/osx_64_.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
MACOSX_DEPLOYMENT_TARGET:
- '10.9'
- '10.13'
MACOSX_SDK_VERSION:
- '10.13'
c_compiler:
- clang
c_compiler_version:
- '16'
c_stdlib:
- macosx_deployment_target
c_stdlib_version:
- '10.9'
- '10.13'
channel_sources:
- conda-forge
channel_targets:
Expand All @@ -25,11 +27,11 @@ mpi:
mpich:
- '4'
numpy:
- '2.0'
- '2.0'
- '2.0'
- '1.22'
- '1.23'
- '1.26'
- '1.22'
- '1.22'
- '2.0'
openmpi:
- '4'
pin_run_as_build:
Expand Down
10 changes: 6 additions & 4 deletions .ci_support/osx_arm64_.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
MACOSX_DEPLOYMENT_TARGET:
- '11.0'
MACOSX_SDK_VERSION:
- '11.0'
c_compiler:
- clang
c_compiler_version:
Expand All @@ -25,11 +27,11 @@ mpi:
mpich:
- '4'
numpy:
- '2.0'
- '2.0'
- '2.0'
- '1.22'
- '1.23'
- '1.26'
- '1.22'
- '1.22'
- '2.0'
openmpi:
- '4'
pin_run_as_build:
Expand Down
4 changes: 2 additions & 2 deletions .gitattributes

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .scripts/build_steps.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .scripts/run_osx_build.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions conda-forge.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
build_platform:
osx_arm64: osx_64
linux_aarch64: linux_64
linux_ppc64le: linux_64
osx_arm64: osx_64
conda_build:
pkg_format: '2'
conda_forge_output_validation: true
github:
branch_name: main
tooling_branch_name: main
provider:
linux_aarch64: azure
linux_ppc64le: azure
conda_build:
pkg_format: '2'
test: native_and_emulated
2 changes: 1 addition & 1 deletion recipe/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
mpi:
- nompi
- mpich # [unix]
- openmpi # [unix]
- openmpi # [unix]
51 changes: 31 additions & 20 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% set name = "lalinference" %}
{% set version = "4.1.6" %}
{% set build = 0 %}
{% set build = 1 %}

# dependencies
{% set lal_version = "7.5.0" %}
Expand All @@ -11,6 +11,12 @@
{% set lalsimulation_version = "5.4.0" %}
{% set swig_version = "3.0.10" %}

# we can build manuals when:
# - not cross-compiling
# - not Python 3.9 (no astropy available for numpy 2.x)
{% set manpages = False %}
{% set manpages = True %} # [py!=39 and build_platform == target_platform]

package:
name: {{ name }}-split
version: {{ version }}
Expand All @@ -23,14 +29,14 @@ source:
- 0001-lalinference-use-ConfigParser-in-review_test.py.patch

build:
error_overdepending: true
error_overlinking: true
number: {{ build }}
skip: true # [win]

requirements:
build:
- {{ compiler('c') }}
- {{ stdlib("c") }}
- llvm-openmp # [osx]
- make
- pkg-config >=0.18.0
Expand Down Expand Up @@ -75,11 +81,15 @@ outputs:
build:
error_overdepending: true
error_overlinking: true
missing_dso_whitelist:
# https://github.com/conda/conda-build/issues/5403
- $RPATH/ld64.so.2 # [ppc64le]
run_exports:
- {{ pin_subpackage("liblalinference", max_pin="x") }}
requirements:
build:
- {{ compiler('c') }}
- {{ stdlib("c") }}
- llvm-openmp # [osx]
- make
- swig >={{ swig_version }}
Expand Down Expand Up @@ -131,14 +141,11 @@ outputs:
- name: python-lalinference
script: build-python.sh
build:
error_overdepending: true
error_overlinking: true
ignore_run_exports:
- numpy
- python
requirements:
build:
- {{ compiler('c') }}
- {{ stdlib("c") }}
- make
- pkg-config
- swig >={{ swig_version }}
Expand All @@ -152,13 +159,13 @@ outputs:
- python
run:
- astropy >=1.1.1
- healpy >=1.9.1
- healpy >=1.9.1 # [py<39]
- healpy >=1.17.3 # [py>=39]
- h5py
- {{ pin_subpackage('liblalinference', exact=True) }}
- ligo-segments
- lscsoft-glue >=1.54.1
- matplotlib-base >=1.2.0
- {{ pin_compatible('numpy') }}
- python
- python-lal >={{ lal_version }}
- python-lalmetaio >={{ lalmetaio_version }}
Expand Down Expand Up @@ -218,7 +225,8 @@ outputs:
requirements:
build:
- {{ compiler('c') }}
- help2man >=1.37 # [build_platform == target_platform]
- {{ stdlib("c") }}
- help2man >=1.37 # [manpages]
- llvm-openmp # [osx and mpi != 'nompi']
- make
- pkg-config >=0.18.0
Expand All @@ -236,18 +244,18 @@ outputs:
- liblalmetaio >={{ lalmetaio_version }} # [mpi != 'nompi']
- {{ mpi }} # [mpi != 'nompi']
- python
- {{ pin_subpackage('python-lalinference', exact=True) }}
# run requirements needed for help2man (not when cross compiling)
- astropy >=1.1.1 # [build_platform == target_platform]
- h5py # [build_platform == target_platform]
- ligo-gracedb # [build_platform == target_platform]
- lscsoft-glue >=1.54.1 # [build_platform == target_platform]
- matplotlib-base >=1.2.0 # [build_platform == target_platform]
- python-lal >={{ lal_version }} # [build_platform == target_platform]
- python-lalsimulation >={{ lalsimulation_version }} # [build_platform == target_platform]
- python-ligo-lw >=1.7.0 # [build_platform == target_platform]
- scipy >=0.9.0 # [build_platform == target_platform]
- six # [build_platform == target_platform]
- astropy >=1.1.1 # [manpages]
- h5py # [manpages]
- ligo-gracedb # [manpages]
- lscsoft-glue >=1.54.1 # [manpages]
- matplotlib-base >=1.2.0 # [manpages]
- python-lal >={{ lal_version }} # [manpages]
- {{ pin_subpackage('python-lalinference', exact=True) }} # [manpages]
- python-lalsimulation >={{ lalsimulation_version }} # [manpages]
- python-ligo-lw >=1.7.0 # [manpages]
- scipy >=0.9.0 # [manpages]
- six # [manpages]
run:
- astropy >=1.1.1
- gsl # [mpi != 'nompi']
Expand All @@ -266,6 +274,9 @@ outputs:
- python-ligo-lw >=1.7.0
- scipy >=0.9.0
- six
run_constrained:
# https://github.com/conda-forge/backports-feedstock/issues/6
- setuptools <71.0.0 # [py<39]
test:
requires:
- cpnest
Expand Down

0 comments on commit 68e0878

Please sign in to comment.