Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add m1 support to conda build scripts #813

Merged
merged 4 commits into from
Mar 16, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion conda-recipes/llvmdev/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ set -x
LLVM_TARGETS_TO_BUILD=${LLVM_TARGETS_TO_BUILD:-"host;AArch64;AMDGPU;ARM;BPF;Hexagon;Mips;MSP430;NVPTX;PowerPC;Sparc;SystemZ;X86;XCore;RISCV"}

# This is the clang compiler prefix
DARWIN_TARGET=x86_64-apple-darwin13.4.0
if [[ $build_platform == osx-arm64 ]]; then
DARWIN_TARGET=arm64-apple-darwin20.0.0
else
DARWIN_TARGET=x86_64-apple-darwin13.4.0
fi


declare -a _cmake_config
Expand Down
4 changes: 2 additions & 2 deletions conda-recipes/llvmdev/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{% set version = "11.1.0" %}
{% set sha256_llvm = "ce8508e318a01a63d4e8b3090ab2ded3c598a50258cc49e2625b9120d4c03ea5" %}
{% set sha256_lld = "017a788cbe1ecc4a949abf10755870519086d058a2e99f438829aef24f0c66ce" %}
{% set build_number = "4" %}
{% set build_number = "5" %}

package:
name: llvmdev
Expand Down Expand Up @@ -54,7 +54,7 @@ requirements:
host:
# needed for llc at runtime
- zlib # [not win]
- xar # [osx]
- xar # [osx and x86_64]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does OSX-arm64 not need xar?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The package doesn't exist in the package repository for this platform. I'm not entirely certain what it is for, and the tests seem to pass without it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like it was added a while back as a workaround: #348 (specifically: 73cf559) it may not be applicable any more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess the question is... does llvm-objdump work on M1, as from 73cf559 it seems like that was what triggered adding it. I suppose though that this is also somewhat moot if the package doesn't exist and further that this is a first build out on this architecture!

# llvm-lit testing needs *a* python
- python # [not (armv6l or armv7l or aarch64 or win)]

Expand Down
23 changes: 19 additions & 4 deletions conda-recipes/llvmlite/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
set -x

if [[ $(uname) == Darwin ]]; then
${SYS_PREFIX}/bin/conda create -y -p ${SRC_DIR}/bootstrap clangxx_osx-64=10
if [[ $build_platform == osx-arm64 ]]; then
CLANG_PKG_SELECTOR=clangxx_osx-arm64=12
else
CLANG_PKG_SELECTOR=clangxx_osx-64=10
fi
${SYS_PREFIX}/bin/conda create -y -p ${SRC_DIR}/bootstrap ${CLANG_PKG_SELECTOR}
export PATH=${SRC_DIR}/bootstrap/bin:${PATH}
CONDA_PREFIX=${SRC_DIR}/bootstrap \
. ${SRC_DIR}/bootstrap/etc/conda/activate.d/*
Expand All @@ -19,11 +24,21 @@ if [[ $(uname) == Darwin ]]; then
fi

if [ -n "$MACOSX_DEPLOYMENT_TARGET" ]; then
# OSX needs 10.7 or above with libc++ enabled
export MACOSX_DEPLOYMENT_TARGET=10.10
if [[ $build_platform == osx-arm64 ]]; then
export MACOSX_DEPLOYMENT_TARGET=11.0
else
# OSX needs 10.7 or above with libc++ enabled
export MACOSX_DEPLOYMENT_TARGET=10.10
fi
seibert marked this conversation as resolved.
Show resolved Hide resolved
fi

DARWIN_TARGET=x86_64-apple-darwin13.4.0

# This is the clang compiler prefix
if [[ $build_platform == osx-arm64 ]]; then
DARWIN_TARGET=arm64-apple-darwin20.0.0
else
DARWIN_TARGET=x86_64-apple-darwin13.4.0
fi


export PYTHONNOUSERSITE=1
Expand Down
3 changes: 2 additions & 1 deletion conda-recipes/llvmlite/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ requirements:
host:
- python
# On channel https://anaconda.org/numba/
- llvmdev 11.1.0 *4 # [not win]
- llvmdev 11.1.0 *5 # [(osx and arm64)]
- llvmdev 11.1.0 *4 # [not (osx and arm64) and not win]
seibert marked this conversation as resolved.
Show resolved Hide resolved
- llvmdev 11.1.0 4 # [win]
- vs2015_runtime # [win]
# llvmdev is built with libz compression support
Expand Down