Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
8327cc8
Update project toml
ggeorgakoudis Feb 3, 2026
f9a95bb
Update setup.py for LLVM 20 openmp and patches
ggeorgakoudis Feb 3, 2026
02e8af7
Add required clangxx when setting up the miniconda3 env
ggeorgakoudis Feb 3, 2026
81338ee
Build CUDA targets with toolchain by default to avoid ABI issues
ggeorgakoudis Feb 3, 2026
26b413f
Run explicitly omp offloading registration constructors
ggeorgakoudis Feb 3, 2026
75d2eca
Add bitcode debug output for the LLVM plugin pass
ggeorgakoudis Feb 3, 2026
0343541
Set default thread limit to 0 to align with omptarget
ggeorgakoudis Feb 3, 2026
7652de5
Update codegen in omp_ir.py
ggeorgakoudis Feb 3, 2026
ee84c7c
Fix test requiring thread_limit to avoid out-of-bounds array writes
ggeorgakoudis Feb 3, 2026
994a02d
Remove -flto to avoid plugin requirement for the gold linker
ggeorgakoudis Feb 3, 2026
ed7d9fe
Pass DSAType by const reference in toString() for efficiency
ggeorgakoudis Feb 3, 2026
94e579f
Update to starts_with and add final module verification
ggeorgakoudis Feb 3, 2026
7bb9ef2
Update codegen in the LLVM pass
ggeorgakoudis Feb 3, 2026
3e1dd68
Fix warnings
ggeorgakoudis Feb 3, 2026
31c41a1
Update README
ggeorgakoudis Feb 3, 2026
a561d76
Update python versions in gitlab ci
ggeorgakoudis Feb 3, 2026
1a7a170
Reduce files in wheel through manifest and update libomp building
ggeorgakoudis Feb 3, 2026
2a112a1
Update cibuildwheel building to use manylinux clang and llvm
ggeorgakoudis Feb 3, 2026
60d4144
Update cibuildwheels github action
ggeorgakoudis Feb 3, 2026
cd189bc
Update conda recipe
ggeorgakoudis Feb 3, 2026
17bd554
Update build-and-test script for gitlab ci
ggeorgakoudis Feb 3, 2026
536d912
Fixup: check extractall for compat with older python versions
ggeorgakoudis Feb 3, 2026
481e63f
Improve debug printing of host modules
ggeorgakoudis Feb 4, 2026
a551e82
Set cuda context flag CU_CTX_SCHED_BLOCKING_SYNC
ggeorgakoudis Feb 4, 2026
d2bd353
Use the tgt_target_kernel interface
ggeorgakoudis Feb 4, 2026
884417c
Fix compat with macos 11.0 deployment target
ggeorgakoudis Feb 5, 2026
e5b85aa
Use llvm-openmp package for conda builds to avoid conflicts
ggeorgakoudis Feb 5, 2026
b8d70eb
Fix openmp library conflicts
ggeorgakoudis Feb 5, 2026
0ff91ec
Add placeholder directories for package-data validation
ggeorgakoudis Feb 5, 2026
583367c
Fix test to explicit num_threads for compat with github runners
ggeorgakoudis Feb 5, 2026
a502911
Update build script for gitlab ci
ggeorgakoudis Feb 5, 2026
62428d3
Fix python version range in pyproject.toml
ggeorgakoudis Feb 5, 2026
13c4c7e
Upgrade cibuildwheel to 3.3.1
ggeorgakoudis Feb 5, 2026
90efd34
Fix ploop.1.py example
ggeorgakoudis Feb 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions .github/workflows/build-upload-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ jobs:
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065

- name: Install cibuildwheel
run: python -m pip install cibuildwheel==3.1.4
run: python -m pip install cibuildwheel==3.3.1

- name: Build wheels {{ matrix.os }}
# Set LLVM_VERSION for the host to forward to the cibuildwheel
# environment.
env:
LLVM_VERSION: "15.0.7"
LLVM_VERSION: "20.1.8"
run: python -m cibuildwheel --output-dir wheelhouse

- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
Expand All @@ -58,7 +58,7 @@ jobs:

- name: Build sdist
env:
LLVM_VERSION: "15.0.7"
LLVM_VERSION: "20.1.8"
run: pipx run build --sdist

- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
Expand All @@ -73,8 +73,14 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, ubuntu-24.04-arm]
python-version: ['3.10', '3.11', '3.12', '3.13']
numba-version: ['0.61.0', '0.61.2']
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
numba-version: ['0.62.0', '0.62.1', '0.63.0', '0.63.1']
exclude:
- python-version: '3.14'
numba-version: '0.62.0'
- python-version: '3.14'
numba-version: '0.62.1'

steps:
- name: Download built wheels
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0
Expand Down
1 change: 1 addition & 0 deletions .gitlab/jobs/tioga.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ variables:
- "3.11"
- "3.12"
- "3.13"
- "3.14"

build-and-test-tioga:
extends: [.base-job, .python-variants]
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1 @@
recursive-include src/numba/openmp/libs *
recursive-include src/numba/openmp/libs *.py *.so *.a *.bc
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ conda install -c python-for-hpc -c conda-forge pyomp

| PyOMP | Numba |
| ----- | --------------- |
| 0.5.x | 0.62.x - 0.63.x |
| 0.4.x | 0.61.x |
| 0.3.x | 0.57.x - 0.60.x |

Expand Down
6 changes: 3 additions & 3 deletions buildscripts/cibuildwheel/setup-miniconda3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ echo "Miniconda installed"
source "_stage/miniconda3/bin/activate" base
export CONDA_PLUGINS_AUTO_ACCEPT_TOS=true

# Create clangdev ${LLVM_VERSION}
echo "Installing manylinux llvmdev ${LLVM_VERSION}..."
conda create -n llvmdev-${LLVM_VERSION} -c conda-forge -q -y clang=${LLVM_VERSION} clang-tools=${LLVM_VERSION} llvmdev=${LLVM_VERSION}
# Create conda environment with tools and libraries for the LLVM_VERSION.
echo "Installing llvmdev ${LLVM_VERSION}..."
conda create -n llvmdev-${LLVM_VERSION} -c conda-forge -q -y clang=${LLVM_VERSION} clangxx=${LLVM_VERSION} clang-tools=${LLVM_VERSION} llvmdev=${LLVM_VERSION} zstd
53 changes: 17 additions & 36 deletions buildscripts/conda-recipes/pyomp/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% set version = environ.get('GIT_DESCRIBE_TAG', '0.0.0').lstrip('v') %}
{% set LLVM_VERSION = environ.get('LLVM_VERSION', '15.0.7') %}
{% set LLVM_VERSION = environ.get('LLVM_VERSION', '20.1.8') %}

package:
name: pyomp
Expand All @@ -15,8 +15,11 @@ build:
script:
- export LLVM_VERSION={{ LLVM_VERSION }}
- export LLVM_DIR=${PREFIX}
- export CC=${PREFIX}/bin/clang
- export CXX=${PREFIX}/bin/clang++
- export VERBOSE=1
- export CPPFLAGS="-mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET} -isystem ${PREFIX}/include -D_FORTIFY_SOURCE=2" # [osx]
- export ENABLE_BUNDLED_LIBOMPTARGET=1 # [linux]
- rm -rf build dist src/*.egg-info
- {{ PYTHON }} -m pip install -v .

Expand All @@ -28,6 +31,7 @@ requirements:
- sysroot_linux-64 # [linux64]
- sysroot_linux-aarch64 # [aarch64]
- cmake
- ninja
- setuptools_scm
- elfutils # [linux]
- libffi # [linux]
Expand All @@ -39,55 +43,32 @@ requirements:
- sysroot_linux-aarch64 # [aarch64]
- setuptools
- setuptools_scm
- numba >=0.61, <0.62
- numba >=0.62, <0.64
- clang {{ LLVM_VERSION }}
- clangxx {{ LLVM_VERSION }}
- clang-tools {{ LLVM_VERSION }}
- llvmdev {{ LLVM_VERSION }}
- zlib
# require llvm-openmp for the openmp cpu runtime.
- llvm-openmp {{ LLVM_VERSION }}
- elfutils # [linux]
- libffi # [linux]
run:
- python
- setuptools
- numba >=0.61, <0.62
- numba >=0.62, <0.64
# require llvm-openmp for the openmp cpu runtime.
- llvm-openmp {{ LLVM_VERSION }}
- lark
- cffi

test:
commands:
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomp.dylib # [osx]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomp.so # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-amdgpu-gfx1010.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-amdgpu-gfx1030.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-amdgpu-gfx1031.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-amdgpu-gfx700.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-amdgpu-gfx701.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-amdgpu-gfx801.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-amdgpu-gfx803.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-amdgpu-gfx900.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-amdgpu-gfx902.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-amdgpu-gfx906.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-amdgpu-gfx908.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-amdgpu-gfx90a.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-nvptx-sm_35.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-nvptx-sm_37.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-nvptx-sm_50.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-nvptx-sm_52.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-nvptx-sm_53.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-nvptx-sm_60.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-nvptx-sm_61.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-nvptx-sm_62.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-nvptx-sm_70.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-nvptx-sm_72.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-nvptx-sm_75.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-nvptx-sm_80.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget-nvptx-sm_86.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget.rtl.amdgpu.so # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget.rtl.cuda.so # [linux]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget.rtl.ppc64.so # [linux and ppc64le]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget.rtl.x86_64.so # [linux and x86_64]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget.rtl.aarch64.so # [linux and aarch64]
- test -f $SP_DIR/numba/openmp/libs/libomp/lib/libomptarget.so # [linux]
- test -f $SP_DIR/numba/openmp/libs/pass/libIntrinsicsOpenMP.dylib # [osx]
- test -f $SP_DIR/numba/openmp/libs/pass/libIntrinsicsOpenMP.so # [linux]
- test -f $SP_DIR/numba/openmp/libs/openmp/lib/libomptarget-amdgpu.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/openmp/lib/libomptarget-nvptx.bc # [linux]
- test -f $SP_DIR/numba/openmp/libs/openmp/lib/libomptarget.so # [linux]

about:
home: https://github.com/Python-for-HPC/PyOMP
Expand Down
11 changes: 8 additions & 3 deletions buildscripts/gitlab/build-and-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ set -e

# Create a unique temporary directory for this job.
TMPDIR=/tmp/pyomp/${CI_JOB_ID}
rm -rf ${TMPDIR}
mkdir -p ${TMPDIR}
pushd ${TMPDIR}

# Set the LLVM_VERSION to use.
export LLVM_VERSION="15.0.7"
export LLVM_VERSION="20.1.8"

# Set the envs directory under the temporary directory.
export CONDA_ENVS_DIRS="${TMPDIR}/_stage/miniconda3/envs"
Expand All @@ -17,14 +18,18 @@ export CONDA_ENVS_DIRS="${TMPDIR}/_stage/miniconda3/envs"
source ${CI_PROJECT_DIR}/buildscripts/cibuildwheel/setup-miniconda3.sh

# Export environment variables for building and testing.
export ENABLE_BUNDLED_LIBOMP="1"
export ENABLE_BUNDLED_LIBOMPTARGET="1"
export LLVM_DIR="${CONDA_ENVS_DIRS}/llvmdev-${LLVM_VERSION}"
export PATH="${CONDA_ENVS_DIRS}/llvmdev-${LLVM_VERSION}/bin:${PATH}"
export CMAKE_PREFIX_PATH="${CONDA_PREFIX}"
export USE_CXX11_ABI="1"
export PIP_NO_INPUT="1"

# Create and activate a conda environment with the desired Python version.
conda create -n py-${PYOMP_CI_PYTHON_VERSION} -c conda-forge -y python=${PYOMP_CI_PYTHON_VERSION}
conda activate py-${PYOMP_CI_PYTHON_VERSION}
# Add extra packages needed to build openmp libraries.
conda install -c conda-forge -y zstd libffi

# Clone and fetch the commit with history for package versioning.
git clone https://github.com/${GITHUB_PROJECT_ORG}/${GITHUB_PROJECT_NAME}.git --single-branch
Expand All @@ -33,7 +38,7 @@ git fetch origin ${CI_COMMIT_SHA}
git checkout ${CI_COMMIT_SHA}

# Install pyomp.
CC=gcc CXX=g++ python -m pip install -v .
CC=clang CXX=clang++ python -m pip install -v .

# Run host OpenMP tests.
TEST_DEVICES=0 RUN_TARGET=0 python -m numba.runtests -v -- numba.openmp.tests.test_openmp
Expand Down
9 changes: 5 additions & 4 deletions examples/ploop.1.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import numba
from numba.openmp import njit
from numba.openmp import openmp_context as openmp
from numba.openmp import omp_set_num_threads, omp_get_thread_num, omp_get_num_threads, omp_get_wtime
import numpy as np

@numba.njit

@njit
def simple(n, a, b):
with openmp("parallel for"):
for i in range(1, n):
b[i] = (a[i] + a[i-1]) / 2.0
b[i] = (a[i] + a[i - 1]) / 2.0


a = np.ones(100)
b = np.empty(len(a))
Expand Down
41 changes: 29 additions & 12 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[build-system]
requires = ["setuptools>=75.3", "wheel", "setuptools-scm>=8", "cmake>=3.20"]
requires = ["setuptools>=75.3", "setuptools-scm>=8", "cmake>=3.20", "ninja"]
build-backend = "setuptools.build_meta"

[project]
name = "pyomp"
dynamic = ["version"]
description = "Python OpenMP library based on Numba"
readme = "README.md"
requires-python = ">=3.10, <3.14"
requires-python = ">=3.10, <3.15"
license = "BSD-2-Clause"
license-files = ["LICENSE", "LICENSE-OPENMP.txt"]
classifiers = [
Expand All @@ -17,7 +17,7 @@ classifiers = [
"Intended Audience :: Developers",
"Topic :: Software Development :: Compilers",
]
dependencies = ["numba>=0.61, <0.62", "lark", "cffi", "setuptools"]
dependencies = ["numba>=0.62, <0.64", "lark", "cffi", "setuptools"]
maintainers = [
{ name = "Giorgis Georgakoudis", email = "georgakoudis1@llnl.gov" },
]
Expand All @@ -37,7 +37,7 @@ include = ["numba.openmp*"]

# Bundle the CMake-installed artifacts into the wheel.
[tool.setuptools.package-data]
"numba.openmp.libs" = ["pass/*", "libomp/**/*"]
"numba.openmp.libs" = ["pass/*", "openmp/**/*"]

# setuptools-scm config
[tool.setuptools_scm]
Expand All @@ -49,7 +49,6 @@ archs = ["native"]
# Pass LLVM_VERSION from the host environment to cibuildwheel.
environment-pass = ["LLVM_VERSION"]
# We use miniconda3 to get the clang/llvm toolchain on Linux.
before-all = ["bash buildscripts/cibuildwheel/setup-miniconda3.sh"]
before-build = ["rm -rf build dist src/*.egg-info"]
skip = ["*-musllinux_*", "cp38-*"]
test-command = [
Expand All @@ -59,14 +58,32 @@ test-command = [
"OMP_TARGET_OFFLOAD=mandatory TEST_DEVICES=1 RUN_TARGET=1 python -m numba.runtests -v -- numba.openmp.tests.test_openmp.TestOpenmpTarget",
]

[tool.cibuildwheel.environment]
USE_CXX11_ABI = "1"
PIP_NO_INPUT = "1"

[tool.cibuildwheel.linux]
before-all = [
"yum install -y elfutils-libelf-devel libffi-devel",
"bash buildscripts/cibuildwheel/setup-miniconda3.sh",
"yum install -y elfutils-libelf-devel libffi-devel clang-devel-20.1.8 llvm-devel-20.1.8",
]

[tool.cibuildwheel.environment]
LLVM_DIR = "${PWD}/_stage/miniconda3/envs/llvmdev-${LLVM_VERSION}"
PATH = "${PWD}/_stage/miniconda3/envs/llvmdev-${LLVM_VERSION}/bin:${PATH}"
USE_CXX11_ABI = "1"
PIP_NO_INPUT = "1"
[tool.cibuildwheel.linux.environment]
ENABLE_BUNDLED_LIBOMP = "1"
ENABLE_BUNDLED_LIBOMPTARGET = "1"
LLVM_DIR = "/usr/lib64/cmake/llvm"
CC = "/usr/bin/clang"
CXX = "/usr/bin/clang++"

[tool.cibuildwheel.macos]
before-all = ["bash buildscripts/cibuildwheel/setup-miniconda3.sh"]

[tool.cibuildwheel.macos.environment]
ENABLE_BUNDLED_LIBOMP = "1"
LLVM_DIR = "${PWD}/_stage/miniconda3/envs/llvmdev-${LLVM_VERSION}/lib/cmake/llvm"
CC = "${PWD}/_stage/miniconda3/envs/llvmdev-${LLVM_VERSION}/bin/clang"
CXX = "${PWD}/_stage/miniconda3/envs/llvmdev-${LLVM_VERSION}/bin/clang++"
# Set the deplioyment target to macOS 11.0.
MACOSX_DEPLOYMENT_TARGET = "11.0"
# Set the cmake prefix path to find libraries in the conda environment which is
# compatible with the macos target.
CMAKE_PREFIX_PATH = "${PWD}/_stage/miniconda3/envs/llvmdev-${LLVM_VERSION}/"
Loading
Loading