Skip to content

Commit 911ae7c

Browse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents e7d5b0b + 5aa8c0f commit 911ae7c

File tree

9 files changed

+189
-138
lines changed

9 files changed

+189
-138
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
## Copyright 2021-2024 The Khronos Group
2+
## SPDX-License-Identifier: Apache-2.0
3+
4+
name: "Configure, build, and test ANARI-SDK"
5+
description: "Runs cmake to configure, build, and test the ANARI-SDK"
6+
inputs:
7+
workspace:
8+
description: "Main working directory"
9+
required: true
10+
config:
11+
description: "Build configuration"
12+
required: true
13+
os:
14+
description: "Operating system"
15+
required: true
16+
shell:
17+
description: "Native shell to use for job steps"
18+
required: true
19+
runs:
20+
using: "composite"
21+
steps:
22+
- name: Configure CMake
23+
shell: ${{ inputs.shell }}
24+
run: >
25+
cmake -LA -B ${{ inputs.workspace }}/build
26+
-DBUILD_CTS=${{ inputs.os != 'ubuntu-20.04' }}
27+
-DBUILD_EXAMPLES=ON
28+
-DBUILD_HDANARI=OFF
29+
-DBUILD_HELIDE_DEVICE=ON
30+
-DBUILD_REMOTE_DEVICE=${{ inputs.os == 'ubuntu-20.04' }}
31+
-DBUILD_TESTING=ON
32+
-DBUILD_VIEWER=OFF
33+
-DCMAKE_BUILD_TYPE=${{ inputs.config }}
34+
-DCMAKE_INSTALL_PREFIX=${{ inputs.workspace }}/build/install
35+
-DCTS_ENABLE_GLTF=OFF
36+
-DINSTALL_CTS=ON
37+
38+
- name: Build
39+
shell: ${{ inputs.shell }}
40+
run: cmake --build ${{ inputs.workspace }}/build --config ${{ inputs.config }} --target install
41+
42+
- name: Unit Tests
43+
shell: ${{ inputs.shell }}
44+
working-directory: ${{ inputs.workspace }}/build
45+
run: ctest -R unit_test -C ${{ inputs.config }}
46+
47+
- name: Render Tests
48+
shell: ${{ inputs.shell }}
49+
working-directory: ${{ inputs.workspace }}/build
50+
run: ctest -R render_test -C ${{ inputs.config }}
51+
52+
- name: Tutorial Tests
53+
shell: ${{ inputs.shell }}
54+
working-directory: ${{ inputs.workspace }}/build
55+
run: ctest -R anariTutorial -C ${{ inputs.config }}

.github/workflows/anari_sdk_ci.yml

Lines changed: 64 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## Copyright 2021-2024 The Khronos Group
2+
## SPDX-License-Identifier: Apache-2.0
3+
14
name: ANARI-SDK CI
25

36
on:
@@ -10,85 +13,79 @@ env:
1013
ANARI_LIBRARY: helide
1114

1215
jobs:
13-
build:
16+
build-linux:
1417
runs-on: ${{ matrix.os }}
1518
strategy:
1619
matrix:
17-
os: [ubuntu-latest, windows-latest]
20+
os: [ubuntu-20.04, ubuntu-22.04, ubuntu-24.04]
1821
config: [Release, Debug]
19-
22+
exclude:
23+
- os: ubuntu-20.04
24+
config: Debug
2025
steps:
21-
- uses: actions/checkout@v3
22-
2326
- name: Install Packages
24-
if: ${{ matrix.os == 'ubuntu-latest' }}
25-
run: sudo apt install -y libboost-system-dev
26-
27-
- name: Configure CMake
28-
run: >
29-
cmake -LA -B ${{ github.workspace }}/build
30-
-DCMAKE_BUILD_TYPE=${{ matrix.config }}
31-
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/build/install
32-
-DBUILD_SHARED_LIBS=ON
33-
-DBUILD_CTS=ON
34-
-DBUILD_EXAMPLES=ON
35-
-DBUILD_HDANARI=OFF
36-
-DBUILD_HELIDE_DEVICE=ON
37-
-DBUILD_REMOTE_DEVICE=${{ matrix.os == 'ubuntu-latest' }}
38-
-DBUILD_TESTING=ON
39-
-DBUILD_VIEWER=OFF
40-
41-
- name: Build
42-
run: cmake --build ${{github.workspace}}/build --config ${{ matrix.config }} --target install
43-
44-
- name: Unit Tests
45-
working-directory: ${{ github.workspace }}/build
46-
run: ctest -R unit_test -C ${{ matrix.config }}
47-
48-
- name: Render Tests
49-
working-directory: ${{github.workspace}}/build
50-
run: ctest -R render_test -C ${{ matrix.config }}
51-
52-
- name: Tutorial Tests
53-
working-directory: ${{github.workspace}}/build
54-
run: ctest -R anariTutorial -C ${{ matrix.config }}
27+
if: ${{ matrix.os == 'ubuntu-20.04' }}
28+
run: sudo apt install -y libboost-system-dev libpython3-dev
29+
- name: Check out code
30+
uses: actions/checkout@v4
31+
- name: Build and test
32+
uses: ./.github/actions/configure_and_build
33+
with:
34+
workspace: ${{ github.workspace }}
35+
config: ${{ matrix.config }}
36+
os: ${{ matrix.os }}
37+
shell: bash
38+
- name: Upload install
39+
if: ${{ matrix.config == 'Release' && matrix.os == 'ubuntu-20.04' }}
40+
uses: actions/upload-artifact@v4
41+
with:
42+
name: ANARI-SDK_ubuntu-20.04
43+
path: ${{ github.workspace }}/build/install
44+
45+
build-windows:
46+
runs-on: ${{ matrix.os }}
47+
strategy:
48+
matrix:
49+
os: [windows-latest]
50+
config: [Release, Debug]
51+
steps:
52+
- name: Check out code
53+
uses: actions/checkout@v4
54+
- name: Build and test
55+
uses: ./.github/actions/configure_and_build
56+
with:
57+
workspace: ${{ github.workspace }}
58+
config: ${{ matrix.config }}
59+
os: ${{ matrix.os }}
60+
shell: pwsh
61+
- name: Upload install
62+
if: ${{ matrix.config == 'Release' }}
63+
uses: actions/upload-artifact@v4
64+
with:
65+
name: ANARI-SDK_windows
66+
path: ${{ github.workspace }}/build/install
5567

5668
build-macos:
5769
# iOS is 10x expensive to run on GitHub machines, so only run if we know something else passed as well
58-
needs: build
70+
needs: [build-linux, build-windows]
5971
runs-on: ${{ matrix.os }}
6072
strategy:
6173
matrix:
6274
os: [macos-latest]
6375
config: [Release]
64-
6576
steps:
66-
- uses: actions/checkout@v3
67-
68-
- name: Configure CMake
69-
run: >
70-
cmake -LA -B ${{ github.workspace }}/build
71-
-DCMAKE_BUILD_TYPE=${{ matrix.config }}
72-
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/build/install
73-
-DBUILD_SHARED_LIBS=ON
74-
-DBUILD_EXAMPLES=ON
75-
-DBUILD_HDANARI=OFF
76-
-DBUILD_HELIDE_DEVICE=ON
77-
-DBUILD_REMOTE_DEVICE=OFF
78-
-DBUILD_TESTING=ON
79-
-DBUILD_VIEWER=OFF
80-
81-
- name: Build
82-
run: cmake --build ${{ github.workspace }}/build --config ${{ matrix.config }} --target install
83-
84-
- name: Unit Tests
85-
working-directory: ${{ github.workspace }}/build
86-
run: ctest -R unit_test -C ${{ matrix.config }}
87-
88-
- name: Render Tests
89-
working-directory: ${{ github.workspace }}/build
90-
run: ctest -R render_test -C ${{ matrix.config }}
91-
92-
- name: Tutorial Tests
93-
working-directory: ${{ github.workspace }}/build
94-
run: ctest -R anariTutorial -C ${{ matrix.config }}
77+
- name: Check out code
78+
uses: actions/checkout@v4
79+
- name: Build and test
80+
uses: ./.github/actions/configure_and_build
81+
with:
82+
workspace: ${{ github.workspace }}
83+
config: ${{ matrix.config }}
84+
os: ${{ matrix.os }}
85+
shell: bash
86+
- name: Upload install
87+
if: ${{ matrix.config == 'Release' }}
88+
uses: actions/upload-artifact@v4
89+
with:
90+
name: ANARI-SDK_macos
91+
path: ${{ github.workspace }}/build/install

CMakeLists.txt

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake)
3030

3131
set(ANARI_SDK_VERSION_MAJOR 0)
3232
set(ANARI_SDK_VERSION_MINOR 12)
33-
set(ANARI_SDK_VERSION_PATCH 0)
33+
set(ANARI_SDK_VERSION_PATCH 1)
3434
set(ANARI_SDK_VERSION
3535
${ANARI_SDK_VERSION_MAJOR}.${ANARI_SDK_VERSION_MINOR}.${ANARI_SDK_VERSION_PATCH}
3636
)
@@ -54,31 +54,26 @@ elseif(UNIX)
5454
list(APPEND CMAKE_INSTALL_RPATH "$ORIGIN/../${CMAKE_INSTALL_LIBDIR}")
5555
endif()
5656

57-
# Built-in CMake options
58-
option(BUILD_SHARED_LIBS "Build shared libraries instead of static" ON)
57+
## Built-in CMake options ##
58+
5959
option(BUILD_TESTING "Build tests for CTest" ON)
60-
# ANARI specific options
60+
option(BUILD_SHARED_LIBS "Build shared libraries instead of static" ON)
61+
62+
## ANARI specific options ##
6163

6264
option(BUILD_CTS "Build cts toolkit" OFF)
6365
cmake_dependent_option(CTS_ENABLE_GLTF "Enable glTF support for cts" ON "BUILD_CTS" OFF)
6466
option(USE_DRACO "Use draco when loading glTF files" OFF)
6567
option(USE_WEBP "Use webp when loading glTF files" OFF)
6668
option(USE_KTX "Use ktx when loading glTF files" OFF)
67-
68-
if (CTS_ENABLE_GLTF)
69-
# To enforce WEBP, KTX and DRACO support (CI does not have these dependecies)
70-
# set(USE_KTX ON)
71-
# set(USE_WEBP ON)
72-
# set(USE_DRACO ON)
73-
endif()
74-
7569
option(BUILD_EXAMPLES "Build example applications and example device" ON)
7670
cmake_dependent_option(BUILD_VIEWER
7771
"Build interactive viewer app (requires GLFW)"
7872
OFF
7973
"BUILD_EXAMPLES"
8074
OFF
8175
)
76+
option(INSTALL_CTS "Install CTS scripts and data" OFF)
8277
option(INSTALL_VIEWER_LIBRARY "Install anari::anari_viewer library target" ON)
8378
option(INSTALL_VIEWER "Install anariViewer app" OFF)
8479
mark_as_advanced(INSTALL_VIEWER)
@@ -88,19 +83,14 @@ cmake_dependent_option(VIEWER_ENABLE_GLTF
8883
"BUILD_VIEWER"
8984
OFF
9085
)
91-
if (VIEWER_ENABLE_GLTF)
92-
# To enforce WEBP and DRACO support (CI does not have these dependecies)
93-
# set(USE_WEBP ON)
94-
# set(USE_DRACO ON)
95-
endif()
9686
cmake_dependent_option(VIEWER_ENABLE_KTX
9787
"Enable KTX support in viewer"
9888
OFF
9989
"BUILD_VIEWER"
10090
OFF
10191
)
10292
if (VIEWER_ENABLE_KTX)
103-
set(USE_KTX ON)
93+
set(USE_KTX ON)
10494
endif()
10595

10696
## The generate_all targets collects all offline code generation targets

cmake/anari_generate_codegen.cmake

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ function(anari_generate_queries)
66
return()
77
endif()
88

9+
find_package(Python3 REQUIRED COMPONENTS Interpreter)
10+
911
cmake_parse_arguments(
1012
# prefix
1113
"GENERATE"
@@ -21,12 +23,6 @@ function(anari_generate_queries)
2123

2224
file(GLOB_RECURSE CORE_JSONS ${ANARI_CODE_GEN_ROOT}/api/*.json)
2325

24-
find_package(Python3 OPTIONAL_COMPONENTS Interpreter)
25-
if (NOT TARGET Python3::Interpreter)
26-
message(WARNING "Unable to find python interpreter, skipping code-gen targets")
27-
return()
28-
endif()
29-
3026
if (NOT DEFINED GENERATE_DEVICE_TARGET)
3127
message(FATAL_ERROR "DEVICE_TARGET option required for anari_generate_queries()")
3228
endif()

code_gen/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ if(CMAKE_VERSION VERSION_LESS "3.12")
2424
return()
2525
endif()
2626

27-
find_package(Python3 OPTIONAL_COMPONENTS Interpreter Development.Module)
28-
2927
if (NOT TARGET Python3::Interpreter)
3028
message(WARNING "Unable to find python interpreter, skipping code-gen + API bindings")
3129
return()
@@ -71,6 +69,7 @@ add_custom_target(generate_headers DEPENDS
7169

7270
add_dependencies(generate_all generate_headers)
7371

72+
find_package(Python3 QUIET COMPONENTS Interpreter Development.Module)
7473
if (NOT TARGET Python3::Module)
7574
message(WARNING "Unable to find python Module, skipping python bindings")
7675
return()

0 commit comments

Comments
 (0)