Skip to content

Commit f6ac6a3

Browse files
author
peng.li24
committed
ci: fix Ubuntu 24.04 — remove libgomp1-dev (non-existent), make OpenMP optional
libgomp1-dev does not exist as a separate package on Ubuntu 24.04; OpenMP runtime (libgomp1) and headers (omp.h) are bundled with GCC. - ci.yml: remove libgomp1 + libgomp1-dev from apt-get install - CMakeLists.txt: find_package(OpenMP) without REQUIRED; conditional target_link_libraries so build succeeds even without OpenMP - einsum.h already guards #include <omp.h> and #pragma omp behind #ifdef _OPENMP
1 parent 4ff144b commit f6ac6a3

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ jobs:
4646
- name: Install system dependencies
4747
run: |
4848
sudo apt-get update -qq
49-
sudo apt-get install -y libeigen3-dev libgomp1 libgomp1-dev
49+
sudo apt-get install -y libeigen3-dev
50+
# libgomp1 (OpenMP runtime) and omp.h (OpenMP headers) are bundled
51+
# with GCC on Ubuntu 24.04 — no separate libgomp1-dev package exists
5052
5153
- name: Verify AVX-512 support
5254
run: |

tests/CMakeLists.txt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ endif()
3939
# Eigen3 (optional — used for norm/std helpers in module.cpp)
4040
find_package(Eigen3 CONFIG QUIET)
4141

42-
# OpenMP
43-
find_package(OpenMP REQUIRED)
42+
# OpenMP (optional — einsum uses #pragma omp only when _OPENMP is defined)
43+
find_package(OpenMP)
4444

4545
# ---- Python extension module -------------------------------------------------
4646
pybind11_add_module(numpycpp MODULE module.cpp)
@@ -68,7 +68,10 @@ target_compile_options(numpycpp PRIVATE
6868
-fno-builtin-cbrt -fno-builtin-expm1 -fno-builtin-log1p
6969
)
7070

71-
target_link_libraries(numpycpp PRIVATE OpenMP::OpenMP_CXX dl)
71+
if(OpenMP_CXX_FOUND)
72+
target_link_libraries(numpycpp PRIVATE OpenMP::OpenMP_CXX)
73+
endif()
74+
target_link_libraries(numpycpp PRIVATE dl)
7275

7376
# Place .so next to the test scripts for easy import
7477
set_target_properties(numpycpp PROPERTIES

0 commit comments

Comments
 (0)