-
Notifications
You must be signed in to change notification settings - Fork 327
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1100 from numba/main
Backport #1099 to release branch: Fix manylinux wheel builds
- Loading branch information
Showing
16 changed files
with
263 additions
and
228 deletions.
There are no files selected for viewing
22 changes: 12 additions & 10 deletions
22
buildscripts/manylinux_2_17/README.md → buildscripts/manylinux/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
# $1 is the miniconda download link | ||
if [ -z "$1" ]; then | ||
echo "Error: Miniconda download link argument is required" | ||
exit 1 | ||
fi | ||
set -xe | ||
cd $(dirname $0) | ||
source ./prepare_miniconda.sh $1 | ||
conda create -n buildenv -y conda conda-build | ||
conda activate buildenv | ||
conda list | ||
conda-build /root/llvmlite/conda-recipes/llvmdev_manylinux --output-folder=/root/llvmlite/docker_output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
# $1 is the filename of the script to run inside docker. | ||
# The file must exist in buildscripts/manylinux/. | ||
# $2 is the python version name in /opt/python of the manylinux docker image. | ||
# Only used for build_llvmlite.sh. | ||
# Check if required parameters are provided | ||
if [ -z "$1" ] ; then | ||
echo "Error: Missing required parameters" | ||
echo "Usage: $0 <script-filename> [<python-version>]" | ||
exit 1 | ||
fi | ||
set -xe | ||
# Use this to make the llvmdev packages that are manylinux compatible | ||
SRCDIR=$( cd "$(dirname $0)/../.." && pwd ) | ||
echo "SRCDIR=$SRCDIR" | ||
|
||
echo "MINICONDA_FILE=$MINICONDA_FILE" | ||
# Ensure the latest docker image | ||
IMAGE_URI="quay.io/pypa/${MANYLINUX_IMAGE}:latest" | ||
docker pull $IMAGE_URI | ||
docker run --rm -it -v $SRCDIR:/root/llvmlite $IMAGE_URI ${PRECMD} /root/llvmlite/buildscripts/manylinux/$1 ${MINICONDA_FILE} $2 |
5 changes: 2 additions & 3 deletions
5
...dscripts/manylinux_2_17/docker_run_x32.sh → buildscripts/manylinux/docker_run_aarch64.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
export ARCH="i686" | ||
export PRECMD="linux32" | ||
export MINICONDA_FILE="https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86.sh" | ||
export MANYLINUX_IMAGE="manylinux_2_28_aarch64" | ||
export MINICONDA_FILE="https://repo.anaconda.com/miniconda/Miniconda3-py311_24.9.2-0-Linux-aarch64.sh" | ||
cd $(dirname $0) | ||
./docker_run.sh $1 $2 |
4 changes: 2 additions & 2 deletions
4
...dscripts/manylinux_2_17/docker_run_x64.sh → buildscripts/manylinux/docker_run_x64.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
export ARCH="x86_64" | ||
export MINICONDA_FILE="https://repo.anaconda.com/miniconda/Miniconda3-py39_4.9.2-Linux-x86_64.sh" | ||
export MANYLINUX_IMAGE="manylinux2014_x86_64" | ||
export MINICONDA_FILE="https://repo.anaconda.com/miniconda/Miniconda3-py311_24.9.2-0-Linux-x86_64.sh" | ||
cd $(dirname $0) | ||
./docker_run.sh $1 $2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
set -e | ||
cd /root | ||
curl -L -o mini3.sh $1 | ||
bash mini3.sh -b -f -p /root/miniconda3 | ||
echo "Miniconda installed" | ||
source /root/miniconda3/bin/activate base | ||
echo "Env activated" | ||
cd - |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
#!/bin/bash | ||
# File is a copy of ../llvmdev/build.sh with changes to: | ||
# - disable ZSTD | ||
|
||
|
||
# based on https://github.com/AnacondaRecipes/llvmdev-feedstock/blob/master/recipe/build.sh | ||
|
||
set -x | ||
|
||
# Make osx work like linux. | ||
sed -i.bak "s/NOT APPLE AND ARG_SONAME/ARG_SONAME/g" llvm/cmake/modules/AddLLVM.cmake | ||
sed -i.bak "s/NOT APPLE AND NOT ARG_SONAME/NOT ARG_SONAME/g" llvm/cmake/modules/AddLLVM.cmake | ||
|
||
mkdir build | ||
cd build | ||
|
||
export CPU_COUNT=4 | ||
|
||
CMAKE_ARGS="${CMAKE_ARGS} -DLLVM_ENABLE_PROJECTS=lld;libunwind;compiler-rt" | ||
|
||
if [[ "$target_platform" == "linux-64" ]]; then | ||
CMAKE_ARGS="${CMAKE_ARGS} -DLLVM_USE_INTEL_JITEVENTS=ON" | ||
fi | ||
|
||
if [[ "$CC_FOR_BUILD" != "" && "$CC_FOR_BUILD" != "$CC" ]]; then | ||
CMAKE_ARGS="${CMAKE_ARGS} -DCROSS_TOOLCHAIN_FLAGS_NATIVE=-DCMAKE_C_COMPILER=$CC_FOR_BUILD;-DCMAKE_CXX_COMPILER=$CXX_FOR_BUILD;-DCMAKE_C_FLAGS=-O2;-DCMAKE_CXX_FLAGS=-O2;-DCMAKE_EXE_LINKER_FLAGS=-Wl,-rpath,${BUILD_PREFIX}/lib;-DCMAKE_MODULE_LINKER_FLAGS=;-DCMAKE_SHARED_LINKER_FLAGS=;-DCMAKE_STATIC_LINKER_FLAGS=;-DLLVM_INCLUDE_BENCHMARKS=OFF;" | ||
CMAKE_ARGS="${CMAKE_ARGS} -DLLVM_HOST_TRIPLE=$(echo $HOST | sed s/conda/unknown/g) -DLLVM_DEFAULT_TARGET_TRIPLE=$(echo $HOST | sed s/conda/unknown/g)" | ||
fi | ||
|
||
# disable -fno-plt due to https://bugs.llvm.org/show_bug.cgi?id=51863 due to some GCC bug | ||
if [[ "$target_platform" == "linux-ppc64le" ]]; then | ||
CFLAGS="$(echo $CFLAGS | sed 's/-fno-plt //g')" | ||
CXXFLAGS="$(echo $CXXFLAGS | sed 's/-fno-plt //g')" | ||
CMAKE_ARGS="${CMAKE_ARGS} -DFFI_INCLUDE_DIR=$PREFIX/include" | ||
CMAKE_ARGS="${CMAKE_ARGS} -DFFI_LIBRARY_DIR=$PREFIX/lib" | ||
fi | ||
|
||
if [[ $target_platform == osx-arm64 ]]; then | ||
CMAKE_ARGS="${CMAKE_ARGS} -DCMAKE_ENABLE_WERROR=FALSE" | ||
fi | ||
|
||
cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DCMAKE_LIBRARY_PATH="${PREFIX}" \ | ||
-DLLVM_ENABLE_ZSTD=OFF \ | ||
-DLLVM_ENABLE_LIBEDIT=OFF \ | ||
-DLLVM_ENABLE_LIBXML2=OFF \ | ||
-DLLVM_ENABLE_RTTI=ON \ | ||
-DLLVM_ENABLE_TERMINFO=OFF \ | ||
-DLLVM_INCLUDE_BENCHMARKS=OFF \ | ||
-DLLVM_INCLUDE_DOCS=OFF \ | ||
-DLLVM_INCLUDE_EXAMPLES=OFF \ | ||
-DLLVM_INCLUDE_GO_TESTS=OFF \ | ||
-DLLVM_INCLUDE_TESTS=ON \ | ||
-DLLVM_INCLUDE_UTILS=ON \ | ||
-DLLVM_INSTALL_UTILS=ON \ | ||
-DLLVM_UTILS_INSTALL_DIR=libexec/llvm \ | ||
-DLLVM_BUILD_LLVM_DYLIB=OFF \ | ||
-DLLVM_LINK_LLVM_DYLIB=OFF \ | ||
-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=WebAssembly \ | ||
-DLLVM_ENABLE_FFI=ON \ | ||
-DLLVM_ENABLE_Z3_SOLVER=OFF \ | ||
-DLLVM_OPTIMIZED_TABLEGEN=ON \ | ||
-DCMAKE_POLICY_DEFAULT_CMP0111=NEW \ | ||
-DCOMPILER_RT_BUILD_BUILTINS=ON \ | ||
-DCOMPILER_RT_BUILTINS_HIDE_SYMBOLS=OFF \ | ||
-DCOMPILER_RT_BUILD_LIBFUZZER=OFF \ | ||
-DCOMPILER_RT_BUILD_CRT=OFF \ | ||
-DCOMPILER_RT_BUILD_MEMPROF=OFF \ | ||
-DCOMPILER_RT_BUILD_PROFILE=OFF \ | ||
-DCOMPILER_RT_BUILD_SANITIZERS=OFF \ | ||
-DCOMPILER_RT_BUILD_XRAY=OFF \ | ||
-DCOMPILER_RT_BUILD_GWP_ASAN=OFF \ | ||
-DCOMPILER_RT_BUILD_ORC=OFF \ | ||
-DCOMPILER_RT_INCLUDE_TESTS=OFF \ | ||
${CMAKE_ARGS} \ | ||
-GNinja \ | ||
../llvm | ||
|
||
|
||
ninja -j${CPU_COUNT} | ||
|
||
ninja install | ||
|
||
if [[ "${target_platform}" == "linux-64" || "${target_platform}" == "osx-64" ]]; then | ||
export TEST_CPU_FLAG="-mcpu=haswell" | ||
else | ||
export TEST_CPU_FLAG="" | ||
fi | ||
|
||
if [[ "$CONDA_BUILD_CROSS_COMPILATION" != "1" ]]; then | ||
|
||
echo "Testing on ${target_platform}" | ||
# bin/opt -S -vector-library=SVML $TEST_CPU_FLAG -O3 $RECIPE_DIR/numba-3016.ll | bin/FileCheck $RECIPE_DIR/numba-3016.ll || exit $? | ||
|
||
if [[ "$target_platform" == linux* ]]; then | ||
ln -s $(which $CC) $BUILD_PREFIX/bin/gcc | ||
|
||
# These tests tests permission-based behaviour and probably fail because of some | ||
# filesystem-related reason. They are sporadic failures and don't seem serious so they're excluded. | ||
# Note that indents would introduce spaces into the environment variable | ||
export LIT_FILTER_OUT='tools/llvm-ar/error-opening-permission.test|'\ | ||
'tools/llvm-dwarfdump/X86/output.s|'\ | ||
'tools/llvm-ifs/fail-file-write.test|'\ | ||
'tools/llvm-ranlib/error-opening-permission.test|'\ | ||
'ExecutionEngine/Interpreter/intrinsics.ll' | ||
fi | ||
|
||
if [[ "$target_platform" == osx-* ]]; then | ||
# This failure seems like something to do with the output format of ls -lu | ||
# and looks harmless | ||
export LIT_FILTER_OUT='tools/llvm-objcopy/ELF/strip-preserve-atime.test|'\ | ||
'ExecutionEngine/Interpreter/intrinsics.ll' | ||
fi | ||
|
||
cd ../llvm/test | ||
${PYTHON} ../../build/bin/llvm-lit -vv --ignore-fail Transforms ExecutionEngine Analysis CodeGen/X86 | ||
fi | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# This file is a copy of ../llvmdev/meta.yaml with minor changes for manylinux | ||
{% set shortversion = "15.0" %} | ||
{% set version = "15.0.7" %} | ||
{% set sha256_llvm = "8b5fcb24b4128cf04df1b0b9410ce8b1a729cb3c544e6da885d234280dedeac6" %} | ||
{% set build_number = "0" %} | ||
|
||
package: | ||
name: llvmdev | ||
version: {{ version }} | ||
|
||
source: | ||
- url: https://github.com/llvm/llvm-project/releases/download/llvmorg-{{ version.replace(".rc", "-rc") }}/llvm-project-{{ version.replace(".rc", "rc") }}.src.tar.xz | ||
sha256: {{ sha256_llvm }} | ||
patches: | ||
- ../llvm15-clear-gotoffsetmap.patch | ||
- ../llvm15-remove-use-of-clonefile.patch | ||
- ../llvm15-svml.patch | ||
- ../compiler-rt-cfi-startproc-war.patch | ||
- ../compiler-rt-macos-build.patch | ||
|
||
build: | ||
number: {{ build_number }} | ||
string: "manylinux" | ||
script_env: | ||
- CFLAGS | ||
- CXXFLAGS | ||
- PY_VCRUNTIME_REDIST | ||
ignore_run_exports: | ||
# Is static-linked | ||
- xar | ||
|
||
requirements: | ||
build: | ||
# Do not use the compiler | ||
# - {{ compiler('cxx') }} | ||
- cmake | ||
- ninja | ||
- python >=3 | ||
# - libcxx # it is not defined{{ cxx_compiler_version }} # [osx] | ||
- patch # [not win] | ||
# - m2-patch # [win] | ||
- git # [(linux and x86_64)] | ||
|
||
host: | ||
#- libcxx # it is not defined{{ cxx_compiler_version }} # [osx] | ||
- libffi # [unix] | ||
# # libxml2 supports a windows-only feature, see https://github.com/llvm/llvm-project/blob/llvmorg-17.0.6/llvm/include/llvm/WindowsManifest/WindowsManifestMerger.h | ||
# - libxml2 # [win] | ||
- zlib | ||
|
||
test: | ||
files: | ||
- numba-3016.ll | ||
commands: | ||
- $PREFIX/bin/llvm-config --libs # [not win] | ||
- $PREFIX/bin/llc -version # [not win] | ||
|
||
# - if not exist %LIBRARY_INC%\\llvm\\Pass.h exit 1 # [win] | ||
# - if not exist %LIBRARY_LIB%\\LLVMSupport.lib exit 1 # [win] | ||
|
||
- test -f $PREFIX/include/llvm/Pass.h # [unix] | ||
- test -f $PREFIX/lib/libLLVMSupport.a # [unix] | ||
|
||
- test -f $PREFIX/lib/libLLVMCore.a # [not win] | ||
|
||
# LLD tests | ||
- ld.lld --version # [unix] | ||
# - lld-link /? # [win] | ||
|
||
about: | ||
home: http://llvm.org/ | ||
dev_url: https://github.com/llvm-mirror/llvm | ||
license: NCSA | ||
license_file: llvm/LICENSE.TXT | ||
summary: Development headers and libraries for LLVM |
Oops, something went wrong.