Skip to content

Commit 8bd91a0

Browse files
authored
Merge pull request #701 from howetuft/llvm-openmp
Llvm openmp: rely on conan llvm-openmp rather than Github runner openmp, in order to decrease MACOS_DEPLOYMENT_VERSION to 14.2 for arm (Github omp is 15.0+)
2 parents 50b5c97 + c597e2e commit 8bd91a0

5 files changed

Lines changed: 16 additions & 29 deletions

File tree

.github/workflows/wheel-builder.yml

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -182,11 +182,11 @@ jobs:
182182
# Arm: opensubdiv
183183
script: |
184184
if ('${{ runner.arch }}' == 'X64') {
185-
target = '14.0'; // Required by libomp
185+
target = '11.0'; // Required by libomp
186186
arch='x86_64';
187187
}
188188
else {
189-
target = '15.0'; // Required by libomp
189+
target = '14.2'; // Required by opensubdiv
190190
arch='armv8';
191191
}
192192
core.exportVariable('MACOSX_DEPLOYMENT_TARGET', target);
@@ -223,11 +223,6 @@ jobs:
223223
echo "LDFLAGS=${LD_FLAGS} -fuse-ld=${LLD_PREFIX}/bin/ld64.lld -L${LLVM_PREFIX}/lib -L${LLD_PREFIX}/lib" >> $GITHUB_ENV
224224
echo "CPPFLAGS=${CPPFLAGS} -I${LLVM_PREFIX}/include -I${LLD_PREFIX}/include" >> $GITHUB_ENV
225225
226-
# OpenMP
227-
brew install libomp
228-
brew link libomp --overwrite
229-
echo "OpenMP_ROOT=$(brew --prefix libomp)" >> $GITHUB_ENV
230-
231226
232227
# TODO: The following block is an ugly hack but, at the moment (2025-02-25),
233228
# scikit-build-core lacks a preset parameter, so this is the only way
@@ -370,18 +365,7 @@ jobs:
370365
delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}
371366
CIBW_TEST_COMMAND_LINUX: pyluxcoretest
372367
CIBW_TEST_COMMAND_WINDOWS: pyluxcoretest
373-
CIBW_TEST_COMMAND_MACOS: |
374-
if [[ ${{ matrix.os }} == 'macos-15-intel' ]]; then
375-
# Full test for Intel
376-
echo "Testing x86_64"
377-
pyluxcoretest
378-
elif [[ ${{ matrix.os }} == 'macos-15' ]]; then
379-
# Light test, as ARM runner raises an OpenCL driver issue otherwise
380-
echo "Testing arm"
381-
python -c "import pyluxcore"
382-
else
383-
echo "UNHANDLED OS"
384-
fi
368+
CIBW_TEST_COMMAND_MACOS: pyluxcoretest
385369
CIBW_CONTAINER_ENGINE: >
386370
docker;
387371
create_args:

CMakeLists.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,7 @@ set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
133133
#endif("${isSystemDir}" STREQUAL "-1")
134134
MESSAGE(STATUS "Install RPATH: ${CMAKE_INSTALL_RPATH}")
135135
if(LINUX)
136-
add_link_options("LINKER:--disable-new-dtags")
137-
endif()
138-
139-
if(LINUX OR APPLE)
140-
add_link_options("LINKER:-Bsymbolic")
136+
add_link_options("LINKER:--disable-new-dtags" "LINKER:-Bsymbolic")
141137
endif()
142138

143139
if (LUXRAYS_DISABLE_OPENCL)

python/pyluxcoretest/pyluxcoretest.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,13 @@ def PropertiesTests():
161161

162162
def LuxRaysDeviceTests():
163163
print("LuxRays device information example......", flush=True)
164-
deviceList = pyluxcore.GetOpenCLDeviceList()
164+
try:
165+
deviceList = pyluxcore.GetOpenCLDeviceList()
166+
except RuntimeError as err:
167+
print(str(err))
168+
return None
165169
print("OpenCL device list: %s\n" % str(deviceList), flush=True)
170+
return deviceList
166171

167172

168173
################################################################################
@@ -866,7 +871,9 @@ def main():
866871
# os.chdir(os.path.dirname(__file__))
867872

868873
PropertiesTests()
869-
LuxRaysDeviceTests()
874+
devices = LuxRaysDeviceTests()
875+
if devices is None:
876+
return
870877
SimpleRender()
871878
GetOutputTest()
872879
ExtractConfiguration()

src/pyluxcore/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ target_link_libraries(pyluxcore PRIVATE
4141
)
4242

4343
if(APPLE)
44-
target_link_libraries(pyluxcore PRIVATE llvm-openmp::llvm-openmp)
44+
target_link_libraries(pyluxcore PRIVATE OpenMP::OpenMP)
4545
else()
4646
target_link_libraries(pyluxcore PRIVATE OpenMP::OpenMP_CXX)
4747
endif(APPLE)

src/slg/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ add_library(bcd STATIC ${BCD_SRCS})
7171
target_link_libraries(bcd PRIVATE boost::boost Eigen3::Eigen)
7272

7373
if(APPLE)
74-
target_link_libraries(bcd PRIVATE llvm-openmp::llvm-openmp)
74+
target_link_libraries(bcd PRIVATE OpenMP::OpenMP)
7575
else()
7676
target_link_libraries(bcd PRIVATE OpenMP::OpenMP_CXX)
7777
endif(APPLE)
@@ -512,7 +512,7 @@ target_link_libraries(slg-core PRIVATE
512512
)
513513

514514
if(APPLE)
515-
target_link_libraries(slg-core PRIVATE llvm-openmp::llvm-openmp)
515+
target_link_libraries(slg-core PRIVATE OpenMP::OpenMP)
516516
else()
517517
target_link_libraries(slg-core PRIVATE OpenMP::OpenMP_CXX)
518518
endif(APPLE)

0 commit comments

Comments
 (0)