Skip to content

Commit bdca0f0

Browse files
authored
Merge pull request #330 from zivid/MISC-2025-11-04-bump-to-sdk-2.17.0
Version 2.17.0
2 parents 02c9e6e + 95dcb21 commit bdca0f0

File tree

116 files changed

+2394
-662
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+2394
-662
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ jobs:
114114
- ubuntu:22.04
115115
- ubuntu:24.04
116116
- ubuntu:25.04
117+
- ubuntu:25.10
117118
- fedora:41
118119
- fedora:42
119120
steps:

CMakeLists.txt

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ project(zivid LANGUAGES CXX)
1616
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
1717

1818
include(ReadZividVersion)
19+
include(CompilerWarningOptions)
20+
include(TargetUtilities)
1921

2022
set(CMAKE_CXX_STANDARD 17)
2123
set(CMAKE_CXX_STANDARD_REQUIRED ON)
@@ -40,12 +42,19 @@ find_package(
4042
Interpreter
4143
Development
4244
)
43-
if(${CMAKE_BUILD_TYPE} MATCHES Debug AND WIN32)
44-
# Because of https://github.com/pybind/pybind11/issues/5467, newer CMake versions on
45-
# windows build throws following error: LNK1104: cannot open file 'python312.lib'. Note
46-
# how linker tries to find python312.lib instead of expected python312_d.lib debug
47-
# version.
48-
set(PYTHON_IS_DEBUG ON)
45+
if(WIN32)
46+
# If "debug" libraries for Python are installed on Windows, `find_package(Python3 ...)`
47+
# above will find debug version `_d` of imported python library during linking. `pybind11`
48+
# however expects to find release versions of imported python library during linking. This
49+
# leads to following linker error: `fatal error LNK1104: cannot open file 'python312.lib'`.
50+
# Hence we map imported python target properties to always use release libraries. See issue
51+
# https://github.com/pybind/pybind11/issues/3403 for details of the following workaround.
52+
set_target_properties(
53+
Python3::Module
54+
PROPERTIES
55+
MAP_IMPORTED_CONFIG_DEBUG
56+
";RELEASE"
57+
)
4958
endif()
5059

5160
find_package(Eigen3 3.4.0 CONFIG REQUIRED)

CMakePresets.json

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,19 @@
1515
"binaryDir": "${sourceParentDir}/build/${presetName}"
1616
},
1717
{
18-
"name": "python_312",
18+
"name": "python_313",
1919
"hidden": true,
2020
"cacheVariables": {
21-
"PYTHON_INTERPRETER_VERSION": "3.12"
21+
"PYTHON_INTERPRETER_VERSION": "3.13"
2222
}
2323
},
2424
{
2525
"name": "linux_sdk_python_wrapper_dev_build",
2626
"description": "Build python wrapper with latest sdk on Linux",
2727
"inherits": "common_opts",
2828
"cacheVariables": {
29-
"CMAKE_C_COMPILER": "clang-18",
30-
"CMAKE_CXX_COMPILER": "clang++-18",
29+
"CMAKE_C_COMPILER": "clang-20",
30+
"CMAKE_CXX_COMPILER": "clang++-20",
3131
"CMAKE_EXE_LINKER_FLAGS": "-fuse-ld=mold",
3232
"CMAKE_MODULE_LINKER_FLAGS": "-fuse-ld=mold",
3333
"CMAKE_SHARED_LINKER_FLAGS": "-fuse-ld=mold"
@@ -39,17 +39,17 @@
3939
}
4040
},
4141
{
42-
"name": "linux_sdk_python_312_debug_build",
43-
"description": "Debug build of python wrapper with latest sdk for python 3.12 on Linux",
44-
"inherits": ["linux_sdk_python_wrapper_dev_build", "python_312"],
42+
"name": "linux_sdk_python_313_debug_build",
43+
"description": "Debug build of python wrapper with latest sdk for python 3.13 on Linux",
44+
"inherits": ["linux_sdk_python_wrapper_dev_build", "python_313"],
4545
"cacheVariables": {
4646
"CMAKE_BUILD_TYPE": "Debug"
4747
}
4848
},
4949
{
50-
"name": "linux_sdk_python_312_release_build",
51-
"description": "Release build of python wrapper with latest sdk for python 3.12 on Linux",
52-
"inherits": ["linux_sdk_python_wrapper_dev_build", "python_312"],
50+
"name": "linux_sdk_python_313_release_build",
51+
"description": "Release build of python wrapper with latest sdk for python 3.13 on Linux",
52+
"inherits": ["linux_sdk_python_wrapper_dev_build", "python_313"],
5353
"cacheVariables": {
5454
"CMAKE_BUILD_TYPE": "Release"
5555
}
@@ -65,17 +65,17 @@
6565
}
6666
},
6767
{
68-
"name": "windows_sdk_python_312_debug_build",
69-
"description": "Debug build of python wrapper with latest sdk for python 3.12 on Windows",
70-
"inherits": ["windows_sdk_python_wrapper_dev_build", "python_312"],
68+
"name": "windows_sdk_python_313_debug_build",
69+
"description": "Debug build of python wrapper with latest sdk for python 3.13 on Windows",
70+
"inherits": ["windows_sdk_python_wrapper_dev_build", "python_313"],
7171
"cacheVariables": {
7272
"CMAKE_BUILD_TYPE": "Debug"
7373
}
7474
},
7575
{
76-
"name": "windows_sdk_python_312_release_build",
77-
"description": "Release build of python wrapper with latest sdk for python 3.12 on Windows",
78-
"inherits": ["windows_sdk_python_wrapper_dev_build", "python_312"],
76+
"name": "windows_sdk_python_313_release_build",
77+
"description": "Release build of python wrapper with latest sdk for python 3.13 on Windows",
78+
"inherits": ["windows_sdk_python_wrapper_dev_build", "python_313"],
7979
"cacheVariables": {
8080
"CMAKE_BUILD_TYPE": "Release"
8181
}

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ at [zivid.com](https://www.zivid.com/).
1818
### Dependencies
1919

2020
* [Python](https://www.python.org/) version 3.7 or higher
21-
* [Zivid SDK][zivid-download-software-url] version 2.16.0 (see [here][zivid-software-installation-url] for help)
21+
* [Zivid SDK][zivid-download-software-url] version 2.17.0 (see [docs][zivid-software-installation-url] for help)
2222
* [Compiler](doc/CompilerInstallation.md) with C++17 support
2323

2424
*Ubuntu users must install Python headers (`apt install python3-dev`) in addition to the regular `python3` package.*
@@ -229,7 +229,7 @@ This requires Zivid SDK version 2.7.0 to be installed on the system.
229229
## License
230230

231231
This project is licensed, see the [LICENSE](LICENSE) file for details. The licenses of dependencies are
232-
listed [here](./licenses-dependencies).
232+
listed [license dependencies](./licenses-dependencies).
233233

234234
## Support
235235

@@ -239,7 +239,7 @@ cannot find a solution to your issue, please contact <customersuccess@zivid.com>
239239
## Test matrix
240240

241241
The test matrix shows which Python versions and operating systems are tested in CI.
242-
Click [here](continuous-integration/TestMatrix.md) to go to the test matrix.
242+
Check [text matrix here](continuous-integration/TestMatrix.md) to go to the test matrix.
243243

244244
[header-image]: https://www.zivid.com/hubfs/softwarefiles/images/zivid-generic-github-header.png
245245

cmake/CompilerWarningOptions.cmake

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
option(WARNINGS "Enable compiler warnings" OFF)
2+
3+
if(WARNINGS)
4+
option(WARNINGS_AS_ERRORS "Treat compiler warnings as errors" OFF)
5+
endif()
6+
7+
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
8+
if(WARNINGS)
9+
if(WARNINGS_AS_ERRORS)
10+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
11+
endif()
12+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic -Wshadow -Wswitch-default -Weffc++")
13+
set(WARNINGS_THAT_SHOULD_BE_IGNORED # WHY it is ok to ignore
14+
)
15+
foreach(WARNING ${WARNINGS_THAT_SHOULD_BE_IGNORED})
16+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-${WARNING}")
17+
endforeach()
18+
else()
19+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w")
20+
endif()
21+
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
22+
if(WARNINGS)
23+
if(WARNINGS_AS_ERRORS)
24+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
25+
endif()
26+
27+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Weverything")
28+
29+
set(WARNINGS_THAT_SHOULD_BE_FIXED
30+
unsafe-buffer-usage # TODO(ZIVID-10837): Reenable this when we start using C++20
31+
gnu-zero-variadic-macro-arguments
32+
)
33+
34+
set(WARNINGS_THAT_SHOULD_BE_IGNORED # WHY it is ok to ignore
35+
c++98-compat # Code base should be modern
36+
c++98-compat-pedantic # Code base should be modern
37+
)
38+
39+
foreach(WARNING ${WARNINGS_THAT_SHOULD_BE_FIXED})
40+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-${WARNING}")
41+
endforeach()
42+
43+
foreach(WARNING ${WARNINGS_THAT_SHOULD_BE_IGNORED})
44+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-${WARNING}")
45+
endforeach()
46+
else()
47+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w")
48+
endif()
49+
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
50+
if(WARNINGS)
51+
if(WARNINGS_AS_ERRORS)
52+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX")
53+
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /WX")
54+
endif()
55+
set(WARNINGS_THAT_SHOULD_BE_IGNORED # WHY it is ok to ignore
56+
4244 # Narrowing conversions: Too strict and noisy for this code base.
57+
4267 # Conversion: Happens a lot in this code, would complicate them too much to handle manually.
58+
4702 # Unreachable code: Ignoring because it triggers too many false positives on pybind11 wrapping code
59+
)
60+
foreach(WARNING ${WARNINGS_THAT_SHOULD_BE_IGNORED})
61+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd${WARNING}")
62+
endforeach()
63+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
64+
else()
65+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W0")
66+
endif()
67+
else()
68+
message(WARNING "Unknown compiler, not able to set compiler options for ${CMAKE_CXX_COMPILER_ID}")
69+
endif()

cmake/TargetUtilities.cmake

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
function(_zivid_python_library)
2+
set(OPTIONS "")
3+
set(ONE_VALUE_ARGUMENTS
4+
NAME
5+
TYPE
6+
)
7+
set(MULTI_VALUE_ARGUMENTS
8+
SOURCES
9+
LINK_LIBRARIES
10+
)
11+
cmake_parse_arguments("ARG" "" "${ONE_VALUE_ARGUMENTS}" "${MULTI_VALUE_ARGUMENTS}" ${ARGN})
12+
13+
string(TOLOWER ${ARG_NAME} NAME_TOLOWER)
14+
set(MODULE_NAME "_zivid${NAME_TOLOWER}")
15+
16+
if(${ARG_TYPE} STREQUAL "MODULE")
17+
set(ABI_OPTION "WITH_SOABI")
18+
endif()
19+
20+
set(TEMPLATES_DIR "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../src/templates")
21+
22+
# gersemi: off
23+
configure_file( # NOLINT
24+
"${TEMPLATES_DIR}/Wrapper.h.in"
25+
"${CMAKE_CURRENT_BINARY_DIR}/include/ZividPython/${ARG_NAME}Wrapper.h"
26+
@ONLY
27+
)
28+
# gersemi: on
29+
30+
pybind11_add_module(
31+
${MODULE_NAME}
32+
${ARG_TYPE}
33+
${ABI_OPTION}
34+
${ARG_SOURCES}
35+
# NO_EXTRAS: prevents pybind11 from adding certain linker options that caused issues with some
36+
# compilers
37+
NO_EXTRAS
38+
)
39+
40+
add_library("ZividPython::${ARG_NAME}" ALIAS ${MODULE_NAME})
41+
42+
target_link_libraries(${MODULE_NAME} PRIVATE ${ARG_LINK_LIBRARIES})
43+
44+
# Workaround for:
45+
# https://gitlab.kitware.com/cmake/cmake/-/issues/21676.
46+
set_target_properties(
47+
${MODULE_NAME}
48+
PROPERTIES
49+
DEBUG_POSTFIX
50+
""
51+
)
52+
53+
target_include_directories(
54+
${MODULE_NAME}
55+
PUBLIC
56+
include
57+
${CMAKE_CURRENT_BINARY_DIR}/include/
58+
)
59+
60+
# gersemi: off
61+
install( # NOLINT
62+
TARGETS ${MODULE_NAME}
63+
LIBRARY DESTINATION modules/_zivid
64+
RUNTIME DESTINATION modules/_zivid
65+
)
66+
# gersemi: on
67+
endfunction()
68+
69+
function(zivid_python_shared_library)
70+
_zivid_python_library(TYPE SHARED ${ARGN})
71+
endfunction()
72+
73+
function(zivid_python_module_library)
74+
_zivid_python_library(TYPE MODULE ${ARGN})
75+
endfunction()

continuous-integration/TestMatrix.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
| Operating System | Python version |
44
|:-----------------|:--------------------------------------|
5+
| Ubuntu 25.10 | 3.13 |
56
| Ubuntu 25.04 | 3.13 |
67
| Ubuntu 24.04 | 3.12 |
78
| Ubuntu 22.04 | 3.10 |
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.16.0
1+
2.17.0

continuous-integration/linux/platform-dependent/ubuntu/setup-opencl.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ function ubuntu_install_opencl_cpu_runtime {
1111
apt update || exit $?
1212

1313
# Install the OpenCL runtime
14-
# TODO: remove libxml2 once Intel sorts out its package dependencies
15-
apt --assume-yes install libxml2 intel-oneapi-runtime-opencl-2024 intel-oneapi-runtime-compilers-2024 || exit $?
14+
apt --assume-yes install intel-oneapi-runtime-opencl intel-oneapi-runtime-compilers || exit $?
1615

1716
}
1817

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"ZIVID_SDK_EXACT_VERSION": "2.16.0+46cdaba6-1"
2+
"ZIVID_SDK_EXACT_VERSION": "2.17.0+5fc9f05e-1"
33
}

0 commit comments

Comments
 (0)