Skip to content

Commit

Permalink
Address review.
Browse files Browse the repository at this point in the history
Main changes are improving error handling, documentation
  • Loading branch information
sklam committed Nov 14, 2024
1 parent fdfbb4f commit 7ba4e73
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 22 deletions.
7 changes: 4 additions & 3 deletions buildscripts/manylinux/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@
Run the script below to start docker off building `llvmdev` base from the current state of the source tree:

- x86_64 linux: `./buildscripts/manylinux/docker_run_x64.sh build_llvmdev.sh`
- uses manylinux2014 image for glibc 2.17+
- uses manylinux2014 image for glibc 2.17+: `pypa.io/pypa/manylinux2014_x86_64`
- aarch64 linux: `./buildscripts/manylinux/docker_run_aarch64.sh build_llvmdev.sh`
- uses manylinux_2_28 image for glibc 2.28+
- uses manylinux_2_28 image for glibc 2.28+: `pypa.io/pypa/manylinux_2_28_aarch64`

The conda packages will be stored into `<llvmlite_source_root>/docker_output`

Note: the `docker_output` location can be used as a local conda channel.

Finally, upload the conda package to the numba channel under the "manylinux_x_y" label:
Finally, upload the conda package to the numba channel under the "manylinux_x_y"
label (`x` and `y` are glibc major and minor version numbers, respectively):

`anaconda upload -u numba -l manylinux_x_y <filepath>`

Expand Down
9 changes: 6 additions & 3 deletions buildscripts/manylinux/build_llvmdev.sh
Original file line number Diff line number Diff line change
@@ -1,10 +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
# make conda-build env t
conda create -n buildenv -y conda conda-build
conda activate buildenv
conda list
echo "BUILD_CHANNELS: $BUILD_CHANNELS"
conda-build $BUILD_CHANNELS /root/llvmlite/conda-recipes/llvmdev_manylinux --output-folder=/root/llvmlite/docker_output
conda-build /root/llvmlite/conda-recipes/llvmdev_manylinux --output-folder=/root/llvmlite/docker_output
5 changes: 4 additions & 1 deletion buildscripts/manylinux/build_llvmlite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@ conda activate $envname

if [[ $(uname -m) == "aarch64" ]] ; then
conda install -y numba/label/manylinux_2_28::llvmdev --no-deps
else
elif [[ $(uname -m) == "x86_64" ]] ; then
conda install -y numba/label/manylinux_2_17::llvmdev --no-deps
else
echo "Error: Unsupported architecture: $(uname -m)"
exit 1
fi

# Prepend builtin Python Path
Expand Down
22 changes: 16 additions & 6 deletions buildscripts/manylinux/docker_run.sh
Original file line number Diff line number Diff line change
@@ -1,11 +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 manylinux2010 compatible
srcdir=$( cd "$(dirname $0)/../.." && pwd )
echo "srcdir=$srcdir"
# 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="quay.io/pypa/${MANYLINUX_IMAGE}:latest"
docker pull $image
docker run --rm -it -v $srcdir:/root/llvmlite $image ${PRECMD} /root/llvmlite/buildscripts/manylinux/$1 ${MINICONDA_FILE} $2
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
6 changes: 3 additions & 3 deletions buildscripts/manylinux/prepare_miniconda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
set -e
cd /root
curl -L -o mini3.sh $1
bash mini3.sh -b -f -p $HOME/miniconda3
bash mini3.sh -b -f -p /root/miniconda3
echo "Miniconda installed"
source $HOME/miniconda3/bin/activate base
source /root/miniconda3/bin/activate base
echo "Env activated"
cd /root/llvmlite/buildscripts/manylinux
cd -
3 changes: 3 additions & 0 deletions conda-recipes/llvmdev_manylinux/build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/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

Expand Down
13 changes: 7 additions & 6 deletions conda-recipes/llvmdev_manylinux/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# 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" %}
Expand Down Expand Up @@ -37,14 +38,14 @@ requirements:
- python >=3
# - libcxx # it is not defined{{ cxx_compiler_version }} # [osx]
- patch # [not win]
- m2-patch # [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]
# # 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:
Expand All @@ -54,8 +55,8 @@ test:
- $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]
# - 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]
Expand All @@ -64,7 +65,7 @@ test:

# LLD tests
- ld.lld --version # [unix]
- lld-link /? # [win]
# - lld-link /? # [win]

about:
home: http://llvm.org/
Expand Down

0 comments on commit 7ba4e73

Please sign in to comment.