├── .clang-format ├── .codeclimate.yml ├── .coveragerc ├── .flake8 ├── .gitattributes ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── config.yml │ ├── feature_request.md │ ├── first_rc_checklist.md │ └── sub_rc_checklist.md └── workflows │ ├── llvmdev_build.yml │ ├── llvmlite_linux-64_conda_builder.yml │ ├── llvmlite_linux-64_wheel_builder.yml │ ├── llvmlite_linux-arm64_conda_builder.yml │ ├── llvmlite_linux-arm64_wheel_builder.yml │ ├── llvmlite_osx-64_conda_builder.yml │ ├── llvmlite_osx-64_wheel_builder.yml │ ├── llvmlite_osx-arm64_conda_builder.yml │ ├── llvmlite_osx-arm64_wheel_builder.yml │ ├── llvmlite_win-64_conda_builder.yml │ ├── llvmlite_win-64_wheel_builder.yml │ └── pre-commit.yml ├── .gitignore ├── .pre-commit-config.yaml ├── .readthedocs.yaml ├── .scrutinizer.yml ├── .ycm_extra_conf.py ├── CHANGE_LOG ├── LICENSE ├── LICENSE.thirdparty ├── MANIFEST.in ├── README.rst ├── azure-pipelines.yml ├── buildscripts ├── azure │ ├── azure-linux-macos.yml │ └── azure-windows.yml ├── github │ ├── MacOSX10.10.sdk.checksum │ ├── llvmdev_evaluate.py │ ├── patch_osx-64_wheel.sh │ ├── setup_platform.sh │ ├── validate_osx-64_wheel.sh │ └── validate_win-64_wheel.py ├── incremental │ ├── after_success.sh │ ├── build.cmd │ ├── build.sh │ ├── install_miniconda.sh │ ├── setup_conda_environment.cmd │ ├── setup_conda_environment.sh │ ├── test.cmd │ └── test.sh └── manylinux │ ├── README.md │ ├── build_llvmdev.sh │ ├── build_llvmlite.sh │ ├── docker_run.sh │ ├── docker_run_aarch64.sh │ ├── docker_run_x64.sh │ └── prepare_miniconda.sh ├── codecov.yml ├── conda-recipes ├── appveyor │ └── run_with_env.cmd ├── compiler-rt-cfi-startproc-war.patch ├── compiler-rt-macos-build.patch ├── llvm15-clear-gotoffsetmap.patch ├── llvm15-remove-use-of-clonefile.patch ├── llvm15-svml.patch ├── llvmdev │ ├── bld.bat │ ├── build.sh │ ├── conda_build_config.yaml │ ├── meta.yaml │ ├── numba-3016.ll │ └── patches │ │ ├── 0002-CMake-Fix-Findzstd-module-for-shared-DLL-on-Windows.patch │ │ └── no-windows-symlinks.patch ├── llvmdev_for_wheel │ ├── bld.bat │ ├── build.sh │ ├── conda_build_config.yaml │ └── meta.yaml └── llvmlite │ ├── bld.bat │ ├── build.sh │ ├── conda_build_config.yaml │ ├── meta.yaml │ └── run_test.py ├── docs ├── Makefile ├── gh-pages.py ├── make.bat ├── rtd-requirements.txt └── source │ ├── _static │ └── EMPTY │ ├── admin-guide │ └── install.rst │ ├── conf.py │ ├── contributing.rst │ ├── faqs.rst │ ├── glossary.rst │ ├── index.rst │ ├── release-notes.rst │ └── user-guide │ ├── binding │ ├── analysis-utilities.rst │ ├── context.rst │ ├── dynamic-libraries.rst │ ├── examples.rst │ ├── execution-engine.rst │ ├── index.rst │ ├── initialization-finalization.rst │ ├── misc.rst │ ├── modules.rst │ ├── object-file.rst │ ├── optimization-passes.rst │ ├── pass_timings.rst │ ├── target-information.rst │ ├── type-references.rst │ └── value-references.rst │ ├── deprecation.rst │ ├── examples │ ├── floatrep.py │ ├── ir_fpadd.py │ ├── ll_fpadd.py │ ├── llvmir.py │ ├── notebooks │ │ └── Visualize ControlFlow.ipynb │ ├── parseasm.py │ ├── sum.py │ └── test.ll │ ├── index.rst │ └── ir │ ├── examples.rst │ ├── index.rst │ ├── ir-builder.rst │ ├── modules.rst │ ├── types.rst │ └── values.rst ├── examples ├── floatrep.py ├── ir_fpadd.py ├── ll_fpadd.py ├── lljit.py ├── llvmir.py ├── llvmir_iter.py ├── notebooks │ └── Visualize ControlFlow.ipynb ├── npm_passes.py ├── npm_pipeline.py ├── opaque_pointers │ ├── llvmir.py │ └── sum.py ├── parseasm.py ├── printer-passes-npm.py ├── sum.py └── test.ll ├── ffi ├── CMakeLists.txt ├── Makefile.freebsd ├── Makefile.linux ├── Makefile.netbsd ├── Makefile.osx ├── PASSREGISTRY.def ├── assembly.cpp ├── bitcode.cpp ├── build.py ├── core.cpp ├── core.h ├── custom_passes.cpp ├── dummy │ └── CMakeLists.txt ├── dylib.cpp ├── executionengine.cpp ├── initfini.cpp ├── linker.cpp ├── memorymanager.cpp ├── memorymanager.h ├── module.cpp ├── newpassmanagers.cpp ├── object_file.cpp ├── orcjit.cpp ├── passmanagers.cpp ├── targets.cpp ├── transforms.cpp ├── type.cpp └── value.cpp ├── llvmlite ├── __init__.py ├── _version.py ├── binding │ ├── __init__.py │ ├── analysis.py │ ├── common.py │ ├── context.py │ ├── dylib.py │ ├── executionengine.py │ ├── ffi.py │ ├── initfini.py │ ├── linker.py │ ├── module.py │ ├── newpassmanagers.py │ ├── object_file.py │ ├── options.py │ ├── orcjit.py │ ├── passmanagers.py │ ├── targets.py │ ├── transforms.py │ ├── typeref.py │ └── value.py ├── ir │ ├── __init__.py │ ├── _utils.py │ ├── builder.py │ ├── context.py │ ├── instructions.py │ ├── module.py │ ├── transforms.py │ ├── types.py │ └── values.py ├── tests │ ├── __init__.py │ ├── __main__.py │ ├── customize.py │ ├── refprune_proto.py │ ├── test_binding.py │ ├── test_ir.py │ ├── test_refprune.py │ └── test_valuerepr.py └── utils.py ├── renovate.json ├── run_coverage.py ├── runtests.py ├── setup.py └── versioneer.py /.clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | BasedOnStyle: LLVM 3 | IndentWidth: 4 4 | -------------------------------------------------------------------------------- /.codeclimate.yml: -------------------------------------------------------------------------------- 1 | # Configuration for codeclimate.com 2 | 3 | engines: 4 | duplication: 5 | enabled: true 6 | config: 7 | languages: 8 | python: 9 | mass_threshold: 50 10 | fixme: 11 | enabled: true 12 | pep8: 13 | enabled: true 14 | radon: 15 | enabled: true 16 | 17 | ratings: 18 | paths: 19 | - "llvmlite/**.py" 20 | 21 | exclude_paths: 22 | - "**/six.py" 23 | - "**/_version.py" 24 | -------------------------------------------------------------------------------- /.coveragerc: -------------------------------------------------------------------------------- 1 | # configuration file used by run_coverage.py 2 | [run] 3 | branch = True 4 | source = llvmlite 5 | 6 | [report] 7 | 8 | exclude_lines = 9 | pragma: no cover 10 | if __name__ == .__main__.: 11 | 12 | # General support infrastructure (third-party libs, testing machinery) 13 | # that we don't bother covering. 14 | omit = 15 | */__main__.py 16 | llvmlite/enum.py 17 | llvmlite/six.py 18 | llvmlite/_version.py 19 | llvmlite/tests/customize.py 20 | 21 | [html] 22 | -------------------------------------------------------------------------------- /.flake8: -------------------------------------------------------------------------------- 1 | [flake8] 2 | ignore = 3 | # Extra space in brackets 4 | E20, 5 | # Multiple spaces around "," 6 | E231,E241, 7 | # Comments 8 | E26, 9 | # Assigning lambda expression 10 | E731, 11 | # Ambiguous variable names 12 | E741, 13 | # line break before binary operator 14 | W503, 15 | # line break after binary operator 16 | W504, 17 | max-line-length = 80 18 | 19 | exclude = 20 | __pycache__ 21 | .git 22 | *.pyc 23 | *~ 24 | *.o 25 | *.so 26 | *.cpp 27 | *.c 28 | *.h 29 | __init__.py 30 | _version.py 31 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | llvmlite/_version.py export-subst 2 | # All patch files must be checked out with UNIX line endings even on Windows. 3 | *.patch text eol=lf 4 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug Report 3 | about: Report a bug. Not for asking general questions - see below. 4 | 5 | --- 6 | 7 | 15 | 16 | ## Reporting a bug 17 | 18 | 23 | 24 | - [ ] I have tried using the latest released version of llvmlite (most recent is 25 | visible in the change log (https://github.com/numba/llvmlite/blob/main/CHANGE_LOG). 26 | - [ ] I have included a self contained code sample to reproduce the problem. 27 | i.e. it's possible to run as 'python bug.py'. 28 | 29 | 35 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: General Question 4 | url: https://numba.discourse.group/c/llvmlite 5 | about: "If you have a general question (not a bug report or feature request) then please ask in the llvmlite section of Numba's discourse instance." 6 | - name: Quick Question/Just want to say Hi! 7 | url: https://gitter.im/numba/llvmlite 8 | about: "If you have a quick question or want chat to users/developers in real time then please use gitter.im/numba/llvmlite" 9 | - name: Discuss an involved feature 10 | url: https://numba.discourse.group/c/llvmlite 11 | about: "If you would like to suggest a more involved feature like *Can a new pass be added to do X* then please start a discussion in the llvmlite section of Numba's discourse instance." 12 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature Request 3 | about: Tell us about something you'd like llvmlite to support. Not for asking general questions - see below. 4 | 5 | --- 6 | 7 | --- 8 | 9 | 17 | 18 | ## Feature request 19 | 20 | 26 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/first_rc_checklist.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: First Release Candidate Checklist (maintainer only) 3 | about: Checklist template for the first release of every series 4 | title: llvmlite X.Y.Zrc1 Checklist (FIXME) 5 | labels: task 6 | 7 | --- 8 | 9 | 10 | ## llvmlite X.Y.Z 11 | 12 | * [ ] Merge to `main`. 13 | * [ ] "remaining Pull-Requests from milestone". 14 | * In case of an LLVM upgrade: 15 | * [ ] Check if the compatability matrix in the `README.rst` needs updating. 16 | * [ ] Check if the inter-sphinx link in `llvmlite/docs/source/conf.py` 17 | needs an update. 18 | * [ ] Create X.Y release branch `releaseX.Y` 19 | * [ ] Update `CHANGE_LOG` in a PR targeting the release branch. 20 | * [ ] Follow the format of previous `CHANGE_LOG` entries. 21 | * [ ] Get the change-log-PR reviewed and merged. 22 | * [ ] Test `HEAD` of release branch on buildfarm (pre-tag testing): 23 | * [ ] conda package build and test. 24 | * [ ] wheel build. 25 | * [ ] Test `HEAD` of release branch on conda-forge 26 | * [ ] Annotated tag `vX.Y.Zrc1` on release branch (`llvmlite` tags DO have a `v` prefix). 27 | * [ ] Build and upload conda packages on buildfarm (check "upload"). 28 | * [ ] Build wheels and sdist on the buildfarm (check "upload"). 29 | * [ ] Verify packages uploaded to Anaconda Cloud and copy to `numba/label/main`. 30 | * [ ] Upload wheels and sdist to PyPI. (upload from `ci_artifacts`). 31 | * [ ] Verify wheels for all platforms arrived on PyPi. 32 | * [ ] Initialize and verify ReadTheDocs build. 33 | * [ ] Send RC announcement email / post announcement to discourse group. 34 | * [ ] Post link to X and Mastodon and anywhere else that is appropriate. 35 | 36 | ### Post Release: 37 | 38 | * [ ] Clean up `ci_artifacts` by moving files to subdirectories 39 | * [ ] Tag X.Y+1.0dev0 to start new development cycle on `main`. 40 | * [ ] Update release checklist template with any additional bullet points that 41 | may have arisen during the release. 42 | * [ ] Close milestone (and then close this release issue). 43 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/sub_rc_checklist.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Subsequent Release Candidate Checklist (maintainer only) 3 | about: Checklist template for all subsequent releases (RC 2-N, FINAL and PATCH) of every series 4 | title: llvmlite X.Y.Z Checklist (FIXME) 5 | labels: task 6 | 7 | --- 8 | 9 | 10 | ## llvmlite X.Y.Z 11 | 12 | * [ ] Cherry-pick items from the X.Y.Z milestone into a PR targeting the release branch. 13 | * [ ] Update `CHANGE_LOG` on cherry-pick-PR. 14 | * [ ] Have cherry-pick-PR reviewed and merged. 15 | * [ ] Test `HEAD` of release branch on buildfarm (pre-tag testing): 16 | * [ ] conda package build and test. 17 | * [ ] wheel build. 18 | * [ ] Annotated tag `vX.Y.Z` on release branch (`llvmlite` tags DO have a `v` prefix). 19 | * [ ] Build and upload conda packages on buildfarm (check "upload"). 20 | * [ ] Build wheels and sdist on the buildfarm (check "upload"). 21 | * [ ] Verify packages uploaded to Anaconda Cloud and copy to `numba/label/main`. 22 | * [ ] Upload wheels and sdist to PyPI. (upload from `ci_artifacts`). 23 | * [ ] Verify wheels for all platforms arrived on PyPi. 24 | * [ ] Verify ReadTheDocs build. 25 | * [ ] Send RC/FINAL announcement email / post announcement to discourse group. 26 | * [ ] Post link to Twitter and Mastodon and anywhere else that is appropriate. 27 | 28 | ### Post release 29 | 30 | * [ ] Cherry-pick changes to the `CHANGE_LOG` to `main`. (FINAL ONLY) 31 | * [ ] Clean up `ci_artifacts` by moving files to subdirectories 32 | * [ ] Update release checklist template with any additional bullet points that 33 | may have arisen during the release. 34 | * [ ] Ping Anaconda Distro team to trigger a build for `defaults` (FINAL ONLY). 35 | * [ ] Close milestone (and then close this release issue). 36 | -------------------------------------------------------------------------------- /.github/workflows/llvmlite_linux-64_conda_builder.yml: -------------------------------------------------------------------------------- 1 | 2 | name: llvmlite_linux-64_conda_builder 3 | 4 | on: 5 | pull_request: 6 | paths: 7 | - .github/workflows/llvmlite_linux-64_conda_builder.yml 8 | workflow_dispatch: 9 | inputs: 10 | llvmdev_run_id: 11 | description: 'llvmdev workflow run ID (optional)' 12 | required: false 13 | type: string 14 | 15 | jobs: 16 | linux-64-build: 17 | name: linux-64-build 18 | runs-on: ubuntu-latest 19 | defaults: 20 | run: 21 | shell: bash -elx {0} 22 | strategy: 23 | matrix: 24 | python-version: ["3.10", "3.11", "3.12", "3.13"] 25 | fail-fast: false 26 | 27 | steps: 28 | - name: Clone repository 29 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 30 | with: 31 | fetch-depth: 0 32 | 33 | - name: Setup Miniconda 34 | uses: conda-incubator/setup-miniconda@505e6394dae86d6a5c7fbb6e3fb8938e3e863830 # v3.1.1 35 | with: 36 | auto-update-conda: true 37 | auto-activate-base: true 38 | activate-environment: "" 39 | 40 | - name: Install conda-build 41 | run: conda install conda-build 42 | 43 | - name: Download llvmdev Artifact 44 | if: ${{ inputs.llvmdev_run_id != '' }} 45 | uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 46 | with: 47 | name: llvmdev_linux-64 48 | path: llvmdev_conda_packages 49 | run-id: ${{ inputs.llvmdev_run_id }} 50 | repository: ${{ github.repository }} 51 | github-token: ${{ secrets.GITHUB_TOKEN }} 52 | 53 | - name: Build llvmlite conda package 54 | run: | 55 | if [ "${{ inputs.llvmdev_run_id }}" != "" ]; then 56 | LLVMDEV_CHANNEL="file://$PWD/llvmdev_conda_packages" 57 | else 58 | LLVMDEV_CHANNEL="numba" 59 | fi 60 | CONDA_CHANNEL_DIR="conda_channel_dir" 61 | mkdir $CONDA_CHANNEL_DIR 62 | conda build --debug -c "$LLVMDEV_CHANNEL" -c defaults --python=${{ matrix.python-version }} conda-recipes/llvmlite --output-folder=$CONDA_CHANNEL_DIR --no-test 63 | 64 | - name: Upload llvmlite conda package 65 | uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 66 | with: 67 | name: llvmlite-linux-64-py${{ matrix.python-version }} 68 | path: conda_channel_dir 69 | compression-level: 0 70 | retention-days: 7 71 | if-no-files-found: error 72 | 73 | linux-64-test: 74 | name: linux-64-test 75 | needs: linux-64-build 76 | runs-on: ubuntu-latest 77 | defaults: 78 | run: 79 | shell: bash -elx {0} 80 | strategy: 81 | matrix: 82 | python-version: ["3.10", "3.11", "3.12", "3.13"] 83 | fail-fast: false 84 | 85 | steps: 86 | - name: Setup miniconda 87 | uses: conda-incubator/setup-miniconda@505e6394dae86d6a5c7fbb6e3fb8938e3e863830 # v3.1.1 88 | 89 | - name: Download llvmlite artifact 90 | uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 91 | with: 92 | name: llvmlite-linux-64-py${{ matrix.python-version }} 93 | 94 | - name: Install conda-build and llvmlite 95 | run: | 96 | conda install conda-build 97 | 98 | - name: Run tests 99 | run: conda build --test linux-64/llvmlite*.conda 100 | -------------------------------------------------------------------------------- /.github/workflows/llvmlite_linux-arm64_conda_builder.yml: -------------------------------------------------------------------------------- 1 | name: llvmlite_linux-arm64_conda_builder 2 | 3 | on: 4 | pull_request: 5 | paths: 6 | - .github/workflows/llvmlite_linux-arm64_conda_builder.yml 7 | workflow_dispatch: 8 | inputs: 9 | llvmdev_run_id: 10 | description: 'llvmdev workflow run ID (optional)' 11 | required: false 12 | type: string 13 | 14 | jobs: 15 | linux-arm64-build: 16 | name: linux-arm64-build 17 | runs-on: ubuntu-24.04-arm 18 | defaults: 19 | run: 20 | shell: bash -elx {0} 21 | strategy: 22 | matrix: 23 | python-version: ["3.10", "3.11", "3.12", "3.13"] 24 | fail-fast: false 25 | 26 | steps: 27 | - name: Clone repository 28 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 29 | with: 30 | fetch-depth: 0 31 | 32 | - name: Setup Miniconda 33 | uses: conda-incubator/setup-miniconda@505e6394dae86d6a5c7fbb6e3fb8938e3e863830 # v3.1.1 34 | with: 35 | auto-update-conda: true 36 | auto-activate-base: true 37 | activate-environment: "" 38 | 39 | - name: Install conda-build 40 | run: conda install conda-build 41 | 42 | - name: Download llvmdev Artifact 43 | if: ${{ inputs.llvmdev_run_id != '' }} 44 | uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 45 | with: 46 | name: llvmdev_linux-arm64 47 | path: llvmdev_conda_packages 48 | run-id: ${{ inputs.llvmdev_run_id }} 49 | repository: ${{ github.repository }} 50 | github-token: ${{ secrets.GITHUB_TOKEN }} 51 | 52 | - name: Build llvmlite conda package 53 | run: | 54 | if [ "${{ inputs.llvmdev_run_id }}" != "" ]; then 55 | LLVMDEV_CHANNEL="file://${{ github.workspace }}/llvmdev_conda_packages" 56 | else 57 | LLVMDEV_CHANNEL="numba" 58 | fi 59 | CONDA_CHANNEL_DIR="conda_channel_dir" 60 | mkdir "$CONDA_CHANNEL_DIR" 61 | conda build --debug -c "$LLVMDEV_CHANNEL" -c defaults --python=${{ matrix.python-version }} conda-recipes/llvmlite --output-folder="$CONDA_CHANNEL_DIR" --no-test 62 | 63 | - name: Upload llvmlite conda package 64 | uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 65 | with: 66 | name: llvmlite-linux-arm64-py${{ matrix.python-version }} 67 | path: conda_channel_dir 68 | compression-level: 0 69 | retention-days: 7 70 | if-no-files-found: error 71 | 72 | linux-arm64-test: 73 | name: linux-arm64-test 74 | needs: linux-arm64-build 75 | runs-on: ubuntu-24.04-arm 76 | defaults: 77 | run: 78 | shell: bash -elx {0} 79 | strategy: 80 | matrix: 81 | python-version: ["3.10", "3.11", "3.12", "3.13"] 82 | fail-fast: false 83 | 84 | steps: 85 | - name: Setup miniconda 86 | uses: conda-incubator/setup-miniconda@505e6394dae86d6a5c7fbb6e3fb8938e3e863830 # v3.1.1 87 | 88 | - name: Download llvmlite artifact 89 | uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 90 | with: 91 | name: llvmlite-linux-arm64-py${{ matrix.python-version }} 92 | 93 | - name: Install conda-build 94 | run: | 95 | conda install conda-build 96 | 97 | - name: Run tests 98 | run: conda build --test linux-aarch64/llvmlite*.conda 99 | -------------------------------------------------------------------------------- /.github/workflows/llvmlite_osx-64_conda_builder.yml: -------------------------------------------------------------------------------- 1 | name: llvmlite_osx-64_conda_builder 2 | 3 | on: 4 | pull_request: 5 | paths: 6 | - .github/workflows/llvmlite_osx-64_conda_builder.yml 7 | workflow_dispatch: 8 | inputs: 9 | llvmdev_run_id: 10 | description: 'llvmdev workflow run ID (optional)' 11 | required: false 12 | type: string 13 | 14 | # Add concurrency control 15 | concurrency: 16 | group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} 17 | cancel-in-progress: true 18 | 19 | jobs: 20 | osx-64-build: 21 | name: osx-64-build 22 | runs-on: macos-13 23 | defaults: 24 | run: 25 | shell: bash -elx {0} 26 | strategy: 27 | matrix: 28 | python-version: ["3.10", "3.11", "3.12", "3.13"] 29 | fail-fast: false 30 | 31 | steps: 32 | - name: Clone repository 33 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 34 | with: 35 | fetch-depth: 0 36 | 37 | - name: Setup platform-specific requirements 38 | run: | 39 | source ./buildscripts/github/setup_platform.sh "osx-64" 40 | 41 | - name: Setup Miniconda 42 | uses: conda-incubator/setup-miniconda@505e6394dae86d6a5c7fbb6e3fb8938e3e863830 # v3.1.1 43 | with: 44 | auto-update-conda: true 45 | auto-activate-base: true 46 | activate-environment: "" 47 | 48 | - name: Install conda-build 49 | run: conda install conda-build 50 | 51 | - name: Download llvmdev Artifact 52 | if: ${{ inputs.llvmdev_run_id != '' }} 53 | uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 54 | with: 55 | name: llvmdev_osx-64 56 | path: llvmdev_conda_packages 57 | run-id: ${{ inputs.llvmdev_run_id }} 58 | repository: ${{ github.repository }} 59 | github-token: ${{ secrets.GITHUB_TOKEN }} 60 | 61 | - name: Build llvmlite conda package 62 | run: | 63 | if [ "${{ inputs.llvmdev_run_id }}" != "" ]; then 64 | LLVMDEV_CHANNEL="file://$PWD/llvmdev_conda_packages" 65 | else 66 | LLVMDEV_CHANNEL="numba" 67 | fi 68 | CONDA_CHANNEL_DIR="conda_channel_dir" 69 | mkdir $CONDA_CHANNEL_DIR 70 | conda build --debug -c "$LLVMDEV_CHANNEL" -c defaults --python=${{ matrix.python-version }} conda-recipes/llvmlite --output-folder=$CONDA_CHANNEL_DIR --no-test --variants '{"CONDA_BUILD_SYSROOT": "/opt/MacOSX10.10.sdk"}' 71 | 72 | - name: Upload llvmlite conda package 73 | uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 74 | with: 75 | name: llvmlite-osx-64-py${{ matrix.python-version }} 76 | path: conda_channel_dir 77 | compression-level: 0 78 | retention-days: 7 79 | if-no-files-found: error 80 | 81 | - name: Show Workflow Run ID 82 | run: "echo \"Workflow Run ID: ${{ github.run_id }}\"" 83 | 84 | osx-64-test: 85 | name: osx-64-test 86 | needs: osx-64-build 87 | runs-on: macos-13 88 | defaults: 89 | run: 90 | shell: bash -elx {0} 91 | strategy: 92 | matrix: 93 | python-version: ["3.10", "3.11", "3.12", "3.13"] 94 | fail-fast: false 95 | 96 | steps: 97 | - name: Setup miniconda 98 | uses: conda-incubator/setup-miniconda@505e6394dae86d6a5c7fbb6e3fb8938e3e863830 # v3.1.1 99 | 100 | - name: Download llvmlite artifact 101 | uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 102 | with: 103 | name: llvmlite-osx-64-py${{ matrix.python-version }} 104 | 105 | - name: Install conda-build 106 | run: | 107 | conda install conda-build 108 | 109 | - name: Run tests 110 | run: conda build --test osx-64/llvmlite*.conda 111 | -------------------------------------------------------------------------------- /.github/workflows/llvmlite_osx-arm64_conda_builder.yml: -------------------------------------------------------------------------------- 1 | name: llvmlite_osx-arm64_conda_builder 2 | 3 | on: 4 | pull_request: 5 | paths: 6 | - .github/workflows/llvmlite_osx-arm64_conda_builder.yml 7 | workflow_dispatch: 8 | inputs: 9 | llvmdev_run_id: 10 | description: 'llvmdev workflow run ID (optional)' 11 | required: false 12 | type: string 13 | 14 | # Add concurrency control 15 | concurrency: 16 | group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} 17 | cancel-in-progress: true 18 | 19 | jobs: 20 | osx-arm64-build: 21 | name: osx-arm64-build 22 | runs-on: macos-14 23 | defaults: 24 | run: 25 | shell: bash -elx {0} 26 | strategy: 27 | matrix: 28 | python-version: ["3.10", "3.11", "3.12", "3.13"] 29 | fail-fast: false 30 | 31 | steps: 32 | - name: Clone repository 33 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 34 | with: 35 | fetch-depth: 0 36 | 37 | - name: Setup Miniconda 38 | uses: conda-incubator/setup-miniconda@505e6394dae86d6a5c7fbb6e3fb8938e3e863830 # v3.1.1 39 | with: 40 | auto-update-conda: true 41 | auto-activate-base: true 42 | activate-environment: "" 43 | 44 | - name: Install conda-build 45 | run: conda install conda-build 46 | 47 | - name: Download llvmdev Artifact 48 | if: ${{ inputs.llvmdev_run_id != '' }} 49 | uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 50 | with: 51 | name: llvmdev_osx-arm64 52 | path: llvmdev_conda_packages 53 | run-id: ${{ inputs.llvmdev_run_id }} 54 | repository: ${{ github.repository }} 55 | github-token: ${{ secrets.GITHUB_TOKEN }} 56 | 57 | - name: Build llvmlite conda package 58 | run: | 59 | if [ "${{ inputs.llvmdev_run_id }}" != "" ]; then 60 | LLVMDEV_CHANNEL="file://${{ github.workspace }}/llvmdev_conda_packages" 61 | else 62 | LLVMDEV_CHANNEL="numba" 63 | fi 64 | CONDA_CHANNEL_DIR="conda_channel_dir" 65 | mkdir $CONDA_CHANNEL_DIR 66 | conda build --debug -c "$LLVMDEV_CHANNEL" -c defaults --python=${{ matrix.python-version }} conda-recipes/llvmlite --output-folder=$CONDA_CHANNEL_DIR --no-test 67 | 68 | - name: Upload llvmlite conda package 69 | uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 70 | with: 71 | name: llvmlite-osx-arm64-py${{ matrix.python-version }} 72 | path: conda_channel_dir 73 | compression-level: 0 74 | retention-days: 7 75 | if-no-files-found: error 76 | 77 | - name: Show Workflow Run ID 78 | run: "echo \"Workflow Run ID: ${{ github.run_id }}\"" 79 | 80 | osx-arm64-test: 81 | name: osx-arm64-test 82 | needs: osx-arm64-build 83 | runs-on: macos-14 84 | defaults: 85 | run: 86 | shell: bash -elx {0} 87 | strategy: 88 | matrix: 89 | python-version: ["3.10", "3.11", "3.12", "3.13"] 90 | fail-fast: false 91 | 92 | steps: 93 | - name: Setup miniconda 94 | uses: conda-incubator/setup-miniconda@505e6394dae86d6a5c7fbb6e3fb8938e3e863830 # v3.1.1 95 | 96 | - name: Download llvmlite artifact 97 | uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 98 | with: 99 | name: llvmlite-osx-arm64-py${{ matrix.python-version }} 100 | 101 | - name: Install conda-build 102 | run: | 103 | conda install conda-build 104 | 105 | - name: Run tests 106 | run: conda build --test osx-arm64/llvmlite*.conda 107 | -------------------------------------------------------------------------------- /.github/workflows/llvmlite_win-64_conda_builder.yml: -------------------------------------------------------------------------------- 1 | 2 | name: llvmlite_win-64_conda_builder 3 | 4 | on: 5 | pull_request: 6 | paths: 7 | - .github/workflows/llvmlite_win-64_conda_builder.yml 8 | workflow_dispatch: 9 | inputs: 10 | llvmdev_run_id: 11 | description: 'llvmdev workflow run ID (optional)' 12 | required: false 13 | type: string 14 | 15 | # Add concurrency control 16 | concurrency: 17 | group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} 18 | cancel-in-progress: true 19 | 20 | jobs: 21 | win-64-build: 22 | name: win-64-build 23 | runs-on: windows-2019 24 | defaults: 25 | run: 26 | shell: bash -elx {0} 27 | strategy: 28 | matrix: 29 | python-version: ["3.10", "3.11", "3.12", "3.13"] 30 | fail-fast: false 31 | 32 | steps: 33 | - name: Clone repository 34 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 35 | with: 36 | fetch-depth: 0 37 | 38 | - name: Setup Miniconda 39 | uses: conda-incubator/setup-miniconda@505e6394dae86d6a5c7fbb6e3fb8938e3e863830 # v3.1.1 40 | with: 41 | auto-update-conda: true 42 | auto-activate-base: true 43 | activate-environment: "" 44 | 45 | - name: Install conda-build 46 | run: conda install conda-build 47 | 48 | - name: Download llvmdev Artifact 49 | if: ${{ inputs.llvmdev_run_id != '' }} 50 | uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 51 | with: 52 | name: llvmdev_win-64 53 | path: llvmdev_conda_packages 54 | run-id: ${{ inputs.llvmdev_run_id }} 55 | repository: ${{ github.repository }} 56 | github-token: ${{ secrets.GITHUB_TOKEN }} 57 | 58 | - name: Build llvmlite conda package 59 | run: | 60 | if [ "${{ inputs.llvmdev_run_id }}" != "" ]; then 61 | LLVMDEV_CHANNEL="file://${{ github.workspace }}/llvmdev_conda_packages" 62 | else 63 | LLVMDEV_CHANNEL="numba" 64 | fi 65 | CONDA_CHANNEL_DIR="conda_channel_dir" 66 | mkdir $CONDA_CHANNEL_DIR 67 | conda build --debug -c $LLVMDEV_CHANNEL -c defaults --python=${{ matrix.python-version }} conda-recipes/llvmlite --output-folder=$CONDA_CHANNEL_DIR --no-test 68 | 69 | - name: Upload llvmlite conda package 70 | uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 71 | with: 72 | name: llvmlite-win-64-py${{ matrix.python-version }} 73 | path: conda_channel_dir 74 | compression-level: 0 75 | retention-days: 7 76 | if-no-files-found: error 77 | 78 | - name: Show Workflow Run ID 79 | run: "echo \"Workflow Run ID: ${{ github.run_id }}\"" 80 | 81 | win-64-test: 82 | name: win-64-test 83 | needs: win-64-build 84 | runs-on: windows-2019 85 | defaults: 86 | run: 87 | shell: bash -elx {0} 88 | strategy: 89 | matrix: 90 | python-version: ["3.10", "3.11", "3.12", "3.13"] 91 | fail-fast: false 92 | 93 | steps: 94 | - name: Setup miniconda 95 | uses: conda-incubator/setup-miniconda@505e6394dae86d6a5c7fbb6e3fb8938e3e863830 # v3.1.1 96 | 97 | - name: Download llvmlite artifact 98 | uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 99 | with: 100 | name: llvmlite-win-64-py${{ matrix.python-version }} 101 | 102 | - name: Install conda-build 103 | run: | 104 | conda install conda-build 105 | 106 | - name: Run tests 107 | run: conda build --test win-64/llvmlite*.conda 108 | -------------------------------------------------------------------------------- /.github/workflows/pre-commit.yml: -------------------------------------------------------------------------------- 1 | name: lint with pre-commit 2 | 3 | on: 4 | pull_request: 5 | push: 6 | branches: 7 | - main 8 | tags: 9 | - '*' 10 | 11 | jobs: 12 | pre-commit: 13 | runs-on: ubuntu-latest 14 | defaults: 15 | run: 16 | shell: bash -el {0} 17 | steps: 18 | - name: Checkout 19 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 20 | - name: Setup Miniconda 21 | uses: conda-incubator/setup-miniconda@505e6394dae86d6a5c7fbb6e3fb8938e3e863830 # v3.1.1 22 | with: 23 | auto-update-conda: true 24 | auto-activate-base: false 25 | - name: Install pre-commit 26 | run: conda install -c conda-forge pre-commit 27 | - name: Lint code with pre-commit 28 | run: pre-commit run --verbose --all-files 29 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | *.pyd 3 | *.o 4 | *.so 5 | *.dylib 6 | *.dll 7 | build/ 8 | dist/ 9 | *.egg-info 10 | ffi/build/ 11 | htmlcov/ 12 | .coverage 13 | coverage.xml 14 | MANIFEST 15 | docs/_build/ 16 | docs/gh-pages/ 17 | .*.swp 18 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | repos: 2 | - repo: https://github.com/pre-commit/pre-commit-hooks 3 | rev: v5.0.0 4 | hooks: 5 | - id: check-added-large-files 6 | - id: fix-byte-order-marker 7 | - id: check-case-conflict 8 | - id: check-json 9 | - id: check-yaml 10 | exclude: ^.*meta\.yaml$ 11 | - repo: https://github.com/pre-commit/mirrors-clang-format 12 | rev: v20.1.4 13 | hooks: 14 | - id: clang-format 15 | types_or: [c++, c, c#, cuda, metal] 16 | - repo: https://github.com/PyCQA/flake8 17 | rev: 7.2.0 18 | hooks: 19 | - id: flake8 20 | exclude: ^docs/.*|examples/.*|ffi/.*|versioneer.py$ 21 | - repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt 22 | rev: 0.2.3 23 | hooks: 24 | - id: yamlfmt 25 | args: [--mapping, '2', --offset, '2', --sequence, '4', --implicit_start] 26 | files: .pre-commit-config.yaml$ 27 | - repo: https://github.com/python-jsonschema/check-jsonschema 28 | rev: 0.33.0 29 | hooks: 30 | - id: check-azure-pipelines 31 | - id: check-github-workflows 32 | - id: check-renovate 33 | - repo: https://github.com/rhysd/actionlint 34 | rev: v1.7.7 35 | hooks: 36 | - id: actionlint 37 | - repo: meta 38 | hooks: 39 | - id: check-hooks-apply 40 | - id: check-useless-excludes 41 | -------------------------------------------------------------------------------- /.readthedocs.yaml: -------------------------------------------------------------------------------- 1 | # .readthedocs.yaml 2 | # Read the Docs configuration file 3 | # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details 4 | 5 | version: 2 6 | 7 | build: 8 | os: ubuntu-22.04 9 | tools: 10 | python: "3.11" 11 | apt_packages: 12 | - llvm-15 13 | jobs: 14 | post_checkout: 15 | - sed -i "s/'llvm-config'/'llvm-config-15'/g" ffi/build.py 16 | 17 | sphinx: 18 | configuration: docs/source/conf.py 19 | fail_on_warning: true 20 | 21 | python: 22 | install: 23 | - requirements: docs/rtd-requirements.txt 24 | - method: pip 25 | path: . 26 | -------------------------------------------------------------------------------- /.scrutinizer.yml: -------------------------------------------------------------------------------- 1 | checks: 2 | python: 3 | code_rating: true 4 | duplicate_code: true 5 | variables_used_before_assignment: true 6 | variables_unused_variable: true 7 | variables_undefined_variable: true 8 | variables_undefined_all_variable: true 9 | variables_no_name_in_module: true 10 | variables_invalid_all_object: true 11 | variables_global_variable_undefined: true 12 | string_too_many_format_args: true 13 | string_too_few_format_args: true 14 | imports_relative_import: true 15 | imports_cyclic_import: true 16 | format_unnecessary_semicolon: true 17 | format_bad_whitespace: true 18 | basic_unreachable: true 19 | basic_empty_docstring: true 20 | basic_duplicate_key: true 21 | 22 | filter: 23 | excluded_paths: 24 | - 'llvmlite/tests/*' 25 | - 'llvmlite/six.py' 26 | - 'llvmlite/_version.py' 27 | - 'llvmlite/versioneer.py' 28 | -------------------------------------------------------------------------------- /.ycm_extra_conf.py: -------------------------------------------------------------------------------- 1 | # YouCompleteMe (https://github.com/ycm-core/YouCompleteMe) configuration file 2 | # that enables it to find the LLVM and Python includes from a conda 3 | # environment, independent of the Conda environment location and Python and 4 | # LLVM versions. 5 | 6 | import os 7 | import sys 8 | 9 | from pathlib import Path 10 | 11 | CONDA_PREFIX = os.environ['CONDA_PREFIX'] 12 | LLVMLITE_DIR = Path(__file__).parent 13 | VER = sys.version_info 14 | PYTHON_INCLUDE_NAME = f'python{VER.major}.{VER.minor}' 15 | 16 | CONDA_INCLUDE_DIR = Path(CONDA_PREFIX, 'include') 17 | PYTHON_INCLUDE_DIR = Path(CONDA_INCLUDE_DIR, PYTHON_INCLUDE_NAME) 18 | FFI_DIR = Path(LLVMLITE_DIR, 'ffi') 19 | 20 | flags = [ 21 | # Include dirs 22 | f'-I{CONDA_INCLUDE_DIR}', 23 | f'-I{PYTHON_INCLUDE_DIR}', 24 | f'-I{FFI_DIR}', 25 | # C++ standard to which LLVM 14 is developed 26 | '-std=c++14', 27 | # Force language to C++ so that core.h is treated as C++ 28 | '-x', 'c++', 29 | ] 30 | 31 | 32 | # This function is called by YCM to obtain the config from this file. 33 | def Settings(**kwargs): 34 | return {'flags': flags} 35 | 36 | 37 | # Executing this configuration file standalone outside of YCM prints the 38 | # settings to aid with debugging the configuration. 39 | if __name__ == '__main__': 40 | print(Settings()) 41 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014-, Continuum Analytics, Inc. 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are 6 | met: 7 | 8 | Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | 11 | Redistributions in binary form must reproduce the above copyright 12 | notice, this list of conditions and the following disclaimer in the 13 | documentation and/or other materials provided with the distribution. 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 15 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 16 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 17 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 18 | HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 19 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 20 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 24 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include *.rst setup.py runtests.py run_coverage.py LICENSE 2 | include versioneer.py 3 | include llvmlite/_version.py 4 | recursive-include examples *.py *.ll 5 | recursive-include ffi *.txt *.h *.cpp Makefile.* *.py 6 | global-exclude CMakeCache.txt 7 | -------------------------------------------------------------------------------- /azure-pipelines.yml: -------------------------------------------------------------------------------- 1 | jobs: 2 | # Mac and Linux use the same template with different matrixes 3 | - template: buildscripts/azure/azure-linux-macos.yml 4 | parameters: 5 | name: macOS 6 | vmImage: macos-13 7 | variables: 8 | MACOSX_DEPLOYMENT_TARGET: '11.0' 9 | matrix: 10 | py310: 11 | PYTHON: '3.10' 12 | CONDA_ENV: cienv 13 | py311: 14 | PYTHON: '3.11' 15 | CONDA_ENV: cienv 16 | py312: 17 | PYTHON: '3.12' 18 | CONDA_ENV: cienv 19 | py313: 20 | PYTHON: '3.13' 21 | CONDA_ENV: cienv 22 | 23 | llvm16: 24 | PYTHON: '3.12' 25 | CONDA_ENV: cienv 26 | LLVM: '16' 27 | 28 | opaque_pointers: 29 | PYTHON: '3.12' 30 | CONDA_ENV: cienv 31 | OPAQUE_POINTERS: yes 32 | 33 | - template: buildscripts/azure/azure-linux-macos.yml 34 | parameters: 35 | name: Linux 36 | vmImage: ubuntu-24.04 37 | matrix: 38 | py310: 39 | PYTHON: '3.10' 40 | CONDA_ENV: cienv 41 | RUN_FLAKE8: yes 42 | DIST_TEST: yes 43 | py311: 44 | PYTHON: '3.11' 45 | CONDA_ENV: cienv 46 | RUN_FLAKE8: yes 47 | DIST_TEST: yes 48 | py312: 49 | PYTHON: '3.12' 50 | CONDA_ENV: cienv 51 | RUN_FLAKE8: yes 52 | DIST_TEST: yes 53 | py313: 54 | PYTHON: '3.13' 55 | CONDA_ENV: cienv 56 | RUN_FLAKE8: yes 57 | DIST_TEST: yes 58 | # temporarily disabled 59 | # pypy: 60 | # PYTHON: pypy 61 | # CONDA_ENV: cienv 62 | py310_wheel: 63 | PYTHON: '3.10' 64 | CONDA_ENV: cienv 65 | WHEEL: 'yes' 66 | py311_wheel: 67 | PYTHON: '3.11' 68 | CONDA_ENV: cienv 69 | WHEEL: 'yes' 70 | py312_wheel: 71 | PYTHON: '3.12' 72 | CONDA_ENV: cienv 73 | WHEEL: 'yes' 74 | py313_wheel: 75 | PYTHON: '3.13' 76 | CONDA_ENV: cienv 77 | WHEEL: 'yes' 78 | 79 | llvm16: 80 | PYTHON: '3.12' 81 | CONDA_ENV: cienv 82 | LLVM: '16' 83 | 84 | opaque_pointers: 85 | PYTHON: '3.12' 86 | CONDA_ENV: cienv 87 | OPAQUE_POINTERS: yes 88 | 89 | - template: buildscripts/azure/azure-windows.yml 90 | parameters: 91 | name: Windows 92 | vmImage: windows-2019 93 | 94 | - job: check_formatting 95 | pool: 96 | vmImage: 'ubuntu-latest' 97 | steps: 98 | - script: | 99 | set -ex 100 | buildscripts/incremental/install_miniconda.sh 101 | export PATH=$HOME/miniconda3/bin:$PATH 102 | conda install -c conda-forge -y clang-format-20 103 | clang-format-20 -n -Werror ffi/*.cpp ffi/*.h 104 | displayName: Check C++ formatting 105 | -------------------------------------------------------------------------------- /buildscripts/azure/azure-linux-macos.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | name: '' 3 | vmImage: '' 4 | matrix: [] 5 | 6 | 7 | jobs: 8 | - job: ${{ parameters.name }} 9 | pool: 10 | vmImage: ${{ parameters.vmImage }} 11 | strategy: 12 | maxParallel: 11 13 | matrix: 14 | ${{ insert }}: ${{ parameters.matrix }} 15 | 16 | steps: 17 | - bash: | 18 | sudo xcode-select -s /Applications/Xcode_14.2.app/Contents/Developer 19 | condition: eq('${{ parameters.name }}', 'macOS') 20 | displayName: 'Set macOS build environment (Xcode 14.2)' 21 | 22 | - script: | 23 | set -e 24 | if [ "$(uname)" == "Linux" ] && [[ "$CONDA_SUBDIR" == "linux-32" || "$BITS32" == "yes" ]]; then sudo apt-get install -y libc6-dev-i386; fi 25 | echo "Installing Miniconda" 26 | buildscripts/incremental/install_miniconda.sh 27 | export PATH=$HOME/miniconda3/bin:$PATH 28 | echo "Setting up Conda environment" 29 | buildscripts/incremental/setup_conda_environment.sh 30 | displayName: 'Before Install' 31 | 32 | - script: | 33 | set -e 34 | export PATH=$HOME/miniconda3/bin:$PATH 35 | buildscripts/incremental/build.sh 36 | displayName: 'Build' 37 | 38 | - script: | 39 | set -e 40 | export PATH=$HOME/miniconda3/bin:$PATH 41 | conda install -y flake8 42 | echo "Running flake8 check" 43 | flake8 llvmlite 44 | displayName: 'Flake8' 45 | condition: eq(variables['RUN_FLAKE8'], 'yes') 46 | 47 | - script: | 48 | set -e 49 | export PATH=$HOME/miniconda3/bin:$PATH 50 | buildscripts/incremental/test.sh 51 | displayName: 'Test' 52 | -------------------------------------------------------------------------------- /buildscripts/azure/azure-windows.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | name: '' 3 | vmImage: '' 4 | 5 | jobs: 6 | - job: ${{ parameters.name }} 7 | pool: 8 | vmImage: ${{ parameters.vmImage }} 9 | strategy: 10 | maxParallel: 11 11 | matrix: 12 | py310: 13 | PYTHON: '3.10' 14 | CONDA_ENV: cienv 15 | py311: 16 | PYTHON: '3.11' 17 | CONDA_ENV: cienv 18 | py312: 19 | PYTHON: '3.12' 20 | CONDA_ENV: cienv 21 | py313: 22 | PYTHON: '3.13' 23 | CONDA_ENV: cienv 24 | 25 | llvm16: 26 | PYTHON: '3.12' 27 | CONDA_ENV: cienv 28 | LLVM: '16' 29 | 30 | opaque_pointers: 31 | PYTHON: '3.12' 32 | CONDA_ENV: cienv 33 | OPAQUE_POINTERS: yes 34 | 35 | steps: 36 | 37 | - powershell: | 38 | $wc = New-Object net.webclient 39 | $wc.Downloadfile("https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe", "Miniconda3-latest-Windows-x86_64.exe") 40 | Start-Process "Miniconda3-latest-Windows-x86_64.exe" "/S /D=C:\Miniconda3" -Wait 41 | displayName: 'Install miniconda' 42 | 43 | - script: | 44 | call C:\Miniconda3\Scripts\activate.bat 45 | call buildscripts\\incremental\\setup_conda_environment.cmd 46 | displayName: 'Before Install' 47 | 48 | - script: | 49 | call C:\Miniconda3\Scripts\activate.bat 50 | call buildscripts\\incremental\\build.cmd 51 | displayName: 'Build' 52 | 53 | - script: | 54 | call C:\Miniconda3\Scripts\activate.bat 55 | call buildscripts\\incremental\\test.cmd 56 | displayName: 'Test' 57 | -------------------------------------------------------------------------------- /buildscripts/github/MacOSX10.10.sdk.checksum: -------------------------------------------------------------------------------- 1 | 3839b875df1f2bc98893b8502da456cc0b022c4666bc6b7eb5764a5f915a9b00 MacOSX10.10.sdk.tar.xz 2 | -------------------------------------------------------------------------------- /buildscripts/github/llvmdev_evaluate.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import json 4 | import os 5 | from pathlib import Path 6 | 7 | 8 | event = os.environ.get("GITHUB_EVENT_NAME") 9 | label = os.environ.get("GITHUB_LABEL_NAME") 10 | inputs = os.environ.get("GITHUB_WORKFLOW_INPUT", "{}") 11 | 12 | runner_mapping = { 13 | "linux-64": "ubuntu-24.04", 14 | "linux-aarch64": "ubuntu-24.04-arm", 15 | "osx-64": "macos-13", 16 | "osx-arm64": "macos-14", 17 | "win-64": "windows-2019", 18 | } 19 | 20 | default_include = [ 21 | { 22 | "runner": runner_mapping["linux-64"], 23 | "platform": "linux-64", 24 | "recipe": "llvmdev", 25 | }, 26 | { 27 | "runner": runner_mapping["win-64"], 28 | "platform": "win-64", 29 | "recipe": "llvmdev", 30 | }, 31 | { 32 | "runner": runner_mapping["win-64"], 33 | "platform": "win-64", 34 | "recipe": "llvmdev_for_wheel", 35 | }, 36 | { 37 | "runner": runner_mapping["osx-64"], 38 | "platform": "osx-64", 39 | "recipe": "llvmdev", 40 | }, 41 | { 42 | "runner": runner_mapping["osx-64"], 43 | "platform": "osx-64", 44 | "recipe": "llvmdev_for_wheel", 45 | }, 46 | ] 47 | 48 | print( 49 | "Deciding what to do based on event: " 50 | f"'{event}', label: '{label}', inputs: '{inputs}'" 51 | ) 52 | if event == "pull_request": 53 | print("pull_request detected") 54 | include = default_include 55 | elif event == "label" and label == "build_on_gha": 56 | print("build label detected") 57 | include = default_include 58 | elif event == "workflow_dispatch": 59 | print("workflow_dispatch detected") 60 | params = json.loads(inputs) 61 | include = [ 62 | { 63 | "runner": runner_mapping[params.get("platform", "linux-64")], 64 | "platform": params.get("platform", "linux-64"), 65 | "recipe": params.get("recipe", "llvmdev"), 66 | } 67 | ] 68 | else: 69 | include = {} 70 | 71 | matrix = {"include": include} 72 | print(f"Emitting matrix:\n {json.dumps(matrix, indent=4)}") 73 | 74 | Path(os.environ["GITHUB_OUTPUT"]).write_text(f"matrix={json.dumps(matrix)}") 75 | -------------------------------------------------------------------------------- /buildscripts/github/patch_osx-64_wheel.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -ex 4 | 5 | WHL_FILE="$1" 6 | 7 | echo "Processing wheel: $WHL_FILE" 8 | 9 | # Unpack the wheel 10 | wheel unpack "$WHL_FILE" 11 | 12 | # Get into the unpacked directory 13 | target_dir=$(echo "$WHL_FILE" | cut -d "-" -f1 -f2) 14 | cd "$target_dir" 15 | 16 | # Find the dylib 17 | target=$(find . -iname "libllvmlite.dylib") 18 | echo "Found dylib at: $target" 19 | 20 | echo "=== BEFORE ===" 21 | otool -L "$target" 22 | 23 | # Fix all @rpath libraries 24 | install_name_tool -change "@rpath/libz.1.dylib" "/usr/lib/libz.1.dylib" "$target" 25 | install_name_tool -change "@rpath/libc++.1.dylib" "/usr/lib/libc++.1.dylib" "$target" 26 | 27 | echo "=== AFTER ===" 28 | otool -L "$target" 29 | 30 | echo "=== $target_dir contents ===" 31 | find . -ls 32 | echo "=== Write back to wheel ===" 33 | cd .. 34 | wheel pack "$target_dir" 35 | 36 | # Remove the directory we unpacked into 37 | rm -rf "$target_dir" 38 | 39 | echo "=== Final wheel filename ===" 40 | ls -la ./*.whl 41 | -------------------------------------------------------------------------------- /buildscripts/github/setup_platform.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -ex 4 | 5 | PLATFORM=$1 6 | 7 | echo "Setting up platform-specific requirements for ${PLATFORM}" 8 | 9 | case "${PLATFORM}" in 10 | "osx-64") 11 | echo "Setting up macOS SDK for osx-64 build" 12 | sdk_dir="buildscripts/github" 13 | mkdir -p "${sdk_dir}" 14 | 15 | # Download SDK 16 | echo "Downloading MacOSX10.10.sdk.tar.xz" 17 | wget -q https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX10.10.sdk.tar.xz 18 | 19 | # Verify checksum 20 | echo "Verifying SDK checksum" 21 | shasum -c "${sdk_dir}/MacOSX10.10.sdk.checksum" || exit 1 22 | 23 | # Extract SDK to /opt 24 | echo "Extracting SDK to /opt" 25 | sudo mkdir -p /opt 26 | sudo tar -xf MacOSX10.10.sdk.tar.xz -C /opt 27 | echo "macOS SDK setup complete" 28 | ;; 29 | *) 30 | echo "No specific setup required for platform: ${PLATFORM}" 31 | ;; 32 | esac 33 | 34 | echo "Platform setup complete for ${PLATFORM}" -------------------------------------------------------------------------------- /buildscripts/github/validate_osx-64_wheel.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -ex 4 | 5 | # This script assumes it is run from the directory containing the wheels. 6 | 7 | shopt -s nullglob # Prevent loop from running if no *.whl files 8 | 9 | for WHL_FILE in *.whl; do 10 | echo "=== Validating $WHL_FILE ===" 11 | 12 | # Check wheel structure 13 | twine check "$WHL_FILE" 14 | 15 | # Check dylib paths 16 | wheel unpack "$WHL_FILE" 17 | WHEEL_DIR=$(echo "$WHL_FILE" | cut -d "-" -f1 -f2) 18 | DYLIB=$(find "$WHEEL_DIR" -iname "libllvmlite.dylib") 19 | 20 | if [ -z "$DYLIB" ]; then 21 | echo "Error: libllvmlite.dylib not found in $WHL_FILE" 22 | exit 1 23 | fi 24 | 25 | echo "=== Checking dynamic library dependencies for $WHL_FILE ===" 26 | otool -L "$DYLIB" 27 | 28 | # Verify library paths 29 | LIBS=("libz.1.dylib" "libc++.1.dylib") 30 | for LIB in "${LIBS[@]}"; do 31 | if ! otool -L "$DYLIB" | grep -q "/usr/lib/$LIB"; then 32 | echo "Error: $LIB path is incorrect in $WHL_FILE" 33 | # Clean up unpacked directory before exiting 34 | rm -rf "$WHEEL_DIR" 35 | exit 1 36 | fi 37 | done 38 | 39 | # Clean up unpacked directory 40 | echo "=== Cleaning up $WHEEL_DIR ===" 41 | rm -rf "$WHEEL_DIR" 42 | 43 | done 44 | 45 | echo "=== Validation successful ===" 46 | -------------------------------------------------------------------------------- /buildscripts/github/validate_win-64_wheel.py: -------------------------------------------------------------------------------- 1 | import lief 2 | import pathlib 3 | 4 | for path in pathlib.Path(".").rglob("**/*.dll"): 5 | print("path", path) 6 | dll = lief.PE.parse(str(path)) 7 | 8 | if hasattr(dll, "delay_imports"): 9 | delay_imports = {x.name for x in dll.delay_imports} 10 | print("Delay imports:", delay_imports) 11 | expected_delay_imports = {"SHELL32.dll", "ole32.dll"} 12 | assert ( 13 | delay_imports == expected_delay_imports 14 | ), f"Unexpected delay imports: {delay_imports}" 15 | 16 | imports = {x.name for x in dll.imports} 17 | print("Regular imports:", imports) 18 | expected_imports = { 19 | "ADVAPI32.dll", 20 | "KERNEL32.dll", 21 | "MSVCP140.dll", 22 | "VCRUNTIME140.dll", 23 | "VCRUNTIME140_1.dll", 24 | "api-ms-win-crt-convert-l1-1-0.dll", 25 | "api-ms-win-crt-environment-l1-1-0.dll", 26 | "api-ms-win-crt-heap-l1-1-0.dll", 27 | "api-ms-win-crt-locale-l1-1-0.dll", 28 | "api-ms-win-crt-math-l1-1-0.dll", 29 | "api-ms-win-crt-runtime-l1-1-0.dll", 30 | "api-ms-win-crt-stdio-l1-1-0.dll", 31 | "api-ms-win-crt-string-l1-1-0.dll", 32 | "api-ms-win-crt-time-l1-1-0.dll", 33 | "api-ms-win-crt-utility-l1-1-0.dll", 34 | } 35 | assert imports == expected_imports, ( 36 | f"Unexpected imports: {imports - expected_imports}\n" 37 | f"Missing imports: {expected_imports - imports}" 38 | ) 39 | -------------------------------------------------------------------------------- /buildscripts/incremental/after_success.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source activate $CONDA_ENV 4 | 5 | # Make sure any error below is reported as such 6 | set -v -e 7 | 8 | if [ "$RUN_COVERAGE" == "yes" ]; then codecov; coveralls; fi 9 | -------------------------------------------------------------------------------- /buildscripts/incremental/build.cmd: -------------------------------------------------------------------------------- 1 | 2 | call activate %CONDA_ENV% 3 | 4 | @rem LLVM derives the location of diaguids.lib from the build-time environment. 5 | @rem Conda-forge packaging works around this by substituting the build-time 6 | @rem location of Visual Studio with $ENV{VSINSTALLDIR}. In order to ensure that 7 | @rem this environment variable is set appropriately, we activate the Visual 8 | @rem Studio Developer Command Prompt prior to running setup.py 9 | @rem 10 | @rem This workaround is required whilst using LLVM from conda-forge; it may also 11 | @rem be necessary to consider a workaround for our own llvmdev packages. 12 | @rem 13 | @rem For more info, see: 14 | @rem 15 | @rem - https://github.com/conda-forge/llvmdev-feedstock/issues/175 16 | @rem - https://github.com/conda-forge/llvmdev-feedstock/pull/223 17 | @rem - https://github.com/MicrosoftDocs/visualstudio-docs/issues/7774 18 | if "%LLVM%"=="16" ( 19 | call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" 20 | if %errorlevel% neq 0 exit /b %errorlevel% 21 | ) 22 | 23 | python setup.py build 24 | -------------------------------------------------------------------------------- /buildscripts/incremental/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | source activate $CONDA_ENV 6 | 7 | # need to build with Anaconda compilers on osx, but they conflict with llvmdev... bootstap 8 | if [[ $(uname) == Darwin ]]; then 9 | # export LLVM_CONFIG explicitly as the one installed from llvmdev 10 | # in the build root env, the one in the bootstrap location needs to be ignored. 11 | export LLVM_CONFIG=$(ls $(which llvm-config)) 12 | 13 | # Set conda subdir and bootstrap with x86_64 compiler 14 | CONDA_SUBDIR=osx-64 15 | conda create -y -p ${PWD}/bootstrap clangxx_osx-64 16 | 17 | SRC_DIR=${PWD} 18 | export PATH=${SRC_DIR}/bootstrap/bin:${PATH} 19 | CONDA_PREFIX=${SRC_DIR}/bootstrap \ 20 | . ${SRC_DIR}/bootstrap/etc/conda/activate.d/* 21 | 22 | # Use explicit SDK path if set, otherwise detect 23 | if [ -z "$SDKROOT" ]; then 24 | SDKPATH=$(xcrun --show-sdk-path) 25 | else 26 | SDKPATH=$SDKROOT 27 | fi 28 | export CONDA_BUILD_SYSROOT=${CONDA_BUILD_SYSROOT:-${SDKPATH}} 29 | 30 | # Set minimum deployment target if not already set 31 | if [ -z "$MACOSX_DEPLOYMENT_TARGET" ]; then 32 | export MACOSX_DEPLOYMENT_TARGET=11.0 33 | fi 34 | 35 | export CXXFLAGS=${CFLAGS}" -mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET}" 36 | export CFLAGS=${CFLAGS}" -mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET}" 37 | SYSROOT_DIR=${CONDA_BUILD_SYSROOT} 38 | CFLAG_SYSROOT="--sysroot ${SYSROOT_DIR}" 39 | ${LLVM_CONFIG} --version 40 | export SDKROOT=${SDKPATH} 41 | 42 | DARWIN_TARGET=x86_64-apple-darwin13.4.0 43 | fi 44 | 45 | if [ -n "$MACOSX_DEPLOYMENT_TARGET" ]; then 46 | export MACOSX_DEPLOYMENT_TARGET 47 | fi 48 | 49 | # Make sure any error below is reported as such 50 | set -v -e 51 | 52 | if [ "$WHEEL" == "yes" ]; then 53 | conda install wheel 54 | python setup.py bdist_wheel 55 | pip install dist/*.whl 56 | else 57 | python setup.py build 58 | fi 59 | -------------------------------------------------------------------------------- /buildscripts/incremental/install_miniconda.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Install Miniconda 4 | unamestr=`uname` 5 | if [[ "$unamestr" == 'Linux' ]]; then 6 | wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh 7 | elif [[ "$unamestr" == 'Darwin' ]]; then 8 | wget https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh 9 | else 10 | echo Error 11 | fi 12 | chmod +x miniconda.sh 13 | bash ./miniconda.sh -b 14 | -------------------------------------------------------------------------------- /buildscripts/incremental/setup_conda_environment.cmd: -------------------------------------------------------------------------------- 1 | @echo on 2 | 3 | @rem Display root environment (for debugging) 4 | call conda list 5 | 6 | @rem Create and populate environment 7 | call conda create -n %CONDA_ENV% -q -y python=%PYTHON% cmake 8 | if %errorlevel% neq 0 exit /b %errorlevel% 9 | 10 | call activate %CONDA_ENV% 11 | if %errorlevel% neq 0 exit /b %errorlevel% 12 | 13 | @rem Install llvmdev 14 | if "%LLVM%"=="16" ( 15 | set LLVMDEV_CHANNEL="conda-forge" 16 | ) else ( 17 | set LLVMDEV_CHANNEL="numba" 18 | ) 19 | 20 | call conda install -y -q -c %LLVMDEV_CHANNEL% llvmdev="%LLVM%" libxml2 21 | if %errorlevel% neq 0 exit /b %errorlevel% 22 | -------------------------------------------------------------------------------- /buildscripts/incremental/setup_conda_environment.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | CONDA_INSTALL="conda install -q -y" 6 | PIP_INSTALL="pip install -q" 7 | 8 | # Deactivate any environment 9 | set +v 10 | source deactivate 11 | set -v 12 | # Display root environment (for debugging) 13 | conda list 14 | 15 | if [ "$PYTHON" == "pypy" ]; then 16 | conda create -c gmarkall -n $CONDA_ENV -q -y pypy 17 | else 18 | conda create -n $CONDA_ENV -q -y python=$PYTHON 19 | fi 20 | 21 | set +v 22 | source activate $CONDA_ENV 23 | set -v 24 | 25 | # Install llvmdev (separate channel, for now) 26 | if [ "$LLVM" == "16" ]; then 27 | $CONDA_INSTALL -c conda-forge llvmdev="16" 28 | else 29 | $CONDA_INSTALL -c numba llvmdev="15.*" 30 | fi 31 | 32 | # Install the compiler toolchain, for osx, bootstrapping needed 33 | # which happens in build.sh 34 | if [[ $(uname) == Linux ]]; then 35 | $CONDA_INSTALL gcc_linux-64 gxx_linux-64 36 | fi 37 | 38 | # Install dependencies for code coverage (codecov.io) 39 | if [ "$RUN_COVERAGE" == "yes" ]; then $PIP_INSTALL codecov coveralls; fi 40 | -------------------------------------------------------------------------------- /buildscripts/incremental/test.cmd: -------------------------------------------------------------------------------- 1 | 2 | call activate %CONDA_ENV% 3 | 4 | if "%OPAQUE_POINTERS%"=="yes" ( 5 | set LLVMLITE_ENABLE_IR_LAYER_TYPED_POINTERS=0 6 | echo "Testing with IR layer opaque pointers enabled" 7 | ) else ( 8 | echo "Testing with IR layer opaque pointers disabled" 9 | ) 10 | 11 | python runtests.py -v 12 | -------------------------------------------------------------------------------- /buildscripts/incremental/test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source activate $CONDA_ENV 4 | 5 | # Make sure any error below is reported as such 6 | set -v -e 7 | 8 | # Run test suite 9 | 10 | python --version 11 | 12 | if [ "$OPAQUE_POINTERS" == "yes" ]; then 13 | export LLVMLITE_ENABLE_IR_LAYER_TYPED_POINTERS=0 14 | echo "Testing with IR layer opaque pointers enabled" 15 | else 16 | echo "Testing with IR layer opaque pointers disabled" 17 | fi 18 | 19 | if [ "$WHEEL" == "yes" ]; then 20 | cd dist 21 | python -m llvmlite.tests -v 22 | elif [ "$DIST_TEST" == "yes" ]; then 23 | LLVMLITE_DIST_TEST=1 python runtests.py -v 24 | else 25 | python runtests.py -v 26 | fi 27 | 28 | if [ "$RUN_COVERAGE" == "yes" ]; then coverage run runtests.py; fi 29 | -------------------------------------------------------------------------------- /buildscripts/manylinux/README.md: -------------------------------------------------------------------------------- 1 | # README: Building manylinux Wheels 2 | 3 | 4 | ## Build llvmdev conda packages for use during manylinux wheel building 5 | 6 | Run the script below to start docker off building `llvmdev` base from the current state of the source tree: 7 | 8 | - x86_64 linux: `./buildscripts/manylinux/docker_run_x64.sh build_llvmdev.sh` 9 | - uses manylinux2014 image for glibc 2.17+: `pypa.io/pypa/manylinux2014_x86_64` 10 | - aarch64 linux: `./buildscripts/manylinux/docker_run_aarch64.sh build_llvmdev.sh` 11 | - uses manylinux_2_28 image for glibc 2.28+: `pypa.io/pypa/manylinux_2_28_aarch64` 12 | 13 | The conda packages will be stored into `/docker_output` 14 | 15 | Note: the `docker_output` location can be used as a local conda channel. 16 | 17 | Finally, upload the conda package to the numba channel under the "manylinux_x_y" 18 | label (`x` and `y` are glibc major and minor version numbers, respectively): 19 | 20 | `anaconda upload -u numba -l manylinux_x_y ` 21 | 22 | 23 | ## Build llvmlite wheel for manylinux 24 | 25 | Run the script below to start docker off building `llvmlite` base from the current state of the source tree: 26 | 27 | - x86_64 linux: `./buildscripts/manylinux/docker_run_x64.sh build_llvmlite.sh ` 28 | - aarch64 linux: `./buildscripts/manylinux/docker_run_aarch64.sh build_llvmlite.sh ` 29 | 30 | The conda packages will be stored into `/docker_output/dist__` 31 | 32 | Available Python installations (``) are: 33 | 34 | - cp310-cp310 35 | - cp311-cp311 36 | - cp312-cp312 37 | - cp313-cp313 38 | 39 | 40 | Reference: https://github.com/pypa/manylinux 41 | -------------------------------------------------------------------------------- /buildscripts/manylinux/build_llvmdev.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # $1 is the miniconda download link 3 | if [ -z "$1" ]; then 4 | echo "Error: Miniconda download link argument is required" 5 | exit 1 6 | fi 7 | set -xe 8 | cd $(dirname $0) 9 | source ./prepare_miniconda.sh $1 10 | conda create -n buildenv -y conda conda-build 11 | conda activate buildenv 12 | conda list 13 | conda-build /root/llvmlite/conda-recipes/llvmdev_for_wheel --output-folder=/root/llvmlite/docker_output 14 | -------------------------------------------------------------------------------- /buildscripts/manylinux/build_llvmlite.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ex 3 | 4 | cd $(dirname $0) 5 | source ./prepare_miniconda.sh $1 6 | 7 | 8 | # Move to source root 9 | cd ../.. 10 | sourceroot=$(pwd) 11 | 12 | # Make conda environmant for llvmdev 13 | pyver=$2 14 | envname="llvmbase" 15 | outputdir="/root/llvmlite/docker_output" 16 | 17 | ls -l /opt/python/$pyver/bin 18 | 19 | conda create -y -n $envname 20 | conda activate $envname 21 | # Install llvmdev 22 | 23 | if [[ $(uname -m) == "aarch64" ]] ; then 24 | conda install -y numba/label/manylinux_2_28::llvmdev --no-deps 25 | elif [[ $(uname -m) == "x86_64" ]] ; then 26 | conda install -y numba/label/manylinux_2_17::llvmdev --no-deps 27 | else 28 | echo "Error: Unsupported architecture: $(uname -m)" 29 | exit 1 30 | fi 31 | 32 | # Prepend builtin Python Path 33 | export PATH=/opt/python/$pyver/bin:$PATH 34 | 35 | echo "Using python: $(which python)" 36 | 37 | # Python 3.12+ won't have setuptools pre-installed 38 | pip install setuptools 39 | 40 | # Clean up 41 | python setup.py clean 42 | 43 | # Build wheel 44 | distdir=$outputdir/dist_$(uname -m)_$pyver 45 | rm -rf $distdir 46 | python setup.py bdist_wheel -d $distdir 47 | 48 | # Audit wheel 49 | cd $distdir 50 | auditwheel --verbose repair *.whl 51 | 52 | cd wheelhouse 53 | ls 54 | -------------------------------------------------------------------------------- /buildscripts/manylinux/docker_run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # $1 is the filename of the script to run inside docker. 3 | # The file must exist in buildscripts/manylinux/. 4 | # $2 is the python version name in /opt/python of the manylinux docker image. 5 | # Only used for build_llvmlite.sh. 6 | # Check if required parameters are provided 7 | if [ -z "$1" ] ; then 8 | echo "Error: Missing required parameters" 9 | echo "Usage: $0 []" 10 | exit 1 11 | fi 12 | set -xe 13 | # Use this to make the llvmdev packages that are manylinux compatible 14 | SRCDIR=$( cd "$(dirname $0)/../.." && pwd ) 15 | echo "SRCDIR=$SRCDIR" 16 | 17 | echo "MINICONDA_FILE=$MINICONDA_FILE" 18 | # Ensure the latest docker image 19 | IMAGE_URI="quay.io/pypa/${MANYLINUX_IMAGE}:latest" 20 | docker pull $IMAGE_URI 21 | docker run --rm -it -v $SRCDIR:/root/llvmlite $IMAGE_URI ${PRECMD} /root/llvmlite/buildscripts/manylinux/$1 ${MINICONDA_FILE} $2 22 | -------------------------------------------------------------------------------- /buildscripts/manylinux/docker_run_aarch64.sh: -------------------------------------------------------------------------------- 1 | export MANYLINUX_IMAGE="manylinux_2_28_aarch64" 2 | export MINICONDA_FILE="https://repo.anaconda.com/miniconda/Miniconda3-py311_24.9.2-0-Linux-aarch64.sh" 3 | cd $(dirname $0) 4 | ./docker_run.sh $1 $2 5 | -------------------------------------------------------------------------------- /buildscripts/manylinux/docker_run_x64.sh: -------------------------------------------------------------------------------- 1 | export MANYLINUX_IMAGE="manylinux2014_x86_64" 2 | export MINICONDA_FILE="https://repo.anaconda.com/miniconda/Miniconda3-py311_24.9.2-0-Linux-x86_64.sh" 3 | cd $(dirname $0) 4 | ./docker_run.sh $1 $2 5 | -------------------------------------------------------------------------------- /buildscripts/manylinux/prepare_miniconda.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | cd /root 4 | curl -L -o mini3.sh $1 5 | bash mini3.sh -b -f -p /root/miniconda3 6 | echo "Miniconda installed" 7 | source /root/miniconda3/bin/activate base 8 | echo "Env activated" 9 | cd - 10 | -------------------------------------------------------------------------------- /codecov.yml: -------------------------------------------------------------------------------- 1 | # Configuration for codecov.io 2 | # When editing this file, please validate its contents using: 3 | # curl -X POST --data-binary @- https://codecov.io/validate < codecov.yml 4 | 5 | comment: 6 | layout: "header, diff, changes, uncovered" 7 | 8 | coverage: 9 | ignore: 10 | - "numba/cuda/.*" 11 | - "numba/hsa/.*" 12 | 13 | status: 14 | # This check can mark a build failed if too much new code 15 | # is not covered (which happens often with JITted functions). 16 | patch: false 17 | project: 18 | default: 19 | # The build fails if total project coverage drops by more than 3% 20 | target: auto 21 | threshold: "3%" 22 | -------------------------------------------------------------------------------- /conda-recipes/appveyor/run_with_env.cmd: -------------------------------------------------------------------------------- 1 | :: From https://github.com/ogrisel/python-appveyor-demo 2 | :: 3 | :: To build extensions for 64 bit Python 3, we need to configure environment 4 | :: variables to use the MSVC 2010 C++ compilers from GRMSDKX_EN_DVD.iso of: 5 | :: MS Windows SDK for Windows 7 and .NET Framework 4 (SDK v7.1) 6 | :: 7 | :: To build extensions for 64 bit Python 2, we need to configure environment 8 | :: variables to use the MSVC 2008 C++ compilers from GRMSDKX_EN_DVD.iso of: 9 | :: MS Windows SDK for Windows 7 and .NET Framework 3.5 (SDK v7.0) 10 | :: 11 | :: 32 bit builds, and 64-bit builds for 3.5 and beyond, do not require specific 12 | :: environment configurations. 13 | :: 14 | :: Note: this script needs to be run with the /E:ON and /V:ON flags for the 15 | :: cmd interpreter, at least for (SDK v7.0) 16 | :: 17 | :: More details at: 18 | :: https://github.com/cython/cython/wiki/64BitCythonExtensionsOnWindows 19 | :: http://stackoverflow.com/a/13751649/163740 20 | :: 21 | :: Author: Olivier Grisel 22 | :: License: CC0 1.0 Universal: http://creativecommons.org/publicdomain/zero/1.0/ 23 | :: 24 | :: Notes about batch files for Python people: 25 | :: 26 | :: Quotes in values are literally part of the values: 27 | :: SET FOO="bar" 28 | :: FOO is now five characters long: " b a r " 29 | :: If you don't want quotes, don't include them on the right-hand side. 30 | :: 31 | :: The CALL lines at the end of this file look redundant, but if you move them 32 | :: outside of the IF clauses, they do not run properly in the SET_SDK_64==Y 33 | :: case, I don't know why. 34 | @ECHO OFF 35 | 36 | SET COMMAND_TO_RUN=%* 37 | SET WIN_SDK_ROOT=C:\Program Files\Microsoft SDKs\Windows 38 | SET WIN_WDK=c:\Program Files (x86)\Windows Kits\10\Include\wdf 39 | 40 | :: Extract the major and minor versions, and allow for the minor version to be 41 | :: more than 9. This requires the version number to have two dots in it. 42 | SET MAJOR_PYTHON_VERSION=%PYTHON_VERSION:~0,1% 43 | IF "%PYTHON_VERSION:~3,1%" == "." ( 44 | SET MINOR_PYTHON_VERSION=%PYTHON_VERSION:~2,1% 45 | ) ELSE ( 46 | SET MINOR_PYTHON_VERSION=%PYTHON_VERSION:~2,2% 47 | ) 48 | 49 | :: Based on the Python version, determine what SDK version to use, and whether 50 | :: to set the SDK for 64-bit. 51 | IF %MAJOR_PYTHON_VERSION% == 2 ( 52 | SET WINDOWS_SDK_VERSION="v7.0" 53 | SET SET_SDK_64=Y 54 | ) ELSE ( 55 | IF %MAJOR_PYTHON_VERSION% == 3 ( 56 | SET WINDOWS_SDK_VERSION="v7.1" 57 | IF %MINOR_PYTHON_VERSION% LEQ 4 ( 58 | SET SET_SDK_64=Y 59 | ) ELSE ( 60 | SET SET_SDK_64=N 61 | IF EXIST "%WIN_WDK%" ( 62 | :: See: https://connect.microsoft.com/VisualStudio/feedback/details/1610302/ 63 | REN "%WIN_WDK%" 0wdf 64 | ) 65 | ) 66 | ) ELSE ( 67 | ECHO Unsupported Python version: "%MAJOR_PYTHON_VERSION%" 68 | EXIT 1 69 | ) 70 | ) 71 | 72 | IF %PYTHON_ARCH% == 64 ( 73 | IF %SET_SDK_64% == Y ( 74 | ECHO Configuring Windows SDK %WINDOWS_SDK_VERSION% for Python %MAJOR_PYTHON_VERSION% on a 64 bit architecture 75 | SET DISTUTILS_USE_SDK=1 76 | SET MSSdk=1 77 | "%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Setup\WindowsSdkVer.exe" -q -version:%WINDOWS_SDK_VERSION% 78 | "%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Bin\SetEnv.cmd" /x64 /release 79 | ECHO Executing: %COMMAND_TO_RUN% 80 | call %COMMAND_TO_RUN% || EXIT 1 81 | ) ELSE ( 82 | ECHO Using default MSVC build environment for 64 bit architecture 83 | ECHO Executing: %COMMAND_TO_RUN% 84 | call %COMMAND_TO_RUN% || EXIT 1 85 | ) 86 | ) ELSE ( 87 | ECHO Using default MSVC build environment for 32 bit architecture 88 | ECHO Executing: %COMMAND_TO_RUN% 89 | call %COMMAND_TO_RUN% || EXIT 1 90 | ) 91 | -------------------------------------------------------------------------------- /conda-recipes/compiler-rt-cfi-startproc-war.patch: -------------------------------------------------------------------------------- 1 | diff --git a/compiler-rt/lib/builtins/assembly.h b/compiler-rt/lib/builtins/assembly.h 2 | index 69a3d8620f92..094285d12ec2 100644 3 | --- a/compiler-rt/lib/builtins/assembly.h 4 | +++ b/compiler-rt/lib/builtins/assembly.h 5 | @@ -260,9 +260,10 @@ 6 | .globl name SEPARATOR \ 7 | SYMBOL_IS_FUNC(name) SEPARATOR \ 8 | DECLARE_SYMBOL_VISIBILITY_UNMANGLED(name) SEPARATOR \ 9 | - CFI_START SEPARATOR \ 10 | DECLARE_FUNC_ENCODING \ 11 | - name: SEPARATOR BTI_C 12 | + name: \ 13 | + SEPARATOR CFI_START \ 14 | + SEPARATOR BTI_C 15 | 16 | #define DEFINE_COMPILERRT_FUNCTION_ALIAS(name, target) \ 17 | .globl SYMBOL_NAME(name) SEPARATOR \ 18 | -------------------------------------------------------------------------------- /conda-recipes/compiler-rt-macos-build.patch: -------------------------------------------------------------------------------- 1 | diff --git a/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake b/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake 2 | index 640c7e7124c9..7bd3edb86eb1 100644 3 | --- a/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake 4 | +++ b/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake 5 | @@ -399,7 +399,9 @@ endfunction() 6 | macro(darwin_add_builtin_libraries) 7 | set(DARWIN_EXCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Darwin-excludes) 8 | 9 | - set(CFLAGS -fPIC -O3 -fvisibility=hidden -DVISIBILITY_HIDDEN -Wall -fomit-frame-pointer) 10 | + set(CFLAGS -fPIC -O3 -Wall -fomit-frame-pointer) 11 | + append_list_if(COMPILER_RT_BUILTINS_HIDE_SYMBOLS -fvisibility=hidden CFLAGS) 12 | + append_list_if(COMPILER_RT_BUILTINS_HIDE_SYMBOLS -DVISIBILITY_HIDDEN CFLAGS) 13 | set(CMAKE_C_FLAGS "") 14 | set(CMAKE_CXX_FLAGS "") 15 | set(CMAKE_ASM_FLAGS "") 16 | -------------------------------------------------------------------------------- /conda-recipes/llvm15-clear-gotoffsetmap.patch: -------------------------------------------------------------------------------- 1 | From 0bcb486d8f66f6aed142d89e7fe21719f7050756 Mon Sep 17 00:00:00 2001 2 | From: Siu Kwan Lam <1929845+sklam@users.noreply.github.com> 3 | Date: Mon, 8 Apr 2024 10:26:49 -0500 4 | Subject: [PATCH] llvm15-clear-gotoffsetmap.patch 5 | 6 | --- 7 | llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp | 1 + 8 | 1 file changed, 1 insertion(+) 9 | 10 | diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp 11 | index c702584b7..08c65897c 100644 12 | --- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp 13 | +++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp 14 | @@ -2352,6 +2352,7 @@ Error RuntimeDyldELF::finalizeLoad(const ObjectFile &Obj, 15 | } 16 | } 17 | 18 | + GOTOffsetMap.clear(); 19 | GOTSectionID = 0; 20 | CurrentGOTIndex = 0; 21 | 22 | -- 23 | 2.41.0 24 | 25 | -------------------------------------------------------------------------------- /conda-recipes/llvm15-remove-use-of-clonefile.patch: -------------------------------------------------------------------------------- 1 | From 492d4fdd963576cb796e29c3c160e17ea9acfbf8 Mon Sep 17 00:00:00 2001 2 | From: Siu Kwan Lam <1929845+sklam@users.noreply.github.com> 3 | Date: Mon, 8 Apr 2024 10:28:24 -0500 4 | Subject: [PATCH] llvm15-remove-use-of-clonefile 5 | 6 | --- 7 | llvm/lib/Support/Unix/Path.inc | 2 ++ 8 | llvm/unittests/Support/Path.cpp | 8 +++++--- 9 | 2 files changed, 7 insertions(+), 3 deletions(-) 10 | 11 | diff --git a/llvm/lib/Support/Unix/Path.inc b/llvm/lib/Support/Unix/Path.inc 12 | index 2ae7c6dc4..ae93f7a1f 100644 13 | --- a/llvm/lib/Support/Unix/Path.inc 14 | +++ b/llvm/lib/Support/Unix/Path.inc 15 | @@ -1476,6 +1476,7 @@ namespace fs { 16 | std::error_code copy_file(const Twine &From, const Twine &To) { 17 | std::string FromS = From.str(); 18 | std::string ToS = To.str(); 19 | + /* 20 | #if __has_builtin(__builtin_available) 21 | if (__builtin_available(macos 10.12, *)) { 22 | // Optimistically try to use clonefile() and handle errors, rather than 23 | @@ -1504,6 +1505,7 @@ std::error_code copy_file(const Twine &From, const Twine &To) { 24 | // cheaper. 25 | } 26 | #endif 27 | + */ 28 | if (!copyfile(FromS.c_str(), ToS.c_str(), /*State=*/NULL, COPYFILE_DATA)) 29 | return std::error_code(); 30 | return std::error_code(errno, std::generic_category()); 31 | diff --git a/llvm/unittests/Support/Path.cpp b/llvm/unittests/Support/Path.cpp 32 | index 6f0022765..822762952 100644 33 | --- a/llvm/unittests/Support/Path.cpp 34 | +++ b/llvm/unittests/Support/Path.cpp 35 | @@ -2266,15 +2266,15 @@ TEST_F(FileSystemTest, permissions) { 36 | 37 | EXPECT_EQ(fs::setPermissions(TempPath, fs::set_uid_on_exe), NoError); 38 | EXPECT_TRUE(CheckPermissions(fs::set_uid_on_exe)); 39 | - 40 | +#if !defined(__APPLE__) 41 | EXPECT_EQ(fs::setPermissions(TempPath, fs::set_gid_on_exe), NoError); 42 | EXPECT_TRUE(CheckPermissions(fs::set_gid_on_exe)); 43 | - 44 | +#endif 45 | // Modern BSDs require root to set the sticky bit on files. 46 | // AIX and Solaris without root will mask off (i.e., lose) the sticky bit 47 | // on files. 48 | #if !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__) && \ 49 | - !defined(_AIX) && !(defined(__sun__) && defined(__svr4__)) 50 | + !defined(_AIX) && !(defined(__sun__) && defined(__svr4__)) && !defined(__APPLE__) 51 | EXPECT_EQ(fs::setPermissions(TempPath, fs::sticky_bit), NoError); 52 | EXPECT_TRUE(CheckPermissions(fs::sticky_bit)); 53 | 54 | @@ -2296,10 +2296,12 @@ TEST_F(FileSystemTest, permissions) { 55 | EXPECT_TRUE(CheckPermissions(fs::all_perms)); 56 | #endif // !FreeBSD && !NetBSD && !OpenBSD && !AIX 57 | 58 | +#if !defined(__APPLE__) 59 | EXPECT_EQ(fs::setPermissions(TempPath, fs::all_perms & ~fs::sticky_bit), 60 | NoError); 61 | EXPECT_TRUE(CheckPermissions(fs::all_perms & ~fs::sticky_bit)); 62 | #endif 63 | +#endif 64 | } 65 | 66 | #ifdef _WIN32 67 | -- 68 | 2.41.0 69 | 70 | -------------------------------------------------------------------------------- /conda-recipes/llvmdev/bld.bat: -------------------------------------------------------------------------------- 1 | REM base on https://github.com/AnacondaRecipes/llvmdev-feedstock/blob/master/recipe/bld.bat 2 | echo on 3 | 4 | mkdir build 5 | cd build 6 | 7 | REM remove GL flag for now 8 | set "CXXFLAGS=-MD" 9 | set "CC=cl.exe" 10 | set "CXX=cl.exe" 11 | 12 | cmake -G "Ninja" ^ 13 | -DCMAKE_BUILD_TYPE="Release" ^ 14 | -DCMAKE_PREFIX_PATH=%LIBRARY_PREFIX% ^ 15 | -DCMAKE_INSTALL_PREFIX:PATH=%LIBRARY_PREFIX% ^ 16 | -DLLVM_USE_INTEL_JITEVENTS=ON ^ 17 | -DLLVM_ENABLE_LIBXML2=FORCE_ON ^ 18 | -DLLVM_ENABLE_RTTI=ON ^ 19 | -DLLVM_ENABLE_ZLIB=FORCE_ON ^ 20 | -DLLVM_ENABLE_ZSTD=FORCE_ON ^ 21 | -DLLVM_INCLUDE_BENCHMARKS=OFF ^ 22 | -DLLVM_INCLUDE_DOCS=OFF ^ 23 | -DLLVM_INCLUDE_EXAMPLES=OFF ^ 24 | -DLLVM_INCLUDE_TESTS=ON ^ 25 | -DLLVM_INCLUDE_UTILS=ON ^ 26 | -DLLVM_INSTALL_UTILS=ON ^ 27 | -DLLVM_UTILS_INSTALL_DIR=libexec\llvm ^ 28 | -DLLVM_BUILD_LLVM_C_DYLIB=no ^ 29 | -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=WebAssembly ^ 30 | -DCMAKE_POLICY_DEFAULT_CMP0111=NEW ^ 31 | -DLLVM_ENABLE_PROJECTS:STRING=lld;compiler-rt ^ 32 | -DLLVM_ENABLE_ASSERTIONS=ON ^ 33 | -DLLVM_ENABLE_DIA_SDK=OFF ^ 34 | -DCOMPILER_RT_BUILD_BUILTINS=ON ^ 35 | -DCOMPILER_RT_BUILTINS_HIDE_SYMBOLS=OFF ^ 36 | -DCOMPILER_RT_BUILD_LIBFUZZER=OFF ^ 37 | -DCOMPILER_RT_BUILD_CRT=OFF ^ 38 | -DCOMPILER_RT_BUILD_MEMPROF=OFF ^ 39 | -DCOMPILER_RT_BUILD_PROFILE=OFF ^ 40 | -DCOMPILER_RT_BUILD_SANITIZERS=OFF ^ 41 | -DCOMPILER_RT_BUILD_XRAY=OFF ^ 42 | -DCOMPILER_RT_BUILD_GWP_ASAN=OFF ^ 43 | -DCOMPILER_RT_BUILD_ORC=OFF ^ 44 | -DCOMPILER_RT_INCLUDE_TESTS=OFF ^ 45 | %SRC_DIR%/llvm 46 | if %ERRORLEVEL% neq 0 exit 1 47 | 48 | cmake --build . 49 | if %ERRORLEVEL% neq 0 exit 1 50 | 51 | cmake --build . --target install 52 | 53 | if %ERRORLEVEL% neq 0 exit 1 54 | 55 | REM bin\opt -S -vector-library=SVML -mcpu=haswell -O3 %RECIPE_DIR%\numba-3016.ll | bin\FileCheck %RECIPE_DIR%\numba-3016.ll 56 | REM if %ERRORLEVEL% neq 0 exit 1 57 | 58 | cd ..\llvm\test 59 | python ..\..\build\bin\llvm-lit.py -vv Transforms ExecutionEngine Analysis CodeGen/X86 60 | -------------------------------------------------------------------------------- /conda-recipes/llvmdev/conda_build_config.yaml: -------------------------------------------------------------------------------- 1 | # Numba/llvmlite stack needs an older compiler for backwards compatability. 2 | c_compiler_version: # [linux] 3 | - 7 # [linux and (x86_64 or ppc64le)] 4 | - 11 # [linux and aarch64] 5 | 6 | cxx_compiler_version: # [linux] 7 | - 7 # [linux and (x86_64 or ppc64le)] 8 | - 11 # [linux and aarch64] 9 | 10 | fortran_compiler_version: # [linux] 11 | - 7 # [linux and (x86_64 or ppc64le)] 12 | - 11 # [linux and aarch64] 13 | 14 | c_compiler: # [win] 15 | - vs2019 # [win] 16 | cxx_compiler: # [win] 17 | - vs2019 # [win] 18 | 19 | MACOSX_SDK_VERSION: # [osx and x86_64] 20 | - 10.12 # [osx and x86_64] 21 | -------------------------------------------------------------------------------- /conda-recipes/llvmdev/meta.yaml: -------------------------------------------------------------------------------- 1 | {% set shortversion = "15.0" %} 2 | {% set version = "15.0.7" %} 3 | {% set sha256_llvm = "8b5fcb24b4128cf04df1b0b9410ce8b1a729cb3c544e6da885d234280dedeac6" %} 4 | {% set build_number = "2" %} 5 | 6 | package: 7 | name: llvmdev 8 | version: {{ version }} 9 | 10 | source: 11 | - url: https://github.com/llvm/llvm-project/releases/download/llvmorg-{{ version.replace(".rc", "-rc") }}/llvm-project-{{ version.replace(".rc", "rc") }}.src.tar.xz 12 | sha256: {{ sha256_llvm }} 13 | patches: 14 | - ../llvm15-clear-gotoffsetmap.patch 15 | - ../llvm15-remove-use-of-clonefile.patch 16 | - ../llvm15-svml.patch 17 | - ../compiler-rt-cfi-startproc-war.patch 18 | - ../compiler-rt-macos-build.patch 19 | 20 | # Patches from conda-forge needed for windows to build 21 | # backport of zlib patches, can be dropped for vs15.0.3, see 22 | # https://reviews.llvm.org/D135457 & https://reviews.llvm.org/D136065 23 | - patches/0002-CMake-Fix-Findzstd-module-for-shared-DLL-on-Windows.patch 24 | - patches/no-windows-symlinks.patch 25 | 26 | build: 27 | number: {{ build_number }} 28 | script_env: 29 | - PY_VCRUNTIME_REDIST 30 | ignore_run_exports: 31 | # Is static-linked 32 | - xar 33 | 34 | requirements: 35 | build: 36 | - {{ compiler('cxx') }} 37 | - cmake 38 | - ninja 39 | - python >=3 40 | - libcxx # it is not defined{{ cxx_compiler_version }} # [osx] 41 | - patch # [not win] 42 | - m2-patch # [win] 43 | - git # [(linux and x86_64)] 44 | 45 | host: 46 | - libcxx # it is not defined{{ cxx_compiler_version }} # [osx] 47 | - libffi # [unix] 48 | # libxml2 supports a windows-only feature, see https://github.com/llvm/llvm-project/blob/llvmorg-17.0.6/llvm/include/llvm/WindowsManifest/WindowsManifestMerger.h 49 | - libxml2 # [win] 50 | - zlib 51 | - zstd 52 | 53 | test: 54 | files: 55 | - numba-3016.ll 56 | commands: 57 | - $PREFIX/bin/llvm-config --libs # [not win] 58 | - $PREFIX/bin/llc -version # [not win] 59 | 60 | - if not exist %LIBRARY_INC%\\llvm\\Pass.h exit 1 # [win] 61 | - if not exist %LIBRARY_LIB%\\LLVMSupport.lib exit 1 # [win] 62 | 63 | - test -f $PREFIX/include/llvm/Pass.h # [unix] 64 | - test -f $PREFIX/lib/libLLVMSupport.a # [unix] 65 | 66 | - test -f $PREFIX/lib/libLLVMCore.a # [not win] 67 | 68 | # LLD tests 69 | - ld.lld --version # [unix] 70 | - lld-link /? # [win] 71 | 72 | about: 73 | home: http://llvm.org/ 74 | dev_url: https://github.com/llvm-mirror/llvm 75 | license: NCSA 76 | license_file: llvm/LICENSE.TXT 77 | summary: Development headers and libraries for LLVM 78 | -------------------------------------------------------------------------------- /conda-recipes/llvmdev/numba-3016.ll: -------------------------------------------------------------------------------- 1 | ; Regression test for llvmdev-feedstock#52 and numba#3016 2 | 3 | ; Generated from C code: int a[1<<10],b[1<<10]; void foo() { int i=0; for(i=0; i<1<<10; i++) { b[i]=sin(a[i]); }} 4 | ; compiled: -fvectorize -fveclib=SVML -O -S -mavx -mllvm -disable-llvm-optzns -emit-llvm 5 | 6 | ; RUN: opt -vector-library=SVML -mcpu=haswell -O3 -S < %s | FileCheck %s 7 | ; CHECK: call {{.*}}__svml_sin4_ha( 8 | ; CHECK-NOT: call {{.*}}__svml_sin4( 9 | ; CHECK-NOT: call {{.*}}__svml_sin8 10 | 11 | source_filename = "svml-3016.c" 12 | target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 13 | target triple = "x86_64-pc-linux-gnu" 14 | 15 | @a = common dso_local global [1024 x i32] zeroinitializer, align 16 16 | @b = common dso_local global [1024 x i32] zeroinitializer, align 16 17 | 18 | ; Function Attrs: nounwind uwtable 19 | define dso_local void @foo() #0 { 20 | %1 = alloca i32, align 4 21 | %2 = bitcast i32* %1 to i8* 22 | call void @llvm.lifetime.start.p0i8(i64 4, i8* %2) #3 23 | store i32 0, i32* %1, align 4, !tbaa !2 24 | store i32 0, i32* %1, align 4, !tbaa !2 25 | br label %3 26 | 27 | ;