From 7a25947b6664ee9b192ea2d767bb36d133de57c4 Mon Sep 17 00:00:00 2001 From: Patrick Avery Date: Wed, 18 Oct 2023 16:06:21 -0500 Subject: [PATCH] Try cross-compiling for arm64 on osx Something like this should be possible... Signed-off-by: Patrick Avery --- conda.recipe/conda_build_config.yaml | 9 +++++++++ conda.recipe/meta.yaml | 16 ++++++++++++---- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/conda.recipe/conda_build_config.yaml b/conda.recipe/conda_build_config.yaml index 77f0eec0a..26d5d326b 100644 --- a/conda.recipe/conda_build_config.yaml +++ b/conda.recipe/conda_build_config.yaml @@ -2,3 +2,12 @@ python: - 3.9 - 3.10 - 3.11 +c_compiler: + - gcc # [linux] + - clang # [osx] + - vs2019 # [win] +target_platform: + - linux-64 # [linux] + - osx-64 # [osx] + - osx-arm64 # [osx] + - win-64 # [win] diff --git a/conda.recipe/meta.yaml b/conda.recipe/meta.yaml index 229760264..fb9e7c416 100644 --- a/conda.recipe/meta.yaml +++ b/conda.recipe/meta.yaml @@ -13,12 +13,20 @@ build: requirements: build: - # Numba is only here to ensure the numpy version is compatible - - numba - - numpy >=1.20 + # This is so that we can build cross-platform for osx-arm64 + - {{ compiler('c') }} + - python {{ python }} # [build_platform != target_platform] + - cross-python_{{ target_platform }} # [build_platform != target_platform] + - numpy >=1.25 # [build_platform != target_platform] + # Numba is only here to make sure we use a version of numpy that is compatible + - numba # [build_platform != target_platform] + host: - python {{ python }} + - numpy >=1.25 - setuptools - setuptools_scm + # Numba is only here to make sure we use a version of numpy that is compatible + - numba run: - appdirs @@ -30,7 +38,7 @@ requirements: - h5py - lmfit - numba - - numpy >=1.20 + - {{ pin_compatible('numpy') }} - psutil - pycifrw - python