Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffamstutz committed Jan 14, 2025
2 parents e7d5b0b + 5aa8c0f commit 911ae7c
Show file tree
Hide file tree
Showing 9 changed files with 189 additions and 138 deletions.
55 changes: 55 additions & 0 deletions .github/actions/configure_and_build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
## Copyright 2021-2024 The Khronos Group
## SPDX-License-Identifier: Apache-2.0

name: "Configure, build, and test ANARI-SDK"
description: "Runs cmake to configure, build, and test the ANARI-SDK"
inputs:
workspace:
description: "Main working directory"
required: true
config:
description: "Build configuration"
required: true
os:
description: "Operating system"
required: true
shell:
description: "Native shell to use for job steps"
required: true
runs:
using: "composite"
steps:
- name: Configure CMake
shell: ${{ inputs.shell }}
run: >
cmake -LA -B ${{ inputs.workspace }}/build
-DBUILD_CTS=${{ inputs.os != 'ubuntu-20.04' }}
-DBUILD_EXAMPLES=ON
-DBUILD_HDANARI=OFF
-DBUILD_HELIDE_DEVICE=ON
-DBUILD_REMOTE_DEVICE=${{ inputs.os == 'ubuntu-20.04' }}
-DBUILD_TESTING=ON
-DBUILD_VIEWER=OFF
-DCMAKE_BUILD_TYPE=${{ inputs.config }}
-DCMAKE_INSTALL_PREFIX=${{ inputs.workspace }}/build/install
-DCTS_ENABLE_GLTF=OFF
-DINSTALL_CTS=ON
- name: Build
shell: ${{ inputs.shell }}
run: cmake --build ${{ inputs.workspace }}/build --config ${{ inputs.config }} --target install

- name: Unit Tests
shell: ${{ inputs.shell }}
working-directory: ${{ inputs.workspace }}/build
run: ctest -R unit_test -C ${{ inputs.config }}

- name: Render Tests
shell: ${{ inputs.shell }}
working-directory: ${{ inputs.workspace }}/build
run: ctest -R render_test -C ${{ inputs.config }}

- name: Tutorial Tests
shell: ${{ inputs.shell }}
working-directory: ${{ inputs.workspace }}/build
run: ctest -R anariTutorial -C ${{ inputs.config }}
131 changes: 64 additions & 67 deletions .github/workflows/anari_sdk_ci.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## Copyright 2021-2024 The Khronos Group
## SPDX-License-Identifier: Apache-2.0

name: ANARI-SDK CI

on:
Expand All @@ -10,85 +13,79 @@ env:
ANARI_LIBRARY: helide

jobs:
build:
build-linux:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
os: [ubuntu-20.04, ubuntu-22.04, ubuntu-24.04]
config: [Release, Debug]

exclude:
- os: ubuntu-20.04
config: Debug
steps:
- uses: actions/checkout@v3

- name: Install Packages
if: ${{ matrix.os == 'ubuntu-latest' }}
run: sudo apt install -y libboost-system-dev

- name: Configure CMake
run: >
cmake -LA -B ${{ github.workspace }}/build
-DCMAKE_BUILD_TYPE=${{ matrix.config }}
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/build/install
-DBUILD_SHARED_LIBS=ON
-DBUILD_CTS=ON
-DBUILD_EXAMPLES=ON
-DBUILD_HDANARI=OFF
-DBUILD_HELIDE_DEVICE=ON
-DBUILD_REMOTE_DEVICE=${{ matrix.os == 'ubuntu-latest' }}
-DBUILD_TESTING=ON
-DBUILD_VIEWER=OFF
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{ matrix.config }} --target install

- name: Unit Tests
working-directory: ${{ github.workspace }}/build
run: ctest -R unit_test -C ${{ matrix.config }}

- name: Render Tests
working-directory: ${{github.workspace}}/build
run: ctest -R render_test -C ${{ matrix.config }}

- name: Tutorial Tests
working-directory: ${{github.workspace}}/build
run: ctest -R anariTutorial -C ${{ matrix.config }}
if: ${{ matrix.os == 'ubuntu-20.04' }}
run: sudo apt install -y libboost-system-dev libpython3-dev
- name: Check out code
uses: actions/checkout@v4
- name: Build and test
uses: ./.github/actions/configure_and_build
with:
workspace: ${{ github.workspace }}
config: ${{ matrix.config }}
os: ${{ matrix.os }}
shell: bash
- name: Upload install
if: ${{ matrix.config == 'Release' && matrix.os == 'ubuntu-20.04' }}
uses: actions/upload-artifact@v4
with:
name: ANARI-SDK_ubuntu-20.04
path: ${{ github.workspace }}/build/install

build-windows:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest]
config: [Release, Debug]
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Build and test
uses: ./.github/actions/configure_and_build
with:
workspace: ${{ github.workspace }}
config: ${{ matrix.config }}
os: ${{ matrix.os }}
shell: pwsh
- name: Upload install
if: ${{ matrix.config == 'Release' }}
uses: actions/upload-artifact@v4
with:
name: ANARI-SDK_windows
path: ${{ github.workspace }}/build/install

build-macos:
# iOS is 10x expensive to run on GitHub machines, so only run if we know something else passed as well
needs: build
needs: [build-linux, build-windows]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest]
config: [Release]

steps:
- uses: actions/checkout@v3

- name: Configure CMake
run: >
cmake -LA -B ${{ github.workspace }}/build
-DCMAKE_BUILD_TYPE=${{ matrix.config }}
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/build/install
-DBUILD_SHARED_LIBS=ON
-DBUILD_EXAMPLES=ON
-DBUILD_HDANARI=OFF
-DBUILD_HELIDE_DEVICE=ON
-DBUILD_REMOTE_DEVICE=OFF
-DBUILD_TESTING=ON
-DBUILD_VIEWER=OFF
- name: Build
run: cmake --build ${{ github.workspace }}/build --config ${{ matrix.config }} --target install

- name: Unit Tests
working-directory: ${{ github.workspace }}/build
run: ctest -R unit_test -C ${{ matrix.config }}

- name: Render Tests
working-directory: ${{ github.workspace }}/build
run: ctest -R render_test -C ${{ matrix.config }}

- name: Tutorial Tests
working-directory: ${{ github.workspace }}/build
run: ctest -R anariTutorial -C ${{ matrix.config }}
- name: Check out code
uses: actions/checkout@v4
- name: Build and test
uses: ./.github/actions/configure_and_build
with:
workspace: ${{ github.workspace }}
config: ${{ matrix.config }}
os: ${{ matrix.os }}
shell: bash
- name: Upload install
if: ${{ matrix.config == 'Release' }}
uses: actions/upload-artifact@v4
with:
name: ANARI-SDK_macos
path: ${{ github.workspace }}/build/install
26 changes: 8 additions & 18 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake)

set(ANARI_SDK_VERSION_MAJOR 0)
set(ANARI_SDK_VERSION_MINOR 12)
set(ANARI_SDK_VERSION_PATCH 0)
set(ANARI_SDK_VERSION_PATCH 1)
set(ANARI_SDK_VERSION
${ANARI_SDK_VERSION_MAJOR}.${ANARI_SDK_VERSION_MINOR}.${ANARI_SDK_VERSION_PATCH}
)
Expand All @@ -54,31 +54,26 @@ elseif(UNIX)
list(APPEND CMAKE_INSTALL_RPATH "$ORIGIN/../${CMAKE_INSTALL_LIBDIR}")
endif()

# Built-in CMake options
option(BUILD_SHARED_LIBS "Build shared libraries instead of static" ON)
## Built-in CMake options ##

option(BUILD_TESTING "Build tests for CTest" ON)
# ANARI specific options
option(BUILD_SHARED_LIBS "Build shared libraries instead of static" ON)

## ANARI specific options ##

option(BUILD_CTS "Build cts toolkit" OFF)
cmake_dependent_option(CTS_ENABLE_GLTF "Enable glTF support for cts" ON "BUILD_CTS" OFF)
option(USE_DRACO "Use draco when loading glTF files" OFF)
option(USE_WEBP "Use webp when loading glTF files" OFF)
option(USE_KTX "Use ktx when loading glTF files" OFF)

if (CTS_ENABLE_GLTF)
# To enforce WEBP, KTX and DRACO support (CI does not have these dependecies)
# set(USE_KTX ON)
# set(USE_WEBP ON)
# set(USE_DRACO ON)
endif()

option(BUILD_EXAMPLES "Build example applications and example device" ON)
cmake_dependent_option(BUILD_VIEWER
"Build interactive viewer app (requires GLFW)"
OFF
"BUILD_EXAMPLES"
OFF
)
option(INSTALL_CTS "Install CTS scripts and data" OFF)
option(INSTALL_VIEWER_LIBRARY "Install anari::anari_viewer library target" ON)
option(INSTALL_VIEWER "Install anariViewer app" OFF)
mark_as_advanced(INSTALL_VIEWER)
Expand All @@ -88,19 +83,14 @@ cmake_dependent_option(VIEWER_ENABLE_GLTF
"BUILD_VIEWER"
OFF
)
if (VIEWER_ENABLE_GLTF)
# To enforce WEBP and DRACO support (CI does not have these dependecies)
# set(USE_WEBP ON)
# set(USE_DRACO ON)
endif()
cmake_dependent_option(VIEWER_ENABLE_KTX
"Enable KTX support in viewer"
OFF
"BUILD_VIEWER"
OFF
)
if (VIEWER_ENABLE_KTX)
set(USE_KTX ON)
set(USE_KTX ON)
endif()

## The generate_all targets collects all offline code generation targets
Expand Down
8 changes: 2 additions & 6 deletions cmake/anari_generate_codegen.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ function(anari_generate_queries)
return()
endif()

find_package(Python3 REQUIRED COMPONENTS Interpreter)

cmake_parse_arguments(
# prefix
"GENERATE"
Expand All @@ -21,12 +23,6 @@ function(anari_generate_queries)

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

find_package(Python3 OPTIONAL_COMPONENTS Interpreter)
if (NOT TARGET Python3::Interpreter)
message(WARNING "Unable to find python interpreter, skipping code-gen targets")
return()
endif()

if (NOT DEFINED GENERATE_DEVICE_TARGET)
message(FATAL_ERROR "DEVICE_TARGET option required for anari_generate_queries()")
endif()
Expand Down
3 changes: 1 addition & 2 deletions code_gen/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ if(CMAKE_VERSION VERSION_LESS "3.12")
return()
endif()

find_package(Python3 OPTIONAL_COMPONENTS Interpreter Development.Module)

if (NOT TARGET Python3::Interpreter)
message(WARNING "Unable to find python interpreter, skipping code-gen + API bindings")
return()
Expand Down Expand Up @@ -71,6 +69,7 @@ add_custom_target(generate_headers DEPENDS

add_dependencies(generate_all generate_headers)

find_package(Python3 QUIET COMPONENTS Interpreter Development.Module)
if (NOT TARGET Python3::Module)
message(WARNING "Unable to find python Module, skipping python bindings")
return()
Expand Down
Loading

0 comments on commit 911ae7c

Please sign in to comment.