Compare commits
13
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1ba16f0533 | ||
|
|
89873d2bd2 | ||
|
|
4ce5a653af | ||
|
|
775e223aea | ||
|
|
9ccee4ca3a | ||
|
|
2389858b9a | ||
|
|
3584dae42d | ||
|
|
e77e2fe6fd | ||
|
|
37c3468929 | ||
|
|
2631955e0d | ||
|
|
7c654c7344 | ||
|
|
08a1d63bca | ||
|
|
ba17e5aed8 |
+122
-88
@@ -9,12 +9,9 @@ on:
|
||||
- 'pr/**'
|
||||
paths-ignore:
|
||||
- 'CHANGES'
|
||||
- 'CODEOWNERS'
|
||||
- 'doc/**'
|
||||
- 'nanovdb/**'
|
||||
- 'openvdb_maya/**'
|
||||
- 'openvdb_houdini/**'
|
||||
- 'fvdb/**'
|
||||
- 'pendingchanges/**'
|
||||
- '**.md'
|
||||
pull_request:
|
||||
@@ -22,14 +19,14 @@ on:
|
||||
- '**'
|
||||
paths-ignore:
|
||||
- 'CHANGES'
|
||||
- 'CODEOWNERS'
|
||||
- 'doc/**'
|
||||
- 'nanovdb/**'
|
||||
- 'openvdb_maya/**'
|
||||
- 'openvdb_houdini/**'
|
||||
- 'fvdb/**'
|
||||
- 'pendingchanges/**'
|
||||
- '**.md'
|
||||
schedule:
|
||||
# run this workflow every midnight Tuesday
|
||||
- cron: '0 0 * * 2'
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
type:
|
||||
@@ -37,117 +34,154 @@ on:
|
||||
required: true
|
||||
default: 'all'
|
||||
|
||||
# Allow subsequent pushes to the same PR or REF to cancel any previous jobs.
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
jobs:
|
||||
linux-ax:
|
||||
linux-ax-vfx:
|
||||
# VFX platform builds for OpenVDB AX
|
||||
if: |
|
||||
github.event_name != 'workflow_dispatch' ||
|
||||
github.event.inputs.type == 'all' ||
|
||||
github.event.inputs.type == 'linux'
|
||||
runs-on: ${{ (github.repository_owner == 'AcademySoftwareFoundation' && 'ubuntu-22.04-8c-32g-300h') || 'ubuntu-latest' }}
|
||||
runs-on: ubuntu-latest
|
||||
name: >
|
||||
linux-ax:${{ matrix.config.image }}-cxx:${{ matrix.config.cxx }}-${{ matrix.config.build }}
|
||||
linux-ax-vfx:${{ matrix.image }}-
|
||||
cxx:${{ matrix.compiler }}-
|
||||
${{ matrix.build }}
|
||||
container:
|
||||
image: aswf/ci-openvdb:${{ matrix.config.image }}
|
||||
image: aswf/ci-openvdb:${{ matrix.image }}
|
||||
env:
|
||||
CXX: ${{ matrix.config.cxx }}
|
||||
CCACHE_DIR: /tmp/ccache
|
||||
CXX: ${{ matrix.compiler }}
|
||||
strategy:
|
||||
matrix:
|
||||
# Only test unified builds (core+ax). weekly CI should test standalone
|
||||
config:
|
||||
- { image: '2026', cxx: 'clang++', build: 'Release', cmake: '' }
|
||||
- { image: '2026', cxx: 'g++', build: 'Release', cmake: '' }
|
||||
- { image: '2026', cxx: 'clang++', build: 'Debug', cmake: '' }
|
||||
- { image: '2025-clang19.1', cxx: 'clang++', build: 'Release', cmake: '' }
|
||||
- { image: '2024-clang16.2', cxx: 'clang++', build: 'Release', cmake: '' }
|
||||
# Needed to test LLVM 15.X
|
||||
- { image: '2023-clang15', cxx: 'clang++', build: 'Release', cmake: '-DDISABLE_DEPENDENCY_VERSION_CHECKS=ON' }
|
||||
image: ['2019-clang8', '2020-clang7', '2021-clang10']
|
||||
compiler: ['clang++']
|
||||
build: ['Release']
|
||||
j: [2]
|
||||
# Extra builds
|
||||
include:
|
||||
- image: '2020-clang7'
|
||||
compiler: 'clang++'
|
||||
build: 'Debug'
|
||||
j: 2
|
||||
- image: '2020-clang7'
|
||||
compiler: 'g++'
|
||||
build: 'Release'
|
||||
# disable parallel builds when using GCC due to memory limits
|
||||
j: 1
|
||||
- image: '2019-clang8'
|
||||
compiler: 'g++'
|
||||
build: 'Release'
|
||||
# disable parallel builds when using GCC due to memory limits
|
||||
j: 1
|
||||
- image: '2021-clang10'
|
||||
compiler: 'g++'
|
||||
build: 'Release'
|
||||
# disable parallel builds when using GCC due to memory limits
|
||||
j: 1
|
||||
fail-fast: false
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: nanobind
|
||||
run: ./ci/install_nanobind.sh 2.5.0
|
||||
# 2026 images are broken with gtest/glfw installs
|
||||
- name: deps
|
||||
if: contains(matrix.config.image, '2026')
|
||||
run: ./ci/install_gtest.sh latest
|
||||
- name: timestamp
|
||||
id: timestamp
|
||||
run: echo "timestamp=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT
|
||||
- name: ccache
|
||||
# don't use ccache for debug builds
|
||||
if: matrix.config.build == 'Release'
|
||||
id: ccache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: /tmp/ccache
|
||||
key: linux-ax${{ matrix.config.image }}-${{ matrix.config.cxx }}-${{ steps.timestamp.outputs.timestamp }}
|
||||
restore-keys: linux-ax${{ matrix.config.image }}-${{ matrix.config.cxx }}-
|
||||
- uses: actions/checkout@v2
|
||||
- name: build
|
||||
run: >
|
||||
./ci/build.sh -v
|
||||
--build-type=${{ matrix.config.build }}
|
||||
--components='core,python,axcore,axbin,axtest'
|
||||
--cargs=\"
|
||||
${{ matrix.config.cmake }}
|
||||
-DOPENVDB_AX_TEST_CMD_DOWNLOADS=ON
|
||||
-DUSE_EXPLICIT_INSTANTIATION=OFF
|
||||
\"
|
||||
-j ${{ matrix.j }}
|
||||
--build-type=${{ matrix.build }}
|
||||
--components="core,axcore,axbin,axtest"
|
||||
--cargs="-DOPENVDB_CXX_STRICT=ON"
|
||||
- name: test
|
||||
run: cd build && ctest -V
|
||||
- name: test_doxygen_examples
|
||||
run: ./ci/extract_test_examples.sh
|
||||
# Keep ccache light by stripping out any caches not accessed in the last day
|
||||
- name: ccache_clean
|
||||
if: matrix.config.build == 'Release'
|
||||
run: ccache --evict-older-than 1d
|
||||
|
||||
macos-ax:
|
||||
linux-ax-standalone-vfx:
|
||||
# VFX platform builds for OpenVDB AX against an existing VDB installation
|
||||
if: |
|
||||
github.event_name != 'workflow_dispatch' ||
|
||||
github.event.inputs.type == 'all' ||
|
||||
github.event.inputs.type == 'linux'
|
||||
runs-on: ubuntu-latest
|
||||
name: >
|
||||
linux-ax-standalone-vfx:${{ matrix.image }}-
|
||||
cxx:${{ matrix.compiler }}-
|
||||
llvm:${{ matrix.llvm }}-
|
||||
${{ matrix.build }}
|
||||
container:
|
||||
image: aswf/ci-openvdb:${{ matrix.image }}
|
||||
env:
|
||||
CXX: ${{ matrix.compiler }}
|
||||
strategy:
|
||||
matrix:
|
||||
image: ['2019-clang6', '2019-clang7', '2019-clang8', '2019-clang9', '2020-clang7', '2021-clang10']
|
||||
compiler: ['clang++']
|
||||
build: ['Release']
|
||||
j: [2]
|
||||
# Extra builds
|
||||
include:
|
||||
- image: '2020-clang7'
|
||||
compiler: 'g++'
|
||||
build: 'Release'
|
||||
# disable parallel builds when using GCC due to memory limits
|
||||
j: 1
|
||||
- image: '2020-clang7'
|
||||
compiler: 'clang++'
|
||||
build: 'Debug'
|
||||
j: 2
|
||||
fail-fast: false
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: vdb
|
||||
run: >
|
||||
./ci/build.sh -v
|
||||
-j ${{ matrix.j }}
|
||||
--build-type=${{ matrix.build }}
|
||||
--components="core"
|
||||
--cargs="-DOPENVDB_CXX_STRICT=ON"
|
||||
- name: clean
|
||||
run: rm -rf build
|
||||
- name: build
|
||||
run: >
|
||||
./ci/build.sh -v
|
||||
-j ${{ matrix.j }}
|
||||
--build-type=${{ matrix.build }}
|
||||
--components="axcore,axbin,axtest"
|
||||
--cargs="-DOPENVDB_CXX_STRICT=ON"
|
||||
- name: test
|
||||
run: cd build && ctest -V
|
||||
- name: test_doxygen_examples
|
||||
run: ./ci/extract_test_examples.sh
|
||||
|
||||
macos-core:
|
||||
if: |
|
||||
github.event_name != 'workflow_dispatch' ||
|
||||
github.event.inputs.type == 'all' ||
|
||||
github.event.inputs.type == 'mac'
|
||||
runs-on: ${{ matrix.config.runner }}
|
||||
name: macos-cxx:${{ matrix.config.cxx }}-llvm:${{ matrix.config.llvm }}-${{ matrix.config.build }}
|
||||
runs-on: macos-10.15
|
||||
name: macos-cxx:${{ matrix.compiler }}-llvm:${{ matrix.llvm }}-${{ matrix.build }}
|
||||
env:
|
||||
CXX: ${{ matrix.config.cxx }}
|
||||
CXX: ${{ matrix.compiler }}
|
||||
strategy:
|
||||
matrix:
|
||||
config:
|
||||
- { runner: 'macos-15', cxx: 'clang++', build: 'Release', llvm: '21' }
|
||||
- { runner: 'macos-14', cxx: 'clang++', build: 'Release', llvm: '21' }
|
||||
- { runner: 'macos-14', cxx: 'clang++', build: 'Release', llvm: '20' }
|
||||
- { runner: 'macos-14', cxx: 'clang++', build: 'Release', llvm: '19' }
|
||||
- { runner: 'macos-14', cxx: 'clang++', build: 'Release', llvm: '18' }
|
||||
- { runner: 'macos-14', cxx: 'clang++', build: 'Release', llvm: '17' }
|
||||
- { runner: 'macos-14', cxx: 'clang++', build: 'Release', llvm: '16' }
|
||||
compiler: ['clang++']
|
||||
build: ['Release']
|
||||
llvm: ['7','8','9','11','12'] #@note llvm10 never got its own brew formula...
|
||||
# Extra builds
|
||||
include:
|
||||
- compiler: 'g++'
|
||||
build: 'Release'
|
||||
llvm: '8'
|
||||
- compiler: 'clang++'
|
||||
build: 'Debug'
|
||||
llvm: '8'
|
||||
fail-fast: false
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v2
|
||||
- name: install_deps
|
||||
run: |
|
||||
./ci/install_macos.sh ${{ matrix.config.llvm }}
|
||||
./ci/install_tbb_macos.sh
|
||||
run: ./ci/install_macos_ax.sh ${{ matrix.llvm }}
|
||||
- name: build
|
||||
run: >
|
||||
./ci/build.sh -v
|
||||
--build-type=${{ matrix.config.build }}
|
||||
--components="core,python,axcore,axbin,axtest"
|
||||
--cargs=\"
|
||||
-DOPENVDB_AX_TEST_CMD_DOWNLOADS=ON
|
||||
-DUSE_EXPLICIT_INSTANTIATION=OFF
|
||||
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/install
|
||||
-DLLVM_DIR=/opt/homebrew/opt/llvm@${{ matrix.config.llvm }}/lib/cmake/llvm
|
||||
\"
|
||||
--build-type=${{ matrix.build }}
|
||||
--components="core,axcore,axbin,axtest"
|
||||
--cargs="-DLLVM_DIR=/usr/local/opt/llvm@${{ matrix.llvm }}/lib/cmake/llvm"
|
||||
- name: test
|
||||
run: cd build && ctest -V
|
||||
- name: test_doxygen_examples
|
||||
@@ -157,15 +191,15 @@ jobs:
|
||||
if: |
|
||||
github.event_name == 'workflow_dispatch' &&
|
||||
github.event.inputs.type == 'grammar'
|
||||
runs-on: ${{ (github.repository_owner == 'AcademySoftwareFoundation' && 'ubuntu-22.04-8c-32g-300h') || 'ubuntu-latest' }}
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: aswf/ci-openvdb:2025-clang19.1
|
||||
image: aswf/ci-openvdb:2021-clang10
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v2
|
||||
- name: build
|
||||
run: ./ci/build.sh -v --components=axgr --target=openvdb_ax_grammar --cargs=\"-DOPENVDB_AX_GRAMMAR_NO_LINES=ON\"
|
||||
- name: upload grammar
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: ax_grammar
|
||||
path: ./build/openvdb_ax/openvdb_ax/openvdb_ax/grammar
|
||||
|
||||
+188
-111
@@ -9,31 +9,29 @@ on:
|
||||
- 'pr/**'
|
||||
paths-ignore:
|
||||
- 'CHANGES'
|
||||
- 'CODEOWNERS'
|
||||
- 'doc/**'
|
||||
- 'openvdb_maya/**'
|
||||
- 'openvdb_houdini/**'
|
||||
- 'openvdb_ax/**'
|
||||
- 'nanovdb/**'
|
||||
- 'fvdb/**'
|
||||
- 'pendingchanges/**'
|
||||
- '**.md'
|
||||
pull_request:
|
||||
# Add 'ready_for_review' to run CI when a draft PR is marked ready.
|
||||
types: [opened, synchronize, reopened, ready_for_review]
|
||||
branches:
|
||||
- '**'
|
||||
paths-ignore:
|
||||
- 'CHANGES'
|
||||
- 'CODEOWNERS'
|
||||
- 'doc/**'
|
||||
- 'openvdb_maya/**'
|
||||
- 'openvdb_houdini/**'
|
||||
- 'openvdb_ax/**'
|
||||
- 'nanovdb/**'
|
||||
- 'fvdb/**'
|
||||
- 'pendingchanges/**'
|
||||
- '**.md'
|
||||
schedule:
|
||||
# run this workflow every day at 7am UTC
|
||||
- cron: '0 7 * * *'
|
||||
# run this workflow every Monday 00:00 UTC
|
||||
# warning: This pattern is checked in various places below
|
||||
- cron: '0 0 * * 1'
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
type:
|
||||
@@ -41,159 +39,238 @@ on:
|
||||
required: true
|
||||
default: 'all'
|
||||
|
||||
# Allow subsequent pushes to the same PR or REF to cancel any previous jobs.
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
jobs:
|
||||
linux-vfx:
|
||||
# VFX platform jobs. These are run on the appropriate CentOS images from
|
||||
# the provided ASWF docker containers
|
||||
if: |
|
||||
(github.event_name == 'push' ||
|
||||
(github.event_name == 'pull_request' && github.event.pull_request.draft == false) ||
|
||||
(github.event_name == 'workflow_dispatch' &&
|
||||
(github.event.inputs.type == 'all' || github.event.inputs.type == 'linux')))
|
||||
runs-on: ${{ (github.repository_owner == 'AcademySoftwareFoundation' && 'ubuntu-22.04-8c-32g-300h') || 'ubuntu-latest' }}
|
||||
github.event_name != 'workflow_dispatch' ||
|
||||
github.event.inputs.type == 'all' ||
|
||||
github.event.inputs.type == 'linux'
|
||||
runs-on: ubuntu-latest
|
||||
name: >
|
||||
linux:${{ matrix.config.image }}-abi:${{ matrix.config.abi }}-cxx:${{ matrix.config.cxx }}-type:${{ matrix.config.build }}
|
||||
linux-vfx:${{ matrix.config.image }}-
|
||||
abi:${{ matrix.config.abi }}-
|
||||
cxx:${{ matrix.config.cxx }}-
|
||||
type:${{ matrix.config.build }}
|
||||
container:
|
||||
image: aswf/ci-openvdb:${{ matrix.config.image }}
|
||||
env:
|
||||
CXX: ${{ matrix.config.cxx }}
|
||||
CCACHE_DIR: /tmp/ccache
|
||||
strategy:
|
||||
matrix:
|
||||
config:
|
||||
- { cxx: clang++, image: '2026', abi: '13', build: 'Release', cmake: '-DOPENVDB_USE_FUTURE_ABI_13=ON -DOPENVDB_ENABLE_ASSERTS=ON' }
|
||||
- { cxx: g++, image: '2026', abi: '13', build: 'Release', cmake: '-DOPENVDB_USE_FUTURE_ABI_13=ON' }
|
||||
- { cxx: clang++, image: '2026', abi: '13', build: 'Debug', cmake: '-DOPENVDB_USE_FUTURE_ABI_13=ON' }
|
||||
- { cxx: clang++, image: '2025-clang19.1', abi: '12', build: 'Release', cmake: '' }
|
||||
- { cxx: clang++, image: '2024-clang17.2', abi: '11', build: 'Release', cmake: '-DDISABLE_DEPENDENCY_VERSION_CHECKS=ON' }
|
||||
- { cxx: clang++, image: '2019', abi: '6', build: 'Release' }
|
||||
- { cxx: clang++, image: '2020', abi: '7', build: 'Release' }
|
||||
- { cxx: clang++, image: '2021', abi: '8', build: 'Release' }
|
||||
- { cxx: clang++, image: '2021', abi: '9', build: 'Release' }
|
||||
- { cxx: clang++, image: '2021', abi: '8', build: 'Debug' }
|
||||
- { cxx: clang++, image: '2022-clang11', abi: '9', build: 'Release' }
|
||||
- { cxx: g++, image: '2020', abi: '7', build: 'Release' }
|
||||
- { cxx: g++, image: '2021', abi: '8', build: 'Release' }
|
||||
fail-fast: false
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: nanobind
|
||||
run: ./ci/install_nanobind.sh 2.5.0
|
||||
# 2026 images are broken with gtest/glfw installs
|
||||
- name: deps
|
||||
if: contains(matrix.config.image, '2026')
|
||||
run: |
|
||||
./ci/install_gtest.sh latest
|
||||
./ci/install_glfw.sh latest
|
||||
- name: timestamp
|
||||
id: timestamp
|
||||
run: echo "timestamp=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT
|
||||
- name: ccache
|
||||
# don't use ccache for debug builds
|
||||
if: matrix.config.build == 'Release'
|
||||
id: ccache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: /tmp/ccache
|
||||
key: linux-vfx${{ matrix.config.image }}-abi${{ matrix.config.abi }}-${{ matrix.config.cxx }}-${{ steps.timestamp.outputs.timestamp }}
|
||||
restore-keys: linux-vfx${{ matrix.config.image }}-abi${{ matrix.config.abi }}-${{ matrix.config.cxx }}-
|
||||
- uses: actions/checkout@v2
|
||||
- name: install_gtest
|
||||
run: ./ci/install_gtest.sh 1.8.0
|
||||
- name: build
|
||||
run: >
|
||||
./ci/build.sh -v
|
||||
--build-type=${{ matrix.config.build }}
|
||||
--components=\"core,python,bin,view,render,test\"
|
||||
--cargs=\"
|
||||
${{ matrix.config.cmake }}
|
||||
-DOPENVDB_CXX_STRICT=ON
|
||||
-DOPENVDB_ABI_VERSION_NUMBER=${{ matrix.config.abi }}
|
||||
\"
|
||||
--components=\"core,python,bin,test\"
|
||||
--cargs=\"-DOPENVDB_CXX_STRICT=ON -DOPENVDB_ABI_VERSION_NUMBER=${{ matrix.config.abi }}\"
|
||||
- name: test
|
||||
# Skip Debug on commits as they take a while.
|
||||
if: github.event_name == 'workflow_dispatch' || matrix.config.build == 'Release'
|
||||
# Always run tests on weekly builds but skip Debug on commits as they take a while.
|
||||
# https://github.community/t/distinct-job-for-each-schedule/17811/2
|
||||
if: contains(github.event.schedule, '0 0 * * 1') || matrix.config.build == 'Release'
|
||||
run: |
|
||||
cd build && ctest -V
|
||||
cd - && ./ci/test_install.sh
|
||||
# Keep ccache light by stripping out any caches not accessed in the last day
|
||||
- name: ccache_clean
|
||||
if: matrix.config.build == 'Release'
|
||||
run: ccache --evict-older-than 1d
|
||||
|
||||
windows:
|
||||
# Windows CI. Tests a dynamic build with MD.
|
||||
# Windows CI. Tests static and dynamic builds with MT and MD respectively.
|
||||
if: |
|
||||
(github.event_name == 'push' ||
|
||||
(github.event_name == 'pull_request' && github.event.pull_request.draft == false) ||
|
||||
(github.event_name == 'workflow_dispatch' &&
|
||||
(github.event.inputs.type == 'all' || github.event.inputs.type == 'win')))
|
||||
runs-on: ${{ (github.repository_owner == 'AcademySoftwareFoundation' && 'windows-2022-8c-32g-300h') || 'windows-latest' }}
|
||||
name: windows
|
||||
github.event_name != 'workflow_dispatch' ||
|
||||
github.event.inputs.type == 'all' ||
|
||||
github.event.inputs.type == 'win'
|
||||
runs-on: windows-2019
|
||||
name: windows-vc:${{ matrix.config.vc }}-type:${{ matrix.config.build }}
|
||||
env:
|
||||
VCPKG_DEFAULT_TRIPLET: x64-windows
|
||||
VCPKG_DEFAULT_TRIPLET: ${{ matrix.config.vc }}
|
||||
strategy:
|
||||
matrix:
|
||||
config:
|
||||
# static build of blosc from vcpkg does not build internal sources.
|
||||
# USE_STATIC_DEPENDENCIES is required for IlmBase/OpenEXR defines and
|
||||
# Boost as both shared and static libs are installed.
|
||||
- { vc: 'x64-windows-static', build: 'Release', cmake: '-A x64 -G \"Visual Studio 16 2019\" -DOPENVDB_CORE_SHARED=OFF -DUSE_STATIC_DEPENDENCIES=ON -DBLOSC_USE_EXTERNAL_SOURCES=ON' }
|
||||
- { vc: 'x64-windows-static', build: 'Debug', cmake: '-A x64 -G \"Visual Studio 16 2019\" -DOPENVDB_CORE_SHARED=OFF -DUSE_STATIC_DEPENDENCIES=ON -DBLOSC_USE_EXTERNAL_SOURCES=ON' }
|
||||
- { vc: 'x64-windows', build: 'Release', cmake: '-A x64 -G \"Visual Studio 16 2019\" -DOPENVDB_CORE_STATIC=OFF' }
|
||||
- { vc: 'x64-windows', build: 'Debug', cmake: '-A x64 -G \"Visual Studio 16 2019\" -DOPENVDB_CORE_STATIC=OFF' }
|
||||
#- { vc: 'x64-windows', build: 'Release', cmake: '-G \"MinGW Makefiles\" -DOPENVDB_CORE_STATIC=OFF' }
|
||||
fail-fast: false
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v2
|
||||
- name: path
|
||||
shell: pwsh
|
||||
run: |
|
||||
# note: system path must be modified in a previous step to it's use
|
||||
echo "$Env:VCPKG_INSTALLATION_ROOT\installed\x64-windows\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
||||
echo "${{github.workspace}}\build\openvdb\openvdb\Release" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
||||
echo "$Env:VCPKG_INSTALLATION_ROOT\installed\${{ matrix.config.vc }}\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
||||
echo "${{github.workspace}}\build\openvdb\openvdb\${{ matrix.config.build }}" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
||||
- name: install
|
||||
shell: powershell
|
||||
run: .\ci\install_windows.ps1
|
||||
- name: install_numpy
|
||||
shell: powershell
|
||||
run: .\ci\install_windows_numpy.ps1
|
||||
shell: bash
|
||||
run: ./ci/install_windows.sh
|
||||
- name: build
|
||||
shell: bash
|
||||
run: >
|
||||
./ci/build.sh -v
|
||||
--config='Release'
|
||||
--components='core,bin,view,render,python,test'
|
||||
--cargs=\'
|
||||
-A x64 -G \"Visual Studio 17 2022\" -DOPENVDB_CORE_STATIC=OFF
|
||||
-DMSVC_COMPRESS_PDB=ON
|
||||
-DUSE_EXR=ON
|
||||
-DUSE_PNG=ON
|
||||
-DVCPKG_TARGET_TRIPLET=${VCPKG_DEFAULT_TRIPLET}
|
||||
-DCMAKE_TOOLCHAIN_FILE=\"${VCPKG_INSTALLATION_ROOT}\\scripts\\buildsystems\\vcpkg.cmake\"
|
||||
\'
|
||||
- name: size
|
||||
# Print the build directy size (monitor if we're hitting runner limits)
|
||||
run: du -h build
|
||||
--config=${{ matrix.config.build }}
|
||||
--components=\"core,bin,test\"
|
||||
--cargs=\'${{ matrix.config.cmake }} -DVCPKG_TARGET_TRIPLET=${VCPKG_DEFAULT_TRIPLET} -DCMAKE_TOOLCHAIN_FILE=\"${VCPKG_INSTALLATION_ROOT}\\scripts\\buildsystems\\vcpkg.cmake\"\'
|
||||
- name: test
|
||||
run: cd build && ctest -V -C Release
|
||||
shell: bash
|
||||
# Always run tests on weekly builds but skip Debug on commits as they take a while.
|
||||
# https://github.community/t/distinct-job-for-each-schedule/17811/2
|
||||
if: contains(github.event.schedule, '0 0 * * 1') || matrix.config.build == 'Release'
|
||||
run: cd build && ctest -V
|
||||
|
||||
macos:
|
||||
linux-extra:
|
||||
# Extra configuration tests, all run on the ASWF docker images. These run weekly
|
||||
# rather than on PR/merge
|
||||
if: |
|
||||
(github.event_name == 'push' ||
|
||||
(github.event_name == 'pull_request' && github.event.pull_request.draft == false) ||
|
||||
(github.event_name == 'workflow_dispatch' &&
|
||||
(github.event.inputs.type == 'all' || github.event.inputs.type == 'mac')))
|
||||
runs-on: ${{ matrix.config.image }}
|
||||
name: ${{ matrix.config.image }}
|
||||
contains(github.event.schedule, '0 0 * * 1') ||
|
||||
(github.event_name == 'workflow_dispatch' &&
|
||||
(github.event.inputs.type == 'all' ||
|
||||
github.event.inputs.type == 'linux'))
|
||||
runs-on: ubuntu-latest
|
||||
name: linux-extra:${{ matrix.config.name }}
|
||||
container:
|
||||
image: aswf/ci-openvdb:2021
|
||||
env:
|
||||
CXX: clang++
|
||||
strategy:
|
||||
matrix:
|
||||
config:
|
||||
- { image: macos-14 }
|
||||
- { image: macos-15 }
|
||||
- { name: 'abi8lite', cmake: '-DUSE_BLOSC=OFF -DUSE_ZLIB=OFF' }
|
||||
- { name: 'abi8half', cmake: '-DUSE_BLOSC=OFF -DUSE_IMATH_HALF=ON' }
|
||||
- { name: 'abi8sse', cmake: '-DOPENVDB_SIMD=SSE42' }
|
||||
- { name: 'abi8avx', cmake: '-DOPENVDB_SIMD=AVX' }
|
||||
fail-fast: false
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: install
|
||||
run: |
|
||||
./ci/install_macos.sh
|
||||
./ci/install_tbb_macos.sh
|
||||
- uses: actions/checkout@v2
|
||||
- name: install_gtest
|
||||
run: ./ci/install_gtest.sh 1.10.0
|
||||
- name: build
|
||||
run: >
|
||||
./ci/build.sh -v
|
||||
--build-type=Release
|
||||
--components=\"core,python,bin,view,render,test\"
|
||||
--cargs=\'
|
||||
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/install
|
||||
\'
|
||||
--components=\"core,python,bin,test\"
|
||||
--cargs=\"-DOPENVDB_CXX_STRICT=ON -DOPENVDB_ABI_VERSION_NUMBER=8 ${{ matrix.config.cmake }}\"
|
||||
- name: test
|
||||
run: cd build && ctest -V
|
||||
|
||||
testabi8gcc10:
|
||||
if: |
|
||||
github.event_name != 'workflow_dispatch' ||
|
||||
github.event.inputs.type == 'all' ||
|
||||
github.event.inputs.type == 'linux'
|
||||
runs-on: ubuntu-20.04
|
||||
env:
|
||||
CXX: g++-10
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: install_boost
|
||||
run: sudo apt-get -q install -y libboost-dev libboost-system-dev libboost-iostreams-dev
|
||||
- name: install_tbb
|
||||
run: sudo apt-get -q install -y libtbb-dev
|
||||
- name: install_gtest
|
||||
run: sudo apt-get -q install -y libgtest-dev
|
||||
- name: build
|
||||
run: >
|
||||
./ci/build.sh -v
|
||||
--build-type=Release
|
||||
--components=\"core,test\"
|
||||
--cargs=\"-DUSE_BLOSC=OFF -DUSE_ZLIB=OFF -DOPENVDB_ABI_VERSION_NUMBER=8 -DCMAKE_INSTALL_PREFIX=`pwd`\"
|
||||
- name: test
|
||||
run: cd build && ctest -V
|
||||
|
||||
testabi8clang10:
|
||||
if: |
|
||||
github.event_name != 'workflow_dispatch' ||
|
||||
github.event.inputs.type == 'all' ||
|
||||
github.event.inputs.type == 'linux'
|
||||
runs-on: ubuntu-20.04
|
||||
env:
|
||||
CXX: clang++-10
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: install_boost
|
||||
run: sudo apt-get -q install -y libboost-dev libboost-system-dev libboost-iostreams-dev
|
||||
- name: install_tbb
|
||||
run: sudo apt-get -q install -y libtbb-dev
|
||||
- name: install_gtest
|
||||
run: sudo apt-get -q install -y libgtest-dev
|
||||
- name: build
|
||||
run: >
|
||||
./ci/build.sh -v
|
||||
--build-type=Release
|
||||
--components=\"core,test\"
|
||||
--cargs=\"-DUSE_BLOSC=OFF -DUSE_ZLIB=OFF -DOPENVDB_ABI_VERSION_NUMBER=8 -DCMAKE_INSTALL_PREFIX=`pwd`\"
|
||||
- name: test
|
||||
run: cd build && ctest -V
|
||||
|
||||
testmacos1015:
|
||||
if: |
|
||||
github.event_name != 'workflow_dispatch' ||
|
||||
github.event.inputs.type == 'all' ||
|
||||
github.event.inputs.type == 'mac'
|
||||
runs-on: macos-10.15
|
||||
env:
|
||||
CXX: clang++
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: install
|
||||
shell: bash
|
||||
# brew boost-python3 installs a "Keg-only" version of python which is
|
||||
# not installed to PATH. We must manually provide the location of the
|
||||
# required python installation to CMake through a hint variable which
|
||||
# is exported in install_macos.sh
|
||||
run: ./ci/install_macos.sh
|
||||
- name: install
|
||||
shell: bash
|
||||
run: ./ci/install_blosc.sh 1.5.0
|
||||
- name: build
|
||||
shell: bash
|
||||
# Also need to disable compiler warnings for ABI 6 and above due to
|
||||
# the version of clang installed
|
||||
run: >
|
||||
./ci/build.sh -v
|
||||
--build-type=Release
|
||||
--components=\"core,python,bin,test\"
|
||||
--cargs=\"-DOPENVDB_CXX_STRICT=OFF -DOPENVDB_ABI_VERSION_NUMBER=8 -DOPENVDB_SIMD=SSE42\"
|
||||
- name: test
|
||||
shell: bash
|
||||
run: cd build && ctest -V
|
||||
|
||||
# Test EXR 3 and TBB 2021 on MacOS
|
||||
testmacos1015_latest:
|
||||
runs-on: macos-10.15
|
||||
env:
|
||||
CXX: clang++
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: install
|
||||
shell: bash
|
||||
run: |
|
||||
brew update
|
||||
brew install bash gnu-getopt cmake imath openexr boost tbb glfw googletest
|
||||
echo "/usr/local/opt/gnu-getopt/bin" >> $GITHUB_PATH
|
||||
- name: build
|
||||
shell: bash
|
||||
run: >
|
||||
./ci/build.sh -v
|
||||
--build-type=Release
|
||||
--components=\"core,bin,test\"
|
||||
--cargs=\"-DOPENVDB_CXX_STRICT=OFF -DUSE_BLOSC=OFF -DUSE_ZLIB=OFF\"
|
||||
- name: test
|
||||
shell: bash
|
||||
run: cd build && ctest -V
|
||||
|
||||
+19
-134
@@ -11,6 +11,7 @@ on:
|
||||
- 'CHANGES'
|
||||
- 'openvdb_maya/**'
|
||||
- 'pendingchanges/**'
|
||||
- '**.md'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
@@ -18,161 +19,45 @@ on:
|
||||
- 'CHANGES'
|
||||
- 'openvdb_maya/**'
|
||||
- 'pendingchanges/**'
|
||||
- '**.md'
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
deploy:
|
||||
description: 'Deploy to openvdb-website (docs/coverage)?'
|
||||
description: 'Deploy docs?'
|
||||
required: true
|
||||
default: 'none'
|
||||
|
||||
# Allow subsequent pushes to the same PR or REF to cancel any previous jobs.
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
default: 'false'
|
||||
|
||||
jobs:
|
||||
validate_docs:
|
||||
# Cheap static checks that run before the heavier doxygen build:
|
||||
# * every #include <...> referenced from a fenced code block in doc/ resolves
|
||||
# * every github.com/.../blob/<branch>/<path> URL points to a file on disk
|
||||
# Catches the class of docs-rot from issue #2161 (e.g. nanovdb::util ->
|
||||
# nanovdb::tools rename) before the doxygen job runs.
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: set_up_python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.x'
|
||||
- name: run_validator
|
||||
run: python3 ci/validate_docs_references.py
|
||||
|
||||
doxygen:
|
||||
needs: validate_docs
|
||||
runs-on: ${{ (github.repository_owner == 'AcademySoftwareFoundation' && 'ubuntu-22.04-8c-32g-300h') || 'ubuntu-latest' }}
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CXX: g++
|
||||
container:
|
||||
image: aswf/ci-openvdb:2026
|
||||
image: aswf/ci-openvdb:2019
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v2
|
||||
- name: install_doxygen
|
||||
run: ./ci/install_doxygen.sh 1_14_0
|
||||
- name: nanobind
|
||||
run: ./ci/install_nanobind.sh 2.5.0
|
||||
run: ./ci/install_doxygen.sh 1_8_11
|
||||
- name: install_epydoc
|
||||
run: pip install epydoc
|
||||
- name: install_latex
|
||||
run: yum -y install texlive-latex-bin texlive-dvips texlive-collection-fontsrecommended texlive-collection-latexrecommended
|
||||
- name: build
|
||||
# Doxygen's native WARN_AS_ERROR=FAIL_ON_WARNINGS gates the docs build:
|
||||
# any warning fails the job. FAIL_ON_WARNINGS still generates the docs and
|
||||
# writes the full warning log first, so the artifact step below captures
|
||||
# it for debugging. Enabled via OPENVDB_DOXYGEN_WARN_AS_ERROR (see
|
||||
# doc/CMakeLists.txt).
|
||||
run: >
|
||||
./ci/build.sh -v
|
||||
--build-type=Release
|
||||
--components="core,python,doc"
|
||||
--cargs=\"
|
||||
-DUSE_BLOSC=OFF
|
||||
-DOPENVDB_CORE_STATIC=OFF
|
||||
-DOPENVDB_PYTHON_WRAP_ALL_GRID_TYPES=ON
|
||||
-DUSE_EXPLICIT_INSTANTIATION=OFF
|
||||
-DDISABLE_DEPENDENCY_VERSION_CHECKS=ON
|
||||
-DOPENVDB_DOXYGEN_WARN_AS_ERROR=ON
|
||||
\"
|
||||
- name: upload_doxygen_warning_log
|
||||
# Always upload so contributors can debug failed PR builds without
|
||||
# having to reproduce the doxygen environment locally.
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: doxygen-warnings
|
||||
path: build/doc/doxygen.warnings.log
|
||||
if-no-files-found: ignore
|
||||
retention-days: 14
|
||||
- name: pre_deploy
|
||||
# Overwrite global SSH configuration
|
||||
# https://github.com/peaceiris/actions-gh-pages/issues/719
|
||||
# https://linuxhint.com/ssh-stricthostkeychecking/
|
||||
run: >
|
||||
echo "Host *
|
||||
StrictHostKeyChecking no
|
||||
UserKnownHostsFile=/dev/null
|
||||
" > /etc/ssh/ssh_config
|
||||
--cargs=\"-DUSE_BLOSC=OFF -DOPENVDB_CORE_STATIC=OFF -DOPENVDB_PYTHON_WRAP_ALL_GRID_TYPES=ON -DDISABLE_DEPENDENCY_VERSION_CHECKS=ON\"
|
||||
- name: epydoc
|
||||
run: |
|
||||
epydoc --html -o /usr/local/share/doc/OpenVDB/html/python pyopenvdb
|
||||
- name: deploy
|
||||
# only deploy documentation on a manual workflow dispatch
|
||||
# only deploy documentation to gh-pages on a manual workflow dispatch
|
||||
if: |
|
||||
github.repository_owner == 'AcademySoftwareFoundation' &&
|
||||
github.event_name == 'workflow_dispatch' &&
|
||||
github.event.inputs.deploy == 'docs'
|
||||
github.event.inputs.deploy == 'true'
|
||||
uses: peaceiris/actions-gh-pages@v3
|
||||
with:
|
||||
deploy_key: ${{ secrets.PRIVATE_KEY }}
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
publish_dir: /usr/local/share/doc/OpenVDB/html
|
||||
destination_dir: documentation/doxygen
|
||||
external_repository: AcademySoftwareFoundation/openvdb-website
|
||||
publish_branch: master
|
||||
full_commit_message: "Automatic doxygen documentation update
|
||||
- Deployed from: AcademySoftwareFoundation/openvdb ${{ github.sha }}
|
||||
|
||||
Signed-off-by: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>"
|
||||
|
||||
#############################################################################
|
||||
################################ Coverage ###################################
|
||||
#############################################################################
|
||||
|
||||
linux-coverage:
|
||||
if: |
|
||||
github.repository_owner == 'AcademySoftwareFoundation' &&
|
||||
github.event_name == 'workflow_dispatch' &&
|
||||
github.event.inputs.deploy == 'coverage'
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: aswf/ci-openvdb:2025-clang19.1
|
||||
env:
|
||||
CXX: g++
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: install_gcovr
|
||||
run: pip install gcovr
|
||||
- name: build
|
||||
run: >
|
||||
./ci/build.sh -v
|
||||
--build-type=coverage
|
||||
--components="core,axcore,test,axtest"
|
||||
--cargs=\"-DOPENVDB_CORE_STATIC=OFF -DOPENVDB_AX_STATIC=OFF\"
|
||||
- name: test_and_gcov
|
||||
run: |
|
||||
cd build
|
||||
ctest -V
|
||||
make gcov_html
|
||||
cd -
|
||||
- name: zip_large_html
|
||||
# The index.function list is > 100mb. Just zip it and provide it as a
|
||||
# download (could instead use LFS to host but not really worth it).
|
||||
run: |
|
||||
cd build/gcov_html
|
||||
tar -czvf index.functions.html.tar.gz index.functions.html
|
||||
sed -i -e 's/index.functions.html/index.functions.html.tar.gz/g' index.html
|
||||
sed -i -e 's/List of functions/Download function index/g' index.html
|
||||
rm index.functions.html
|
||||
cd -
|
||||
- name: pre_deploy
|
||||
# Overwrite global SSH configuration
|
||||
# https://github.com/peaceiris/actions-gh-pages/issues/719
|
||||
# https://linuxhint.com/ssh-stricthostkeychecking/
|
||||
run: >
|
||||
echo "Host *
|
||||
StrictHostKeyChecking no
|
||||
UserKnownHostsFile=/dev/null
|
||||
" > /etc/ssh/ssh_config
|
||||
- name: deploy
|
||||
uses: peaceiris/actions-gh-pages@v3
|
||||
with:
|
||||
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
||||
publish_dir: ./build/gcov_html
|
||||
destination_dir: documentation/code_coverage
|
||||
external_repository: AcademySoftwareFoundation/openvdb-website
|
||||
publish_branch: master
|
||||
full_commit_message: "Automatic code coverage update
|
||||
- Deployed from: AcademySoftwareFoundation/openvdb ${{ github.sha }}
|
||||
|
||||
Signed-off-by: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>"
|
||||
|
||||
+32
-102
@@ -9,11 +9,8 @@ on:
|
||||
- 'pr/**'
|
||||
paths-ignore:
|
||||
- 'CHANGES'
|
||||
- 'CODEOWNERS'
|
||||
- 'doc/**'
|
||||
- 'nanovdb/**'
|
||||
- 'openvdb_maya/**'
|
||||
- 'fvdb/**'
|
||||
- 'pendingchanges/**'
|
||||
- '**.md'
|
||||
pull_request:
|
||||
@@ -21,24 +18,15 @@ on:
|
||||
- '**'
|
||||
paths-ignore:
|
||||
- 'CHANGES'
|
||||
- 'CODEOWNERS'
|
||||
- 'doc/**'
|
||||
- 'nanovdb/**'
|
||||
- 'openvdb_maya/**'
|
||||
- 'fvdb/**'
|
||||
- 'pendingchanges/**'
|
||||
- '**.md'
|
||||
schedule:
|
||||
# run this workflow every day at 7am UTC
|
||||
- cron: '0 7 * * *'
|
||||
workflow_dispatch:
|
||||
|
||||
# Allow subsequent pushes to the same PR or REF to cancel any previous jobs.
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
jobs:
|
||||
checksecret:
|
||||
# Check that valid github secrets have been set. This isn't needed to retrieve
|
||||
@@ -52,7 +40,7 @@ jobs:
|
||||
env:
|
||||
HOUDINI_CLIENT_ID: ${{ secrets.HOUDINI_CLIENT_ID }}
|
||||
HOUDINI_SECRET_KEY: ${{ secrets.HOUDINI_SECRET_KEY }}
|
||||
run: echo "HOUDINI_SECRETS=${{ env.HOUDINI_CLIENT_ID != '' && env.HOUDINI_SECRET_KEY != '' }}" >> $GITHUB_OUTPUT
|
||||
run: echo "::set-output name=HOUDINI_SECRETS::${{ env.HOUDINI_CLIENT_ID != '' && env.HOUDINI_SECRET_KEY != '' }}"
|
||||
- name: Skip Next Jobs
|
||||
if: steps.check.outputs.HOUDINI_SECRETS != 'true'
|
||||
run: echo "HOUDINI_CLIENT_ID and HOUDINI_SECRET_KEY GitHub Action Secrets needs to be set to install Houdini builds"
|
||||
@@ -62,114 +50,56 @@ jobs:
|
||||
if: >
|
||||
${{ needs.checksecret.outputs.HOUDINI_SECRETS == 'true' ||
|
||||
github.repository_owner == 'AcademySoftwareFoundation' }}
|
||||
runs-on: ${{ (github.repository_owner == 'AcademySoftwareFoundation' && 'ubuntu-22.04-8c-32g-300h') || 'ubuntu-latest' }}
|
||||
name: hou:${{ matrix.config.hou_hash }}-vfx:${{ matrix.config.image }}-cxx:${{ matrix.config.cxx }}-build:${{ matrix.config.build }}
|
||||
runs-on: ubuntu-latest
|
||||
name: hou:${{ matrix.config.hou }}-vfx:${{ matrix.config.image }}-cxx:${{ matrix.config.cxx }}
|
||||
container:
|
||||
image: aswf/ci-base:${{ matrix.config.image }}
|
||||
env:
|
||||
CXX: ${{ matrix.config.cxx }}
|
||||
CCACHE_DIR: /tmp/ccache
|
||||
strategy:
|
||||
matrix:
|
||||
config:
|
||||
- { cxx: clang++, image: '2026', hou_hash: '21_0', build: 'Release', components: 'core,hou,bin,view,render,python,test,axcore,axbin,axtest' }
|
||||
- { cxx: clang++, image: '2026', hou_hash: '21_0', build: 'Debug', components: 'core,hou,bin,view,render,python,test,axcore,axbin,axtest' }
|
||||
- { cxx: g++, image: '2026', hou_hash: '21_0', build: 'Release', components: 'core,hou,bin,view,render,python,test,axcore,axbin,axtest' }
|
||||
- { cxx: clang++, image: '2024', hou_hash: '20_5', build: 'Release', components: 'core,hou,bin,view,render,python,test,axcore,axbin,axtest' }
|
||||
- { cxx: g++, image: '2024', hou_hash: '20_5', build: 'Release', components: 'core,hou,bin,view,render,python,test,axcore,axbin,axtest' }
|
||||
- { cxx: clang++, image: '2020', hou: '18_5', j: '2', build: 'Release', components: 'core,hou,bin,python,test,axcore,axbin,axtest', disable_checks: 'OFF' }
|
||||
- { cxx: clang++, image: '2020', hou: '18_5', j: '2', build: 'Debug', components: 'core,hou', disable_checks: 'OFF' }
|
||||
- { cxx: g++, image: '2020', hou: '18_5', j: '1', build: 'Release', components: 'core,hou', disable_checks: 'OFF' }
|
||||
fail-fast: false
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: nanobind
|
||||
run: ./ci/install_nanobind.sh 2.5.0
|
||||
- name: install_gtest
|
||||
run: ./ci/install_gtest.sh latest
|
||||
- uses: actions/checkout@v2
|
||||
- name: timestamp
|
||||
id: timestamp
|
||||
run: echo "timestamp=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT
|
||||
- name: ccache
|
||||
# don't use ccache for debug builds
|
||||
if: matrix.config.build == 'Release'
|
||||
id: ccache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: /tmp/ccache
|
||||
key: linux-vfx-hou${{ matrix.config.hou_hash }}-${{ matrix.config.image }}-${{ matrix.config.cxx }}-${{ steps.timestamp.outputs.timestamp }}
|
||||
restore-keys: linux-vfx-hou${{ matrix.config.hou_hash }}-${{ matrix.config.image }}-${{ matrix.config.cxx }}-
|
||||
shell: bash
|
||||
run: echo "::set-output name=timestamp::`date -u +'%Y-%m-%dT%H:%M:%SZ'`"
|
||||
- name: fetch_houdini
|
||||
uses: actions/cache/restore@v3
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: hou
|
||||
key: dummy-houdini${{ matrix.config.hou_hash }}-${{ steps.timestamp.outputs.timestamp }}
|
||||
restore-keys: vdb-v5-houdini${{ matrix.config.hou_hash }}-
|
||||
key: dummy-houdini${{ matrix.config.hou }}-${{ steps.timestamp.outputs.timestamp }}
|
||||
restore-keys: vdb-v5-houdini${{ matrix.config.hou }}-
|
||||
- name: validate_houdini
|
||||
run: test -f "hou/hou.tar.gz"
|
||||
# Make sure that the unpacked install is NOT in the root of the OpenVDB checkout
|
||||
# Make sure the cache is copied, not moved, as the cache action always posts the cache.
|
||||
# Also make sure that the unpacked install is NOT in the root of the OpenVDB checkout
|
||||
# otherwise CMake's install RPATHs wil not work correctly.
|
||||
- name: install_houdini
|
||||
run: |
|
||||
mkdir $HOME/houdini_install
|
||||
cp hou/hou.tar.gz $HOME/houdini_install/hou.tar.gz
|
||||
cd $HOME/houdini_install && tar -xzf hou.tar.gz && cd -
|
||||
- name: install_cmake
|
||||
run: ./ci/install_cmake.sh 3.12.0
|
||||
- name: install_gtest
|
||||
run: ./ci/install_gtest.sh 1.10.0
|
||||
- name: build
|
||||
run: |
|
||||
./ci/build.sh -v \
|
||||
--build-type="${{ matrix.config.build }}" \
|
||||
--components="${{ matrix.config.components }}" \
|
||||
--cargs=\" \
|
||||
-DHOUDINI_ROOT=$HOME/houdini_install/hou \
|
||||
-DOPENVDB_BUILD_HOUDINI_ABITESTS=OFF \
|
||||
-DOPENVDB_HOUDINI_INSTALL_PREFIX=/tmp \
|
||||
-DDISABLE_CMAKE_SEARCH_PATHS=ON \
|
||||
-DDISABLE_DEPENDENCY_VERSION_CHECKS=ON \
|
||||
\"
|
||||
- name: test
|
||||
if: matrix.config.build == 'Release'
|
||||
run: cd build && ctest -V
|
||||
# Keep ccache light by stripping out any caches not accessed in the last day
|
||||
- name: ccache_clean
|
||||
if: matrix.config.build == 'Release'
|
||||
run: ccache --evict-older-than 1d
|
||||
|
||||
macos-houdini:
|
||||
needs: [checksecret]
|
||||
if: >
|
||||
${{ needs.checksecret.outputs.HOUDINI_SECRETS == 'true' ||
|
||||
github.repository_owner == 'AcademySoftwareFoundation' }}
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: fetch_houdini
|
||||
uses: actions/cache/restore@v3
|
||||
with:
|
||||
path: hou
|
||||
key: dummy-houdini
|
||||
restore-keys: vdb-v5-houdini-macos-
|
||||
- name: validate_houdini
|
||||
run: test -f "hou/hou.tar.gz"
|
||||
# Make sure that the unpacked install is NOT in the root of the OpenVDB checkout
|
||||
# otherwise CMake's install RPATHs wil not work correctly.
|
||||
- name: install_houdini
|
||||
run: |
|
||||
mkdir $HOME/houdini_install
|
||||
cp hou/hou.tar.gz $HOME/houdini_install/hou.tar.gz
|
||||
cd $HOME/houdini_install && tar -xzf hou.tar.gz && cd -
|
||||
- name: install_deps
|
||||
run: ./ci/install_macos.sh 20
|
||||
- name: build
|
||||
run: |
|
||||
./ci/build.sh -v \
|
||||
--build-type=Release \
|
||||
--components="core,hou,bin,view,render,test,axcore,axbin" \
|
||||
--cargs=\" \
|
||||
-DHOUDINI_ROOT=$HOME/houdini_install/hou \
|
||||
-DOPENVDB_BUILD_HOUDINI_ABITESTS=OFF \
|
||||
-DOPENVDB_HOUDINI_INSTALL_PREFIX=/tmp \
|
||||
-DDISABLE_CMAKE_SEARCH_PATHS=ON \
|
||||
-DDISABLE_DEPENDENCY_VERSION_CHECKS=ON \
|
||||
-DUSE_EXPLICIT_INSTANTIATION=OFF \
|
||||
-DLLVM_DIR=/opt/homebrew/opt/llvm@20/lib/cmake/llvm \
|
||||
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/install \
|
||||
\"
|
||||
shell: bash
|
||||
run: >
|
||||
cd $HOME/houdini_install/hou && source houdini_setup_bash && cd - &&
|
||||
./ci/build.sh -v
|
||||
-j ${{ matrix.config.j }}
|
||||
--build-type=${{ matrix.config.build }}
|
||||
--components="${{ matrix.config.components }}"
|
||||
--cargs=\"-DDISABLE_CMAKE_SEARCH_PATHS=ON -DOPENVDB_BUILD_HOUDINI_ABITESTS=ON -DOPENVDB_HOUDINI_INSTALL_PREFIX=/tmp -DDISABLE_DEPENDENCY_VERSION_CHECKS=${{ matrix.config.disable_checks }}\"
|
||||
- name: test
|
||||
run: cd build && ctest -V
|
||||
# Delete the houdini tarball so that this dummy cache occupies no space
|
||||
- name: delete_hou
|
||||
run: rm -f hou/hou.tar.gz
|
||||
|
||||
@@ -0,0 +1,108 @@
|
||||
|
||||
name: Houdini Cache
|
||||
|
||||
on:
|
||||
schedule:
|
||||
# run this workflow every sunday at noon UTC
|
||||
- cron: '0 12 * * 0'
|
||||
workflow_dispatch:
|
||||
|
||||
# download the latest production version of Houdini, strip out headers,
|
||||
# libraries and binaries required for building OpenVDB and if the build
|
||||
# succeeds, put it into the GitHub Actions cache
|
||||
|
||||
jobs:
|
||||
checksecret:
|
||||
# Check that valid github secrets have been set for the ability to
|
||||
# download Houdini and cache it. The secrets are used in download_houdini.py
|
||||
name: Verify Houdini Secrets
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
HOUDINI_SECRETS: ${{ steps.check.outputs.HOUDINI_SECRETS }}
|
||||
steps:
|
||||
- id: check
|
||||
env:
|
||||
HOUDINI_CLIENT_ID: ${{ secrets.HOUDINI_CLIENT_ID }}
|
||||
HOUDINI_SECRET_KEY: ${{ secrets.HOUDINI_SECRET_KEY }}
|
||||
run: echo "::set-output name=HOUDINI_SECRETS::${{ env.HOUDINI_CLIENT_ID != '' && env.HOUDINI_SECRET_KEY != '' }}"
|
||||
- name: Skip Next Jobs
|
||||
if: steps.check.outputs.HOUDINI_SECRETS != 'true'
|
||||
run: echo "HOUDINI_CLIENT_ID and HOUDINI_SECRET_KEY GitHub Action Secrets needs to be set to install Houdini builds"
|
||||
|
||||
linux_houdini18_5:
|
||||
needs: [checksecret]
|
||||
if: >
|
||||
${{ needs.checksecret.outputs.HOUDINI_SECRETS == 'true' ||
|
||||
github.repository_owner == 'AcademySoftwareFoundation' }}
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CXX: clang++
|
||||
HOUDINI_CLIENT_ID: ${{ secrets.HOUDINI_CLIENT_ID }}
|
||||
HOUDINI_SECRET_KEY: ${{ secrets.HOUDINI_SECRET_KEY }}
|
||||
container:
|
||||
image: aswf/ci-base:2020
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: download_houdini
|
||||
run: ./ci/download_houdini.sh 18.5 ON
|
||||
- name: install_houdini
|
||||
run: |
|
||||
mkdir $HOME/houdini_install
|
||||
cp hou/hou.tar.gz $HOME/houdini_install/hou.tar.gz
|
||||
cd $HOME/houdini_install && tar -xzf hou.tar.gz && cd -
|
||||
- name: install_gtest
|
||||
run: ./ci/install_gtest.sh 1.10.0
|
||||
- name: build
|
||||
shell: bash
|
||||
run: >
|
||||
cd $HOME/houdini_install/hou && source houdini_setup_bash && cd - &&
|
||||
./ci/build.sh -v
|
||||
--build-type=Release
|
||||
--components="core,hou,bin,python,test,axcore,axbin,axtest"
|
||||
--cargs=\"-DDISABLE_CMAKE_SEARCH_PATHS=ON -DOPENVDB_BUILD_HOUDINI_ABITESTS=ON -DOPENVDB_HOUDINI_INSTALL_PREFIX=/tmp\"
|
||||
- name: test
|
||||
run: cd build && ctest -V
|
||||
- name: write_houdini_cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: hou
|
||||
key: vdb-v3-houdini18_5-${{ hashFiles('hou/hou.tar.gz') }}
|
||||
|
||||
linux_houdini18_0:
|
||||
needs: [checksecret]
|
||||
if: >
|
||||
${{ needs.checksecret.outputs.HOUDINI_SECRETS == 'true' ||
|
||||
github.repository_owner == 'AcademySoftwareFoundation' }}
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CXX: clang++
|
||||
HOUDINI_CLIENT_ID: ${{ secrets.HOUDINI_CLIENT_ID }}
|
||||
HOUDINI_SECRET_KEY: ${{ secrets.HOUDINI_SECRET_KEY }}
|
||||
container:
|
||||
image: aswf/ci-base:2019
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: download_houdini
|
||||
run: ./ci/download_houdini.sh 18.0 ON
|
||||
- name: install_houdini
|
||||
run: |
|
||||
mkdir $HOME/houdini_install
|
||||
cp hou/hou.tar.gz $HOME/houdini_install/hou.tar.gz
|
||||
cd $HOME/houdini_install && tar -xzf hou.tar.gz && cd -
|
||||
- name: install_gtest
|
||||
run: ./ci/install_gtest.sh 1.10.0
|
||||
- name: build
|
||||
shell: bash
|
||||
run: >
|
||||
cd $HOME/houdini_install/hou && source houdini_setup_bash && cd - &&
|
||||
./ci/build.sh -v
|
||||
--build-type=Release
|
||||
--components="core,hou,bin,python,test,axcore,axbin,axtest"
|
||||
--cargs=\"-DDISABLE_CMAKE_SEARCH_PATHS=ON -DOPENVDB_BUILD_HOUDINI_ABITESTS=ON -DOPENVDB_HOUDINI_INSTALL_PREFIX=/tmp\"
|
||||
- name: test
|
||||
run: cd build && ctest -V
|
||||
- name: write_houdini_cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: hou
|
||||
key: vdb-v3-houdini18_0-${{ hashFiles('hou/hou.tar.gz') }}
|
||||
@@ -1,282 +0,0 @@
|
||||
|
||||
name: NanoVDB
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
- 'feature/**'
|
||||
- 'pr/**'
|
||||
paths-ignore:
|
||||
- 'CHANGES'
|
||||
- 'CODEOWNERS'
|
||||
- 'doc/**'
|
||||
- 'openvdb_ax/**'
|
||||
- 'openvdb_maya/**'
|
||||
- 'openvdb_houdini/**'
|
||||
- 'fvdb/**'
|
||||
- 'pendingchanges/**'
|
||||
- '**.md'
|
||||
pull_request_target:
|
||||
# Add 'ready_for_review' to run CI when a draft PR is marked ready.
|
||||
types: [opened, synchronize, reopened, ready_for_review]
|
||||
branches:
|
||||
- '**'
|
||||
paths-ignore:
|
||||
- 'CHANGES'
|
||||
- 'CODEOWNERS'
|
||||
- 'doc/**'
|
||||
- 'openvdb_ax/**'
|
||||
- 'openvdb_maya/**'
|
||||
- 'openvdb_houdini/**'
|
||||
- 'fvdb/**'
|
||||
- 'pendingchanges/**'
|
||||
- '**.md'
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
type:
|
||||
description: 'The type of CI to run (all, linux, win, mac)'
|
||||
required: true
|
||||
default: 'all'
|
||||
|
||||
# Allow subsequent pushes to the same PR or REF to cancel any previous jobs.
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
linux-nanovdb:
|
||||
# push OR non-draft PR OR matching manual run
|
||||
if: |
|
||||
(github.event_name == 'push' ||
|
||||
(github.event_name == 'pull_request_target' && github.event.pull_request.draft == false) ||
|
||||
(github.event_name == 'workflow_dispatch' &&
|
||||
(github.event.inputs.type == 'all' || github.event.inputs.type == 'linux')))
|
||||
runs-on: ${{ (github.repository_owner == 'AcademySoftwareFoundation' && 'ubuntu-22.04-8c-32g-300h') || 'ubuntu-latest' }}
|
||||
name: >
|
||||
linux-nanovdb:cxx:${{ matrix.config.cxx }}-${{ matrix.config.build }}
|
||||
# Build in the same image used by the AWS CodeBuild GPU runner so the
|
||||
# uploaded build tree is binary/runtime compatible when executed there.
|
||||
container:
|
||||
image: aswf/ci-openvdb:2024-clang17.2
|
||||
env:
|
||||
CXX: ${{ matrix.config.cxx }}
|
||||
strategy:
|
||||
matrix:
|
||||
config:
|
||||
- { cxx: g++, label: gcc, build: 'Release' }
|
||||
- { cxx: g++, label: gcc, build: 'Debug' }
|
||||
- { cxx: clang++, label: clang, build: 'Release' }
|
||||
- { cxx: clang++, label: clang, build: 'Debug' }
|
||||
fail-fast: false
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
with:
|
||||
ref: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.sha || github.sha }}
|
||||
- name: setup_cuda_12
|
||||
run: |
|
||||
echo "/usr/local/cuda-12/bin" >> $GITHUB_PATH
|
||||
echo "LD_LIBRARY_PATH=/usr/local/cuda-12/lib64:$LD_LIBRARY_PATH" >> $GITHUB_ENV
|
||||
- name: nanobind
|
||||
run: ./ci/install_nanobind.sh 2.5.0
|
||||
- name: build
|
||||
# NOTE: CMAKE_POSITION_INDEPENDENT_CODE set to fix default behaviour change in clang 14
|
||||
# https://github.com/AcademySoftwareFoundation/aswf-docker/issues/228
|
||||
# NOTE: CUDA architecture 86 targets the AWS CodeBuild A10G GPUs used by
|
||||
# the linux-nanovdb-gpu test stage below.
|
||||
run: >
|
||||
./ci/build.sh -v
|
||||
--build-type=${{ matrix.config.build }}
|
||||
--components=core,nano,nanotest,nanoexam,nanobench,nanotool,nanopython,nanopytest
|
||||
--cargs=\'
|
||||
-DUSE_EXPLICIT_INSTANTIATION=OFF
|
||||
-DOPENVDB_CORE_STATIC=OFF
|
||||
-DNANOVDB_USE_CUDA=ON
|
||||
-DCMAKE_CUDA_ARCHITECTURES="86"
|
||||
-DNANOVDB_USE_OPENVDB=ON
|
||||
-DCMAKE_INSTALL_PREFIX=`pwd`
|
||||
-DUSE_BLOSC=ON
|
||||
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
|
||||
\'
|
||||
# Run the non-GPU tests here. GPU-only (cuda/mgpu) tests are executed in
|
||||
# the linux-nanovdb-gpu job. This step also generates the shared test
|
||||
# data files (e.g. data/*.nvdb) that the GPU tests consume, so it must
|
||||
# run before the build tree is uploaded.
|
||||
- name: test
|
||||
run: cd build && ctest -V -E ".*cuda.*|.*mgpu.*"
|
||||
- name: package_gpu_build
|
||||
# Record the absolute workspace path so the GPU runner can restore the
|
||||
# build tree to the same location, keeping RPATHs and CTest-generated
|
||||
# absolute paths valid.
|
||||
run: |
|
||||
META="$GITHUB_WORKSPACE/nanovdb-gpu-meta.env"
|
||||
echo "BUILD_WORKSPACE=$GITHUB_WORKSPACE" > "$META"
|
||||
echo "GITHUB_SHA=$GITHUB_SHA" >> "$META"
|
||||
echo "CONFIG=${{ matrix.config.label }}-${{ matrix.config.build }}" >> "$META"
|
||||
cat "$META"
|
||||
- name: upload_gpu_build
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: nanovdb-gpu-build-${{ matrix.config.label }}-${{ matrix.config.build }}
|
||||
path: |
|
||||
build
|
||||
nanovdb/nanovdb/python/test/TestNanoVDB.py
|
||||
nanovdb-gpu-meta.env
|
||||
retention-days: 1
|
||||
if-no-files-found: error
|
||||
|
||||
linux-nanovdb-gpu:
|
||||
# Execute the CUDA / multi-GPU tests on AWS CodeBuild (4x A10G) using the
|
||||
# prebuilt artifacts from linux-nanovdb. Repository secrets are not shared
|
||||
# with fork PRs, so restrict this job to same-repo events.
|
||||
if: |
|
||||
github.repository == 'AcademySoftwareFoundation/openvdb' &&
|
||||
(github.event_name == 'push' ||
|
||||
(github.event_name == 'pull_request_target' &&
|
||||
github.event.pull_request.draft == false &&
|
||||
github.event.pull_request.head.repo.full_name == github.repository) ||
|
||||
(github.event_name == 'workflow_dispatch' &&
|
||||
(github.event.inputs.type == 'all' || github.event.inputs.type == 'linux')))
|
||||
needs: linux-nanovdb
|
||||
runs-on: ubuntu-latest
|
||||
name: >
|
||||
linux-nanovdb-gpu:${{ matrix.config.label }}-${{ matrix.config.build }}
|
||||
# GITHUB_TOKEN needs actions:read to fetch the workflow-run artifacts.
|
||||
permissions:
|
||||
contents: read
|
||||
actions: read
|
||||
strategy:
|
||||
matrix:
|
||||
config:
|
||||
- { label: gcc, build: 'Release' }
|
||||
- { label: gcc, build: 'Debug' }
|
||||
- { label: clang, build: 'Release' }
|
||||
- { label: clang, build: 'Debug' }
|
||||
fail-fast: false
|
||||
env:
|
||||
# Consumed by buildspec.yml on the CodeBuild side.
|
||||
ARTIFACT_NAME: nanovdb-gpu-build-${{ matrix.config.label }}-${{ matrix.config.build }}
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
steps:
|
||||
- name: Configure AWS Credentials
|
||||
uses: aws-actions/configure-aws-credentials@v6
|
||||
with:
|
||||
aws-access-key-id: ${{ secrets.CODEBUILD_ID }}
|
||||
aws-secret-access-key: ${{ secrets.CODEBUILD_SECRET }}
|
||||
aws-region: us-west-2
|
||||
- name: Run CodeBuild GPU tests
|
||||
uses: aws-actions/aws-codebuild-run-build@v1
|
||||
with:
|
||||
project-name: OpenVDB
|
||||
buildspec-override: ci/buildspec_nanovdb.yml
|
||||
image-override: aswf/ci-openvdb:2024-clang17.2
|
||||
# GITHUB_* variables (GITHUB_RUN_ID, GITHUB_REPOSITORY, ...) are
|
||||
# forwarded automatically. The job-scoped Actions runtime values let
|
||||
# CodeBuild upload report.tgz directly to this workflow run.
|
||||
env-vars-for-codebuild: ARTIFACT_NAME,GH_TOKEN,ACTIONS_RUNTIME_TOKEN,ACTIONS_RESULTS_URL
|
||||
|
||||
windows-nanovdb:
|
||||
if: |
|
||||
(github.event_name == 'push' ||
|
||||
(github.event_name == 'pull_request_target' && github.event.pull_request.draft == false) ||
|
||||
(github.event_name == 'workflow_dispatch' &&
|
||||
(github.event.inputs.type == 'all' || github.event.inputs.type == 'win')))
|
||||
runs-on: ${{ (github.repository_owner == 'AcademySoftwareFoundation' && 'windows-2022-8c-32g-300h') || 'windows-latest' }}
|
||||
env:
|
||||
VCPKG_DEFAULT_TRIPLET: 'x64-windows'
|
||||
visual_studio: "Visual Studio 17 2022"
|
||||
cuda: "12.4.0"
|
||||
strategy:
|
||||
fail-fast: false
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
with:
|
||||
ref: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.sha || github.sha }}
|
||||
- name: path
|
||||
run: |
|
||||
# note: system path must be modified in a previous step to it's use
|
||||
echo "$Env:VCPKG_INSTALLATION_ROOT\installed\x64-windows\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
||||
echo "${{github.workspace}}\build\openvdb\openvdb\Release" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
||||
- name: install_cuda
|
||||
shell: powershell
|
||||
run: .\ci\install_windows_cuda.ps1
|
||||
- name: install
|
||||
shell: powershell
|
||||
run: .\ci\install_windows.ps1
|
||||
- name: build
|
||||
# nvcc doesn't set _WIN32 when run in bash so we need to set it manually
|
||||
shell: bash
|
||||
run: >
|
||||
./ci/build.sh -v
|
||||
--config=Release
|
||||
--components=core,nano,nanotest,nanoexam,nanobench,nanotool,nanopython,nanopytest
|
||||
--cargs=\'
|
||||
-A x64 -G \"Visual Studio 17 2022\" -DOPENVDB_CORE_STATIC=OFF
|
||||
-DMSVC_COMPRESS_PDB=ON
|
||||
-DUSE_EXPLICIT_INSTANTIATION=OFF
|
||||
-DNANOVDB_USE_CUDA=ON
|
||||
-DCMAKE_CUDA_ARCHITECTURES="80"
|
||||
-DCMAKE_CUDA_FLAGS="-D_WIN32"
|
||||
-DNANOVDB_USE_OPENVDB=ON
|
||||
-DVCPKG_TARGET_TRIPLET=${VCPKG_DEFAULT_TRIPLET}
|
||||
-DCMAKE_TOOLCHAIN_FILE=\"${VCPKG_INSTALLATION_ROOT}\\scripts\\buildsystems\\vcpkg.cmake\"
|
||||
\'
|
||||
- name: test
|
||||
shell: bash
|
||||
run: cd build && ctest -V -C Release -E ".*cuda.*|.*mgpu.*"
|
||||
|
||||
macos-nanovdb:
|
||||
if: |
|
||||
(github.event_name == 'push' ||
|
||||
(github.event_name == 'pull_request_target' && github.event.pull_request.draft == false) ||
|
||||
(github.event_name == 'workflow_dispatch' &&
|
||||
(github.event.inputs.type == 'all' || github.event.inputs.type == 'mac')))
|
||||
runs-on: ${{ matrix.config.runner }}
|
||||
env:
|
||||
CXX: ${{ matrix.config.cxx }}
|
||||
strategy:
|
||||
matrix:
|
||||
config:
|
||||
- { runner: 'macos-14', cxx: 'clang++', build: 'Release' }
|
||||
- { runner: 'macos-14', cxx: 'clang++', build: 'Debug' }
|
||||
fail-fast: false
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
with:
|
||||
ref: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.sha || github.sha }}
|
||||
- name: install_deps
|
||||
run: |
|
||||
./ci/install_macos.sh
|
||||
./ci/install_tbb_macos.sh
|
||||
- name: build
|
||||
run: >
|
||||
./ci/build.sh -v
|
||||
--build-type=${{ matrix.config.build }}
|
||||
--components=core,nano,nanotest,nanoexam,nanobench,nanotool,nanopython,nanopytest
|
||||
--cargs=\'-DUSE_EXPLICIT_INSTANTIATION=OFF -DNANOVDB_USE_CUDA=OFF -DNANOVDB_USE_OPENVDB=ON -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/install \'
|
||||
- name: test
|
||||
run: cd build && ctest -V -E ".*cuda.*|.*mgpu.*"
|
||||
|
||||
nanovdb-lite:
|
||||
if: |
|
||||
(github.event_name == 'push' ||
|
||||
(github.event_name == 'pull_request_target' && github.event.pull_request.draft == false) ||
|
||||
(github.event_name == 'workflow_dispatch' &&
|
||||
(github.event.inputs.type == 'all' || github.event.inputs.type == 'linux')))
|
||||
runs-on: ${{ (github.repository_owner == 'AcademySoftwareFoundation' && 'ubuntu-22.04-8c-32g-300h') || 'ubuntu-latest' }}
|
||||
container:
|
||||
image: aswf/ci-openvdb:2024-clang17.2
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
with:
|
||||
ref: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.sha || github.sha }}
|
||||
- name: install_gtest
|
||||
run: ./ci/install_gtest.sh latest
|
||||
- name: build_and_test
|
||||
run: |
|
||||
cd nanovdb/nanovdb
|
||||
mkdir .build
|
||||
cd .build
|
||||
cmake -DUSE_EXPLICIT_INSTANTIATION=OFF -DNANOVDB_BUILD_UNITTESTS=ON -DNANOVDB_USE_OPENVDB=OFF -DNANOVDB_USE_CUDA=OFF -DCMAKE_INSTALL_PREFIX="$(pwd)/install" ../
|
||||
make -j8 install
|
||||
ctest -V
|
||||
@@ -0,0 +1,44 @@
|
||||
|
||||
# This workflow is for running various sanitizers on OpenVDB. We currently
|
||||
# only use clang over gcc (for no particular reason). Note that some of the
|
||||
# errors produces by these sanitizers may be fairly obscure as the
|
||||
# llvm-symbolizer is not installed on the openvdb image. The address
|
||||
# sanitizer should never fail.
|
||||
|
||||
name: Sanitizers
|
||||
|
||||
on:
|
||||
schedule:
|
||||
# run this workflow every Monday 00:00 UTC
|
||||
- cron: '0 0 * * 1'
|
||||
|
||||
jobs:
|
||||
linux-vfx:
|
||||
runs-on: ubuntu-latest
|
||||
name: linux-clang-sanitizer:${{ matrix.config.build }}
|
||||
container:
|
||||
image: aswf/ci-openvdb:2021
|
||||
env:
|
||||
CXX: clang++
|
||||
strategy:
|
||||
matrix:
|
||||
config:
|
||||
- { build: 'asan', cmake: '-DUSE_BLOSC=OFF' } # We never called blosc_destroy(), so disable blosc to silence these errors
|
||||
- { build: 'ubsan', cmake: '' } # Currently doesn't error, just reports all issues
|
||||
#- { build: 'lsan', cmake: '' } # asan encompasses and includes lsan
|
||||
#- { build: 'tsan', cmake: '' } # requires full stack rebuild for valid results (including libc++)
|
||||
#- { build: 'msan', cmake: '' } # requires full stack rebuild for valid results (including libc++)
|
||||
#- { build: 'coverage', cmake: '' } # todo
|
||||
fail-fast: false
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: install_gtest
|
||||
run: ./ci/install_gtest.sh 1.8.0
|
||||
- name: build
|
||||
run: >
|
||||
./ci/build.sh -v
|
||||
--build-type=${{ matrix.config.build }}
|
||||
--components="core,axcore,test,axtest"
|
||||
--cargs=\"-DOPENVDB_CXX_STRICT=ON -DOPENVDB_CORE_STATIC=OFF -DOPENVDB_AX_STATIC=OFF ${{ matrix.config.cmake }}\"
|
||||
- name: test
|
||||
run: cd build && ctest -V
|
||||
@@ -1,613 +0,0 @@
|
||||
# This workflow runs once a week and tests a variety of configurations,
|
||||
# dependencies and other specific or expensive checkes (sanitizers).
|
||||
# It also contains the Houdini Cache jobs which update the CI cache
|
||||
# with new Houdini releases.
|
||||
|
||||
name: Weekly
|
||||
|
||||
on:
|
||||
schedule:
|
||||
# run this workflow Sunday 00:00 UTC
|
||||
- cron: '0 0 * * 0'
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
type:
|
||||
description: 'The type of CI to run (all, houdini, latest, extra, ax, blosc, abi)'
|
||||
required: true
|
||||
default: 'all'
|
||||
|
||||
# Allow subsequent pushes to the same PR or REF to cancel any previous jobs.
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
jobs:
|
||||
#############################################################################
|
||||
################################## Houdini ##################################
|
||||
#############################################################################
|
||||
|
||||
# Check that valid github secrets have been set for the ability to
|
||||
# download Houdini and cache it. The secrets are used in download_houdini.py
|
||||
checksecret:
|
||||
name: Verify Houdini Secrets
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
HOUDINI_SECRETS: ${{ steps.check.outputs.HOUDINI_SECRETS }}
|
||||
steps:
|
||||
- id: check
|
||||
env:
|
||||
HOUDINI_CLIENT_ID: ${{ secrets.HOUDINI_CLIENT_ID }}
|
||||
HOUDINI_SECRET_KEY: ${{ secrets.HOUDINI_SECRET_KEY }}
|
||||
run: echo "HOUDINI_SECRETS=${{ env.HOUDINI_CLIENT_ID != '' && env.HOUDINI_SECRET_KEY != '' }}" >> $GITHUB_OUTPUT
|
||||
- name: Skip Next Jobs
|
||||
if: steps.check.outputs.HOUDINI_SECRETS != 'true'
|
||||
run: echo "HOUDINI_CLIENT_ID and HOUDINI_SECRET_KEY GitHub Action Secrets needs to be set to install Houdini builds"
|
||||
# Explicitly error on the ASWF repo, we expect this secret to always exist
|
||||
- name: Error ASWF
|
||||
if: steps.check.outputs.HOUDINI_SECRETS != 'true' && github.repository_owner == 'AcademySoftwareFoundation'
|
||||
run: exit 1
|
||||
|
||||
# download the latest production version of Houdini X, strip out headers,
|
||||
# libraries and binaries required for building OpenVDB and put it into
|
||||
# the GitHub Actions cache
|
||||
linux_houdini:
|
||||
needs: [checksecret]
|
||||
if: |
|
||||
(needs.checksecret.outputs.HOUDINI_SECRETS == 'true') &&
|
||||
(github.event_name != 'workflow_dispatch' ||
|
||||
github.event.inputs.type == 'all' ||
|
||||
github.event.inputs.type == 'houdini')
|
||||
runs-on: ${{ (github.repository_owner == 'AcademySoftwareFoundation' && 'ubuntu-22.04-8c-32g-300h') || 'ubuntu-latest' }}
|
||||
name: linux-houdini:${{ matrix.config.hou_hash }}
|
||||
env:
|
||||
CXX: clang++
|
||||
HOUDINI_CLIENT_ID: ${{ secrets.HOUDINI_CLIENT_ID }}
|
||||
HOUDINI_SECRET_KEY: ${{ secrets.HOUDINI_SECRET_KEY }}
|
||||
strategy:
|
||||
matrix:
|
||||
config:
|
||||
- { houdini_version: '21.0', platform: 'linux_x86_64_gcc11.2', hou_hash: '21_0' }
|
||||
- { houdini_version: '20.5', platform: 'linux_x86_64_gcc11.2', hou_hash: '20_5' }
|
||||
fail-fast: false
|
||||
container:
|
||||
image: aswf/ci-base:2024
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: timestamp
|
||||
id: timestamp
|
||||
run: echo "timestamp=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT
|
||||
- name: download_houdini
|
||||
run: ./ci/download_houdini.sh ${{ matrix.config.houdini_version }} ${{ matrix.config.platform }} --prod
|
||||
- name: install_houdini
|
||||
run: |
|
||||
mkdir $HOME/houdini_install
|
||||
cp hou/hou.tar.gz $HOME/houdini_install/hou.tar.gz
|
||||
cd $HOME/houdini_install && tar -xzf hou.tar.gz && cd -
|
||||
- name: write_houdini_cache
|
||||
uses: actions/cache/save@v3
|
||||
with:
|
||||
path: hou
|
||||
key: vdb-v5-houdini${{ matrix.config.hou_hash }}-${{ steps.timestamp.outputs.timestamp }}
|
||||
|
||||
macos_houdini:
|
||||
needs: [checksecret]
|
||||
if: |
|
||||
(needs.checksecret.outputs.HOUDINI_SECRETS == 'true') &&
|
||||
(github.event_name != 'workflow_dispatch' ||
|
||||
github.event.inputs.type == 'all' ||
|
||||
github.event.inputs.type == 'houdini')
|
||||
# Note that macos-14 (current macos-latest) switches to M1. We could instead test
|
||||
# the arm build here instead of the x86 one.
|
||||
runs-on: macos-latest
|
||||
name: macos-houdini
|
||||
env:
|
||||
HOUDINI_CLIENT_ID: ${{ secrets.HOUDINI_CLIENT_ID }}
|
||||
HOUDINI_SECRET_KEY: ${{ secrets.HOUDINI_SECRET_KEY }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: timestamp
|
||||
id: timestamp
|
||||
run: echo "timestamp=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT
|
||||
- name: download_houdini
|
||||
run: ./ci/download_houdini.sh 21.0 macosx_arm64_clang15.0_14 --prod
|
||||
- name: install_houdini
|
||||
run: |
|
||||
mkdir $HOME/houdini_install
|
||||
cp hou/hou.tar.gz $HOME/houdini_install/hou.tar.gz
|
||||
cd $HOME/houdini_install && tar -xzf hou.tar.gz && cd -
|
||||
- name: write_houdini_cache
|
||||
uses: actions/cache/save@v3
|
||||
with:
|
||||
path: hou
|
||||
key: vdb-v5-houdini-macos-${{ steps.timestamp.outputs.timestamp }}
|
||||
|
||||
#############################################################################
|
||||
########################### Core Library Extras #############################
|
||||
#############################################################################
|
||||
|
||||
# Extra configuration tests for the OpenVDB Core library. These test a
|
||||
# variety of options with newer compilers.
|
||||
linux-extra:
|
||||
if: |
|
||||
github.event_name != 'workflow_dispatch' ||
|
||||
github.event.inputs.type == 'all' ||
|
||||
github.event.inputs.type == 'extra'
|
||||
runs-on: ${{ (github.repository_owner == 'AcademySoftwareFoundation' && 'ubuntu-22.04-8c-32g-300h') || 'ubuntu-latest' }}
|
||||
name: linux-extra:${{ matrix.config.name }}
|
||||
container:
|
||||
image: aswf/ci-openvdb:${{ matrix.config.image }}
|
||||
env:
|
||||
CXX: clang++
|
||||
strategy:
|
||||
matrix:
|
||||
config:
|
||||
- { name: 'all', image: '2026', build: 'Release', components: 'core,python,bin,view,render,test', cmake: '-DUSE_BLOSC=ON -DUSE_ZLIB=ON -DUSE_EXR=ON -DUSE_PNG=ON' }
|
||||
- { name: 'lite', image: '2026', build: 'Release', components: 'core,python,bin,view,render,test', cmake: '-DUSE_BLOSC=OFF -DUSE_ZLIB=OFF -DUSE_EXR=OFF -DUSE_PNG=OFF -DOPENVDB_USE_DELAYED_LOADING=OFF' }
|
||||
- { name: 'half', image: '2026', build: 'Release', components: 'core,python,bin,view,render,test', cmake: '-DUSE_BLOSC=OFF -DUSE_IMATH_HALF=ON' }
|
||||
- { name: 'simd', image: '2026', build: 'Release', components: 'core,python,bin,view,render,test', cmake: '-DOPENVDB_X86_INSTRSET=7 -DUSE_VCL=ON' } # 7=AVX
|
||||
- { name: 'pygrid', image: '2026', build: 'Release', components: 'core,python,bin,view,render,test', cmake: '-DOPENVDB_PYTHON_WRAP_ALL_GRID_TYPES=ON' }
|
||||
- { name: 'asan', image: '2026', build: 'asan', components: 'core,test', cmake: '-DDISABLE_DEPENDENCY_VERSION_CHECKS=ON -DNANOVDB_USE_OPENVDB=ON -DOPENVDB_AX_STATIC=OFF -DOPENVDB_CORE_STATIC=OFF -DUSE_BLOSC=OFF' } # We never called blosc_destroy(), so disable blosc to silence these errors
|
||||
- { name: 'ubsan', image: '2026', build: 'ubsan', components: 'core,test', cmake: '-DDISABLE_DEPENDENCY_VERSION_CHECKS=ON -DCMAKE_CXX_FLAGS="-Wno-deprecated-declarations" ' }
|
||||
- { name: 'c++20', image: '2026', build: 'Release', components: 'core,test', cmake: '-DCMAKE_CXX_STANDARD=20' }
|
||||
- { name: 'conf', image: '2026', build: 'Release', components: 'core,python,bin,view,render,test', cmake: '-DCMAKE_FIND_PACKAGE_PREFER_CONFIG=ON' }
|
||||
fail-fast: false
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: nanobind
|
||||
run: ./ci/install_nanobind.sh 2.5.0
|
||||
# 2026 images are broken with gtest/glfw/exr installs
|
||||
- name: deps
|
||||
if: contains(matrix.config.image, '2026')
|
||||
run: |
|
||||
./ci/install_gtest.sh latest
|
||||
./ci/install_glfw.sh latest
|
||||
./ci/install_imath.sh v3.2.2
|
||||
./ci/install_exr.sh v3.2.2
|
||||
- name: build
|
||||
run: >
|
||||
./ci/build.sh -v
|
||||
--build-type=${{ matrix.config.build }}
|
||||
--components="${{ matrix.config.components }}"
|
||||
--cargs=\"-DOPENVDB_CXX_STRICT=ON ${{ matrix.config.cmake }}\"
|
||||
- name: test
|
||||
run: cd build && ctest -V
|
||||
|
||||
# Test latest dependencies, latest compilers and options
|
||||
latest:
|
||||
if: |
|
||||
github.event_name != 'workflow_dispatch' ||
|
||||
github.event.inputs.type == 'all' ||
|
||||
github.event.inputs.type == 'latest'
|
||||
runs-on: ${{ matrix.config.runson }}
|
||||
env:
|
||||
CXX: ${{ matrix.config.cxx }}
|
||||
strategy:
|
||||
matrix:
|
||||
config:
|
||||
# llvm-17 is currently the default which has symbol issues with the python module
|
||||
- { runson: ubuntu-latest, cxx: g++, cmake: '-DOPENVDB_PYTHON_USE_AX=OFF' }
|
||||
# Disable the clang job for now. See https://github.com/actions/runner-images/issues/8659
|
||||
# - { runson: ubuntu-latest, cxx: clang++, cmake: '' }
|
||||
# @todo gcc on macos
|
||||
- { runson: macos-latest, cxx: '', cmake: '-DLLVM_DIR=/opt/homebrew/opt/llvm@20/lib/cmake/llvm' }
|
||||
fail-fast: false
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: install_deps
|
||||
run: |
|
||||
if [ "$RUNNER_OS" == "Linux" ]; then
|
||||
sudo apt-get -q install -y libboost-dev libboost-iostreams-dev libtbb-dev libblosc-dev libgtest-dev libgmock-dev python3-numpy
|
||||
./ci/install_nanobind.sh 2.5.0
|
||||
elif [ "$RUNNER_OS" == "macOS" ]; then
|
||||
./ci/install_macos.sh 20
|
||||
./ci/install_tbb_macos.sh
|
||||
else
|
||||
echo "$RUNNER_OS not supported"; exit 1
|
||||
fi
|
||||
- name: build
|
||||
run: >
|
||||
./ci/build.sh -v
|
||||
--build-type=Release
|
||||
--components=\"core,axcore,python,bin,render,test,axbin\"
|
||||
--cargs=\'
|
||||
-DCMAKE_CXX_STANDARD=20
|
||||
-DOPENVDB_USE_DELAYED_LOADING=OFF
|
||||
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/install
|
||||
${{ matrix.config.cmake }}
|
||||
\'
|
||||
- name: test
|
||||
run: cd build && ctest -V
|
||||
|
||||
windows:
|
||||
# Windows CI. Tests static and dynamic builds with MT and MD respectively.
|
||||
if: |
|
||||
github.event_name != 'workflow_dispatch' ||
|
||||
github.event.inputs.type == 'all' ||
|
||||
github.event.inputs.type == 'win'
|
||||
runs-on: ${{ (github.repository_owner == 'AcademySoftwareFoundation' && 'windows-2022-8c-32g-300h') || 'windows-latest' }}
|
||||
name: windows-vc:${{ matrix.config.vc }}-type:${{ matrix.config.build }}
|
||||
env:
|
||||
VCPKG_DEFAULT_TRIPLET: ${{ matrix.config.vc }}
|
||||
strategy:
|
||||
matrix:
|
||||
config:
|
||||
# static build of blosc from vcpkg does not build internal sources.
|
||||
# USE_STATIC_DEPENDENCIES is required for IlmBase/OpenEXR defines and
|
||||
# Boost as both shared and static libs are installed.
|
||||
# USE_EXPLICIT_INSTANTIATION is disabled for debug static libraries
|
||||
# due to disk space constraints
|
||||
- { vc: 'x64-windows-static', components: 'core,bin,view,render,test', build: 'Release', cmake: '-A x64 -G \"Visual Studio 17 2022\" -DOPENVDB_CORE_SHARED=OFF -DUSE_STATIC_DEPENDENCIES=ON -DBLOSC_USE_EXTERNAL_SOURCES=ON' }
|
||||
- { vc: 'x64-windows', components: 'core,bin,view,render,python,test', build: 'Release', cmake: '-A x64 -G \"Visual Studio 17 2022\" -DOPENVDB_CORE_STATIC=OFF' }
|
||||
- { vc: 'x64-windows', components: 'core,bin,view,render,python,test', build: 'Debug', cmake: '-A x64 -G \"Visual Studio 17 2022\" -DOPENVDB_CORE_STATIC=OFF' }
|
||||
fail-fast: false
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: path
|
||||
shell: pwsh
|
||||
run: |
|
||||
# note: system path must be modified in a previous step to it's use
|
||||
echo "$Env:VCPKG_INSTALLATION_ROOT\installed\${{ matrix.config.vc }}\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
||||
echo "${{github.workspace}}\build\openvdb\openvdb\${{ matrix.config.build }}" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
||||
- name: install
|
||||
shell: powershell
|
||||
run: .\ci\install_windows.ps1
|
||||
- name: install_numpy
|
||||
if: matrix.config.vc == 'x64-windows'
|
||||
shell: powershell
|
||||
run: .\ci\install_windows_numpy.ps1
|
||||
- name: build
|
||||
run: >
|
||||
./ci/build.sh -v
|
||||
--config=${{ matrix.config.build }}
|
||||
--components=${{ matrix.config.components }}
|
||||
--cargs=\'
|
||||
${{ matrix.config.cmake }}
|
||||
-DMSVC_COMPRESS_PDB=ON
|
||||
-DUSE_EXR=ON
|
||||
-DUSE_PNG=ON
|
||||
-DVCPKG_TARGET_TRIPLET=${VCPKG_DEFAULT_TRIPLET}
|
||||
-DCMAKE_TOOLCHAIN_FILE=\"${VCPKG_INSTALLATION_ROOT}\\scripts\\buildsystems\\vcpkg.cmake\"
|
||||
\'
|
||||
- name: size
|
||||
# Print the build directy size (monitor if we're hitting runner limits)
|
||||
run: du -h build
|
||||
- name: test
|
||||
# Always run tests on weekly builds but skip Debug on commits as they take a while.
|
||||
# https://github.community/t/distinct-job-for-each-schedule/17811/2
|
||||
if: contains(github.event.schedule, '0 7 * * 1') || matrix.config.build == 'Release'
|
||||
run: cd build && ctest -V -C ${{ matrix.config.build }}
|
||||
|
||||
#############################################################################
|
||||
############################ AX Library Extras ##############################
|
||||
#############################################################################
|
||||
|
||||
linux-ax:
|
||||
if: |
|
||||
github.event_name != 'workflow_dispatch' ||
|
||||
github.event.inputs.type == 'all' ||
|
||||
github.event.inputs.type == 'ax'
|
||||
runs-on: ${{ (github.repository_owner == 'AcademySoftwareFoundation' && 'ubuntu-22.04-8c-32g-300h') || 'ubuntu-latest' }}
|
||||
name: >
|
||||
linux-ax:${{ matrix.config.image }}-cxx:${{ matrix.config.cxx }}-${{ matrix.config.build }}
|
||||
container:
|
||||
image: aswf/ci-openvdb:${{ matrix.config.image }}
|
||||
env:
|
||||
CXX: ${{ matrix.config.cxx }}
|
||||
strategy:
|
||||
matrix:
|
||||
config:
|
||||
- { image: '2025-clang18.1', cxx: 'clang++', build: 'Release', components: 'core,axcore,axbin,axtest', cmake: '' }
|
||||
# @note LLVM 17 builds are incompatible with the vdb python plugin on linux
|
||||
- { image: '2024-clang17.2', cxx: 'clang++', build: 'Release', components: 'core,axcore,axbin,axtest', cmake: '-DOPENVDB_PYTHON_USE_AX=OFF' }
|
||||
fail-fast: false
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: nanobind
|
||||
run: ./ci/install_nanobind.sh 2.5.0
|
||||
- name: build
|
||||
run: >
|
||||
./ci/build.sh -v
|
||||
--build-type=${{ matrix.config.build }}
|
||||
--components=${{ matrix.config.components }}
|
||||
--cargs=\"
|
||||
${{ matrix.config.cmake }}
|
||||
-DOPENVDB_AX_TEST_CMD_DOWNLOADS=ON
|
||||
-DUSE_EXPLICIT_INSTANTIATION=OFF
|
||||
-DOPENVDB_CXX_STRICT=ON
|
||||
-DOPENVDB_BUILD_VDB_TOOL=OFF
|
||||
\"
|
||||
- name: clean
|
||||
if: matrix.config.components == 'core'
|
||||
run: rm -rf build
|
||||
- name: build
|
||||
if: matrix.config.components == 'core'
|
||||
run: >
|
||||
./ci/build.sh -v
|
||||
--build-type=${{ matrix.config.build }}
|
||||
--components="bin,axcore,axbin,axtest,python"
|
||||
--cargs=\"
|
||||
${{ matrix.config.cmake }}
|
||||
-DOPENVDB_AX_TEST_CMD_DOWNLOADS=ON
|
||||
-DUSE_EXPLICIT_INSTANTIATION=OFF
|
||||
-DOPENVDB_CXX_STRICT=ON
|
||||
-DOPENVDB_BUILD_VDB_TOOL=OFF
|
||||
\"
|
||||
- name: test
|
||||
run: cd build && ctest -V
|
||||
- name: test_doxygen_examples
|
||||
run: ./ci/extract_test_examples.sh
|
||||
|
||||
macos-ax:
|
||||
if: |
|
||||
github.event_name != 'workflow_dispatch' ||
|
||||
github.event.inputs.type == 'all' ||
|
||||
github.event.inputs.type == 'ax'
|
||||
runs-on: ${{ matrix.config.runner }}
|
||||
name: macos-cxx:${{ matrix.config.cxx }}-llvm:${{ matrix.config.llvm }}-${{ matrix.config.build }}
|
||||
env:
|
||||
CXX: ${{ matrix.config.cxx }}
|
||||
strategy:
|
||||
matrix:
|
||||
config:
|
||||
- { runner: 'macos-latest', cxx: 'clang++', build: 'Release', llvm: '20' }
|
||||
fail-fast: false
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: install_deps
|
||||
run: |
|
||||
./ci/install_macos.sh ${{ matrix.config.llvm }}
|
||||
./ci/install_tbb_macos.sh
|
||||
- name: build
|
||||
run: >
|
||||
./ci/build.sh -v
|
||||
--build-type=${{ matrix.config.build }}
|
||||
--components="core,python,bin,axcore,axbin,axtest"
|
||||
--cargs=\"
|
||||
-DOPENVDB_AX_TEST_CMD_DOWNLOADS=ON
|
||||
-DUSE_EXPLICIT_INSTANTIATION=OFF
|
||||
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/install
|
||||
-DLLVM_DIR=/opt/homebrew/opt/llvm@${{ matrix.config.llvm }}/lib/cmake/llvm
|
||||
\"
|
||||
- name: test
|
||||
run: cd build && ctest -V
|
||||
- name: test_doxygen_examples
|
||||
run: ./ci/extract_test_examples.sh
|
||||
|
||||
windows-ax:
|
||||
if: |
|
||||
github.event_name != 'workflow_dispatch' ||
|
||||
github.event.inputs.type == 'all' ||
|
||||
github.event.inputs.type == 'ax'
|
||||
runs-on: ${{ (github.repository_owner == 'AcademySoftwareFoundation' && 'windows-2022-8c-32g-300h') || 'windows-latest' }}
|
||||
name: ${{ matrix.config.vc }}-${{ matrix.config.crt }}-${{ matrix.config.build }}-llvm${{ matrix.config.llvm }}
|
||||
env:
|
||||
VCPKG_DEFAULT_TRIPLET: ${{ matrix.config.vc }}
|
||||
# Export this with '' avoid bash treating \ as escape
|
||||
VDB_INSTALL_PREFIX: '${{ github.workspace }}\\install'
|
||||
strategy:
|
||||
matrix:
|
||||
config:
|
||||
# static build of blosc from vcpkg does not build internal sources.
|
||||
# USE_STATIC_DEPENDENCIES is required for IlmBase/OpenEXR defines and
|
||||
# Boost as both shared and static libs are installed.
|
||||
# @todo We don't currently run the axtests with shared builds of ax
|
||||
# due to symbol issues using LLVM as a static lib (which is the only
|
||||
# option on Windows).
|
||||
# @note currently only test static builds with MT as building LLVM as
|
||||
# a shared lib on windows is a bit dicey
|
||||
- { vc: 'x64-windows-static', llvm: '18.1.0', crt: 'MultiThreaded', components: 'core,axcore,axbin,axtest', build: 'Release', cmake: '-DOPENVDB_CORE_SHARED=OFF -DOPENVDB_AX_SHARED=OFF -DUSE_STATIC_DEPENDENCIES=ON -DBLOSC_USE_EXTERNAL_SOURCES=ON' }
|
||||
- { vc: 'x64-windows-static', llvm: '18.1.0', crt: 'MultiThreadedDebug', components: 'core,axcore,axbin,axtest', build: 'Debug', cmake: '-DOPENVDB_CORE_SHARED=OFF -DOPENVDB_AX_SHARED=OFF -DUSE_STATIC_DEPENDENCIES=ON -DBLOSC_USE_EXTERNAL_SOURCES=ON' }
|
||||
- { vc: 'x64-windows', llvm: '18.1.0', crt: 'MultiThreadedDLL', components: 'core,axcore,axbin', build: 'Release', cmake: '-DOPENVDB_CORE_STATIC=OFF -DOPENVDB_AX_STATIC=OFF' }
|
||||
- { vc: 'x64-windows-static', llvm: '15.0.0', crt: 'MultiThreaded', components: 'core,axcore,axbin,axtest', build: 'Release', cmake: '-DOPENVDB_CORE_SHARED=OFF -DOPENVDB_AX_SHARED=OFF -DUSE_STATIC_DEPENDENCIES=ON -DBLOSC_USE_EXTERNAL_SOURCES=ON' }
|
||||
fail-fast: false
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: llvm
|
||||
run: ./ci/install_llvm_windows.sh ${{ matrix.config.llvm }} ${{ matrix.config.crt }}
|
||||
- name: install
|
||||
shell: powershell
|
||||
run: |
|
||||
vcpkg update
|
||||
vcpkg install tbb gtest
|
||||
- name: build
|
||||
run: >
|
||||
./ci/build.sh -v
|
||||
--config=${{ matrix.config.build }}
|
||||
--components="${{ matrix.config.components }}"
|
||||
--cargs=\'
|
||||
-A x64 -G \"Visual Studio 17 2022\"
|
||||
-DOPENVDB_USE_DELAYED_LOADING=OFF
|
||||
-DUSE_BLOSC=OFF \
|
||||
-DUSE_ZLIB=OFF \
|
||||
-DVCPKG_TARGET_TRIPLET=${VCPKG_DEFAULT_TRIPLET}
|
||||
-DCMAKE_TOOLCHAIN_FILE=\"${VCPKG_INSTALLATION_ROOT}\\scripts\\buildsystems\\vcpkg.cmake\"
|
||||
-DMSVC_COMPRESS_PDB=ON
|
||||
-DOPENVDB_AX_TEST_CMD_DOWNLOADS=OFF
|
||||
-DUSE_EXPLICIT_INSTANTIATION=OFF
|
||||
-DLLVM_DIR=\"${HOME}\\llvm_install\\lib\\cmake\\llvm\"
|
||||
-DCMAKE_INSTALL_PREFIX=\"${VDB_INSTALL_PREFIX}\"
|
||||
${{ matrix.config.cmake }}
|
||||
\'
|
||||
- name: runtime_path
|
||||
shell: pwsh
|
||||
run: |
|
||||
# note: system path must be modified in a previous step to it's use
|
||||
echo "$Env:VCPKG_INSTALLATION_ROOT\installed\${{ matrix.config.vc }}\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
||||
echo "$Env:VDB_INSTALL_PREFIX\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
||||
- name: test
|
||||
run: cd build && ctest -V -C ${{ matrix.config.build }}
|
||||
|
||||
#############################################################################
|
||||
################################## Blosc ####################################
|
||||
#############################################################################
|
||||
|
||||
windows-nanovdb:
|
||||
if: |
|
||||
github.event_name != 'workflow_dispatch' ||
|
||||
github.event.inputs.type == 'all' ||
|
||||
github.event.inputs.type == 'win'
|
||||
runs-on: ${{ (github.repository_owner == 'AcademySoftwareFoundation' && 'windows-2022-8c-32g-300h') || 'windows-latest' }}
|
||||
env:
|
||||
VCPKG_DEFAULT_TRIPLET: ${{ matrix.config.vc }}
|
||||
visual_studio: "Visual Studio 17 2022"
|
||||
cuda: "12.4.0"
|
||||
strategy:
|
||||
matrix:
|
||||
config:
|
||||
# static build of blosc from vcpkg does not build internal sources.
|
||||
# USE_STATIC_DEPENDENCIES is required for IlmBase/OpenEXR defines and
|
||||
# Boost as both shared and static libs are installed.
|
||||
- { vc: 'x64-windows-static', build: 'Release', cmake: '-A x64 -G \"Visual Studio 17 2022\" -DOPENVDB_CORE_SHARED=OFF -DUSE_STATIC_DEPENDENCIES=ON -DBLOSC_USE_EXTERNAL_SOURCES=ON -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded' }
|
||||
- { vc: 'x64-windows-static', build: 'Debug', cmake: '-A x64 -G \"Visual Studio 17 2022\" -DOPENVDB_CORE_SHARED=OFF -DUSE_STATIC_DEPENDENCIES=ON -DBLOSC_USE_EXTERNAL_SOURCES=ON -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDebug' }
|
||||
- { vc: 'x64-windows', build: 'Release', cmake: '-A x64 -G \"Visual Studio 17 2022\" -DOPENVDB_CORE_STATIC=OFF' }
|
||||
- { vc: 'x64-windows', build: 'Debug', cmake: '-A x64 -G \"Visual Studio 17 2022\" -DOPENVDB_CORE_STATIC=OFF' }
|
||||
fail-fast: false
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: path
|
||||
shell: powershell
|
||||
run: |
|
||||
# note: system path must be modified in a previous step to it's use
|
||||
echo "$Env:VCPKG_INSTALLATION_ROOT\installed\${{ matrix.config.vc }}\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
||||
echo "${{github.workspace}}\build\openvdb\openvdb\${{ matrix.config.build }}" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
||||
- name: install_cuda
|
||||
shell: powershell
|
||||
run: .\ci\install_windows_cuda.ps1
|
||||
- name: install
|
||||
shell: powershell
|
||||
run: .\ci\install_windows.ps1
|
||||
- name: build
|
||||
shell: bash
|
||||
run: >
|
||||
./ci/build.sh -v
|
||||
--config=${{ matrix.config.build }}
|
||||
--components=core,nano,nanotest,nanoexam,nanobench,nanotool
|
||||
--cargs=\'
|
||||
${{ matrix.config.cmake }}
|
||||
-DMSVC_COMPRESS_PDB=ON
|
||||
-DUSE_EXPLICIT_INSTANTIATION=OFF
|
||||
-DNANOVDB_USE_CUDA=ON
|
||||
-DCMAKE_CUDA_ARCHITECTURES="80"
|
||||
-DNANOVDB_USE_OPENVDB=ON
|
||||
-DVCPKG_TARGET_TRIPLET=${VCPKG_DEFAULT_TRIPLET}
|
||||
-DCMAKE_TOOLCHAIN_FILE=\"${VCPKG_INSTALLATION_ROOT}\\scripts\\buildsystems\\vcpkg.cmake\"
|
||||
\'
|
||||
- name: test
|
||||
shell: bash
|
||||
run: cd build && ctest -V -E ".*cuda.*|.*mgpu.*"
|
||||
|
||||
#############################################################################
|
||||
################################## Blosc ####################################
|
||||
#############################################################################
|
||||
|
||||
linux-blosc:
|
||||
if: |
|
||||
github.event_name != 'workflow_dispatch' ||
|
||||
github.event.inputs.type == 'all' ||
|
||||
github.event.inputs.type == 'blosc'
|
||||
runs-on: ${{ (github.repository_owner == 'AcademySoftwareFoundation' && 'ubuntu-22.04-8c-32g-300h') || 'ubuntu-latest' }}
|
||||
name: linux-blosc:${{ matrix.blosc }}
|
||||
container:
|
||||
image: aswf/ci-openvdb:2025-clang19.1
|
||||
strategy:
|
||||
matrix:
|
||||
blosc: ['1.21.0', 'latest']
|
||||
fail-fast: false
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: install_blosc
|
||||
run: sudo ./ci/install_blosc.sh ${{ matrix.blosc }}
|
||||
- name: build
|
||||
run: >
|
||||
sudo ./ci/build.sh -v
|
||||
--build-type=Release
|
||||
--components=\"core,test\"
|
||||
- name: test
|
||||
run: cd build && sudo ctest -V
|
||||
|
||||
#############################################################################
|
||||
################################## ABI ######################################
|
||||
#############################################################################
|
||||
|
||||
linux-abi-checker:
|
||||
if: |
|
||||
github.event_name == 'workflow_dispatch' &&
|
||||
(github.event.inputs.type == 'all' ||
|
||||
github.event.inputs.type == 'abi')
|
||||
runs-on: ubuntu-22.04
|
||||
env:
|
||||
# The 'abicheck' build type sets these, but older versions of the library
|
||||
# may not have this build type. See OpenVDBCXX.cmake
|
||||
CXXFLAGS: "-gdwarf-4 -g3 -ggdb -Og"
|
||||
steps:
|
||||
- name: Enable Node 16
|
||||
run: |
|
||||
echo "ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION=true" >> $GITHUB_ENV
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
fetch-tags: true
|
||||
# Compute the latest major version - that is used as our baseline
|
||||
# note: For CI forks, make sure you have your tags synced
|
||||
- name: get_major_version
|
||||
run: |
|
||||
LATEST_VERSION_TAG=$(git tag --merged | sort --version-sort | tail -n1)
|
||||
echo "Computed latest VDB tag: ${LATEST_VERSION_TAG}"
|
||||
VDB_MAJOR_VERSION=$(echo ${LATEST_VERSION_TAG} | cut -f1 -d '.' | tr -d -c 0-9)
|
||||
echo "Using major version: ${VDB_MAJOR_VERSION}"
|
||||
echo "VDB_MAJOR_VERSION=${VDB_MAJOR_VERSION}" >> "$GITHUB_ENV"
|
||||
- name: install_deps
|
||||
run: sudo apt-get -q install -y libboost-iostreams-dev libtbb-dev libblosc-dev elfutils
|
||||
- name: install_abi_checker
|
||||
run: sudo apt-get -q install -y abi-dumper abi-compliance-checker
|
||||
- name: build_new
|
||||
run: >
|
||||
./ci/build.sh -v
|
||||
--build-dir=build_new
|
||||
--build-type=abicheck
|
||||
--target=openvdb_shared
|
||||
--components=\"core\"
|
||||
--cargs=\'-DUSE_EXPLICIT_INSTANTIATION=OFF -DDISABLE_DEPENDENCY_VERSION_CHECKS=ON\'
|
||||
- name: checkout_baseline
|
||||
run: git checkout v${VDB_MAJOR_VERSION}.0.0
|
||||
- name: build_old
|
||||
run: >
|
||||
./ci/build.sh -v
|
||||
--build-dir=build_old
|
||||
--build-type=abicheck
|
||||
--target=openvdb_shared
|
||||
--components=\"core\"
|
||||
--cargs=\'-DUSE_EXPLICIT_INSTANTIATION=OFF -DDISABLE_DEPENDENCY_VERSION_CHECKS=ON\'
|
||||
- name: abi_dump
|
||||
run: |
|
||||
abi-dumper build_new/openvdb/openvdb/libopenvdb.so -o ABI-NEW.dump -lver 1
|
||||
abi-dumper build_old/openvdb/openvdb/libopenvdb.so -o ABI-OLD.dump -lver 2
|
||||
# Replace the version namespace in the latest ABI dump with the baseline
|
||||
# version we're comparing against. We should probably instead build the
|
||||
# latest with the baseline version number but no CMake/defines allow us to
|
||||
# do this.
|
||||
- name: replace_symbols
|
||||
run: sed -i -E 's/openvdb([^v]*)v[0-9]*_[0-9]/openvdb\1v'${VDB_MAJOR_VERSION}'_0/g' ABI-NEW.dump
|
||||
- name: abi_check
|
||||
# -strict treats warnings as errors
|
||||
# -extended checks all member data
|
||||
# we check everything _not_ in openvdb::**::internal namespace
|
||||
run: >
|
||||
abi-compliance-checker -l OPENVDB
|
||||
-old ABI-OLD.dump
|
||||
-new ABI-NEW.dump
|
||||
-skip-internal-symbols "\d(openvdb.*internal)"
|
||||
-skip-internal-types "(openvdb.*internal)::"
|
||||
-strict
|
||||
-extended
|
||||
- name: upload_report
|
||||
uses: actions/upload-artifact@v4
|
||||
if: always()
|
||||
with:
|
||||
name: abi_report
|
||||
path: ./compat_reports/OPENVDB/2_to_1/compat_report.html
|
||||
retention-days: 5
|
||||
@@ -4,39 +4,30 @@ name: Whitespace
|
||||
on:
|
||||
push:
|
||||
paths-ignore:
|
||||
- 'ext/**'
|
||||
- 'pendingchanges/**'
|
||||
- 'tsc/meetings/**'
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- 'ext/**'
|
||||
- 'pendingchanges/**'
|
||||
- 'tsc/meetings/**'
|
||||
|
||||
# Allow subsequent pushes to the same PR or REF to cancel any previous jobs.
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
# Search the git repository for any trailing spaces excluding meeting notes and auto-generated wlt files
|
||||
# Search the git repository for any trailing spaces excluding meeting notes
|
||||
trailingspaces:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v2
|
||||
- name: test
|
||||
run: |
|
||||
set +e
|
||||
git grep -n -I -E '^.+[ ]+$' -- ':!tsc/meetings/*' ':!pendingchanges/*' ':!ext/*' ':!*.wlt'
|
||||
git grep -n -I -E '^.+[ ]+$' -- ':!tsc/meetings/*'
|
||||
test $? -eq 1
|
||||
|
||||
# Search for any tabs excluding meeting notes, image files and a few others
|
||||
spacesnottabs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v2
|
||||
- name: test
|
||||
run: |
|
||||
set +e
|
||||
git grep -n " " -- ':!*/whitespace.yml' ':!tsc/meetings/*' ':!*.svg' ':!*.cmd' ':!*.png' ':!pendingchanges/*' ':!ext/*' ':!*.wlt' ':!*.jpg' ':!*.gif' ':!*.mp4' ':!*.pt' ':!*.pth' ':!*.nvdb' ':!*.npz'
|
||||
git grep -n " " -- ':!*/whitespace.yml' ':!tsc/meetings/*' ':!*.svg' ':!*.cmd' ':!*.png'
|
||||
test $? -eq 1
|
||||
|
||||
@@ -1,2 +1 @@
|
||||
/build/*
|
||||
.DS_Store
|
||||
|
||||
+436
-300
@@ -1,5 +1,5 @@
|
||||
# Copyright Contributors to the OpenVDB Project
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MPL-2.0
|
||||
#
|
||||
#[=======================================================================[
|
||||
|
||||
@@ -18,12 +18,12 @@
|
||||
and required dependencies are expected. See the dependency documentation
|
||||
for more information:
|
||||
|
||||
https://www.openvdb.org/documentation/doxygen/dependencies.html
|
||||
https://academysoftwarefoundation.github.io/openvdb/dependencies.html
|
||||
|
||||
And the documentation on building OpenVDB for more in depth installation
|
||||
instructions:
|
||||
|
||||
https://www.openvdb.org/documentation/doxygen/build.html
|
||||
https://academysoftwarefoundation.github.io/openvdb/build.html
|
||||
|
||||
This CMakeLists file provides most available options for configuring the
|
||||
build and installation of all OpenVDB components. By default the core
|
||||
@@ -42,7 +42,7 @@
|
||||
|
||||
# note: cmake_minimum_required must be called before project commands to
|
||||
# ensure policy scope is set up correctly
|
||||
cmake_minimum_required(VERSION 3.24)
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
|
||||
# CMP0091 allows for MSVC ABI targetting via CMAKE_MSVC_RUNTIME_LIBRARY
|
||||
# from CMake 3.15 and above. Must come before project().
|
||||
@@ -52,9 +52,9 @@ endif()
|
||||
|
||||
###### Version
|
||||
|
||||
set(OpenVDB_MAJOR_VERSION 13)
|
||||
set(OpenVDB_MINOR_VERSION 0)
|
||||
set(OpenVDB_PATCH_VERSION 1)
|
||||
set(OpenVDB_MAJOR_VERSION 8)
|
||||
set(OpenVDB_MINOR_VERSION 2)
|
||||
set(OpenVDB_PATCH_VERSION 0)
|
||||
set(OpenVDB_VERSION "${OpenVDB_MAJOR_VERSION}.${OpenVDB_MINOR_VERSION}.${OpenVDB_PATCH_VERSION}")
|
||||
|
||||
project(OpenVDB LANGUAGES CXX VERSION ${OpenVDB_VERSION})
|
||||
@@ -64,7 +64,7 @@ project(OpenVDB LANGUAGES CXX VERSION ${OpenVDB_VERSION})
|
||||
include(CMakeDependentOption)
|
||||
include(GNUInstallDirs)
|
||||
|
||||
# Components
|
||||
# todo epydoc and pdflatex
|
||||
option(OPENVDB_BUILD_CORE "Enable the core OpenVDB library. Both static and shared versions are enabled by default" ON)
|
||||
option(OPENVDB_BUILD_BINARIES "Enable the vdb binaries. Only vdb_print is enabled by default" ON)
|
||||
option(OPENVDB_BUILD_PYTHON_MODULE "Build the pyopenvdb Python module" OFF)
|
||||
@@ -72,47 +72,24 @@ option(OPENVDB_BUILD_UNITTESTS "Build the OpenVDB unit tests" OFF)
|
||||
option(OPENVDB_BUILD_DOCS "Build the OpenVDB documentation" OFF)
|
||||
option(OPENVDB_BUILD_HOUDINI_PLUGIN "Build the Houdini plugin" OFF)
|
||||
option(OPENVDB_BUILD_HOUDINI_ABITESTS "Build the Houdini ABI tests" OFF)
|
||||
option(OPENVDB_BUILD_MAYA_PLUGIN "Build the Maya plugin" OFF)
|
||||
option(OPENVDB_BUILD_AX "Build the OpenVDB AX library. Turns ON if USE_AX is ON." ${USE_AX})
|
||||
option(OPENVDB_BUILD_AX_UNITTESTS "Build the OpenVDB AX unit tests" OFF)
|
||||
option(OPENVDB_BUILD_NANOVDB "Build the NanoVDB library. Turns ON if USE_NANOVDB is ON." ${USE_NANOVDB})
|
||||
|
||||
# Global options
|
||||
option(OPENVDB_BUILD_AX "Build the OpenVDB AX library" OFF)
|
||||
option(OPENVDB_BUILD_AX_BINARIES "Build the OpenVDB AX command line binary" OFF)
|
||||
option(OPENVDB_BUILD_AX_UNITTESTS "Build the OpenVDB AX unit tests" OFF)
|
||||
|
||||
option(OPENVDB_BUILD_MAYA_PLUGIN "Build the Maya plugin" OFF)
|
||||
option(OPENVDB_ENABLE_RPATH "Build with RPATH information" ON)
|
||||
option(OPENVDB_ENABLE_ASSERTS "Build with asserts in OpenVDB code enabled" OFF)
|
||||
option(OPENVDB_ENABLE_VEC_RELATIONAL_OPERATIONS [=[
|
||||
Enabled deprecated relational < and > operators on Vector types. This option
|
||||
will be switched to OFF and the feature will be subsequently removed in future
|
||||
releases.]=] ON)
|
||||
option(OPENVDB_USE_DELAYED_LOADING "Build the core OpenVDB library with delayed-loading." ON)
|
||||
option(OPENVDB_CXX_STRICT "Enable or disable pre-defined compiler warnings" OFF)
|
||||
cmake_dependent_option(OPENVDB_INSTALL_CMAKE_MODULES
|
||||
"Install the provided OpenVDB CMake modules when building the core library"
|
||||
ON "OPENVDB_BUILD_CORE" OFF)
|
||||
option(USE_CCACHE "Build using Ccache if found on the path" ON)
|
||||
# Disable this on Windows due to linker OOM issues:
|
||||
# LNK1248: image size (XXX) exceeds maximum allowable size (FFFFFFFF)
|
||||
# https://github.com/AcademySoftwareFoundation/openvdb/issues/1718
|
||||
# https://github.com/AcademySoftwareFoundation/openvdb/issues/1624
|
||||
cmake_dependent_option(USE_EXPLICIT_INSTANTIATION "Use explicit instantiation for all supported classes
|
||||
and methods against a pre-defined list of OpenVDB trees. This makes the core library larger and slower
|
||||
to compile, but speeds up the compilation of all dependent code by bypassing the expensive template
|
||||
instantation." ON "NOT WIN32" OFF)
|
||||
option(OPENVDB_FUTURE_DEPRECATION "Generate messages for upcoming deprecation" ON)
|
||||
option(OPENVDB_ENABLE_UNINSTALL "Adds a CMake uninstall target." ON)
|
||||
option(USE_COLORED_OUTPUT "Always produce ANSI-colored output (GNU/Clang only)." OFF)
|
||||
|
||||
# Component dependency options
|
||||
cmake_dependent_option(USE_PKGCONFIG "Use pkg-config to search for dependent libraries." ON "NOT WIN32" OFF)
|
||||
option(USE_HOUDINI [=[
|
||||
Build the library against a Houdini installation. Turns on automatically if OPENVDB_BUILD_HOUDINI_PLUGIN is enabled.
|
||||
When enabled, you do not need to provide dependency locations for TBB, Blosc, Imath and OpenEXR. Boost must be
|
||||
provided. Imath/OpenEXR can optionally be provided.]=] OFF)
|
||||
When enabled, you do not need to provide dependency locations for TBB, Blosc, IlmBase and OpenEXR. Boost must be
|
||||
provided. IlmBase/OpenEXR can optionally be provided if Houdini Version >= 17.5.]=] OFF)
|
||||
option(USE_MAYA [=[
|
||||
Build the library against a Maya installation. Turns on automatically if OPENVDB_BUILD_MAYA_PLUGIN is enabled.
|
||||
When enabled, you do not need to provide dependency locations for TBB. All other dependencies must be provided.]=] OFF)
|
||||
option(USE_TBB [=[
|
||||
Use TBB in building the NanoVDB library.]=] ON)
|
||||
option(USE_BLOSC [=[
|
||||
Use blosc while building openvdb components. If OPENVDB_BUILD_CORE is OFF, CMake attempts to query the located
|
||||
openvdb build configuration to decide on blosc support. You may set this to on to force blosc to be used if you
|
||||
@@ -124,49 +101,19 @@ option(USE_LOG4CPLUS [=[
|
||||
Use log4cplus while building openvdb components. If OPENVDB_BUILD_CORE is OFF, CMake attempts to query the
|
||||
located openvdb build configuration to decide on log4cplus support. You may set this to on to force log4cplus
|
||||
to be used if you know it to be required.]=] OFF)
|
||||
option(USE_EXR [=[
|
||||
Use OpenEXR while building openvdb components. If enabled, this also switches USE_IMATH_HALF to ON unless
|
||||
it too was provided and set to OFF.]=] OFF)
|
||||
option(USE_IMATH_HALF [=[
|
||||
Use the definiton of half floating point types from the Imath library. If OFF, the embedded definition provided
|
||||
by OpenVDB is used. If OPENVDB_BUILD_CORE is OFF, CMake attempts to query the located openvdb build configuration
|
||||
to select the correct half support. You may set this to on to force Imath half to be used if you know it to be
|
||||
required.]=] ${USE_EXR})
|
||||
option(USE_PNG "Use PNG while building openvdb components." OFF)
|
||||
option(USE_AX "Use OpenVDB AX while building openvdb components." ${OPENVDB_BUILD_AX})
|
||||
option(USE_NANOVDB "Use NanoVDB while building openvdb components." ${OPENVDB_BUILD_NANOVDB})
|
||||
option(USE_VCL [=[
|
||||
Use the internally supplied copy of Agner Fog's vectorclass (VCL) SIMD wrapper
|
||||
library to instrument OpenVDB tools. This also requires VCL to be installed
|
||||
along with OpenVDB headers. Only applicable which compiling for x86 targets.]=] OFF)
|
||||
set(OPENVDB_X86_INSTRSET 0 CACHE STRING [=[
|
||||
The x86 instruction set to use. When unset, if USE_VCL is ON, this is
|
||||
automatically configured based on provided build flags. When unset and USE_VCL
|
||||
is OFF, defaults to 0. It is expected for you to provide this flag. Available
|
||||
values are:
|
||||
0: Unknown or unspecified
|
||||
1: SSE -msse
|
||||
2: SSE2 -msse2 # Minimum on x86_64
|
||||
3: SSE3 -msse3
|
||||
4: SSSE3 -mssse3
|
||||
5: SSE4.1 -msse4.1
|
||||
6: SSE4.2 -msse4.2 # Minimum recommended where supported
|
||||
7: AVX -mavx
|
||||
8: AVX2 -mavx2
|
||||
9: AVX512F -mavx512f
|
||||
10: AVX512BW/DQ/VL -mavx512bw -mavx512dq -mavx512vl
|
||||
Note that (while not strictly enforced by vendors) each option implies all
|
||||
preceeding flags. If you need more granular control you can provide your
|
||||
desired flags via CXX_FLAGS. Only applicable which compiling for x86 targets.
|
||||
]=])
|
||||
|
||||
required.]=] OFF)
|
||||
cmake_dependent_option(OPENVDB_DISABLE_BOOST_IMPLICIT_LINKING
|
||||
"Disable the implicit linking of Boost libraries on Windows" ON "WIN32" OFF)
|
||||
option(USE_CCACHE "Build using Ccache if found on the path" ON)
|
||||
option(USE_STATIC_DEPENDENCIES [=[
|
||||
Only search for and use static libraries. If OFF the shared versions of requried libraries are prioritised, falling
|
||||
back to static libraries. Forcing individual static dependencies can be enabled by setting XXX_USE_STATIC_LIBS
|
||||
to ON, where XXX is the package name. On Windows this behaviour is less strict, with any located libraries assumed
|
||||
to be static. This has no effect for any packages found with Xxx_DIR (i.e. CMake CONFIG mode).]=] OFF)
|
||||
to be static. ]=] OFF)
|
||||
option(DISABLE_DEPENDENCY_VERSION_CHECKS [=[
|
||||
Disable minimum version checks for OpenVDB dependencies. It is strongly recommended that this remains disabled.
|
||||
Consider updating your dependencies where possible if encountering minimum requirement CMake errors.]=] OFF)
|
||||
@@ -175,6 +122,12 @@ Disable CMakes default system search paths when locating dependencies. When enab
|
||||
its default system search routine if it cannot find a dependency with the provided settings. When disabled, only
|
||||
paths provided through the Xxx_ROOT, supported XXX_INCLUDEDIR/XXX_LIBRARYDIR variables or the SYSTEM_LIBRARY_PATHS
|
||||
list will be searched.]=] OFF)
|
||||
option(OPENVDB_USE_DEPRECATED_ABI_6 "Bypass minimum ABI requirement checks" OFF)
|
||||
option(OPENVDB_USE_FUTURE_ABI_9 "Bypass future ABI check" OFF)
|
||||
option(OPENVDB_FUTURE_DEPRECATION "Generate messages for upcoming deprecation" ON)
|
||||
option(OPENVDB_ENABLE_UNINSTALL "Adds a CMake uninstall target." ON)
|
||||
option(USE_COLORED_OUTPUT "Always produce ANSI-colored output (GNU/Clang only)." OFF)
|
||||
option(USE_PKGCONFIG "Use pkg-config to search for dependent libraries." ON)
|
||||
|
||||
set(SYSTEM_LIBRARY_PATHS "" CACHE STRING [=[
|
||||
A global list of library paths to additionally use into when searching for dependencies.]=])
|
||||
@@ -182,7 +135,7 @@ set(MSVC_MP_THREAD_COUNT "" CACHE STRING [=[
|
||||
The number of threads to use when invoking MSVC builds with cmake --build. CMake defaults to 1. Note that
|
||||
cmake --parallel and CMAKE_BUILD_PARALLEL_LEVEL only change the number of PROJECTS that are built in parallel,
|
||||
NOT the number of TU's ]=])
|
||||
option(MSVC_COMPRESS_PDB "Whether to attempt to compress PDB symbol data in MSVC debug builds." OFF)
|
||||
|
||||
|
||||
set(_CONCURRENT_MALLOC_OPTIONS None Auto Jemalloc Tbbmalloc)
|
||||
if(NOT CONCURRENT_MALLOC)
|
||||
@@ -200,33 +153,228 @@ elseif(NOT ${CONCURRENT_MALLOC} IN_LIST _CONCURRENT_MALLOC_OPTIONS)
|
||||
set(CONCURRENT_MALLOC Auto CACHE STRING FORCE)
|
||||
endif()
|
||||
|
||||
set(_OPENVDB_SIMD_OPTIONS None SSE42 AVX)
|
||||
if(NOT OPENVDB_SIMD)
|
||||
set(OPENVDB_SIMD None CACHE STRING
|
||||
"Choose whether to enable SIMD compiler flags or not, options are: None SSE42 AVX.
|
||||
Although not required, it is strongly recommended to enable SIMD. AVX implies SSE42.
|
||||
None is the default." FORCE
|
||||
)
|
||||
elseif(NOT ${OPENVDB_SIMD} IN_LIST _OPENVDB_SIMD_OPTIONS)
|
||||
message(WARNING "Unrecognized or unsupported value for OPENVDB_SIMD, "
|
||||
"using None instead.")
|
||||
set(OPENVDB_SIMD None CACHE STRING FORCE)
|
||||
endif()
|
||||
|
||||
if(USE_BLOSC AND NOT USE_ZLIB)
|
||||
message(WARNING "ZLib can only be disabled if Blosc is also disabled. Enabling ZLib.")
|
||||
endif()
|
||||
|
||||
if(USE_NANOVDB)
|
||||
if(OPENVDB_BUILD_CORE AND NOT OPENVDB_BUILD_NANOVDB)
|
||||
message(FATAL_ERROR "Invalid CMake build configuration:
|
||||
OPENVDB_BUILD_CORE: [ON]
|
||||
OPENVDB_BUILD_NANOVDB: [OFF]
|
||||
USE_NANOVDB: [ON]
|
||||
If you are rebuilding the core library and using sub components, building
|
||||
these sub components must also be enabled (i.e. -DOPENVDB_BUILD_NANOVDB=ON).")
|
||||
# Top-level location for all openvdb headers
|
||||
set(OPENVDB_INSTALL_INCLUDEDIR "${CMAKE_INSTALL_INCLUDEDIR}/openvdb")
|
||||
|
||||
###### Deprecated options
|
||||
|
||||
if(USE_EXR)
|
||||
message(FATAL_ERROR "The USE_EXR option has been removed. Use USE_IMATH_HALF to use the Half "
|
||||
"implementation from IMath, or leave OFF to use the new embedded version of half floating point types.")
|
||||
endif()
|
||||
if(OPENVDB_BUILD_HOUDINI_SOPS)
|
||||
message(FATAL_ERROR "The OPENVDB_BUILD_HOUDINI_SOPS option has been removed. Use OPENVDB_BUILD_HOUDINI_PLUGIN.")
|
||||
endif()
|
||||
if(DEFINED USE_SYSTEM_LIBRARY_PATHS)
|
||||
message(FATAL_ERROR "The USE_SYSTEM_LIBRARY_PATHS option has been removed. Use DISABLE_CMAKE_SEARCH_PATHS.")
|
||||
endif()
|
||||
|
||||
# Various root level CMake options which are marked as advanced
|
||||
|
||||
mark_as_advanced(
|
||||
OPENVDB_CXX_STRICT
|
||||
OPENVDB_ENABLE_RPATH
|
||||
USE_HOUDINI
|
||||
USE_MAYA
|
||||
USE_LOG4CPLUS
|
||||
USE_IMATH_HALF
|
||||
USE_CCACHE
|
||||
OPENVDB_BUILD_HOUDINI_ABITESTS
|
||||
DISABLE_DEPENDENCY_VERSION_CHECKS
|
||||
DISABLE_CMAKE_SEARCH_PATHS
|
||||
OPENVDB_USE_DEPRECATED_ABI_6
|
||||
OPENVDB_USE_FUTURE_ABI_9
|
||||
OPENVDB_FUTURE_DEPRECATION
|
||||
CONCURRENT_MALLOC
|
||||
USE_COLORED_OUTPUT
|
||||
SYSTEM_LIBRARY_PATHS
|
||||
OPENVDB_SIMD
|
||||
)
|
||||
|
||||
# Configure minimum version requirements - some are treated specially and fall
|
||||
# outside of the DISABLE_DEPENDENCY_VERSION_CHECKS catch
|
||||
|
||||
set(MINIMUM_CXX_STANDARD 14)
|
||||
|
||||
# @note Blosc version is currently treated as exception which must be adhered
|
||||
# to. The minimum version must be at least 1.5.0. Previous versions are incompatible.
|
||||
# Later versions (including 1.5.4), can be buggy on certain platforms.
|
||||
set(MINIMUM_BLOSC_VERSION 1.5.0)
|
||||
# @note ABI always enforced so the correct deprecation messages are available.
|
||||
# OPENVDB_USE_DEPRECATED_ABI_<VERSION> should be used to circumvent this
|
||||
set(MINIMUM_OPENVDB_ABI_VERSION 6)
|
||||
set(FUTURE_MINIMUM_OPENVDB_ABI_VERSION 7)
|
||||
set(FUTURE_OPENVDB_ABI_VERSION 9)
|
||||
|
||||
if(NOT DISABLE_DEPENDENCY_VERSION_CHECKS)
|
||||
# @note Currently tracking CY2019 of the VFX platform where available
|
||||
set(MINIMUM_GCC_VERSION 6.3.1)
|
||||
set(MINIMUM_CLANG_VERSION 3.8)
|
||||
set(MINIMUM_ICC_VERSION 17)
|
||||
set(MINIMUM_MSVC_VERSION 19.10)
|
||||
|
||||
set(MINIMUM_BOOST_VERSION 1.61) # @warning should be 1.66, but H18 ships with 1.61
|
||||
set(MINIMUM_ILMBASE_VERSION 2.2) # @warning should be 2.3, but H18 ships with 2.2
|
||||
set(MINIMUM_OPENEXR_VERSION 2.2) # @warning should be 2.3, but H18 ships with 2.2
|
||||
set(MINIMUM_ZLIB_VERSION 1.2.7)
|
||||
set(MINIMUM_TBB_VERSION 2018.0)
|
||||
set(MINIMUM_LLVM_VERSION 6.0.0)
|
||||
|
||||
set(MINIMUM_PYTHON_VERSION 2.7)
|
||||
set(MINIMUM_NUMPY_VERSION 1.14.0)
|
||||
|
||||
set(MINIMUM_GOOGLETEST_VERSION 1.8)
|
||||
set(MINIMUM_GLFW_VERSION 3.1)
|
||||
set(MINIMUM_LOG4CPLUS_VERSION 1.1.2)
|
||||
set(MINIMUM_HOUDINI_VERSION 18.0)
|
||||
|
||||
# These always promote warnings rather than errors
|
||||
set(MINIMUM_MAYA_VERSION 2017)
|
||||
set(MINIMUM_DOXYGEN_VERSION 1.8.8)
|
||||
endif()
|
||||
|
||||
# VFX 20 deprecations to transition to MINIMUM_* variables in OpenVDB 9.0.0
|
||||
|
||||
# Note: CMake 3.15 chosen as possible next version due to Windows support
|
||||
# with CMAKE_MSVC_RUNTIME_LIBRARY, numpy modules with CMake 3.14 and simplified
|
||||
# python linkage on macOS (Python::Module target in 3.15)
|
||||
set(FUTURE_MINIMUM_CMAKE_VERSION 3.15)
|
||||
|
||||
# No compiler upgrades planned
|
||||
#set(FUTURE_MINIMUM_GCC_VERSION 6.3.1)
|
||||
#set(FUTURE_MINIMUM_ICC_VERSION 17)
|
||||
#set(FUTURE_MINIMUM_MSVC_VERSION 19.10)
|
||||
|
||||
set(FUTURE_MINIMUM_ILMBASE_VERSION 2.4)
|
||||
set(FUTURE_MINIMUM_OPENEXR_VERSION 2.4)
|
||||
set(FUTURE_MINIMUM_BOOST_VERSION 1.70)
|
||||
set(FUTURE_MINIMUM_TBB_VERSION 2019.0)
|
||||
set(FUTURE_MINIMUM_PYTHON_VERSION 3.7)
|
||||
set(FUTURE_MINIMUM_NUMPY_VERSION 1.17.0)
|
||||
set(FUTURE_MINIMUM_HOUDINI_VERSION 18.5)
|
||||
set(FUTURE_MINIMUM_LLVM_VERSION 8.0.0)
|
||||
|
||||
#########################################################################
|
||||
|
||||
# General CMake and CXX settings
|
||||
|
||||
if(FUTURE_MINIMUM_CMAKE_VERSION)
|
||||
if(${CMAKE_VERSION} VERSION_LESS ${FUTURE_MINIMUM_CMAKE_VERSION})
|
||||
message(DEPRECATION "Support for CMake versions < ${FUTURE_MINIMUM_CMAKE_VERSION} "
|
||||
"is deprecated and will be removed.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(USE_AX)
|
||||
if(OPENVDB_BUILD_CORE AND NOT OPENVDB_BUILD_AX)
|
||||
message(FATAL_ERROR "Invalid CMake build configuration:
|
||||
OPENVDB_BUILD_CORE: [ON]
|
||||
OPENVDB_BUILD_AX: [OFF]
|
||||
USE_AX: [ON]
|
||||
If you are rebuilding the core library and using sub components, building
|
||||
these sub components must also be enabled (i.e. -DOPENVDB_BUILD_AX=ON).")
|
||||
if(NOT CMAKE_CXX_STANDARD)
|
||||
set(CMAKE_CXX_STANDARD ${MINIMUM_CXX_STANDARD} CACHE STRING
|
||||
"The C++ standard whose features are requested to build OpenVDB components." FORCE)
|
||||
elseif(CMAKE_CXX_STANDARD LESS ${MINIMUM_CXX_STANDARD})
|
||||
message(FATAL_ERROR "Provided C++ Standard is less than the supported minimum."
|
||||
"Required is at least \"${MINIMUM_CXX_STANDARD}\" (found ${CMAKE_CXX_STANDARD})")
|
||||
endif()
|
||||
|
||||
# Configure MS Runtime
|
||||
|
||||
if(CMAKE_MSVC_RUNTIME_LIBRARY AND CMAKE_VERSION VERSION_LESS 3.15)
|
||||
# CMAKE_MSVC_RUNTIME_LIBRARY selects the MSVC runtime library for use by compilers
|
||||
# targeting the MSVC ABI. Options are: MultiThreaded MultiThreadedDLL MultiThreadedDebug
|
||||
# MultiThreadedDebugDLL. If empty, CMake defaults to MultiThreaded$<$<CONFIG:Debug>:Debug>DLL
|
||||
message(FATAL_ERROR "CMAKE_MSVC_RUNTIME_LIBRARY support is only available from CMake 3.15")
|
||||
endif()
|
||||
if(WIN32 AND CMAKE_MSVC_RUNTIME_LIBRARY)
|
||||
message(STATUS "CMAKE_MSVC_RUNTIME_LIBRARY set to target ${CMAKE_MSVC_RUNTIME_LIBRARY}")
|
||||
|
||||
# Configure Boost library varient on Windows
|
||||
if(NOT Boost_USE_STATIC_RUNTIME)
|
||||
set(Boost_USE_STATIC_RUNTIME OFF)
|
||||
if(CMAKE_MSVC_RUNTIME_LIBRARY STREQUAL MultiThreaded OR
|
||||
CMAKE_MSVC_RUNTIME_LIBRARY STREQUAL MultiThreadedDebug)
|
||||
set(Boost_USE_STATIC_RUNTIME ON)
|
||||
endif()
|
||||
endif()
|
||||
if(NOT Boost_USE_DEBUG_RUNTIME)
|
||||
set(Boost_USE_DEBUG_RUNTIME OFF)
|
||||
if(CMAKE_MSVC_RUNTIME_LIBRARY STREQUAL MultiThreadedDebugDLL OR
|
||||
CMAKE_MSVC_RUNTIME_LIBRARY STREQUAL MultiThreadedDebug)
|
||||
set(Boost_USE_DEBUG_RUNTIME ON)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(OPENVDB_BUILD_HOUDINI_PLUGIN OR OPENVDB_BUILD_HOUDINI_ABITESTS)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
|
||||
set(CMAKE_DISABLE_SOURCE_CHANGES ON)
|
||||
set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)
|
||||
|
||||
if(OPENVDB_ENABLE_RPATH)
|
||||
# Configure rpath for installation base on the following:
|
||||
# https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/RPATH-handling
|
||||
set(CMAKE_SKIP_BUILD_RPATH FALSE)
|
||||
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
|
||||
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
||||
# @todo make relocatable?
|
||||
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
|
||||
endif()
|
||||
|
||||
# For CMake's find Threads module which brings in pthread - This flag
|
||||
# forces the compiler -pthread flag vs -lpthread
|
||||
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
|
||||
|
||||
enable_testing()
|
||||
|
||||
# Add our cmake modules
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
|
||||
|
||||
# Add backports to support older versions of CMake
|
||||
# FindNumPy.cmake is needed if CMake < 3.14
|
||||
|
||||
if(${CMAKE_VERSION} VERSION_LESS 3.14)
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake/backports")
|
||||
endif()
|
||||
|
||||
# Add cmake modules to installation command
|
||||
# @todo fix our glew cmake module
|
||||
|
||||
if(OPENVDB_INSTALL_CMAKE_MODULES)
|
||||
set(OPENVDB_CMAKE_MODULES
|
||||
cmake/FindBlosc.cmake
|
||||
cmake/FindJemalloc.cmake
|
||||
cmake/FindIlmBase.cmake
|
||||
cmake/FindLog4cplus.cmake
|
||||
cmake/FindOpenEXR.cmake
|
||||
cmake/FindOpenVDB.cmake
|
||||
cmake/FindTBB.cmake
|
||||
cmake/OpenVDBGLFW3Setup.cmake
|
||||
cmake/OpenVDBHoudiniSetup.cmake
|
||||
cmake/OpenVDBMayaSetup.cmake
|
||||
cmake/OpenVDBUtils.cmake
|
||||
)
|
||||
install(FILES ${OPENVDB_CMAKE_MODULES} DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/OpenVDB)
|
||||
endif()
|
||||
|
||||
# Configure DCC installation if necessary
|
||||
|
||||
if(OPENVDB_BUILD_HOUDINI_PLUGIN OR
|
||||
OPENVDB_BUILD_HOUDINI_ABITESTS)
|
||||
set(USE_HOUDINI ON)
|
||||
endif()
|
||||
|
||||
@@ -239,112 +387,8 @@ if(USE_MAYA AND USE_HOUDINI)
|
||||
# exactly but it's difficult to validate and dangerous
|
||||
message(FATAL_ERROR "Cannot build both Houdini and Maya plugins against "
|
||||
"the same core dependencies. Plugins must be compiled separately to "
|
||||
"ensure the required DCC dependencies are met.")
|
||||
endif()
|
||||
|
||||
###### Deprecated options
|
||||
|
||||
if(OPENVDB_CODE_COVERAGE)
|
||||
message(FATAL_ERROR "The OPENVDB_CODE_COVERAGE option has been removed. Choose instead the unique"
|
||||
"build type -DCMAKE_BUILD_TYPE=coverage")
|
||||
endif()
|
||||
if(OPENVDB_BUILD_HOUDINI_SOPS)
|
||||
message(FATAL_ERROR "The OPENVDB_BUILD_HOUDINI_SOPS option has been removed. Use OPENVDB_BUILD_HOUDINI_PLUGIN.")
|
||||
endif()
|
||||
if(DEFINED USE_SYSTEM_LIBRARY_PATHS)
|
||||
message(FATAL_ERROR "The USE_SYSTEM_LIBRARY_PATHS option has been removed. Use DISABLE_CMAKE_SEARCH_PATHS.")
|
||||
endif()
|
||||
|
||||
# Various root level CMake options which are marked as advanced
|
||||
|
||||
mark_as_advanced(
|
||||
CONCURRENT_MALLOC
|
||||
DISABLE_CMAKE_SEARCH_PATHS
|
||||
DISABLE_DEPENDENCY_VERSION_CHECKS
|
||||
OPENVDB_BUILD_HOUDINI_ABITESTS
|
||||
OPENVDB_CXX_STRICT
|
||||
OPENVDB_ENABLE_RPATH
|
||||
OPENVDB_USE_DELAYED_LOADING
|
||||
OPENVDB_FUTURE_DEPRECATION
|
||||
OPENVDB_SIMD
|
||||
SYSTEM_LIBRARY_PATHS
|
||||
USE_CCACHE
|
||||
USE_COLORED_OUTPUT
|
||||
USE_HOUDINI
|
||||
USE_IMATH_HALF
|
||||
USE_LOG4CPLUS
|
||||
USE_MAYA
|
||||
MSVC_COMPRESS_PDB
|
||||
)
|
||||
|
||||
#########################################################################
|
||||
|
||||
# Configure MINIMUM and FUTURE_MINIMUM version variables
|
||||
|
||||
include(cmake/config/OpenVDBVersions.cmake)
|
||||
|
||||
if(OPENVDB_FUTURE_DEPRECATION AND FUTURE_MINIMUM_CMAKE_VERSION)
|
||||
if(CMAKE_VERSION VERSION_LESS ${FUTURE_MINIMUM_CMAKE_VERSION})
|
||||
message(DEPRECATION "Support for CMake versions < ${FUTURE_MINIMUM_CMAKE_VERSION} "
|
||||
"is deprecated and will be removed.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
foreach(DEPRECATED_ABI ${OPENVDB_DEPRECATED_ABI_LIST})
|
||||
option(OPENVDB_USE_DEPRECATED_ABI_${DEPRECATED_ABI} "Bypass minimum ABI requirement checks" OFF)
|
||||
mark_as_advanced(OPENVDB_USE_DEPRECATED_ABI_${DEPRECATED_ABI})
|
||||
endforeach()
|
||||
option(OPENVDB_USE_FUTURE_ABI_${FUTURE_OPENVDB_ABI_VERSION} "Bypass future ABI check" OFF)
|
||||
mark_as_advanced(OPENVDB_USE_FUTURE_ABI_${FUTURE_OPENVDB_ABI_VERSION})
|
||||
|
||||
#########################################################################
|
||||
|
||||
enable_testing()
|
||||
|
||||
# Add our cmake modules
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
|
||||
|
||||
# Add cmake modules to installation command
|
||||
|
||||
if(SKBUILD)
|
||||
set(OPENVDB_INSTALL_BINDIR openvdb/${CMAKE_INSTALL_BINDIR})
|
||||
set(OPENVDB_INSTALL_LIBDIR openvdb/${CMAKE_INSTALL_LIBDIR})
|
||||
set(OPENVDB_INSTALL_INCLUDEDIR openvdb/${CMAKE_INSTALL_INCLUDEDIR})
|
||||
|
||||
if(OPENVDB_BUILD_NANOVDB)
|
||||
set(NANOVDB_INSTALL_BINDIR nanovdb/${CMAKE_INSTALL_BINDIR})
|
||||
set(NANOVDB_INSTALL_LIBDIR nanovdb/${CMAKE_INSTALL_LIBDIR})
|
||||
set(NANOVDB_INSTALL_INCLUDEDIR nanovdb/${CMAKE_INSTALL_INCLUDEDIR})
|
||||
set(NANOVDB_INSTALL_DOCDIR nanovdb/${CMAKE_INSTALL_DOCDIR})
|
||||
endif()
|
||||
else()
|
||||
set(OPENVDB_INSTALL_BINDIR ${CMAKE_INSTALL_BINDIR})
|
||||
set(OPENVDB_INSTALL_LIBDIR ${CMAKE_INSTALL_LIBDIR})
|
||||
set(OPENVDB_INSTALL_INCLUDEDIR ${CMAKE_INSTALL_INCLUDEDIR})
|
||||
|
||||
if(OPENVDB_BUILD_NANOVDB)
|
||||
set(NANOVDB_INSTALL_BINDIR ${CMAKE_INSTALL_BINDIR})
|
||||
set(NANOVDB_INSTALL_LIBDIR ${CMAKE_INSTALL_LIBDIR})
|
||||
set(NANOVDB_INSTALL_INCLUDEDIR ${CMAKE_INSTALL_INCLUDEDIR})
|
||||
set(NANOVDB_INSTALL_DOCDIR ${CMAKE_INSTALL_DOCDIR})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(OPENVDB_INSTALL_CMAKE_MODULES)
|
||||
set(OPENVDB_CMAKE_MODULES
|
||||
cmake/FindBlosc.cmake
|
||||
cmake/FindJemalloc.cmake
|
||||
cmake/FindLog4cplus.cmake
|
||||
cmake/FindOpenEXR.cmake
|
||||
cmake/FindOpenVDB.cmake
|
||||
cmake/FindTBB.cmake
|
||||
cmake/OpenVDBGLFW3Setup.cmake
|
||||
cmake/OpenVDBHoudiniSetup.cmake
|
||||
cmake/OpenVDBMayaSetup.cmake
|
||||
cmake/OpenVDBUtils.cmake
|
||||
"ensure the required DCC dependencies are met."
|
||||
)
|
||||
install(FILES ${OPENVDB_CMAKE_MODULES} DESTINATION ${OPENVDB_INSTALL_LIBDIR}/cmake/OpenVDB)
|
||||
endif()
|
||||
|
||||
# Configure component dependencies by loading the Houdini/Maya setup
|
||||
@@ -362,6 +406,15 @@ if(OPENVDB_BUILD_DOCS)
|
||||
add_subdirectory(doc)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
if(OPENVDB_BUILD_AX OR
|
||||
OPENVDB_BUILD_AX_GRAMMAR OR
|
||||
OPENVDB_BUILD_AX_BINARIES OR
|
||||
OPENVDB_BUILD_AX_UNITTESTS)
|
||||
message(FATAL_ERROR "Currently no support for building OpenVDB AX or the OpenVDB AX grammar on Windows.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT OPENVDB_BUILD_AX AND OPENVDB_BUILD_AX_GRAMMAR)
|
||||
# only re-generate the AX grammar
|
||||
set(OPENVDB_AX_SHARED OFF CACHE BOOL "" FORCE)
|
||||
@@ -375,13 +428,13 @@ if(NOT (
|
||||
OPENVDB_BUILD_CORE OR
|
||||
OPENVDB_BUILD_BINARIES OR
|
||||
OPENVDB_BUILD_AX OR
|
||||
OPENVDB_BUILD_AX_BINARIES OR
|
||||
OPENVDB_BUILD_AX_UNITTESTS OR
|
||||
OPENVDB_BUILD_PYTHON_MODULE OR
|
||||
OPENVDB_BUILD_UNITTESTS OR
|
||||
OPENVDB_BUILD_HOUDINI_PLUGIN OR
|
||||
OPENVDB_BUILD_HOUDINI_ABITESTS OR
|
||||
OPENVDB_BUILD_MAYA_PLUGIN OR
|
||||
OPENVDB_BUILD_NANOVDB)
|
||||
OPENVDB_BUILD_MAYA_PLUGIN)
|
||||
)
|
||||
return()
|
||||
endif()
|
||||
@@ -393,54 +446,195 @@ endif()
|
||||
if(USE_CCACHE)
|
||||
find_program(CCACHE_PATH ccache)
|
||||
if(CCACHE_PATH)
|
||||
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ${CCACHE_PATH})
|
||||
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
|
||||
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
|
||||
message(STATUS "Using ccache: ${CCACHE_PATH}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
#########################################################################
|
||||
# Build type configuration
|
||||
|
||||
# Still support -DOPENVDB_SIMD=SSE42 and -DOPENVDB_SIMD=AVX, these alias to
|
||||
# their respective OPENVDB_X86_INSTRSET value but, as a build option, are
|
||||
# deprecated. Not that the defines in version.h need to persist in case
|
||||
# downstream software was using them before including VDB headers
|
||||
set(_OPENVDB_SIMD_OPTIONS None SSE42 AVX)
|
||||
if(NOT OPENVDB_SIMD)
|
||||
set(OPENVDB_SIMD None CACHE STRING "Deprecated, see OPENVDB_X86_INSTRSET." FORCE)
|
||||
else()
|
||||
if(NOT ${OPENVDB_SIMD} IN_LIST _OPENVDB_SIMD_OPTIONS)
|
||||
message(WARNING "Unrecognized or unsupported value for OPENVDB_SIMD, using None instead.")
|
||||
set(OPENVDB_SIMD None CACHE STRING "Deprecated, see OPENVDB_X86_INSTRSET." FORCE)
|
||||
endif()
|
||||
message(DEPRECATION "The OPENVDB_SIMD option is deprecated and will be removed. Use OPENVDB_X86_INSTRSET.")
|
||||
if(OPENVDB_SIMD STREQUAL "AVX")
|
||||
set(OPENVDB_X86_INSTRSET 7)
|
||||
elseif(OPENVDB_SIMD STREQUAL "SSE42")
|
||||
set(OPENVDB_X86_INSTRSET 6)
|
||||
endif()
|
||||
if(OPENVDB_CODE_COVERAGE)
|
||||
message(DEPRECATION "The OPENVDB_CODE_COVERAGE option is deprecated. Choose instead the unique"
|
||||
"build type -DCMAKE_BUILD_TYPE=coverage")
|
||||
set(CMAKE_BUILD_TYPE coverage)
|
||||
endif()
|
||||
if(NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE Release)
|
||||
endif()
|
||||
|
||||
include(cmake/config/OpenVDBBuildTypes.cmake)
|
||||
|
||||
if(CMAKE_BUILD_TYPE EQUAL coverage)
|
||||
# use .gcno extension instead of .cc.gcno
|
||||
# @note This is an undocumented internal cmake var and does not work
|
||||
# with multi config generators
|
||||
set(CMAKE_CXX_OUTPUT_EXTENSION_REPLACE 1)
|
||||
endif()
|
||||
|
||||
# CMAKE_BUILD_TYPE is ignored for multi config generators i.e. MSVS
|
||||
get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
||||
if(NOT _isMultiConfig)
|
||||
message(STATUS "CMake Build Type: ${CMAKE_BUILD_TYPE}")
|
||||
endif()
|
||||
|
||||
#########################################################################
|
||||
|
||||
# Configure general CMake and CXX settings
|
||||
# Compiler configuration. Add definitions for a number of compiler warnings
|
||||
# for sub projects and verify version requirements
|
||||
# @todo add definitions for Intel.
|
||||
|
||||
include(cmake/config/OpenVDBCXX.cmake)
|
||||
set(HAS_AVAILABLE_WARNINGS FALSE)
|
||||
|
||||
#########################################################################
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS MINIMUM_CLANG_VERSION)
|
||||
message(FATAL_ERROR "Insufficient clang++ version. Minimum required is "
|
||||
"\"${MINIMUM_CLANG_VERSION}\". Found version \"${CMAKE_CXX_COMPILER_VERSION}\""
|
||||
)
|
||||
endif()
|
||||
if(OPENVDB_CXX_STRICT)
|
||||
message(STATUS "Configuring Clang CXX warnings")
|
||||
set(HAS_AVAILABLE_WARNINGS TRUE)
|
||||
add_compile_options(
|
||||
-Werror
|
||||
-Wall
|
||||
-Wextra
|
||||
-Wconversion
|
||||
-Wno-sign-conversion
|
||||
)
|
||||
endif()
|
||||
if(USE_COLORED_OUTPUT)
|
||||
message(STATUS "Enabling colored compiler output")
|
||||
add_compile_options(-fcolor-diagnostics)
|
||||
endif()
|
||||
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS MINIMUM_GCC_VERSION)
|
||||
message(FATAL_ERROR "Insufficient g++ version. Minimum required is "
|
||||
"\"${MINIMUM_GCC_VERSION}\". Found version \"${CMAKE_CXX_COMPILER_VERSION}\""
|
||||
)
|
||||
endif()
|
||||
if(OPENVDB_FUTURE_DEPRECATION AND FUTURE_MINIMUM_GCC_VERSION)
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS FUTURE_MINIMUM_GCC_VERSION)
|
||||
message(DEPRECATION "Support for GCC versions < ${FUTURE_MINIMUM_GCC_VERSION} "
|
||||
"is deprecated and will be removed.")
|
||||
endif()
|
||||
endif()
|
||||
if(OPENVDB_CXX_STRICT)
|
||||
message(STATUS "Configuring GCC CXX warnings")
|
||||
set(HAS_AVAILABLE_WARNINGS TRUE)
|
||||
add_compile_options(
|
||||
-Werror
|
||||
-Wall
|
||||
-Wextra
|
||||
-pedantic
|
||||
-Wcast-align
|
||||
-Wcast-qual
|
||||
-Wconversion
|
||||
-Wdisabled-optimization
|
||||
-Woverloaded-virtual
|
||||
)
|
||||
endif()
|
||||
if(USE_COLORED_OUTPUT)
|
||||
message(STATUS "Enabling colored compiler output")
|
||||
add_compile_options(-fdiagnostics-color=always)
|
||||
endif()
|
||||
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS MINIMUM_ICC_VERSION)
|
||||
message(FATAL_ERROR "Insufficient ICC version. Minimum required is "
|
||||
"\"${MINIMUM_ICC_VERSION}\". Found version \"${CMAKE_CXX_COMPILER_VERSION}\""
|
||||
)
|
||||
endif()
|
||||
if(OPENVDB_FUTURE_DEPRECATION AND FUTURE_MINIMUM_ICC_VERSION)
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS FUTURE_MINIMUM_ICC_VERSION)
|
||||
message(DEPRECATION "Support for ICC versions < ${FUTURE_MINIMUM_ICC_VERSION} "
|
||||
"is deprecated and will be removed.")
|
||||
endif()
|
||||
endif()
|
||||
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS MINIMUM_MSVC_VERSION)
|
||||
message(FATAL_ERROR "Insufficient MSVC version. Minimum required is "
|
||||
"\"${MINIMUM_MSVC_VERSION}\". Found version \"${CMAKE_CXX_COMPILER_VERSION}\""
|
||||
)
|
||||
endif()
|
||||
if(OPENVDB_FUTURE_DEPRECATION AND FUTURE_MINIMUM_MSVC_VERSION)
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS FUTURE_MINIMUM_MSVC_VERSION)
|
||||
message(DEPRECATION "Support for MSVC versions < ${FUTURE_MINIMUM_MSVC_VERSION} "
|
||||
"is deprecated and will be removed.")
|
||||
endif()
|
||||
endif()
|
||||
# Increase the number of sections that an object file can contain
|
||||
add_compile_options(/bigobj)
|
||||
# Excludes APIs such as Cryptography, DDE, RPC, Shell, and Windows Sockets
|
||||
add_definitions(-DWIN32_LEAN_AND_MEAN)
|
||||
# Disable non-secure CRT library function warnings
|
||||
# https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/
|
||||
# compiler-warning-level-3-c4996?view=vs-2019#unsafe-crt-library-functions
|
||||
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
|
||||
# Disable POSIX function name warnings
|
||||
# https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/
|
||||
# compiler-warning-level-3-c4996?view=vs-2019#posix-function-names
|
||||
add_definitions(-D_CRT_NONSTDC_NO_WARNINGS)
|
||||
if(NOT OPENVDB_CXX_STRICT)
|
||||
message(STATUS "Suppressing some noisy MSVC CXX warnings, "
|
||||
"set OPENVDB_CXX_STRICT=ON to re-enable them.")
|
||||
# Conversion from int64_t to long
|
||||
add_compile_options(/wd4244)
|
||||
# It's not possible to use STL types in DLL interfaces in a portable and
|
||||
# reliable way so disable this warning
|
||||
add_compile_options(/wd4251)
|
||||
# Conversion from size_t to uLong
|
||||
add_compile_options(/wd4267)
|
||||
# Non dll-interface class used as base for dll-interface class
|
||||
add_compile_options(/wd4275)
|
||||
# Truncation from 'int' to 'bool'
|
||||
add_compile_options(/wd4305)
|
||||
endif()
|
||||
# If a user has explicitly requested a parallel build, configure this during CMake
|
||||
if(MSVC_MP_THREAD_COUNT AND MSVC_MP_THREAD_COUNT GREATER 1)
|
||||
add_compile_options(/MP${MSVC_MP_THREAD_COUNT})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Configure malloc library. Use Jemalloc if available, tbbmalloc otherwise
|
||||
if(OPENVDB_CXX_STRICT AND NOT HAS_AVAILABLE_WARNINGS)
|
||||
message(WARNING "No available CXX warnings for compiler ${CMAKE_CXX_COMPILER_ID}")
|
||||
endif()
|
||||
unset(HAS_AVAILABLE_WARNINGS)
|
||||
|
||||
if(CONCURRENT_MALLOC STREQUAL "Auto")
|
||||
find_package(Jemalloc QUIET)
|
||||
if(NOT TARGET Jemalloc::jemalloc)
|
||||
message(WARNING "Unable to find Jemalloc, attempting to fall back to TBB malloc.
|
||||
It is recommended to use Jemalloc for optimum performance.")
|
||||
# Configure malloc library. Use Jemalloc for Linux and non-Maya, otherwise Tbbmalloc.
|
||||
# * On Mac OSX, linking against Jemalloc < 4.3.0 seg-faults with this error:
|
||||
# malloc: *** malloc_zone_unregister() failed for 0xaddress
|
||||
# Houdini 17.5 and older ships with Jemalloc 3.6.0, so we make Tbbmalloc the default
|
||||
# on Mac OSX (https://github.com/jemalloc/jemalloc/issues/420). Later versions of
|
||||
# Jemalloc are thought to work, but haven't been tested.
|
||||
# * On Windows, we follow SideFX's example in using Tbbmalloc due to the challenges
|
||||
# of injecting into the Windows runtime to replace the system allocator.
|
||||
|
||||
if((OPENVDB_BUILD_BINARIES OR OPENVDB_BUILD_UNITTESTS) AND CONCURRENT_MALLOC STREQUAL "Auto")
|
||||
if(WIN32 OR APPLE OR USE_MAYA)
|
||||
set(CONCURRENT_MALLOC "Tbbmalloc")
|
||||
else()
|
||||
set(CONCURRENT_MALLOC "Jemalloc")
|
||||
find_package(Jemalloc QUIET)
|
||||
if(NOT TARGET Jemalloc::jemalloc)
|
||||
message(WARNING "Unable to find Jemalloc, attempting to fall back to TBB malloc.
|
||||
It is recommended to use Jemalloc for optimum performance.")
|
||||
set(CONCURRENT_MALLOC "Tbbmalloc")
|
||||
else()
|
||||
set(CONCURRENT_MALLOC "Jemalloc")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Configure SIMD. AVX implies SSE 4.2.
|
||||
|
||||
if(OPENVDB_SIMD STREQUAL "AVX")
|
||||
add_compile_options(-mavx -msse4.2)
|
||||
add_definitions(-DOPENVDB_USE_AVX)
|
||||
add_definitions(-DOPENVDB_USE_SSE42)
|
||||
elseif(OPENVDB_SIMD STREQUAL "SSE42")
|
||||
add_compile_options(-msse4.2)
|
||||
add_definitions(-DOPENVDB_USE_SSE42)
|
||||
endif()
|
||||
|
||||
#########################################################################
|
||||
|
||||
# Configure our cmake modules to only search for static libraries
|
||||
@@ -448,6 +642,7 @@ endif()
|
||||
if(USE_STATIC_DEPENDENCIES)
|
||||
set(BLOSC_USE_STATIC_LIBS ON)
|
||||
set(OPENEXR_USE_STATIC_LIBS ON)
|
||||
set(ILMBASE_USE_STATIC_LIBS ON)
|
||||
set(TBB_USE_STATIC_LIBS ON)
|
||||
set(LOG4CPLUS_USE_STATIC_LIBS ON)
|
||||
set(JEMALLOC_USE_STATIC_LIBS ON)
|
||||
@@ -459,19 +654,7 @@ endif()
|
||||
|
||||
# Configure OpenVDB Library and ABI versions
|
||||
|
||||
set(NEEDS_OPENVDB OFF)
|
||||
|
||||
if(OPENVDB_BUILD_AX OR
|
||||
OPENVDB_BUILD_BINARIES OR
|
||||
OPENVDB_BUILD_UNITTESTS OR
|
||||
OPENVDB_BUILD_HOUDINI_PLUGIN OR
|
||||
OPENVDB_BUILD_MAYA_PLUGIN OR
|
||||
OPENVDB_BUILD_PYTHON_MODULE OR
|
||||
OPENVDB_BUILD_HOUDINI_ABITESTS)
|
||||
set(NEEDS_OPENVDB ON)
|
||||
endif()
|
||||
|
||||
if(NOT OPENVDB_BUILD_CORE AND NEEDS_OPENVDB)
|
||||
if(NOT OPENVDB_BUILD_CORE)
|
||||
# Find VDB installation and determine lib/abi versions. This resets the
|
||||
# version and ABI numbers
|
||||
find_package(OpenVDB REQUIRED)
|
||||
@@ -491,57 +674,11 @@ message(STATUS "Configuring for OpenVDB Version ${OpenVDB_VERSION}")
|
||||
# Locate openvdb_ax if necessary
|
||||
|
||||
if(NOT OPENVDB_BUILD_AX AND
|
||||
(OPENVDB_BUILD_AX_UNITTESTS OR
|
||||
USE_AX))
|
||||
(OPENVDB_BUILD_AX_BINARIES OR
|
||||
OPENVDB_BUILD_AX_UNITTESTS))
|
||||
find_package(OpenVDB REQUIRED COMPONENTS openvdb_ax)
|
||||
endif()
|
||||
|
||||
# Locate nanovdb if necessary
|
||||
|
||||
if(NOT OPENVDB_BUILD_NANOVDB AND
|
||||
USE_NANOVDB)
|
||||
find_package(OpenVDB REQUIRED COMPONENTS nanovdb)
|
||||
endif()
|
||||
|
||||
# Locate Python and nanobind if necessary
|
||||
if(OPENVDB_BUILD_PYTHON_MODULE OR (OPENVDB_BUILD_NANOVDB AND NANOVDB_BUILD_PYTHON_MODULE))
|
||||
|
||||
find_package(Python ${MINIMUM_PYTHON_VERSION} REQUIRED COMPONENTS Development Interpreter)
|
||||
if(OPENVDB_FUTURE_DEPRECATION AND FUTURE_MINIMUM_PYTHON_VERSION)
|
||||
if(Python_VERSION VERSION_LESS ${FUTURE_MINIMUM_PYTHON_VERSION})
|
||||
message(DEPRECATION "Support for Python versions < ${FUTURE_MINIMUM_GLFW_VERSION} "
|
||||
"is deprecated and will be removed.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
find_package(nanobind REQUIRED CONFIG)
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(nanobind
|
||||
FOUND_VAR nanobind_FOUND
|
||||
REQUIRED_VARS NB_DIR
|
||||
VERSION_VAR nanobind_VERSION)
|
||||
|
||||
if(OPENVDB_FUTURE_DEPRECATION AND FUTURE_MINIMUM_NANOBIND_VERSION)
|
||||
if(nanobind_VERSION VERSION_LESS ${FUTURE_MINIMUM_NANOBIND_VERSION})
|
||||
message(DEPRECATION "Support for nanobind versions < ${FUTURE_MINIMUM_NANOBIND_VERSION} "
|
||||
"is deprecated and will be removed.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED VDB_PYTHON_INSTALL_DIRECTORY)
|
||||
if(DEFINED Python_SITELIB)
|
||||
get_filename_component(Python_PACKAGES_DIR ${Python_SITELIB} NAME)
|
||||
else()
|
||||
set(Python_PACKAGES_DIR "site-packages")
|
||||
endif()
|
||||
set(VDB_PYTHON_INSTALL_DIRECTORY
|
||||
${CMAKE_INSTALL_LIBDIR}/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/${Python_PACKAGES_DIR}
|
||||
CACHE STRING "The directory to install the openvdb and nanovdb Python modules."
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
# Validate the OpenVDB ABI Version. If OpenVDB_ABI is not set, we're either building
|
||||
# the core library OR the ABI hasn't been deduced from a VDB installation. Use the
|
||||
# value from OPENVDB_ABI_VERSION_NUMBER, falling back to the lib major version number
|
||||
@@ -571,14 +708,14 @@ if(OpenVDB_ABI LESS MINIMUM_OPENVDB_ABI_VERSION)
|
||||
"no longer supported.")
|
||||
endif()
|
||||
|
||||
if(OpenVDB_ABI IN_LIST OPENVDB_DEPRECATED_ABI_LIST)
|
||||
if(FUTURE_MINIMUM_OPENVDB_ABI_VERSION AND OpenVDB_ABI LESS FUTURE_MINIMUM_OPENVDB_ABI_VERSION)
|
||||
if(NOT OPENVDB_USE_DEPRECATED_ABI_${OpenVDB_ABI})
|
||||
message(FATAL_ERROR "OpenVDB ABI versions earlier than ${OpenVDB_MAJOR_VERSION} "
|
||||
message(FATAL_ERROR "OpenVDB ABI versions earlier than ${FUTURE_MINIMUM_OPENVDB_ABI_VERSION} "
|
||||
"are deprecated. Set CMake option OPENVDB_USE_DEPRECATED_ABI_${OpenVDB_ABI} to ON to "
|
||||
"suppress this error.")
|
||||
endif()
|
||||
|
||||
message(DEPRECATION "OpenVDB ABI versions earlier than ${OpenVDB_MAJOR_VERSION} "
|
||||
message(DEPRECATION "OpenVDB ABI versions earlier than ${FUTURE_MINIMUM_OPENVDB_ABI_VERSION} "
|
||||
"are deprecated and will soon be removed.")
|
||||
# global target definition
|
||||
add_definitions(-DOPENVDB_USE_DEPRECATED_ABI_${OpenVDB_ABI})
|
||||
@@ -615,23 +752,26 @@ if(OPENVDB_BUILD_AX)
|
||||
add_subdirectory(openvdb_ax/openvdb_ax)
|
||||
endif()
|
||||
|
||||
if(OPENVDB_BUILD_AX_BINARIES)
|
||||
add_subdirectory(openvdb_ax/openvdb_ax/cmd)
|
||||
endif()
|
||||
|
||||
if(OPENVDB_BUILD_AX_UNITTESTS)
|
||||
add_subdirectory(openvdb_ax/openvdb_ax/test)
|
||||
endif()
|
||||
|
||||
if(OPENVDB_BUILD_PYTHON_MODULE)
|
||||
add_subdirectory(openvdb/openvdb/python)
|
||||
endif()
|
||||
|
||||
if(OPENVDB_BUILD_BINARIES)
|
||||
add_subdirectory(openvdb_cmd)
|
||||
add_subdirectory(openvdb/openvdb/cmd)
|
||||
endif()
|
||||
|
||||
if(OPENVDB_BUILD_UNITTESTS)
|
||||
add_subdirectory(openvdb/openvdb/unittest)
|
||||
endif()
|
||||
|
||||
# Tests the vdb_ax binary so needs to come after openvdb_cmd
|
||||
if(OPENVDB_BUILD_AX_UNITTESTS)
|
||||
add_subdirectory(openvdb_ax/openvdb_ax/test)
|
||||
endif()
|
||||
|
||||
if(OPENVDB_BUILD_HOUDINI_PLUGIN)
|
||||
add_subdirectory(openvdb_houdini/openvdb_houdini)
|
||||
endif()
|
||||
@@ -644,10 +784,6 @@ if(OPENVDB_BUILD_MAYA_PLUGIN)
|
||||
add_subdirectory(openvdb_maya/openvdb_maya)
|
||||
endif()
|
||||
|
||||
if(OPENVDB_BUILD_NANOVDB)
|
||||
add_subdirectory(nanovdb/nanovdb)
|
||||
endif()
|
||||
|
||||
##########################################################################
|
||||
|
||||
if(OPENVDB_ENABLE_UNINSTALL)
|
||||
|
||||
+23
-26
@@ -5,39 +5,36 @@
|
||||
# https://git-scm.com/docs/gitignore#_pattern_format
|
||||
|
||||
# Admin/General
|
||||
/.github/ @kmuseth @apradhana @jmlait @idclip @danrbailey @richhones
|
||||
/ci/ @kmuseth @apradhana @jmlait @idclip @danrbailey @richhones
|
||||
/cmake/ @kmuseth @apradhana @jmlait @idclip @danrbailey @richhones
|
||||
/doc/ @kmuseth @apradhana @jmlait @idclip @danrbailey @richhones
|
||||
/pendingchanges/ @kmuseth @apradhana @jmlait @idclip @danrbailey @richhones
|
||||
/tsc/ @kmuseth @apradhana @jmlait @idclip @danrbailey @richhones
|
||||
CODEOWNERS @kmuseth @apradhana @jmlait @idclip @danrbailey @richhones
|
||||
LICENSE @kmuseth @apradhana @jmlait @idclip @danrbailey @richhones
|
||||
CHANGES @kmuseth @apradhana @jmlait @idclip @danrbailey @richhones
|
||||
*.md @kmuseth @apradhana @jmlait @idclip @danrbailey @richhones
|
||||
/.github/ @kmuseth @apradhana @jmlait @idclip @danrbailey
|
||||
/ci/ @kmuseth @apradhana @jmlait @idclip @danrbailey
|
||||
/cmake/ @kmuseth @apradhana @jmlait @idclip @danrbailey
|
||||
/doc/ @kmuseth @apradhana @jmlait @idclip @danrbailey
|
||||
/pendingchanges/ @kmuseth @apradhana @jmlait @idclip @danrbailey
|
||||
/tsc/ @kmuseth @apradhana @jmlait @idclip @danrbailey
|
||||
CODEOWNERS @kmuseth @apradhana @jmlait @idclip @danrbailey
|
||||
LICENSE @kmuseth @apradhana @jmlait @idclip @danrbailey
|
||||
CHANGES @kmuseth @apradhana @jmlait @idclip @danrbailey
|
||||
*.md @kmuseth @apradhana @jmlait @idclip @danrbailey
|
||||
|
||||
# Core OpenVDB Library
|
||||
/openvdb/ @kmuseth
|
||||
/openvdb/openvdb/points/ @danrbailey @idclip
|
||||
/openvdb/ @kmuseth
|
||||
/openvdb/openvdb/points/ @danrbailey @idclip
|
||||
|
||||
# OpenVDB AX
|
||||
/openvdb_ax/ @idclip @richhones
|
||||
|
||||
# NanoVDB
|
||||
/nanovdb/ @kmuseth
|
||||
/openvdb_ax/ @idclip
|
||||
|
||||
# OpenVDB Houdini - Default
|
||||
/openvdb_houdini/ @kmuseth
|
||||
/openvdb_houdini/ @kmuseth
|
||||
|
||||
# OpenVDB Houdini - VDB Primitive and SideFX Utils
|
||||
/openvdb_houdini/openvdb_houdini/GEO_PrimVDB.* @jmlait
|
||||
/openvdb_houdini/openvdb_houdini/GU_PrimVDB.* @jmlait
|
||||
/openvdb_houdini/openvdb_houdini/GEO_VDBTranslator.* @jmlait
|
||||
/openvdb_houdini/openvdb_houdini/GT_GEOPrimCollectVDB.* @jmlait
|
||||
/openvdb_houdini/openvdb_houdini/SOP_VDBVerbUtils.* @jmlait
|
||||
/openvdb_houdini/openvdb_houdini/UT_VDBUtils.* @jmlait
|
||||
/openvdb_houdini/openvdb_houdini/GEO_PrimVDB.* @jmlait
|
||||
/openvdb_houdini/openvdb_houdini/GU_PrimVDB.* @jmlait
|
||||
/openvdb_houdini/openvdb_houdini/GEO_VDBTranslator.* @jmlait
|
||||
/openvdb_houdini/openvdb_houdini/GT_GEOPrimCollectVDB.* @jmlait
|
||||
/openvdb_houdini/openvdb_houdini/SOP_VDBVerbUtils.* @jmlait
|
||||
/openvdb_houdini/openvdb_houdini/UT_VDBUtils.* @jmlait
|
||||
|
||||
# OpenVDB Houdini - VDB Points
|
||||
/openvdb_houdini/openvdb_houdini/PointUtils.* @danrbailey @idclip
|
||||
/openvdb_houdini/openvdb_houdini/*_OpenVDB_Points_* @danrbailey @idclip
|
||||
/openvdb_houdini/openvdb_houdini/GR_PrimVDBPoints.* @danrbailey @idclip
|
||||
/openvdb_houdini/openvdb_houdini/PointUtils.* @danrbailey @idclip
|
||||
/openvdb_houdini/openvdb_houdini/*_OpenVDB_Points_* @danrbailey @idclip
|
||||
/openvdb_houdini/openvdb_houdini/GR_PrimVDBPoints.* @danrbailey @idclip
|
||||
|
||||
+16
-24
@@ -10,7 +10,7 @@ The contributor role is the starting role for anyone participating in the projec
|
||||
|
||||
### Process for becoming a contributor
|
||||
|
||||
* Review the [coding standards](https://www.openvdb.org/documentation/doxygen/codingStyle.html) to ensure your contribution is in line with the project's coding and styling guidelines.
|
||||
* Review the [coding standards](https://academysoftwarefoundation.github.io/openvdb/codingStyle.html) to ensure your contribution is in line with the project's coding and styling guidelines.
|
||||
* Have a signed CLA on file ( see [below](#contributor-license-agreements) )
|
||||
* Submit your code as a PR with the appropriate [DCO sign-off](#commit-sign-off).
|
||||
* Have your submission approved by the [committer(s)](#committer) and merged into the codebase.
|
||||
@@ -22,7 +22,7 @@ open source software best practice policies of the Linux Foundation.
|
||||
|
||||
#### License
|
||||
|
||||
OpenVDB is licensed under the [Apache License, version 2.0](LICENSE.md)
|
||||
OpenVDB is licensed under the [Mozilla Public License, version 2.0](LICENSE.md)
|
||||
license. Contributions to OpenVDB should abide by that standard
|
||||
license.
|
||||
|
||||
@@ -54,27 +54,21 @@ Every commit must be signed off. That is, every commit log message
|
||||
must include a “`Signed-off-by`” line (generated, for example, with
|
||||
“`git commit --signoff`”), indicating that the committer wrote the
|
||||
code and has the right to release it under the
|
||||
[Apache License, version 2.0](LICENSE.md)
|
||||
[Mozilla Public License, version 2.0](LICENSE.md)
|
||||
license. See the [TAC documentation on contribution sign off](https://github.com/AcademySoftwareFoundation/tac/blob/master/process/contributing.md#contribution-sign-off) for more information on this requirement.
|
||||
|
||||
#### Stale PRs
|
||||
## Committer
|
||||
|
||||
A PR that does not have a signed CLA or DCO sign-off will be given at least one week in which to resolve the issue and then will be closed. The TSC cannot review or merge PRs without these requirements having been met. Please re-open PRs that are now expected to pass once this criteria has been met.
|
||||
The committer role enables the participant to commit code directly to the repository, but also comes with the obligation to be a responsible leader in the community.
|
||||
|
||||
## Maintainer
|
||||
|
||||
The maintainer role is the equivalent of the "Committer" role in the charter.
|
||||
|
||||
This role enables the participant to commit code directly to the repository, but also comes with the obligation to be a responsible leader in the community.
|
||||
|
||||
### Process for becoming a maintainer
|
||||
### Process for becoming a committer
|
||||
|
||||
* Show your experience with the codebase through contributions and engagement on the community channels.
|
||||
* Request to become a maintainer.
|
||||
* Have the majority of maintainers approve you becoming a maintainer.
|
||||
* Request to become a committer.
|
||||
* Have the majority of committers approve you becoming a committer.
|
||||
* Your name and email is added to the MAINTAINERS.md file for the project.
|
||||
|
||||
### Maintainer responsibilities
|
||||
### Committer responsibilities
|
||||
|
||||
* Monitor email aliases.
|
||||
* Monitor Slack (delayed response is perfectly acceptable).
|
||||
@@ -82,29 +76,27 @@ This role enables the participant to commit code directly to the repository, but
|
||||
* Make sure that ongoing PRs are moving forward at the right pace or close them.
|
||||
* Remain an active contributor to the project in general and the code base in particular.
|
||||
|
||||
### When does a maintainer lose maintainer status?
|
||||
### When does a committer lose committer status?
|
||||
|
||||
If a maintainer is no longer interested or cannot perform the maintainer duties listed above, they
|
||||
If a committer is no longer interested or cannot perform the committer duties listed above, they
|
||||
should volunteer to be moved to emeritus status. In extreme cases this can also occur by a vote of
|
||||
the maintainers per the voting process below.
|
||||
the committers per the voting process below.
|
||||
|
||||
## Technical Steering Committee (TSC) member
|
||||
|
||||
The Technical Steering Committee (TSC) oversees the overall technical direction of OpenVDB, as defined in the [charter](charter.md).
|
||||
|
||||
TSC voting members consist of maintainers that have been nominated by the TSC, with a supermajority of voting members required to have a maintainer elected to be a TSC voting member. TSC voting members term and succession is defined in the [charter](charter.md).
|
||||
TSC voting members consist of committers that have been nominated by the committers, with a supermajority of voting members required to have a committer elected to be a TSC voting member. TSC voting members term and succession is defined in the [charter](charter.md).
|
||||
|
||||
All meetings of the TSC are open to participation by any member of the OpenVDB community. Meeting times are listed in the [ASWF technical community calendar](https://lists.aswf.io/g/tac/calendar).
|
||||
|
||||
## Current TSC members
|
||||
|
||||
* Ken Museth (Chair), Nvidia
|
||||
* Andre Pradhana, Nvidia
|
||||
* Ken Museth, Chair / NVIDIA
|
||||
* Andre Pradhana, DreamWorks
|
||||
* Jeff Lait, SideFX
|
||||
* Nick Avramoussis, WETA FX
|
||||
* Nick Avramoussis, WETA
|
||||
* Dan Bailey, ILM
|
||||
* Richard Jones, ILM
|
||||
* Gregory Hurst, United Therapeutics
|
||||
|
||||
# Release Process
|
||||
|
||||
|
||||
@@ -1,176 +1,373 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
Mozilla Public License Version 2.0
|
||||
==================================
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
1. Definitions
|
||||
--------------
|
||||
|
||||
1. Definitions.
|
||||
1.1. "Contributor"
|
||||
means each individual or legal entity that creates, contributes to
|
||||
the creation of, or owns Covered Software.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
1.2. "Contributor Version"
|
||||
means the combination of the Contributions of others (if any) used
|
||||
by a Contributor and that particular Contributor's Contribution.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
1.3. "Contribution"
|
||||
means Covered Software of a particular Contributor.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
1.4. "Covered Software"
|
||||
means Source Code Form to which the initial Contributor has attached
|
||||
the notice in Exhibit A, the Executable Form of such Source Code
|
||||
Form, and Modifications of such Source Code Form, in each case
|
||||
including portions thereof.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
1.5. "Incompatible With Secondary Licenses"
|
||||
means
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
(a) that the initial Contributor has attached the notice described
|
||||
in Exhibit B to the Covered Software; or
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
(b) that the Covered Software was made available under the terms of
|
||||
version 1.1 or earlier of the License, but not also under the
|
||||
terms of a Secondary License.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
1.6. "Executable Form"
|
||||
means any form of the work other than Source Code Form.
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
1.7. "Larger Work"
|
||||
means a work that combines Covered Software with other material, in
|
||||
a separate file or files, that is not Covered Software.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
1.8. "License"
|
||||
means this document.
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
1.9. "Licensable"
|
||||
means having the right to grant, to the maximum extent possible,
|
||||
whether at the time of the initial grant or subsequently, any and
|
||||
all of the rights conveyed by this License.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
1.10. "Modifications"
|
||||
means any of the following:
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
(a) any file in Source Code Form that results from an addition to,
|
||||
deletion from, or modification of the contents of Covered
|
||||
Software; or
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
(b) any new file in Source Code Form that contains any Covered
|
||||
Software.
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
1.11. "Patent Claims" of a Contributor
|
||||
means any patent claim(s), including without limitation, method,
|
||||
process, and apparatus claims, in any patent Licensable by such
|
||||
Contributor that would be infringed, but for the grant of the
|
||||
License, by the making, using, selling, offering for sale, having
|
||||
made, import, or transfer of either its Contributions or its
|
||||
Contributor Version.
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
1.12. "Secondary License"
|
||||
means either the GNU General Public License, Version 2.0, the GNU
|
||||
Lesser General Public License, Version 2.1, the GNU Affero General
|
||||
Public License, Version 3.0, or any later versions of those
|
||||
licenses.
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
1.13. "Source Code Form"
|
||||
means the form of the work preferred for making modifications.
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
1.14. "You" (or "Your")
|
||||
means an individual or a legal entity exercising rights under this
|
||||
License. For legal entities, "You" includes any entity that
|
||||
controls, is controlled by, or is under common control with You. For
|
||||
purposes of this definition, "control" means (a) the power, direct
|
||||
or indirect, to cause the direction or management of such entity,
|
||||
whether by contract or otherwise, or (b) ownership of more than
|
||||
fifty percent (50%) of the outstanding shares or beneficial
|
||||
ownership of such entity.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
2. License Grants and Conditions
|
||||
--------------------------------
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
2.1. Grants
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
Each Contributor hereby grants You a world-wide, royalty-free,
|
||||
non-exclusive license:
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
(a) under intellectual property rights (other than patent or trademark)
|
||||
Licensable by such Contributor to use, reproduce, make available,
|
||||
modify, display, perform, distribute, and otherwise exploit its
|
||||
Contributions, either on an unmodified basis, with Modifications, or
|
||||
as part of a Larger Work; and
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
(b) under Patent Claims of such Contributor to make, use, sell, offer
|
||||
for sale, have made, import, and otherwise transfer either its
|
||||
Contributions or its Contributor Version.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
2.2. Effective Date
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
The licenses granted in Section 2.1 with respect to any Contribution
|
||||
become effective for each Contribution on the date the Contributor first
|
||||
distributes such Contribution.
|
||||
|
||||
2.3. Limitations on Grant Scope
|
||||
|
||||
The licenses granted in this Section 2 are the only rights granted under
|
||||
this License. No additional rights or licenses will be implied from the
|
||||
distribution or licensing of Covered Software under this License.
|
||||
Notwithstanding Section 2.1(b) above, no patent license is granted by a
|
||||
Contributor:
|
||||
|
||||
(a) for any code that a Contributor has removed from Covered Software;
|
||||
or
|
||||
|
||||
(b) for infringements caused by: (i) Your and any other third party's
|
||||
modifications of Covered Software, or (ii) the combination of its
|
||||
Contributions with other software (except as part of its Contributor
|
||||
Version); or
|
||||
|
||||
(c) under Patent Claims infringed by Covered Software in the absence of
|
||||
its Contributions.
|
||||
|
||||
This License does not grant any rights in the trademarks, service marks,
|
||||
or logos of any Contributor (except as may be necessary to comply with
|
||||
the notice requirements in Section 3.4).
|
||||
|
||||
2.4. Subsequent Licenses
|
||||
|
||||
No Contributor makes additional grants as a result of Your choice to
|
||||
distribute the Covered Software under a subsequent version of this
|
||||
License (see Section 10.2) or under the terms of a Secondary License (if
|
||||
permitted under the terms of Section 3.3).
|
||||
|
||||
2.5. Representation
|
||||
|
||||
Each Contributor represents that the Contributor believes its
|
||||
Contributions are its original creation(s) or it has sufficient rights
|
||||
to grant the rights to its Contributions conveyed by this License.
|
||||
|
||||
2.6. Fair Use
|
||||
|
||||
This License is not intended to limit any rights You have under
|
||||
applicable copyright doctrines of fair use, fair dealing, or other
|
||||
equivalents.
|
||||
|
||||
2.7. Conditions
|
||||
|
||||
Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
|
||||
in Section 2.1.
|
||||
|
||||
3. Responsibilities
|
||||
-------------------
|
||||
|
||||
3.1. Distribution of Source Form
|
||||
|
||||
All distribution of Covered Software in Source Code Form, including any
|
||||
Modifications that You create or to which You contribute, must be under
|
||||
the terms of this License. You must inform recipients that the Source
|
||||
Code Form of the Covered Software is governed by the terms of this
|
||||
License, and how they can obtain a copy of this License. You may not
|
||||
attempt to alter or restrict the recipients' rights in the Source Code
|
||||
Form.
|
||||
|
||||
3.2. Distribution of Executable Form
|
||||
|
||||
If You distribute Covered Software in Executable Form then:
|
||||
|
||||
(a) such Covered Software must also be made available in Source Code
|
||||
Form, as described in Section 3.1, and You must inform recipients of
|
||||
the Executable Form how they can obtain a copy of such Source Code
|
||||
Form by reasonable means in a timely manner, at a charge no more
|
||||
than the cost of distribution to the recipient; and
|
||||
|
||||
(b) You may distribute such Executable Form under the terms of this
|
||||
License, or sublicense it under different terms, provided that the
|
||||
license for the Executable Form does not attempt to limit or alter
|
||||
the recipients' rights in the Source Code Form under this License.
|
||||
|
||||
3.3. Distribution of a Larger Work
|
||||
|
||||
You may create and distribute a Larger Work under terms of Your choice,
|
||||
provided that You also comply with the requirements of this License for
|
||||
the Covered Software. If the Larger Work is a combination of Covered
|
||||
Software with a work governed by one or more Secondary Licenses, and the
|
||||
Covered Software is not Incompatible With Secondary Licenses, this
|
||||
License permits You to additionally distribute such Covered Software
|
||||
under the terms of such Secondary License(s), so that the recipient of
|
||||
the Larger Work may, at their option, further distribute the Covered
|
||||
Software under the terms of either this License or such Secondary
|
||||
License(s).
|
||||
|
||||
3.4. Notices
|
||||
|
||||
You may not remove or alter the substance of any license notices
|
||||
(including copyright notices, patent notices, disclaimers of warranty,
|
||||
or limitations of liability) contained within the Source Code Form of
|
||||
the Covered Software, except that You may alter any license notices to
|
||||
the extent required to remedy known factual inaccuracies.
|
||||
|
||||
3.5. Application of Additional Terms
|
||||
|
||||
You may choose to offer, and to charge a fee for, warranty, support,
|
||||
indemnity or liability obligations to one or more recipients of Covered
|
||||
Software. However, You may do so only on Your own behalf, and not on
|
||||
behalf of any Contributor. You must make it absolutely clear that any
|
||||
such warranty, support, indemnity, or liability obligation is offered by
|
||||
You alone, and You hereby agree to indemnify every Contributor for any
|
||||
liability incurred by such Contributor as a result of warranty, support,
|
||||
indemnity or liability terms You offer. You may include additional
|
||||
disclaimers of warranty and limitations of liability specific to any
|
||||
jurisdiction.
|
||||
|
||||
4. Inability to Comply Due to Statute or Regulation
|
||||
---------------------------------------------------
|
||||
|
||||
If it is impossible for You to comply with any of the terms of this
|
||||
License with respect to some or all of the Covered Software due to
|
||||
statute, judicial order, or regulation then You must: (a) comply with
|
||||
the terms of this License to the maximum extent possible; and (b)
|
||||
describe the limitations and the code they affect. Such description must
|
||||
be placed in a text file included with all distributions of the Covered
|
||||
Software under this License. Except to the extent prohibited by statute
|
||||
or regulation, such description must be sufficiently detailed for a
|
||||
recipient of ordinary skill to be able to understand it.
|
||||
|
||||
5. Termination
|
||||
--------------
|
||||
|
||||
5.1. The rights granted under this License will terminate automatically
|
||||
if You fail to comply with any of its terms. However, if You become
|
||||
compliant, then the rights granted under this License from a particular
|
||||
Contributor are reinstated (a) provisionally, unless and until such
|
||||
Contributor explicitly and finally terminates Your grants, and (b) on an
|
||||
ongoing basis, if such Contributor fails to notify You of the
|
||||
non-compliance by some reasonable means prior to 60 days after You have
|
||||
come back into compliance. Moreover, Your grants from a particular
|
||||
Contributor are reinstated on an ongoing basis if such Contributor
|
||||
notifies You of the non-compliance by some reasonable means, this is the
|
||||
first time You have received notice of non-compliance with this License
|
||||
from such Contributor, and You become compliant prior to 30 days after
|
||||
Your receipt of the notice.
|
||||
|
||||
5.2. If You initiate litigation against any entity by asserting a patent
|
||||
infringement claim (excluding declaratory judgment actions,
|
||||
counter-claims, and cross-claims) alleging that a Contributor Version
|
||||
directly or indirectly infringes any patent, then the rights granted to
|
||||
You by any and all Contributors for the Covered Software under Section
|
||||
2.1 of this License shall terminate.
|
||||
|
||||
5.3. In the event of termination under Sections 5.1 or 5.2 above, all
|
||||
end user license agreements (excluding distributors and resellers) which
|
||||
have been validly granted by You or Your distributors under this License
|
||||
prior to termination shall survive termination.
|
||||
|
||||
************************************************************************
|
||||
* *
|
||||
* 6. Disclaimer of Warranty *
|
||||
* ------------------------- *
|
||||
* *
|
||||
* Covered Software is provided under this License on an "as is" *
|
||||
* basis, without warranty of any kind, either expressed, implied, or *
|
||||
* statutory, including, without limitation, warranties that the *
|
||||
* Covered Software is free of defects, merchantable, fit for a *
|
||||
* particular purpose or non-infringing. The entire risk as to the *
|
||||
* quality and performance of the Covered Software is with You. *
|
||||
* Should any Covered Software prove defective in any respect, You *
|
||||
* (not any Contributor) assume the cost of any necessary servicing, *
|
||||
* repair, or correction. This disclaimer of warranty constitutes an *
|
||||
* essential part of this License. No use of any Covered Software is *
|
||||
* authorized under this License except under this disclaimer. *
|
||||
* *
|
||||
************************************************************************
|
||||
|
||||
************************************************************************
|
||||
* *
|
||||
* 7. Limitation of Liability *
|
||||
* -------------------------- *
|
||||
* *
|
||||
* Under no circumstances and under no legal theory, whether tort *
|
||||
* (including negligence), contract, or otherwise, shall any *
|
||||
* Contributor, or anyone who distributes Covered Software as *
|
||||
* permitted above, be liable to You for any direct, indirect, *
|
||||
* special, incidental, or consequential damages of any character *
|
||||
* including, without limitation, damages for lost profits, loss of *
|
||||
* goodwill, work stoppage, computer failure or malfunction, or any *
|
||||
* and all other commercial damages or losses, even if such party *
|
||||
* shall have been informed of the possibility of such damages. This *
|
||||
* limitation of liability shall not apply to liability for death or *
|
||||
* personal injury resulting from such party's negligence to the *
|
||||
* extent applicable law prohibits such limitation. Some *
|
||||
* jurisdictions do not allow the exclusion or limitation of *
|
||||
* incidental or consequential damages, so this exclusion and *
|
||||
* limitation may not apply to You. *
|
||||
* *
|
||||
************************************************************************
|
||||
|
||||
8. Litigation
|
||||
-------------
|
||||
|
||||
Any litigation relating to this License may be brought only in the
|
||||
courts of a jurisdiction where the defendant maintains its principal
|
||||
place of business and such litigation shall be governed by laws of that
|
||||
jurisdiction, without reference to its conflict-of-law provisions.
|
||||
Nothing in this Section shall prevent a party's ability to bring
|
||||
cross-claims or counter-claims.
|
||||
|
||||
9. Miscellaneous
|
||||
----------------
|
||||
|
||||
This License represents the complete agreement concerning the subject
|
||||
matter hereof. If any provision of this License is held to be
|
||||
unenforceable, such provision shall be reformed only to the extent
|
||||
necessary to make it enforceable. Any law or regulation which provides
|
||||
that the language of a contract shall be construed against the drafter
|
||||
shall not be used to construe this License against a Contributor.
|
||||
|
||||
10. Versions of the License
|
||||
---------------------------
|
||||
|
||||
10.1. New Versions
|
||||
|
||||
Mozilla Foundation is the license steward. Except as provided in Section
|
||||
10.3, no one other than the license steward has the right to modify or
|
||||
publish new versions of this License. Each version will be given a
|
||||
distinguishing version number.
|
||||
|
||||
10.2. Effect of New Versions
|
||||
|
||||
You may distribute the Covered Software under the terms of the version
|
||||
of the License under which You originally received the Covered Software,
|
||||
or under the terms of any subsequent version published by the license
|
||||
steward.
|
||||
|
||||
10.3. Modified Versions
|
||||
|
||||
If you create software not governed by this License, and you want to
|
||||
create a new license for such software, you may create and use a
|
||||
modified version of this License if you rename the license and remove
|
||||
any references to the name of the license steward (except to note that
|
||||
such modified license differs from this License).
|
||||
|
||||
10.4. Distributing Source Code Form that is Incompatible With Secondary
|
||||
Licenses
|
||||
|
||||
If You choose to distribute Source Code Form that is Incompatible With
|
||||
Secondary Licenses under the terms of this version of the License, the
|
||||
notice described in Exhibit B of this License must be attached.
|
||||
|
||||
Exhibit A - Source Code Form License Notice
|
||||
-------------------------------------------
|
||||
|
||||
This Source Code Form is subject to the terms of the Mozilla Public
|
||||
License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
If it is not possible or desirable to put the notice in a particular
|
||||
file, then You may include the notice in a location (such as a LICENSE
|
||||
file in a relevant directory) where a recipient would be likely to look
|
||||
for such a notice.
|
||||
|
||||
You may add additional accurate notices of copyright ownership.
|
||||
|
||||
Exhibit B - "Incompatible With Secondary Licenses" Notice
|
||||
---------------------------------------------------------
|
||||
|
||||
This Source Code Form is "Incompatible With Secondary Licenses", as
|
||||
defined by the Mozilla Public License, v. 2.0.
|
||||
|
||||
+6
-9
@@ -6,13 +6,10 @@
|
||||
The current OpenVDB maintainers are:
|
||||
|
||||
|
||||
| Name | Email |
|
||||
| ---------------- | -----------------
|
||||
| Jeff Lait | jlait@sidefx.com
|
||||
| Dan Bailey | danbailey@ilm.com
|
||||
| Name | Email |
|
||||
| -------------- | -----------------
|
||||
| Jeff Lait | jlait@sidefx.com
|
||||
| Dan Bailey | danbailey@ilm.com
|
||||
| Nick Avramoussis | navramoussis@wetafx.co.nz
|
||||
| Ken Museth | ken.museth@gmail.com
|
||||
| Andre Pradhana | andre.pradhana@gmail.com
|
||||
| Richard Jones | richardj@ilm.com
|
||||
| Gregory Hurst | tbd
|
||||
| Jonathan Swartz | tbd
|
||||
| Ken Museth | ken.museth@gmail.com
|
||||
| Andre Pradhana | andre.pradhana@dreamworks.com
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
The following copyright holders agree that all of their contributions
|
||||
originally submitted to this project under the Mozilla Public License
|
||||
Version 2.0, are hereby relicensed to the Apache License, Version 2.0,
|
||||
and are submitted pursuant to the Developer Certificate of Origin, version 1.1:
|
||||
|
||||
Ken Museth
|
||||
Mehdi Chinoune
|
||||
DreamWorks Animation
|
||||
Side Effects Software Inc.
|
||||
Blender Foundation
|
||||
NVIDIA Corporation
|
||||
United Therapeutics Corporation
|
||||
Digital Domain 3.0, Inc.
|
||||
Double Negative
|
||||
Ubisoft Entertainment SA
|
||||
Adobe Inc.
|
||||
Mathieu Malaterre
|
||||
Brecht Sanders
|
||||
Ignacio Vizzo
|
||||
Ben FrantzDale
|
||||
Sebastian Gaida
|
||||
Alessio Quaglino
|
||||
Benedikt Mersch
|
||||
David Aguilar
|
||||
Brian Sharpe
|
||||
Kartik Shrivastava
|
||||
Michael Lackner
|
||||
Lucas Baraya
|
||||
Kuba Roth
|
||||
Tom Cnops
|
||||
Walt Disney Pictures (Walt Disney Animation Studios)
|
||||
The Linux Foundation
|
||||
Industrial Light & Magic (ILM)
|
||||
@@ -1,104 +1,118 @@
|
||||

|
||||

|
||||
|
||||
| OpenVDB | AX | Nano | Houdini | License | CII |
|
||||
| :----: | :----: | :----: | :----: | :-----: | :-: |
|
||||
| [](https://github.com/AcademySoftwareFoundation/openvdb/actions/workflows/build.yml) | [](https://github.com/AcademySoftwareFoundation/openvdb/actions/workflows/ax.yml) | [](https://github.com/AcademySoftwareFoundation/openvdb/actions/workflows/nanovdb.yml) | [](https://github.com/AcademySoftwareFoundation/openvdb/actions/workflows/houdini.yml) | [](LICENSE) | [](https://bestpractices.coreinfrastructure.org/projects/2774) |
|
||||
[](LICENSE.md)
|
||||
[](https://bestpractices.coreinfrastructure.org/projects/2774)
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
| Build | Status |
|
||||
| --------------- | ------ |
|
||||
| OpenVDB | [](https://github.com/AcademySoftwareFoundation/openvdb/actions?query=workflow%3ABuild) |
|
||||
| OpenVDB AX | [](https://github.com/AcademySoftwareFoundation/openvdb/actions?query=workflow%3Aax) |
|
||||
|
||||
[Website](https://www.openvdb.org) |
|
||||
[Discussion Forum](https://github.com/AcademySoftwareFoundation/openvdb/discussions) |
|
||||
[Documentation](https://www.openvdb.org/documentation/doxygen) |
|
||||
[Releases](https://github.com/AcademySoftwareFoundation/openvdb/releases) |
|
||||
[License](https://www.apache.org/licenses/LICENSE-2.0) |
|
||||
[Slack](https://slack.aswf.io/)
|
||||
[Discussion Forum](https://www.openvdb.org/forum) |
|
||||
[Documentation](https://academysoftwarefoundation.github.io/openvdb)
|
||||
|
||||
OpenVDB is an open source C++ library comprising a novel hierarchical data structure and a large suite of tools for the efficient storage and manipulation of sparse volumetric data discretized on three-dimensional grids. It was developed by DreamWorks Animation for use in volumetric applications typically encountered in feature film production.
|
||||
|
||||
OpenVDB is an open source C++ library comprising a novel hierarchical data
|
||||
structure and a large suite of tools for the efficient storage and manipulation
|
||||
of sparse volumetric data discretized on three-dimensional grids. It was
|
||||
developed by DreamWorks Animation for use in volumetric applications typically
|
||||
encountered in feature film production.
|
||||
|
||||
### Development Repository
|
||||
|
||||
This GitHub repository hosts the trunk of the OpenVDB development. This implies
|
||||
that it is the newest public version with the latest features and bug fixes.
|
||||
However, it also means that it has not undergone a lot of testing and is
|
||||
generally less stable than the [production releases](https://github.com/AcademySoftwareFoundation/openvdb/releases).
|
||||
This GitHub repository hosts the trunk of the OpenVDB development. This implies that it is the newest public version with the latest features and bug fixes. However, it also means that it has not undergone a lot of testing and is generally less stable than the [production releases](https://github.com/AcademySoftwareFoundation/openvdb/releases).
|
||||
|
||||
|
||||
### License
|
||||
|
||||
OpenVDB is released under the [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0),
|
||||
which is a free, open source software license developed and maintained by the
|
||||
Apache Software Foundation.
|
||||
OpenVDB is released under the [Mozilla Public License Version 2.0](https://www.mozilla.org/MPL/2.0/), which is a free, open source software license developed and maintained by the Mozilla Foundation.
|
||||
|
||||
The trademarks of any contributor to this project may not be used in
|
||||
association with the project without the contributor's express permission.
|
||||
|
||||
NOTE: OpenVDB has completed re-licensing from [Mozilla Public License Version 2.0](https://www.mozilla.org/MPL/2.0/) to [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0). Please see the file RE-LICENSE_NOTE.txt for more details.
|
||||
The trademarks of any contributor to this project may not be used in association with the project without the contributor's express permission.
|
||||
|
||||
### Contributing
|
||||
|
||||
OpenVDB welcomes contributions to the OpenVDB project. Please refer to the
|
||||
[contribution guidelines](CONTRIBUTING.md) for details on how to make a
|
||||
contribution.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
OpenVDB welcomes contributions to the OpenVDB project. Please refer to the [contribution guidelines](CONTRIBUTING.md) for details on how to make a contribution.
|
||||
|
||||
### Developer Quick Start
|
||||
|
||||
The following provides basic installation examples for the core OpenVDB library.
|
||||
Other components, such as the python module, OpenVDB AX, NanoVDB and various
|
||||
executables, may require additional dependencies. See the
|
||||
[build documentation](https://www.openvdb.org/documentation/doxygen/build.html)
|
||||
for help with installations.
|
||||
The following provides basic installation examples for the core OpenVDB library. Other components, such as the python module, OpenVDB AX and various executables, may require additional dependencies. See the [build documentation](https://academysoftwarefoundation.github.io/openvdb/build.html) for help with installations.
|
||||
|
||||
##### Linux/MacOS
|
||||
#### Linux
|
||||
##### Installing Dependencies (Boost, TBB, Blosc)
|
||||
|
||||
```bash
|
||||
# Linux
|
||||
# @note If your distribution does not have required versions, consider using
|
||||
# apt pinning. See the dependency documentation for more details.
|
||||
```
|
||||
apt-get install -y libboost-iostreams-dev
|
||||
apt-get install -y libboost-system-dev
|
||||
apt-get install -y libtbb-dev
|
||||
apt-get install -y libblosc-dev
|
||||
|
||||
# MacOS
|
||||
# @note We are using homebrew in this example to install requried dependencies
|
||||
# https://brew.sh/
|
||||
brew install boost
|
||||
brew install tbb
|
||||
brew install c-blosc
|
||||
```
|
||||
```
|
||||
git clone git@github.com:Blosc/c-blosc.git
|
||||
cd c-blosc
|
||||
git checkout tags/v1.5.0 -b v1.5.0
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ..
|
||||
make -j4
|
||||
make install
|
||||
cd ../..
|
||||
```
|
||||
|
||||
```bash
|
||||
##### Building OpenVDB
|
||||
```
|
||||
git clone git@github.com:AcademySoftwareFoundation/openvdb.git
|
||||
cd openvdb
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ..
|
||||
make -j4 && make install
|
||||
make -j4
|
||||
make install
|
||||
```
|
||||
|
||||
##### Windows
|
||||
#### macOS
|
||||
##### Installing Dependencies (Boost, TBB, Blosc)
|
||||
```
|
||||
brew install boost
|
||||
brew install tbb
|
||||
```
|
||||
```
|
||||
git clone git@github.com:Blosc/c-blosc.git
|
||||
cd c-blosc
|
||||
git checkout tags/v1.5.0 -b v1.5.0
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ..
|
||||
make -j4
|
||||
make install
|
||||
cd ../..
|
||||
```
|
||||
##### Building OpenVDB
|
||||
```
|
||||
git clone git@github.com:AcademySoftwareFoundation/openvdb.git
|
||||
cd openvdb
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ..
|
||||
make -j4
|
||||
make install
|
||||
```
|
||||
#### Windows
|
||||
##### Installing Dependencies (Boost, TBB, Blosc)
|
||||
|
||||
Note that the following commands have only been tested for 64bit systems/libraries.
|
||||
It is recommended to set the `VCPKG_DEFAULT_TRIPLET` environment variable to
|
||||
`x64-windows` to use 64-bit libraries by default. You will also require
|
||||
[Visual Studio](https://visualstudio.microsoft.com/downloads/) (for the MSVC C++
|
||||
runtime and compiler toolchains), [CMake](https://cmake.org/download/) and optionally
|
||||
[vcpkg](https://github.com/microsoft/vcpkg) for the installation of OpenVDB's
|
||||
dependencies.
|
||||
[Git](https://git-scm.com/downloads), [vcpkg](https://github.com/microsoft/vcpkg)
|
||||
and [CMake](https://cmake.org/download/) to be installed.
|
||||
|
||||
```bash
|
||||
```
|
||||
vcpkg install zlib:x64-windows
|
||||
vcpkg install blosc:x64-windows
|
||||
vcpkg install tbb:x64-windows
|
||||
vcpkg install boost-iostreams:x64-windows
|
||||
vcpkg install boost-system:x64-windows
|
||||
vcpkg install boost-any:x64-windows
|
||||
vcpkg install boost-algorithm:x64-windows
|
||||
vcpkg install boost-uuid:x64-windows
|
||||
vcpkg install boost-interprocess:x64-windows
|
||||
```
|
||||
|
||||
```bash
|
||||
##### Building OpenVDB
|
||||
```
|
||||
git clone git@github.com:AcademySoftwareFoundation/openvdb.git
|
||||
cd openvdb
|
||||
mkdir build
|
||||
@@ -106,20 +120,3 @@ cd build
|
||||
cmake -DCMAKE_TOOLCHAIN_FILE=<PATH_TO_VCPKG>\scripts\buildsystems\vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows -A x64 ..
|
||||
cmake --build . --parallel 4 --config Release --target install
|
||||
```
|
||||
|
||||
#### Building OpenVDB AX and NanoVDB
|
||||
|
||||
OpenVDB AX depends on the core OpenVDB library. NanoVDB can be built with and
|
||||
without OpenVDB support. Note that NanoVDB has its own build instructions, see
|
||||
the [NanoVDB build documentation](https://www.openvdb.org/documentation/doxygen/NanoVDB_HowToBuild.html)
|
||||
for details.
|
||||
|
||||
The following variables can be passed to the `cmake` configure command. There
|
||||
are more optional VDB components, see the [build documentation](https://www.openvdb.org/documentation/doxygen/build.html)
|
||||
for a complete list.
|
||||
|
||||
| Option | Details |
|
||||
| :---- | :----- |
|
||||
| `-D OPENVDB_BUILD_AX=ON` | to enable OpenVDB AX |
|
||||
| `-D OPENVDB_BUILD_NANOVDB=ON` | to enable NanoVDB |
|
||||
| `-D NANOVDB_USE_OPENVDB=ON` | to use OpenVDB in NanoVDB |
|
||||
|
||||
+25
-66
@@ -1,11 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
# Copyright Contributors to the OpenVDB Project
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
set -e
|
||||
|
||||
CI_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd)
|
||||
|
||||
# print versions
|
||||
bash --version
|
||||
if [ ! -z "$CXX" ]; then $CXX -v; fi
|
||||
@@ -21,7 +17,6 @@ OPTS_ARGS+=("v") ## See --verbose
|
||||
OPTL_ARGS+=("components:") ## Specify cmake component(s) to enable
|
||||
OPTL_ARGS+=("config:") ## Specify cmake configuration during the build step
|
||||
OPTL_ARGS+=("target:") ## Specify target(s) to build
|
||||
OPTL_ARGS+=("build-dir:") ## Build directory
|
||||
OPTL_ARGS+=("cargs:") ## args to pass directly to cmake generation step
|
||||
OPTL_ARGS+=("build-type:") ## Release, Debug, etc.
|
||||
OPTL_ARGS+=("verbose") ## Verbose build output
|
||||
@@ -30,52 +25,23 @@ OPTL_ARGS+=("verbose") ## Verbose build output
|
||||
declare -A PARMS
|
||||
PARMS[--components]=core,bin
|
||||
PARMS[--target]=install
|
||||
PARMS[--build-dir]=build
|
||||
|
||||
if [[ $RUNNER_NAME == *"8c-32g-300h"* ]]; then
|
||||
if [[ $CXX == "g++" ]]; then
|
||||
# GCC hits memory limits on runners, reduce threads
|
||||
PARMS[-j]=6
|
||||
else
|
||||
# ASWF github actions runners have 8 threads
|
||||
PARMS[-j]=8
|
||||
fi
|
||||
else
|
||||
# Github actions runners have 2 threads
|
||||
# https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners
|
||||
if [[ $CXX == "g++" ]]; then
|
||||
# GCC hits memory limits on runners, build in serial
|
||||
PARMS[-j]=1
|
||||
else
|
||||
PARMS[-j]=2
|
||||
fi
|
||||
fi
|
||||
# github actions runners have 2 threads
|
||||
# https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners
|
||||
PARMS[-j]=2
|
||||
|
||||
# Available options for --components
|
||||
declare -A COMPONENTS
|
||||
COMPONENTS['core']='OPENVDB_BUILD_CORE'
|
||||
COMPONENTS['python']='OPENVDB_BUILD_PYTHON_MODULE'
|
||||
COMPONENTS['test']='OPENVDB_BUILD_UNITTESTS'
|
||||
# @todo split out vdb tool from this...
|
||||
COMPONENTS['bin']='OPENVDB_BUILD_VDB_PRINT,OPENVDB_BUILD_VDB_LOD,OPENVDB_BUILD_VDB_TOOL,OPENVDB_BUILD_VDB_TOOL_UNITTESTS'
|
||||
COMPONENTS['view']='OPENVDB_BUILD_VDB_VIEW'
|
||||
COMPONENTS['render']='OPENVDB_BUILD_VDB_RENDER'
|
||||
COMPONENTS['bin']='OPENVDB_BUILD_BINARIES'
|
||||
COMPONENTS['hou']='OPENVDB_BUILD_HOUDINI_PLUGIN'
|
||||
COMPONENTS['doc']='OPENVDB_BUILD_DOCS'
|
||||
|
||||
COMPONENTS['axcore']='OPENVDB_BUILD_AX'
|
||||
COMPONENTS['axgr']='OPENVDB_BUILD_AX_GRAMMAR'
|
||||
COMPONENTS['axbin']='OPENVDB_BUILD_AX_BINARIES'
|
||||
COMPONENTS['axtest']='OPENVDB_BUILD_AX_UNITTESTS'
|
||||
|
||||
COMPONENTS['nano']='OPENVDB_BUILD_NANOVDB'
|
||||
COMPONENTS['nanotest']='NANOVDB_BUILD_UNITTESTS'
|
||||
COMPONENTS['nanoexam']='NANOVDB_BUILD_EXAMPLES'
|
||||
COMPONENTS['nanobench']='NANOVDB_BUILD_BENCHMARK'
|
||||
COMPONENTS['nanotool']='NANOVDB_BUILD_TOOLS'
|
||||
COMPONENTS['nanopython']='NANOVDB_BUILD_PYTHON_MODULE'
|
||||
COMPONENTS['nanopytest']='NANOVDB_BUILD_PYTHON_UNITTESTS'
|
||||
|
||||
################################################
|
||||
|
||||
HAS_PARM() {
|
||||
@@ -121,8 +87,6 @@ if HAS_PARM --cargs; then
|
||||
if [ -z $CMAKE_EXTRA ]; then CMAKE_EXTRA=${PARMS[--cargs]}
|
||||
else CMAKE_EXTRA+=" "${PARMS[--cargs]}; fi
|
||||
fi
|
||||
BUILD_DIR=${PARMS[--build-dir]}
|
||||
|
||||
# handle whitespace
|
||||
eval "CMAKE_EXTRA=($CMAKE_EXTRA)"
|
||||
|
||||
@@ -131,15 +95,7 @@ if HAS_PARM -v || HAS_PARM --verbose; then
|
||||
# support older versions of CMake.
|
||||
CMAKE_EXTRA+=("-DCMAKE_VERBOSE_MAKEFILE=ON")
|
||||
fi
|
||||
if HAS_PARM --build-type; then
|
||||
CMAKE_EXTRA+=("-DCMAKE_BUILD_TYPE=${PARMS[--build-type]}")
|
||||
build_type="${PARMS[--build-type]}"
|
||||
debug="Debug"
|
||||
# Ignore case - if the build-type is Debug, we enable asserts
|
||||
if [ "${build_type,,}" = "${debug,,}" ]; then
|
||||
CMAKE_EXTRA+=("-DOPENVDB_ENABLE_ASSERTS=ON")
|
||||
fi
|
||||
fi
|
||||
if HAS_PARM --build-type; then CMAKE_EXTRA+=("-DCMAKE_BUILD_TYPE=${PARMS[--build-type]}"); fi
|
||||
|
||||
# Available components. If a component is not provided it is
|
||||
# explicitly set to OFF.
|
||||
@@ -158,16 +114,12 @@ for comp in "${!COMPONENTS[@]}"; do
|
||||
setting="ON"; break
|
||||
fi
|
||||
done
|
||||
OPENVDB_TOGGLES="${COMPONENTS[$comp]}"
|
||||
OPENVDB_TOGGLES=(${OPENVDB_TOGGLES//,/ })
|
||||
for toggle in "${!OPENVDB_TOGGLES[@]}"; do
|
||||
CMAKE_EXTRA+=("-D${OPENVDB_TOGGLES[$toggle]}=$setting")
|
||||
done
|
||||
CMAKE_EXTRA+=("-D${COMPONENTS[$comp]}=$setting")
|
||||
done
|
||||
|
||||
################################################
|
||||
|
||||
# github actions runners have 8 threads
|
||||
# github actions runners have 2 threads
|
||||
# https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners
|
||||
export CMAKE_BUILD_PARALLEL_LEVEL=${PARMS[-j]}
|
||||
echo "Build using ${CMAKE_BUILD_PARALLEL_LEVEL} threads"
|
||||
@@ -179,7 +131,15 @@ echo "Build using ${CMAKE_BUILD_PARALLEL_LEVEL} threads"
|
||||
# However it does not seem to for our project.
|
||||
# https://gitlab.kitware.com/cmake/cmake/-/issues/20564
|
||||
|
||||
CMAKE_BUILD_CMD="cmake --build . --parallel ${PARMS[-j]} --target $TARGET --verbose"
|
||||
CMAKE_BUILD_CMD="cmake --build . --parallel ${PARMS[-j]} --target $TARGET"
|
||||
|
||||
if HAS_PARM -v || HAS_PARM --verbose; then
|
||||
# cmake 3.14 and later required for --verbose
|
||||
function version { echo "$@" | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }'; }
|
||||
if [ $(version $CMAKE_VERSION) -gt $(version '3.14.0') ]; then
|
||||
CMAKE_BUILD_CMD+=" --verbose"
|
||||
fi
|
||||
fi
|
||||
|
||||
if HAS_PARM --config; then
|
||||
CMAKE_BUILD_CMD+=" --config ${PARMS[--config]}"
|
||||
@@ -187,22 +147,21 @@ fi
|
||||
|
||||
################################################
|
||||
|
||||
mkdir -p ${BUILD_DIR}
|
||||
cd ${BUILD_DIR}
|
||||
mkdir -p build
|
||||
cd build
|
||||
|
||||
# Report the cmake commands
|
||||
set -x
|
||||
|
||||
# Note:
|
||||
# - OPENVDB_BUILD_BINARIES is always ON, but each binary will be toggled depending on the provided comps
|
||||
# - always enabled the python tests with OPENVDB_BUILD_PYTHON_UNITTESTS if the python module is in use,
|
||||
# regardless of the 'test' component being enabled or not (see the OPENVDB_BUILD_PYTHON_UNITTESTS option).
|
||||
# - all sub binary options are always on and can be toggles with: OPENVDB_BUILD_BINARIES=ON/OFF
|
||||
cmake \
|
||||
-DOPENVDB_USE_DEPRECATED_ABI_11=ON \
|
||||
-DOPENVDB_USE_DEPRECATED_ABI_12=ON \
|
||||
-DOPENVDB_TOOL_USE_NANO=OFF \
|
||||
-DOPENVDB_BUILD_BINARIES=ON \
|
||||
-DOPENVDB_BUILD_PYTHON_UNITTESTS=ON \
|
||||
-DOPENVDB_USE_DEPRECATED_ABI_6=ON \
|
||||
-DOPENVDB_USE_FUTURE_ABI_9=ON \
|
||||
-DOPENVDB_BUILD_VDB_PRINT=ON \
|
||||
-DOPENVDB_BUILD_VDB_LOD=ON \
|
||||
-DOPENVDB_BUILD_VDB_RENDER=ON \
|
||||
-DOPENVDB_BUILD_VDB_VIEW=ON \
|
||||
-DMSVC_MP_THREAD_COUNT=${PARMS[-j]} \
|
||||
"${CMAKE_EXTRA[@]}" \
|
||||
..
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
# Copyright Contributors to the OpenVDB Project
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
set -ex
|
||||
|
||||
|
||||
@@ -1,208 +0,0 @@
|
||||
version: 0.2
|
||||
|
||||
# Runs the NanoVDB CUDA / multi-GPU unit tests on AWS CodeBuild (4x A10G).
|
||||
# This spec does NOT build the project. Instead it downloads the prebuilt
|
||||
# build tree produced by the matching GitHub Actions run (see the
|
||||
# linux-nanovdb / linux-nanovdb-gpu jobs in .github/workflows/nanovdb.yml),
|
||||
# restores it at its original absolute path, and executes the GPU and Python tests.
|
||||
#
|
||||
# Required environment variables (provided by aws-codebuild-run-build):
|
||||
# ARTIFACT_NAME - name of the GitHub Actions artifact to fetch
|
||||
# GH_TOKEN - ephemeral GITHUB_TOKEN with actions:read
|
||||
# GITHUB_REPOSITORY - owner/repo (auto-forwarded GITHUB_* variable)
|
||||
# GITHUB_RUN_ID - workflow run that produced the artifact (auto-forwarded)
|
||||
# ACTIONS_RUNTIME_TOKEN - job-scoped token used to upload the report
|
||||
# ACTIONS_RESULTS_URL - GitHub Actions artifact service endpoint
|
||||
|
||||
env:
|
||||
variables:
|
||||
CUDA_HOME: /usr/local/cuda-12
|
||||
DIAGNOSTIC_GIST_ID: c082e01bf80cd88d045e1e61bd78d43c
|
||||
DIAGNOSTIC_GIST_REVISION: dcd46d4e3a65c5d36e1cde96ade0c102464d8a45
|
||||
|
||||
phases:
|
||||
install:
|
||||
commands:
|
||||
# Rocky Linux 8 image: tools required to fetch and unpack artifacts and
|
||||
# clone the multi-GPU diagnostic gist.
|
||||
- dnf install -y jq unzip tree 'dnf-command(config-manager)'
|
||||
- dnf config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo
|
||||
- dnf install -y gh
|
||||
- dnf module reset -y nodejs
|
||||
- dnf module enable -y nodejs:20
|
||||
- dnf install -y nodejs
|
||||
- npm install --prefix /tmp/actions-artifact-uploader --omit=dev --no-audit --no-fund @actions/artifact@6.2.1
|
||||
|
||||
pre_build:
|
||||
commands:
|
||||
# Confirm the GPUs are visible (expect 4x A10G).
|
||||
- nvidia-smi
|
||||
- nvidia-smi topo -m
|
||||
- |
|
||||
echo "=== IOMMU diagnostics ==="
|
||||
|
||||
kernel_cmdline=$(cat /proc/cmdline)
|
||||
echo "Kernel command line:"
|
||||
echo "${kernel_cmdline}"
|
||||
|
||||
iommu_args=$(echo "${kernel_cmdline}" |
|
||||
grep -Eo '(^|[[:space:]])(iommu|amd_iommu|intel_iommu)=[^[:space:]]+' |
|
||||
xargs || true)
|
||||
if [ -n "${iommu_args}" ]; then
|
||||
echo "Explicit IOMMU kernel arguments: ${iommu_args}"
|
||||
else
|
||||
echo "No explicit IOMMU kernel arguments found"
|
||||
fi
|
||||
|
||||
if dmesg_output=$(dmesg 2>&1); then
|
||||
echo "IOMMU kernel messages:"
|
||||
echo "${dmesg_output}" |
|
||||
grep -Ei 'DMAR|IOMMU|AMD-Vi|amd_iommu|intel_iommu' ||
|
||||
echo "No IOMMU kernel messages found"
|
||||
|
||||
echo "IOMMU passthrough messages:"
|
||||
echo "${dmesg_output}" |
|
||||
grep -Ei 'iommu.*(pt|passthrough)|default domain type.*passthrough' ||
|
||||
echo "No IOMMU passthrough messages found"
|
||||
else
|
||||
echo "dmesg unavailable in this container: ${dmesg_output}"
|
||||
fi
|
||||
|
||||
if compgen -G '/sys/kernel/iommu_groups/*/devices/*' >/dev/null; then
|
||||
echo "Populated IOMMU groups are visible"
|
||||
group_count=0
|
||||
typed_group_count=0
|
||||
for group in /sys/kernel/iommu_groups/*; do
|
||||
[ -d "${group}" ] || continue
|
||||
group_count=$((group_count + 1))
|
||||
if [ -r "${group}/type" ]; then
|
||||
typed_group_count=$((typed_group_count + 1))
|
||||
echo "IOMMU group ${group##*/} type: $(cat "${group}/type")"
|
||||
fi
|
||||
done
|
||||
echo "Visible IOMMU group count: ${group_count}"
|
||||
if [ "${typed_group_count}" -eq 0 ]; then
|
||||
echo "Per-group IOMMU domain types are not exposed by this kernel"
|
||||
fi
|
||||
else
|
||||
echo "No populated IOMMU groups are visible"
|
||||
fi
|
||||
|
||||
if compgen -G '/sys/class/iommu/*' >/dev/null; then
|
||||
echo "IOMMU devices visible in /sys/class/iommu:"
|
||||
for iommu in /sys/class/iommu/*; do
|
||||
echo " ${iommu##*/}"
|
||||
done
|
||||
else
|
||||
echo "No IOMMU devices are visible in /sys/class/iommu"
|
||||
fi
|
||||
# Locate, download and restore the prebuilt build tree.
|
||||
- 'echo "Fetching artifact ${ARTIFACT_NAME} from run ${GITHUB_RUN_ID}"'
|
||||
- |
|
||||
set -euo pipefail
|
||||
api="https://api.github.com/repos/${GITHUB_REPOSITORY}"
|
||||
artifacts_json=$(curl -fsSL \
|
||||
-H "Authorization: Bearer ${GH_TOKEN}" \
|
||||
-H "Accept: application/vnd.github+json" \
|
||||
-H "X-GitHub-Api-Version: 2022-11-28" \
|
||||
"${api}/actions/runs/${GITHUB_RUN_ID}/artifacts?per_page=100")
|
||||
count=$(echo "${artifacts_json}" | jq --arg n "${ARTIFACT_NAME}" \
|
||||
'[.artifacts[] | select(.name==$n)] | length')
|
||||
if [ "${count}" != "1" ]; then
|
||||
echo "ERROR: expected exactly 1 artifact named '${ARTIFACT_NAME}', found ${count}"
|
||||
exit 1
|
||||
fi
|
||||
artifact_id=$(echo "${artifacts_json}" | jq -r --arg n "${ARTIFACT_NAME}" \
|
||||
'.artifacts[] | select(.name==$n) | .id')
|
||||
echo "Resolved artifact id ${artifact_id}"
|
||||
# The API returns a short-lived (60s) redirect to blob storage. Resolve
|
||||
# the redirect first, then download without the Authorization header so
|
||||
# it is not forwarded to the storage host.
|
||||
download_url=$(curl -sS -o /dev/null -w '%{redirect_url}' \
|
||||
-H "Authorization: Bearer ${GH_TOKEN}" \
|
||||
-H "Accept: application/vnd.github+json" \
|
||||
"${api}/actions/artifacts/${artifact_id}/zip")
|
||||
curl -fsSL -o /tmp/nanovdb-gpu-build.zip "${download_url}"
|
||||
- rm -rf /tmp/nanovdb-gpu-artifact
|
||||
- mkdir -p /tmp/nanovdb-gpu-artifact
|
||||
- unzip -q /tmp/nanovdb-gpu-build.zip -d /tmp/nanovdb-gpu-artifact
|
||||
- |
|
||||
set -euo pipefail
|
||||
set -a
|
||||
. /tmp/nanovdb-gpu-artifact/nanovdb-gpu-meta.env
|
||||
set +a
|
||||
echo "Restoring build tree and Python tests to ${BUILD_WORKSPACE}"
|
||||
mkdir -p "${BUILD_WORKSPACE}"
|
||||
rm -rf "${BUILD_WORKSPACE}/build"
|
||||
mv /tmp/nanovdb-gpu-artifact/build "${BUILD_WORKSPACE}/build"
|
||||
python_test_dir="${BUILD_WORKSPACE}/nanovdb/nanovdb/python/test"
|
||||
mkdir -p "${python_test_dir}"
|
||||
mv /tmp/nanovdb-gpu-artifact/nanovdb/nanovdb/python/test/TestNanoVDB.py \
|
||||
"${python_test_dir}/TestNanoVDB.py"
|
||||
|
||||
build:
|
||||
commands:
|
||||
- |
|
||||
set -euo pipefail
|
||||
set -a
|
||||
. /tmp/nanovdb-gpu-artifact/nanovdb-gpu-meta.env
|
||||
set +a
|
||||
export PATH="${CUDA_HOME}/bin:${PATH}"
|
||||
export LD_LIBRARY_PATH="${CUDA_HOME}/lib64:${BUILD_WORKSPACE}/build/openvdb/openvdb:${BUILD_WORKSPACE}/build/nanovdb/nanovdb:${LD_LIBRARY_PATH:-}"
|
||||
cd "${BUILD_WORKSPACE}/build"
|
||||
ctest -V -R ".*cuda.*|.*mgpu.*|pytest_nanovdb" --output-on-failure
|
||||
|
||||
post_build:
|
||||
commands:
|
||||
- |
|
||||
set -euo pipefail
|
||||
diagnostic_dir="${CODEBUILD_SRC_DIR}/${DIAGNOSTIC_GIST_ID}"
|
||||
rm -rf "${diagnostic_dir}" "${CODEBUILD_SRC_DIR}/report.tgz"
|
||||
cd "${CODEBUILD_SRC_DIR}"
|
||||
gh gist clone "${DIAGNOSTIC_GIST_ID}"
|
||||
# Pin the executable diagnostic code rather than trusting the mutable
|
||||
# head of the public gist on every CI run.
|
||||
git -C "${diagnostic_dir}" checkout --detach "${DIAGNOSTIC_GIST_REVISION}"
|
||||
|
||||
diagnostic_status=0
|
||||
(
|
||||
cd "${diagnostic_dir}"
|
||||
bash ./run_on_runner.sh
|
||||
) || diagnostic_status=$?
|
||||
|
||||
if [ -d "${diagnostic_dir}/report" ]; then
|
||||
tar czf "${CODEBUILD_SRC_DIR}/report.tgz" \
|
||||
-C "${diagnostic_dir}" report/
|
||||
else
|
||||
echo "ERROR: the diagnostic did not produce report/"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Upload directly into the current GitHub Actions job. These values are
|
||||
# short-lived and scoped to this job's artifact service.
|
||||
: "${ACTIONS_RUNTIME_TOKEN:?ACTIONS_RUNTIME_TOKEN was not forwarded}"
|
||||
: "${ACTIONS_RESULTS_URL:?ACTIONS_RESULTS_URL was not forwarded}"
|
||||
cat > /tmp/actions-artifact-uploader/upload.mjs <<'EOF'
|
||||
import {DefaultArtifactClient} from '@actions/artifact'
|
||||
|
||||
const reportPath = `${process.env.CODEBUILD_SRC_DIR}/report.tgz`
|
||||
const artifactName = process.env.ARTIFACT_NAME.replace(
|
||||
/^nanovdb-gpu-build-/,
|
||||
'nanovdb-gpu-report-'
|
||||
)
|
||||
const client = new DefaultArtifactClient()
|
||||
const result = await client.uploadArtifact(
|
||||
artifactName,
|
||||
[reportPath],
|
||||
process.env.CODEBUILD_SRC_DIR,
|
||||
{
|
||||
retentionDays: 7,
|
||||
compressionLevel: 0
|
||||
}
|
||||
)
|
||||
console.log(
|
||||
`Uploaded ${artifactName}: id=${result.id}, size=${result.size}, digest=${result.digest}`
|
||||
)
|
||||
EOF
|
||||
node /tmp/actions-artifact-uploader/upload.mjs
|
||||
exit "${diagnostic_status}"
|
||||
Executable → Regular
+37
-87
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env python3
|
||||
#!/usr/local/bin/python
|
||||
#
|
||||
# Copyright Contributors to the OpenVDB Project
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MPL-2.0
|
||||
#
|
||||
# Python script to download the latest Houdini builds
|
||||
# using the SideFX download API:
|
||||
@@ -19,16 +19,16 @@ import base64
|
||||
import requests
|
||||
import hashlib
|
||||
import os
|
||||
import argparse
|
||||
import copy
|
||||
|
||||
# For progress bar printing
|
||||
try:
|
||||
from tqdm import tqdm
|
||||
has_tqdm = True
|
||||
except:
|
||||
has_tqdm = False
|
||||
pass
|
||||
# this argument is for the major.minor version of Houdini to download (such as 15.0, 15.5, 16.0)
|
||||
version = sys.argv[1]
|
||||
only_production = True if sys.argv[2] == 'ON' else False
|
||||
user_client_id = os.getenv('HOUDINI_CLIENT_ID')
|
||||
user_client_secret_key = os.getenv('HOUDINI_SECRET_KEY')
|
||||
|
||||
if not re.match('[0-9][0-9]\.[0-9]$', version):
|
||||
raise IOError('Invalid Houdini Version "%s", expecting in the form "major.minor" such as "16.0"' % version)
|
||||
|
||||
|
||||
# Code that provides convenient Python wrappers to call into the API:
|
||||
|
||||
@@ -94,7 +94,7 @@ def get_access_token_and_expiry_time(
|
||||
),
|
||||
})
|
||||
if response.status_code != 200:
|
||||
raise AuthorizationError(response.status_code, response.text)
|
||||
raise AuthorizationError(response.status_code, reponse.text)
|
||||
|
||||
response_json = response.json()
|
||||
access_token_expiry_time = time.time() - 2 + response_json["expires_in"]
|
||||
@@ -138,83 +138,33 @@ class APIError(Exception):
|
||||
self.http_code = http_code
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
service = service(
|
||||
access_token_url="https://www.sidefx.com/oauth2/application_token",
|
||||
client_id=user_client_id,
|
||||
client_secret_key=user_client_secret_key,
|
||||
endpoint_url="https://www.sidefx.com/api/",
|
||||
)
|
||||
|
||||
parser = argparse.ArgumentParser(description='Download a Houdini Installation')
|
||||
parser.add_argument('version', type=str, help='Major.Minor version of Houdini to download')
|
||||
parser.add_argument('platform', type=str, help='Platform target')
|
||||
parser.add_argument('--prod', action='store_true', help='Only download production builds')
|
||||
parser.add_argument('--list', action='store_true', help='Just list the available builds and exit.')
|
||||
args = parser.parse_args()
|
||||
releases_list = service.download.get_daily_builds_list(
|
||||
product='houdini', version=version, platform='linux', only_production=only_production)
|
||||
|
||||
version = args.version
|
||||
platform = args.platform
|
||||
only_production = args.prod
|
||||
latest_release = service.download.get_daily_build_download(
|
||||
product='houdini', version=version, platform='linux', build=releases_list[0]['build'])
|
||||
|
||||
user_client_id = os.getenv('HOUDINI_CLIENT_ID')
|
||||
user_client_secret_key = os.getenv('HOUDINI_SECRET_KEY')
|
||||
|
||||
if not re.match('[0-9][0-9]\.[0-9]$', version):
|
||||
raise IOError('Invalid Houdini Version "%s", expecting in the form "major.minor" such as "16.0"' % version)
|
||||
|
||||
service = service(
|
||||
access_token_url="https://www.sidefx.com/oauth2/application_token",
|
||||
client_id=user_client_id,
|
||||
client_secret_key=user_client_secret_key,
|
||||
endpoint_url="https://www.sidefx.com/api/",
|
||||
)
|
||||
|
||||
releases_list = service.download.get_daily_builds_list(
|
||||
product='houdini', version=version, platform=platform, only_production=only_production)
|
||||
|
||||
print('Available builds:')
|
||||
for rel in releases_list:
|
||||
rel = copy.deepcopy(rel)
|
||||
if 'third_party_libraries' in rel:
|
||||
# Don't print these
|
||||
del rel['third_party_libraries']
|
||||
print(rel)
|
||||
|
||||
if args.list:
|
||||
sys.exit(0)
|
||||
|
||||
print('Selecting build: ' + releases_list[0]['build'])
|
||||
|
||||
latest_release = service.download.get_daily_build_download(
|
||||
product='houdini', version=version, platform=platform, build=releases_list[0]['build'])
|
||||
print(latest_release)
|
||||
|
||||
# Can't do this procedurally as latest_release['filename'] can contain
|
||||
# multiple periods and may have multiple trailing extensions...
|
||||
extension = ''
|
||||
if 'linux' in platform: extension = 'tar.gz'
|
||||
elif 'macos' in platform: extension = 'dmg'
|
||||
elif 'win64' in platform: extension = 'exe'
|
||||
assert(extension in latest_release['filename'])
|
||||
|
||||
# Download the file and save it as hou.extension
|
||||
local_filename = 'hou.' + extension
|
||||
print('Writing to "' + local_filename + '"')
|
||||
|
||||
response = requests.get(latest_release['download_url'], stream=True)
|
||||
if response.status_code == 200:
|
||||
# Download the file as hou.tar.gz
|
||||
local_filename = 'hou.tar.gz'
|
||||
response = requests.get(latest_release['download_url'], stream=True)
|
||||
if response.status_code == 200:
|
||||
with open(local_filename, 'wb') as f:
|
||||
response.raw.decode_content = True
|
||||
if has_tqdm:
|
||||
file_size = int(response.headers.get('Content-Length', 0))
|
||||
desc = "(Unknown total file size)" if file_size == 0 else ""
|
||||
with tqdm.wrapattr(response.raw, "read", total=file_size, desc=desc) as r_raw:
|
||||
with open(local_filename, 'wb') as f:
|
||||
shutil.copyfileobj(r_raw, f)
|
||||
else:
|
||||
with open(local_filename, 'wb') as f:
|
||||
shutil.copyfileobj(response.raw, f)
|
||||
else:
|
||||
raise Exception('Error downloading file!')
|
||||
shutil.copyfileobj(response.raw, f)
|
||||
else:
|
||||
raise Exception('Error downloading file!')
|
||||
|
||||
# Verify the file checksum is matching
|
||||
file_hash = hashlib.md5()
|
||||
with open(local_filename, 'rb') as f:
|
||||
for chunk in iter(lambda: f.read(4096), b''):
|
||||
file_hash.update(chunk)
|
||||
if file_hash.hexdigest() != latest_release['hash']:
|
||||
raise Exception('Checksum does not match!')
|
||||
# Verify the file checksum is matching
|
||||
file_hash = hashlib.md5()
|
||||
with open(local_filename, 'rb') as f:
|
||||
for chunk in iter(lambda: f.read(4096), b''):
|
||||
file_hash.update(chunk)
|
||||
if file_hash.hexdigest() != latest_release['hash']:
|
||||
raise Exception('Checksum does not match!')
|
||||
|
||||
+37
-113
@@ -1,130 +1,54 @@
|
||||
#!/usr/bin/env bash
|
||||
# Copyright Contributors to the OpenVDB Project
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
set -ex
|
||||
|
||||
HOUDINI_MAJOR="$1"
|
||||
PLATFORM="$2"
|
||||
OTHER_ARGS="$3"
|
||||
GOLD="$2"
|
||||
|
||||
if [[ $PLATFORM =~ "linux" ]]; then
|
||||
pip3 install --user requests
|
||||
elif [[ $PLATFORM =~ "macos" ]]; then
|
||||
# Tell the homebrew install of pip3 that we don't care about installing directly through pip3
|
||||
pip3 install --user requests --break-system-packages
|
||||
fi
|
||||
pip install --user requests
|
||||
|
||||
python3 ci/download_houdini.py $HOUDINI_MAJOR $PLATFORM $OTHER_ARGS
|
||||
python ci/download_houdini.py $HOUDINI_MAJOR $GOLD
|
||||
|
||||
if [[ $PLATFORM =~ "linux" ]]; then
|
||||
# create dir hierarchy
|
||||
mkdir -p hou/bin
|
||||
mkdir -p hou/houdini
|
||||
mkdir -p hou/toolkit
|
||||
mkdir -p hou/dsolib
|
||||
# create dir hierarchy
|
||||
mkdir -p hou/bin
|
||||
mkdir -p hou/houdini
|
||||
mkdir -p hou/toolkit
|
||||
mkdir -p hou/dsolib
|
||||
|
||||
# unpack hou.tar.gz and cleanup
|
||||
tar -xzf hou.tar.gz
|
||||
rm -rf hou.tar.gz
|
||||
cd houdini*
|
||||
tar -xzf houdini.tar.gz
|
||||
# unpack hou.tar.gz and cleanup
|
||||
tar -xzf hou.tar.gz
|
||||
rm -rf hou.tar.gz
|
||||
cd houdini*
|
||||
tar -xzf houdini.tar.gz
|
||||
|
||||
# copy required files into hou dir
|
||||
cp houdini_setup* ../hou/.
|
||||
# copy required files into hou dir
|
||||
cp houdini_setup* ../hou/.
|
||||
cp -r toolkit/cmake ../hou/toolkit/.
|
||||
cp -r toolkit/include ../hou/toolkit/.
|
||||
cp -r dsolib/libHoudini* ../hou/dsolib/.
|
||||
cp -r dsolib/libopenvdb_sesi* ../hou/dsolib/.
|
||||
cp -r dsolib/libblosc* ../hou/dsolib/.
|
||||
cp -r dsolib/libhboost* ../hou/dsolib/.
|
||||
cp -r dsolib/libz* ../hou/dsolib/.
|
||||
cp -r dsolib/libbz2* ../hou/dsolib/.
|
||||
cp -r dsolib/libtbb* ../hou/dsolib/.
|
||||
cp -r dsolib/libHalf* ../hou/dsolib/.
|
||||
cp -r dsolib/libjemalloc* ../hou/dsolib/.
|
||||
cp -r dsolib/liblzma* ../hou/dsolib/.
|
||||
cp -r dsolib/libIex* ../hou/dsolib/.
|
||||
cp -r dsolib/libImath* ../hou/dsolib/.
|
||||
cp -r dsolib/libIlmThread* ../hou/dsolib/.
|
||||
cp -r dsolib/libIlmImf* ../hou/dsolib/.
|
||||
|
||||
# report library names
|
||||
ls -al dsolib/
|
||||
|
||||
# copy required libraries
|
||||
mv toolkit/cmake ../hou/toolkit/.
|
||||
mv toolkit/include ../hou/toolkit/.
|
||||
mv dsolib/libHoudini* ../hou/dsolib/.
|
||||
mv dsolib/libopenvdb_sesi* ../hou/dsolib/.
|
||||
mv dsolib/libblosc* ../hou/dsolib/.
|
||||
mv dsolib/libhboost* ../hou/dsolib/.
|
||||
mv dsolib/libz* ../hou/dsolib/.
|
||||
mv dsolib/libbz2* ../hou/dsolib/.
|
||||
mv dsolib/libtbb* ../hou/dsolib/.
|
||||
mv dsolib/libjemalloc* ../hou/dsolib/.
|
||||
mv dsolib/liblzma* ../hou/dsolib/.
|
||||
mv dsolib/libIex* ../hou/dsolib/.
|
||||
mv dsolib/libImath* ../hou/dsolib/.
|
||||
mv dsolib/libIlmThread* ../hou/dsolib/.
|
||||
cd ..
|
||||
|
||||
elif [[ $PLATFORM =~ "macos" ]]; then
|
||||
# Exract files by mounting the downloaded dmg (we only really want to
|
||||
# expand Houdini.framework)
|
||||
hdiutil attach hou.dmg
|
||||
pkgutil --expand-full /Volumes/Houdini/Houdini.pkg Houdini
|
||||
hdiutil detach /Volumes/Houdini
|
||||
rm hou.dmg
|
||||
|
||||
# Move the required Frameworks and delete the extracted src
|
||||
mkdir -p hou/Frameworks
|
||||
mv Houdini/Framework.pkg/Payload/Houdini.framework hou/Frameworks/Houdini.framework
|
||||
rm -rf Houdini
|
||||
|
||||
# Report library names
|
||||
ls -al hou/Frameworks/Houdini.framework/Libraries
|
||||
|
||||
# Remove unused resources
|
||||
cd hou/Frameworks/Houdini.framework/Resources/
|
||||
rm -rf $(ls | grep -e toolkit -v)
|
||||
cd -
|
||||
|
||||
# Handle libraries. On some versions of MacOS with older versions of ld,
|
||||
# ld will complain (error) if shared libraries contain missing files which
|
||||
# are referenced with LC_LOAD_DYLIB or LC_RPATH entries (even though they
|
||||
# are not explicitly required at link time). We still want to delete these
|
||||
# unused libs as they occupt ~1-2GB. To handle this, we generate a unique
|
||||
# list of libs that our direct dependencies reference and create an empty
|
||||
# shared dylib in their place.
|
||||
cd hou/Frameworks/Houdini.framework/Libraries
|
||||
# Remove any folders here, they aren't needed
|
||||
rm -rf $(ls -p | grep /)
|
||||
# Remove any library that does not match the -e patterns (inverse grep with -v)
|
||||
unused_libraries=$(ls | \
|
||||
grep -e libHoudini \
|
||||
-e libopenvdb_sesi \
|
||||
-e libblosc \
|
||||
-e libhboost \
|
||||
-e libz \
|
||||
-e libbz2 \
|
||||
-e libtbb \
|
||||
-e libjemalloc \
|
||||
-e liblzma \
|
||||
-e libIex \
|
||||
-e libImath \
|
||||
-e libIlmThread \
|
||||
-v)
|
||||
rm -rf ${unused_libraries}
|
||||
|
||||
# Create an empty valid shared lib
|
||||
echo '' | clang -x c -shared -o libempty.dylib -
|
||||
|
||||
# Generate a unique list of libs that our remaining libs reference
|
||||
for i in $(ls); do otool -LX $i >> libnames; done
|
||||
sort -u libnames | grep @rpath | cut -f1 -d' ' | xargs > rpaths
|
||||
|
||||
# Recreate unused libraries that have been deleted as empty shared dylibs
|
||||
# to keep ld happy
|
||||
for libpath in $(cat rpaths); do
|
||||
libpath=${libpath#"@rpath/"}
|
||||
echo "Checking $libpath"
|
||||
if [ ! -f $libpath ]; then
|
||||
echo "Creating empty library at $libpath"
|
||||
mkdir -p $(dirname $libpath)
|
||||
cp libempty.dylib $libpath
|
||||
fi
|
||||
done
|
||||
|
||||
rm libempty.dylib
|
||||
cd -
|
||||
# needed for < H18.0 (due to sesitag)
|
||||
if [ "$HOUDINI_MAJOR" == "17.0" ] || [ "$HOUDINI_MAJOR" == "17.5" ]; then
|
||||
cp -r bin/app_init* ../hou/bin/.
|
||||
cp -r bin/sesitag* ../hou/bin/.
|
||||
cp -r dsolib/lib* ../hou/dsolib/.
|
||||
fi
|
||||
|
||||
# write hou into hou.tar.gz and cleanup
|
||||
cd ..
|
||||
tar -czvf hou.tar.gz hou
|
||||
|
||||
# move hou.tar.gz into hou subdirectory
|
||||
|
||||
@@ -1,108 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
# Copyright Contributors to the OpenVDB Project
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
import threading
|
||||
import zipfile
|
||||
import argparse
|
||||
|
||||
try:
|
||||
from urllib.request import urlretrieve
|
||||
except ImportError:
|
||||
from urllib import urlretrieve
|
||||
|
||||
parser = argparse.ArgumentParser(description='VDB files to download')
|
||||
parser.add_argument('--files', '-f', type=str, nargs='+',
|
||||
help='files to download i.e. bunny.vdb fire.vdb')
|
||||
args = parser.parse_args()
|
||||
|
||||
vdbs = [
|
||||
'armadillo.vdb',
|
||||
'boat_points.vdb',
|
||||
'buddha.vdb',
|
||||
'bunny.vdb',
|
||||
'bunny_cloud.vdb',
|
||||
'bunny_points.vdb',
|
||||
'crawler.vdb',
|
||||
'cube.vdb',
|
||||
'dragon.vdb',
|
||||
'emu.vdb',
|
||||
'explosion.vdb',
|
||||
'fire.vdb',
|
||||
'icosahedron.vdb',
|
||||
'iss.vdb',
|
||||
'smoke1.vdb',
|
||||
'smoke2.vdb',
|
||||
'space.vdb',
|
||||
'sphere.vdb',
|
||||
'sphere_points.vdb',
|
||||
'torus.vdb',
|
||||
'torus_knot.vdb',
|
||||
'utahteapot.vdb',
|
||||
'venusstatue.vdb',
|
||||
'waterfall_points.vdb'
|
||||
]
|
||||
|
||||
if args.files:
|
||||
vdbs = list(set(vdbs) & set(args.files))
|
||||
if not vdbs:
|
||||
raise RuntimeError('No valid VDBs specified for download')
|
||||
|
||||
# forma urls in the form:
|
||||
# 'https://artifacts.aswf.io/io/aswf/openvdb/models/buddha.vdb/1.0.0/buddha.vdb-1.0.0.zip'
|
||||
|
||||
vdb_urls = []
|
||||
for vdb in vdbs:
|
||||
url = 'https://artifacts.aswf.io/io/aswf/openvdb/models/' + \
|
||||
vdb +'/1.0.0/' + vdb + '-1.0.0.zip'
|
||||
vdb_urls.append(url)
|
||||
|
||||
|
||||
def download(link, filelocation):
|
||||
urlretrieve(link, filelocation)
|
||||
|
||||
# Init downloads
|
||||
|
||||
downloads = dict()
|
||||
|
||||
for url in vdb_urls:
|
||||
zip_filename = os.path.basename(url)
|
||||
print('Initiating download "' + url + '"')
|
||||
download_thread = threading.Thread(target=download, args=(url,zip_filename))
|
||||
download_thread.start()
|
||||
downloads[zip_filename] = download_thread
|
||||
|
||||
sys.stdout.flush()
|
||||
|
||||
# Process files
|
||||
|
||||
while downloads:
|
||||
zip_file = None
|
||||
while not zip_file:
|
||||
time.sleep(1)
|
||||
for file, thread in downloads.items():
|
||||
if not thread.is_alive():
|
||||
thread.join()
|
||||
zip_file = file
|
||||
break
|
||||
# Remove the entry
|
||||
del downloads[zip_file]
|
||||
|
||||
try:
|
||||
# Extract the downloaded zip
|
||||
print('Extracting "' + zip_file + '"...')
|
||||
sys.stdout.flush()
|
||||
with zipfile.ZipFile(zip_file, 'r') as zip_ref:
|
||||
zip_ref.extractall()
|
||||
|
||||
print('Cleaning up "' + zip_file + '"...')
|
||||
sys.stdout.flush()
|
||||
if os.path.isfile(zip_file): os.remove(zip_file)
|
||||
|
||||
except Exception as e:
|
||||
print(e)
|
||||
pass
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
# Copyright Contributors to the OpenVDB Project
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#################################################################################
|
||||
# This script extracts all code blocks from AX documentation which are NOT #
|
||||
# marked as cpp/sh/unparsed and attempts to parse or compile them through the #
|
||||
@@ -15,7 +13,7 @@
|
||||
set -e
|
||||
|
||||
ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )/../"
|
||||
VDB_AX=$ROOT/build/openvdb_cmd/vdb_ax/vdb_ax
|
||||
VDB_AX=$ROOT/build/openvdb_ax/openvdb_ax/cmd/vdb_ax
|
||||
|
||||
DOCS=()
|
||||
DOCS+=($ROOT/doc/ax/ax.txt)
|
||||
|
||||
+2
-22
@@ -1,15 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
# Copyright Contributors to the OpenVDB Project
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
set -ex
|
||||
|
||||
BLOSC_VERSION="$1"
|
||||
INSTALL_ROOT="$2"
|
||||
CMAKE_EXTRA=()
|
||||
if [ ! -z "${INSTALL_ROOT}" ]; then
|
||||
CMAKE_EXTRA+=("-DCMAKE_INSTALL_PREFIX=${INSTALL_ROOT}")
|
||||
fi
|
||||
|
||||
git clone https://github.com/Blosc/c-blosc.git
|
||||
cd c-blosc
|
||||
@@ -20,19 +13,6 @@ fi
|
||||
|
||||
mkdir build
|
||||
cd build
|
||||
|
||||
# On MacOS there's a bug between blosc 1.14-1.20 where unistd isn't included
|
||||
# in zlib-1.2.8/gzlib.c. Provide -DPREFER_EXTERNAL_ZLIB to use the installed
|
||||
# version of zlib.
|
||||
# https://github.com/Blosc/python-blosc/issues/229
|
||||
cmake \
|
||||
-DPREFER_EXTERNAL_ZLIB=ON \
|
||||
-DBUILD_STATIC=OFF \
|
||||
-DBUILD_TESTS=OFF \
|
||||
-DBUILD_FUZZERS=OFF \
|
||||
-DBUILD_BENCHMARKS=OFF \
|
||||
"${CMAKE_EXTRA[@]}" \
|
||||
..
|
||||
|
||||
make -j8
|
||||
cmake ../.
|
||||
make -j4
|
||||
make install
|
||||
|
||||
Executable
+15
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -ex
|
||||
|
||||
CMAKE_VERSION="$1"
|
||||
CMAKE_PACKAGE=cmake-${CMAKE_VERSION}-Linux-x86_64
|
||||
|
||||
wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/${CMAKE_PACKAGE}.tar.gz
|
||||
|
||||
tar -xf ${CMAKE_PACKAGE}.tar.gz
|
||||
cp ${CMAKE_PACKAGE}/bin/* /usr/local/bin/
|
||||
cp -r ${CMAKE_PACKAGE}/share/* /usr/local/share/
|
||||
|
||||
rm -rf ${CMAKE_PACKAGE}
|
||||
rm -rf ${CMAKE_PACKAGE}.tar.gz
|
||||
@@ -1,17 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
# Copyright Contributors to the OpenVDB Project
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
set -ex
|
||||
CURL_VERSION="$1"
|
||||
|
||||
wget -O cppunit.tar.gz https://dev-www.libreoffice.org/src/cppunit-${CURL_VERSION}.tar.gz
|
||||
|
||||
tar -xzf cppunit.tar.gz
|
||||
|
||||
cd cppunit-${CURL_VERSION}
|
||||
|
||||
./configure
|
||||
|
||||
make -j8
|
||||
make install
|
||||
@@ -1,6 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
# Copyright Contributors to the OpenVDB Project
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
set -ex
|
||||
|
||||
@@ -15,6 +13,6 @@ fi
|
||||
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -DCMAKE_POLICY_VERSION_MINIMUM=3.5 ../.
|
||||
make -j8
|
||||
cmake ../.
|
||||
make -j4
|
||||
make install
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
# Copyright Contributors to the OpenVDB Project
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
set -ex
|
||||
EXR_VERSION="$1"
|
||||
|
||||
git clone https://github.com/AcademySoftwareFoundation/openexr.git
|
||||
cd openexr
|
||||
|
||||
if [ "$EXR_VERSION" != "latest" ]; then
|
||||
git checkout tags/${EXR_VERSION} -b ${EXR_VERSION}
|
||||
fi
|
||||
|
||||
mkdir build
|
||||
cd build
|
||||
|
||||
cmake ..
|
||||
|
||||
make -j$(nproc)
|
||||
sudo make install
|
||||
@@ -1,21 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
# Copyright Contributors to the OpenVDB Project
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
set -ex
|
||||
GLFW_VERSION="$1"
|
||||
|
||||
git clone https://github.com/glfw/glfw.git
|
||||
cd glfw
|
||||
|
||||
if [ "$GLFW_VERSION" != "latest" ]; then
|
||||
git checkout tags/${GLFW_VERSION} -b ${GLFW_VERSION}
|
||||
fi
|
||||
|
||||
mkdir build
|
||||
cd build
|
||||
|
||||
cmake ..
|
||||
|
||||
make -j8
|
||||
make install
|
||||
+5
-8
@@ -1,21 +1,18 @@
|
||||
#!/usr/bin/env bash
|
||||
# Copyright Contributors to the OpenVDB Project
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
set -ex
|
||||
|
||||
GTEST_VERSION="$1"
|
||||
|
||||
git clone https://github.com/google/googletest.git
|
||||
cd googletest
|
||||
|
||||
if [ "$GTEST_VERSION" != "latest" ]; then
|
||||
git checkout tags/${GTEST_VERSION} -b ${GTEST_VERSION}
|
||||
git checkout release-${GTEST_VERSION} -b v${GTEST_VERSION}
|
||||
fi
|
||||
|
||||
mkdir build
|
||||
cd build
|
||||
|
||||
cmake ..
|
||||
|
||||
make -j$(nproc)
|
||||
sudo make install
|
||||
cmake ../.
|
||||
make -j4
|
||||
make install
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
# Copyright Contributors to the OpenVDB Project
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
set -ex
|
||||
IMATH_VERSION="$1"
|
||||
|
||||
git clone https://github.com/AcademySoftwareFoundation/Imath.git
|
||||
cd Imath
|
||||
|
||||
if [ "$IMATH_VERSION" != "latest" ]; then
|
||||
git checkout tags/${IMATH_VERSION} -b ${IMATH_VERSION}
|
||||
fi
|
||||
|
||||
mkdir build
|
||||
cd build
|
||||
|
||||
cmake ..
|
||||
|
||||
make -j$(nproc)
|
||||
sudo make install
|
||||
@@ -1,62 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
# Copyright Contributors to the OpenVDB Project
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
set -ex
|
||||
|
||||
LLVM_VER="$1"
|
||||
LLVM_CRT="$2"
|
||||
|
||||
# Legacy define for older versions of LLVM
|
||||
LLVM_LEGACY_CRT_DEFINE=""
|
||||
if [[ "${LLVM_CRT}" == "MultiThreaded" ]]; then
|
||||
LLVM_LEGACY_CRT_DEFINE="MT"
|
||||
elif [[ "${LLVM_CRT}" == "MultiThreadedDebug" ]]; then
|
||||
LLVM_LEGACY_CRT_DEFINE="MTd"
|
||||
elif [[ "${LLVM_CRT}" == "MultiThreadedDLL" ]]; then
|
||||
LLVM_LEGACY_CRT_DEFINE="MD"
|
||||
elif [[ "${LLVM_CRT}" == "MultiThreadedDebugDLL" ]]; then
|
||||
LLVM_LEGACY_CRT_DEFINE="MDd"
|
||||
fi
|
||||
|
||||
git clone -b llvmorg-${LLVM_VER} --depth 1 https://github.com/llvm/llvm-project.git llvm
|
||||
cd llvm
|
||||
|
||||
mkdir .build
|
||||
cd .build
|
||||
|
||||
cmake -B . -S ../llvm -A x64 -G "Visual Studio 17 2022" -Thost=x64 \
|
||||
-DCMAKE_INSTALL_PREFIX="${HOME}/llvm_install" \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DLLVM_ENABLE_ASSERTIONS=OFF \
|
||||
-DLLVM_ENABLE_PROJECTS="" \
|
||||
-DLLVM_ENABLE_RUNTIMES="" \
|
||||
-DLLVM_ENABLE_UNWIND_TABLES=OFF \
|
||||
-DLLVM_TARGETS_TO_BUILD="host" \
|
||||
-DLLVM_INCLUDE_BENCHMARKS=OFF \
|
||||
-DLLVM_INCLUDE_EXAMPLES=OFF \
|
||||
-DLLVM_INCLUDE_TESTS=OFF \
|
||||
-DLLVM_INCLUDE_DOCS=OFF \
|
||||
-DLLVM_INCLUDE_TOOLS=OFF \
|
||||
-DLLVM_INCLUDE_UTILS=OFF \
|
||||
-DLLVM_BUILD_BENCHMARKS=OFF \
|
||||
-DLLVM_BUILD_EXAMPLES=OFF \
|
||||
-DLLVM_BUILD_TESTS=OFF \
|
||||
-DLLVM_BUILD_DOCS=OFF \
|
||||
-DLLVM_BUILD_TOOLS=OFF \
|
||||
-DLLVM_BUILD_UTILS=OFF \
|
||||
-DLLVM_ENABLE_BINDINGS=OFF \
|
||||
-DLLVM_ENABLE_OCAMLDOC=OFF \
|
||||
-DLLVM_PARALLEL_COMPILE_JOBS=4 \
|
||||
-DLLVM_PARALLEL_LINK_JOBS=4 \
|
||||
-DCMAKE_MSVC_RUNTIME_LIBRARY=${LLVM_CRT} \
|
||||
-DLLVM_USE_CRT_RELEASE=${LLVM_LEGACY_CRT_DEFINE}
|
||||
|
||||
cmake --build . --parallel 4 --config Release --target install
|
||||
|
||||
cd ..
|
||||
|
||||
du -h .build -d0
|
||||
du -h ${HOME}/llvm_install -d0
|
||||
|
||||
rm -rf .build
|
||||
+16
-31
@@ -1,52 +1,37 @@
|
||||
#!/usr/bin/env bash
|
||||
# Copyright Contributors to the OpenVDB Project
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
set -x
|
||||
|
||||
# Remove Python3 symlinks in /usr/local/bin as workaround to brew update issues
|
||||
# https://github.com/actions/setup-python/issues/577
|
||||
rm /usr/local/bin/2to3* || :
|
||||
rm /usr/local/bin/idle3* || :
|
||||
rm /usr/local/bin/pydoc* || :
|
||||
rm /usr/local/bin/python3* || :
|
||||
|
||||
brew update
|
||||
brew install bash gnu-getopt # for CI scripts
|
||||
brew install boost
|
||||
brew install c-blosc
|
||||
brew install cmake
|
||||
brew install ilmbase
|
||||
brew install openexr@2
|
||||
brew install boost
|
||||
brew install boost-python3 # also installs the dependent python version
|
||||
brew install tbb@2020
|
||||
brew install zlib
|
||||
brew install glfw
|
||||
brew install googletest
|
||||
brew install jq # for trivial parsing of brew json
|
||||
brew install openexr
|
||||
brew install nanobind # also installs the dependent python version
|
||||
brew install robin-map # required for nanobind
|
||||
brew install numpy # only for python tests
|
||||
brew install zlib
|
||||
brew install jemalloc
|
||||
|
||||
# Alias python version installed by nanobind to path
|
||||
py_version=$(brew info nanobind --json | \
|
||||
# Alias python version installed by boost-python3 to path
|
||||
py_version=$(brew info boost-python3 --json | \
|
||||
jq -cr '.[].dependencies[] | select(. | startswith("python"))')
|
||||
echo "Using python $py_version"
|
||||
# export for subsequent action steps (note, not exported for this env)
|
||||
echo "Python_ROOT_DIR=/usr/local/opt/$py_version" >> $GITHUB_ENV
|
||||
echo "/usr/local/opt/$py_version/bin" >> $GITHUB_PATH
|
||||
|
||||
# use bash
|
||||
echo "/usr/local/opt/bash/bin" >> $GITHUB_PATH
|
||||
echo "/opt/homebrew/opt/bash/bin" >> $GITHUB_PATH
|
||||
# Export OpenEXR paths which are no longer installed to /usr/local (as v2.x is deprecated)
|
||||
echo "IlmBase_ROOT=/usr/local/opt/ilmbase" >> $GITHUB_ENV
|
||||
echo "OpenEXR_ROOT=/usr/local/opt/openexr@2" >> $GITHUB_ENV
|
||||
echo "/usr/local/opt/openexr@2/bin" >> $GITHUB_PATH
|
||||
|
||||
# Export TBB paths which are no longer installed to /usr/local (as v2020 is deprecated)
|
||||
echo "TBB_ROOT=/usr/local/opt/tbb@2020" >> $GITHUB_ENV
|
||||
echo "/usr/local/opt/tbb@2020/bin" >> $GITHUB_PATH
|
||||
|
||||
# use gnu-getopt
|
||||
echo "/usr/local/opt/gnu-getopt/bin" >> $GITHUB_PATH
|
||||
echo "/opt/homebrew/opt/gnu-getopt/bin" >> $GITHUB_PATH
|
||||
|
||||
LLVM_VERSION=$1
|
||||
if [ ! -z "$LLVM_VERSION" ]; then
|
||||
if [ "$LLVM_VERSION" == "latest" ]; then
|
||||
brew install llvm
|
||||
else
|
||||
brew install llvm@$LLVM_VERSION
|
||||
fi
|
||||
fi
|
||||
|
||||
Executable
+26
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Download and install deps from homebrew on macos
|
||||
|
||||
LLVM_VERSION=$1
|
||||
if [ -z $LLVM_VERSION ]; then
|
||||
echo "No LLVM version provided for LLVM installation"
|
||||
exit -1
|
||||
fi
|
||||
|
||||
brew update
|
||||
brew install bash gnu-getopt # for CI scripts
|
||||
brew install cmake
|
||||
brew install boost
|
||||
brew install cppunit
|
||||
brew install c-blosc
|
||||
brew install tbb@2020
|
||||
brew install llvm@$LLVM_VERSION
|
||||
brew install zlib
|
||||
|
||||
# Export TBB paths which are no longer installed to /usr/local (as v2020 is deprecated)
|
||||
echo "TBB_ROOT=/usr/local/opt/tbb@2020" >> $GITHUB_ENV
|
||||
echo "/usr/local/opt/tbb@2020/bin" >> $GITHUB_PATH
|
||||
|
||||
# use gnu-getopt
|
||||
echo "/usr/local/opt/gnu-getopt/bin" >> $GITHUB_PATH
|
||||
@@ -1,30 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
# Copyright Contributors to the OpenVDB Project
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
set -ex
|
||||
|
||||
PYBIND11_VERSION="$1"
|
||||
INSTALL_ROOT="$2"
|
||||
CMAKE_EXTRA=()
|
||||
if [ ! -z "${INSTALL_ROOT}" ]; then
|
||||
CMAKE_EXTRA+=("-DCMAKE_INSTALL_PREFIX=${INSTALL_ROOT}")
|
||||
fi
|
||||
|
||||
git clone --recurse-submodules https://github.com/wjakob/nanobind.git
|
||||
cd nanobind
|
||||
|
||||
if [ "$PYBIND11_VERSION" != "latest" ]; then
|
||||
git checkout tags/v${PYBIND11_VERSION} -b v${PYBIND11_VERSION}
|
||||
fi
|
||||
|
||||
mkdir build
|
||||
cd build
|
||||
|
||||
cmake \
|
||||
-DNB_TEST=OFF \
|
||||
"${CMAKE_EXTRA[@]}" \
|
||||
..
|
||||
|
||||
make -j8
|
||||
sudo make install
|
||||
@@ -1,8 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
# Copyright Contributors to the OpenVDB Project
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
set -x
|
||||
|
||||
brew update
|
||||
brew install tbb
|
||||
@@ -1,28 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
# Copyright Contributors to the OpenVDB Project
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
set -ex
|
||||
|
||||
# Download the TeX Live installer
|
||||
wget https://mirrors.mit.edu/CTAN/systems/texlive/tlnet/install-tl-unx.tar.gz
|
||||
|
||||
# Extract
|
||||
tar xzf install-tl-unx.tar.gz
|
||||
rm install-tl-unx.tar.gz
|
||||
cd install-tl-*
|
||||
|
||||
# Run the installer with no docs or source installation
|
||||
./install-tl --no-interaction --no-doc-install --no-src-install --scheme=minimal --repository https://mirrors.mit.edu/CTAN/systems/texlive/tlnet
|
||||
|
||||
# Export the texlive PATH to GITHUB_PATH
|
||||
TEXLIVE_PATH=$(echo /usr/local/texlive/*/bin/x86_64-linux)
|
||||
export PATH=${TEXLIVE_PATH}:${PATH}
|
||||
echo "${TEXLIVE_PATH}" >> $GITHUB_PATH
|
||||
|
||||
# Install the required packages
|
||||
tlmgr install latex-bin dvips collection-fontsrecommended collection-latexrecommended
|
||||
|
||||
# Validate that installing dvips and latex has been successful
|
||||
dvips --version
|
||||
latex --version
|
||||
@@ -1,40 +0,0 @@
|
||||
# Enable verbose and stop on error
|
||||
$ErrorActionPreference = "Stop"
|
||||
$VerbosePreference = "Continue"
|
||||
|
||||
# Required dependencies
|
||||
$vcpkgPackages = @(
|
||||
"zlib",
|
||||
"libpng",
|
||||
"openexr",
|
||||
"tbb",
|
||||
"gtest",
|
||||
"cppunit",
|
||||
"blosc",
|
||||
"glfw3",
|
||||
"glew",
|
||||
"python3",
|
||||
"jemalloc",
|
||||
"boost-iostreams",
|
||||
"boost-interprocess",
|
||||
"boost-algorithm",
|
||||
"nanobind"
|
||||
)
|
||||
|
||||
# Update vcpkg
|
||||
vcpkg update
|
||||
|
||||
# Allow the vcpkg command to fail once so we can retry with the latest
|
||||
try {
|
||||
vcpkg install $vcpkgPackages
|
||||
} catch {
|
||||
Write-Host "vcpkg install failed, retrying with latest ports..."
|
||||
# Retry the installation with updated ports
|
||||
Push-Location $env:VCPKG_INSTALLATION_ROOT
|
||||
git pull
|
||||
Pop-Location
|
||||
vcpkg update
|
||||
vcpkg install $vcpkgPackages
|
||||
}
|
||||
|
||||
Write-Host "vcpkg install completed successfully"
|
||||
Executable
+7
@@ -0,0 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -ex
|
||||
|
||||
vcpkg update
|
||||
vcpkg install zlib openexr tbb gtest blosc glfw3 glew \
|
||||
boost-iostreams boost-system boost-any boost-uuid boost-interprocess boost-algorithm
|
||||
@@ -1,174 +0,0 @@
|
||||
# Download and install CUDA on windows. Based off the scripts by:
|
||||
# https://github.com/ptheywood/cuda-cmake-github-actions
|
||||
|
||||
## -------------------
|
||||
## Constants
|
||||
## -------------------
|
||||
|
||||
# Dictionary of known cuda versions and thier download URLS, which do not follow a consistent pattern :(
|
||||
$CUDA_KNOWN_URLS = @{
|
||||
"8.0.44" = "http://developer.nvidia.com/compute/cuda/8.0/Prod/network_installers/cuda_8.0.44_win10_network-exe";
|
||||
"8.0.61" = "http://developer.nvidia.com/compute/cuda/8.0/Prod2/network_installers/cuda_8.0.61_win10_network-exe";
|
||||
"9.0.176" = "http://developer.nvidia.com/compute/cuda/9.0/Prod/network_installers/cuda_9.0.176_win10_network-exe";
|
||||
"9.1.85" = "http://developer.nvidia.com/compute/cuda/9.1/Prod/network_installers/cuda_9.1.85_win10_network";
|
||||
"9.2.148" = "http://developer.nvidia.com/compute/cuda/9.2/Prod2/network_installers2/cuda_9.2.148_win10_network";
|
||||
"10.0.130" = "http://developer.nvidia.com/compute/cuda/10.0/Prod/network_installers/cuda_10.0.130_win10_network";
|
||||
"10.1.105" = "http://developer.nvidia.com/compute/cuda/10.1/Prod/network_installers/cuda_10.1.105_win10_network.exe";
|
||||
"10.1.168" = "http://developer.nvidia.com/compute/cuda/10.1/Prod/network_installers/cuda_10.1.168_win10_network.exe";
|
||||
"10.1.243" = "http://developer.download.nvidia.com/compute/cuda/10.1/Prod/network_installers/cuda_10.1.243_win10_network.exe";
|
||||
"10.2.89" = "http://developer.download.nvidia.com/compute/cuda/10.2/Prod/network_installers/cuda_10.2.89_win10_network.exe";
|
||||
"11.0.1" = "http://developer.download.nvidia.com/compute/cuda/11.0.1/network_installers/cuda_11.0.1_win10_network.exe";
|
||||
"11.0.2" = "http://developer.download.nvidia.com/compute/cuda/11.0.2/network_installers/cuda_11.0.2_win10_network.exe";
|
||||
"11.0.3" = "http://developer.download.nvidia.com/compute/cuda/11.0.3/network_installers/cuda_11.0.3_win10_network.exe";
|
||||
"11.1.0" = "https://developer.download.nvidia.com/compute/cuda/11.1.0/network_installers/cuda_11.1.0_win10_network.exe";
|
||||
"11.1.1" = "https://developer.download.nvidia.com/compute/cuda/11.1.1/network_installers/cuda_11.1.1_win10_network.exe";
|
||||
"11.2.0" = "https://developer.download.nvidia.com/compute/cuda/11.2.0/network_installers/cuda_11.2.0_win10_network.exe";
|
||||
"11.2.1" = "https://developer.download.nvidia.com/compute/cuda/11.2.1/network_installers/cuda_11.2.1_win10_network.exe";
|
||||
"11.2.2" = "https://developer.download.nvidia.com/compute/cuda/11.2.2/network_installers/cuda_11.2.2_win10_network.exe";
|
||||
"11.3.0" = "https://developer.download.nvidia.com/compute/cuda/11.3.0/network_installers/cuda_11.3.0_win10_network.exe";
|
||||
"11.6.2" = "https://developer.download.nvidia.com/compute/cuda/11.6.2/network_installers/cuda_11.6.2_windows_network.exe";
|
||||
"12.4.0" = "https://developer.download.nvidia.com/compute/cuda/12.4.0/network_installers/cuda_12.4.0_windows_network.exe"
|
||||
}
|
||||
|
||||
# @todo - change this to be based on _MSC_VER intead, or invert it to be CUDA keyed instead?
|
||||
$VISUAL_STUDIO_MIN_CUDA = @{
|
||||
"2022" = "12.4";
|
||||
"2019" = "10.1";
|
||||
"2017" = "10.0"; # Depends on which version of 2017! 9.0 to 10.0 depending on version
|
||||
"2015" = "8.0"; # might support older, unsure.
|
||||
}
|
||||
|
||||
# cuda_runtime.h is in nvcc <= 10.2, but cudart >= 11.0
|
||||
# @todo - make this easier to vary per CUDA version.
|
||||
$CUDA_PACKAGES_IN = @(
|
||||
"nvcc";
|
||||
"visual_studio_integration";
|
||||
"curand_dev";
|
||||
"nvrtc_dev";
|
||||
"cudart";
|
||||
"thrust";
|
||||
)
|
||||
|
||||
|
||||
## -------------------
|
||||
## Select CUDA version
|
||||
## -------------------
|
||||
|
||||
# Get the cuda version from the environment as env:cuda.
|
||||
$CUDA_VERSION_FULL = $env:cuda
|
||||
# Make sure CUDA_VERSION_FULL is set and valid, otherwise error.
|
||||
|
||||
# Validate CUDA version, extracting components via regex
|
||||
$cuda_ver_matched = $CUDA_VERSION_FULL -match "^(?<major>[1-9][0-9]*)\.(?<minor>[0-9]+)\.(?<patch>[0-9]+)$"
|
||||
if(-not $cuda_ver_matched){
|
||||
Write-Output "Invalid CUDA version specified, <major>.<minor>.<patch> required. '$CUDA_VERSION_FULL'."
|
||||
exit 1
|
||||
}
|
||||
$CUDA_MAJOR=$Matches.major
|
||||
$CUDA_MINOR=$Matches.minor
|
||||
$CUDA_PATCH=$Matches.patch
|
||||
|
||||
## ---------------------------
|
||||
## Visual studio support check
|
||||
## ---------------------------
|
||||
# Exit if visual studio is too new for the cuda version.
|
||||
$VISUAL_STUDIO = $env:visual_studio.trim()
|
||||
if ($VISUAL_STUDIO.length -ge 4) {
|
||||
$VISUAL_STUDIO_YEAR = $VISUAL_STUDIO.Substring($VISUAL_STUDIO.Length-4)
|
||||
if ($VISUAL_STUDIO_YEAR.length -eq 4 -and $VISUAL_STUDIO_MIN_CUDA.containsKey($VISUAL_STUDIO_YEAR)){
|
||||
$MINIMUM_CUDA_VERSION = $VISUAL_STUDIO_MIN_CUDA[$VISUAL_STUDIO_YEAR]
|
||||
if ([version]$CUDA_VERSION_FULL -lt [version]$MINIMUM_CUDA_VERSION) {
|
||||
Write-Output "Error: Visual Studio $($VISUAL_STUDIO_YEAR) requires CUDA >= $($MINIMUM_CUDA_VERSION)"
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Write-Output "Warning: Unknown Visual Studio Version. CUDA version may be insufficient."
|
||||
}
|
||||
|
||||
## ------------------------------------------------
|
||||
## Select CUDA packages to install from environment
|
||||
## ------------------------------------------------
|
||||
|
||||
$CUDA_PACKAGES = ""
|
||||
|
||||
# for CUDA >= 11 cudart is a required package.
|
||||
# if([version]$CUDA_VERSION_FULL -ge [version]"11.0") {
|
||||
# if(-not $CUDA_PACKAGES_IN -contains "cudart") {
|
||||
# $CUDA_PACKAGES_IN += 'cudart'
|
||||
# }
|
||||
# }
|
||||
|
||||
Foreach ($package in $CUDA_PACKAGES_IN) {
|
||||
# Make sure the correct package name is used for nvcc.
|
||||
if($package -eq "nvcc" -and [version]$CUDA_VERSION_FULL -lt [version]"9.1"){
|
||||
$package="compiler"
|
||||
} elseif($package -eq "compiler" -and [version]$CUDA_VERSION_FULL -ge [version]"9.1") {
|
||||
$package="nvcc"
|
||||
}
|
||||
$CUDA_PACKAGES += " $($package)_$($CUDA_MAJOR).$($CUDA_MINOR)"
|
||||
|
||||
}
|
||||
echo "$($CUDA_PACKAGES)"
|
||||
## -----------------
|
||||
## Prepare download
|
||||
## -----------------
|
||||
|
||||
# Select the download link if known, otherwise have a guess.
|
||||
$CUDA_REPO_PKG_REMOTE=""
|
||||
if($CUDA_KNOWN_URLS.containsKey($CUDA_VERSION_FULL)){
|
||||
$CUDA_REPO_PKG_REMOTE=$CUDA_KNOWN_URLS[$CUDA_VERSION_FULL]
|
||||
} else{
|
||||
# Guess what the url is given the most recent pattern (at the time of writing, 10.1)
|
||||
Write-Output "note: URL for CUDA ${$CUDA_VERSION_FULL} not known, estimating."
|
||||
$CUDA_REPO_PKG_REMOTE="http://developer.download.nvidia.com/compute/cuda/$($CUDA_MAJOR).$($CUDA_MINOR)/Prod/network_installers/cuda_$($CUDA_VERSION_FULL)_win10_network.exe"
|
||||
}
|
||||
$CUDA_REPO_PKG_LOCAL="cuda_$($CUDA_VERSION_FULL)_win10_network.exe"
|
||||
|
||||
|
||||
## ------------
|
||||
## Install CUDA
|
||||
## ------------
|
||||
|
||||
# Get CUDA network installer
|
||||
Write-Output "Downloading CUDA Network Installer for $($CUDA_VERSION_FULL) from: $($CUDA_REPO_PKG_REMOTE)"
|
||||
Invoke-WebRequest $CUDA_REPO_PKG_REMOTE -OutFile $CUDA_REPO_PKG_LOCAL | Out-Null
|
||||
if(Test-Path -Path $CUDA_REPO_PKG_LOCAL){
|
||||
Write-Output "Downloading Complete"
|
||||
} else {
|
||||
Write-Output "Error: Failed to download $($CUDA_REPO_PKG_LOCAL) from $($CUDA_REPO_PKG_REMOTE)"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Invoke silent install of CUDA (via network installer)
|
||||
Write-Output "Installing CUDA $($CUDA_VERSION_FULL). Subpackages $($CUDA_PACKAGES)"
|
||||
Start-Process -Wait -FilePath .\"$($CUDA_REPO_PKG_LOCAL)" -ArgumentList "-s $($CUDA_PACKAGES)"
|
||||
|
||||
# Check the return status of the CUDA installer.
|
||||
if (!$?) {
|
||||
Write-Output "Error: CUDA installer reported error. $($LASTEXITCODE)"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Store the CUDA_PATH in the environment for the current session, to be forwarded in the action.
|
||||
$CUDA_PATH = "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v$($CUDA_MAJOR).$($CUDA_MINOR)"
|
||||
$CUDA_PATH_VX_Y = "CUDA_PATH_V$($CUDA_MAJOR)_$($CUDA_MINOR)"
|
||||
# Set environmental variables in this session
|
||||
$env:CUDA_PATH = "$($CUDA_PATH)"
|
||||
$env:CUDA_PATH_VX_Y = "$($CUDA_PATH_VX_Y)"
|
||||
Write-Output "CUDA_PATH $($CUDA_PATH)"
|
||||
Write-Output "CUDA_PATH_VX_Y $($CUDA_PATH_VX_Y)"
|
||||
|
||||
# PATH needs updating elsewhere, anything in here won't persist.
|
||||
# Append $CUDA_PATH/bin to path.
|
||||
# Set CUDA_PATH as an environmental variable
|
||||
|
||||
|
||||
# If executing on github actions, emit the appropriate echo statements to update environment variables
|
||||
if (Test-Path "env:GITHUB_ACTIONS") {
|
||||
# Set paths for subsequent steps, using $env:CUDA_PATH
|
||||
echo "Adding CUDA to CUDA_PATH, CUDA_PATH_X_Y and PATH"
|
||||
echo "CUDA_PATH=$env:CUDA_PATH" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||
echo "$env:CUDA_PATH_VX_Y=$env:CUDA_PATH" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||
echo "$env:CUDA_PATH/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
# Enable verbose and stop on error
|
||||
$ErrorActionPreference = "Stop"
|
||||
$VerbosePreference = "Continue"
|
||||
|
||||
# Install numpy for tests
|
||||
& "$env:VCPKG_INSTALLATION_ROOT\installed\$env:VCPKG_DEFAULT_TRIPLET\tools\python3\python.exe" -m ensurepip --upgrade
|
||||
& "$env:VCPKG_INSTALLATION_ROOT\installed\$env:VCPKG_DEFAULT_TRIPLET\tools\python3\python.exe" -m pip install numpy
|
||||
|
||||
Write-Host "pip numpy install completed successfully"
|
||||
+2
-4
@@ -1,6 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
# Copyright Contributors to the OpenVDB Project
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
set -e
|
||||
|
||||
# Various tests to test the FindOpenVDB CMake modules and
|
||||
@@ -10,10 +8,10 @@ set -e
|
||||
# the expected VDB installation
|
||||
|
||||
cmakelists="
|
||||
cmake_minimum_required(VERSION 3.24)
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
project(TestInstall LANGUAGES CXX)
|
||||
find_package(OpenVDB REQUIRED COMPONENTS openvdb)
|
||||
add_executable(test_vdb_print \"../openvdb_cmd/vdb_print/main.cc\")
|
||||
add_executable(test_vdb_print \"../openvdb/openvdb/cmd/openvdb_print.cc\")
|
||||
target_link_libraries(test_vdb_print OpenVDB::openvdb)
|
||||
"
|
||||
mkdir tmp
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
# Copyright Contributors to the OpenVDB Project
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
set -ex
|
||||
|
||||
|
||||
@@ -1,236 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
# Copyright Contributors to the OpenVDB Project
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
"""Validate cross-references inside the OpenVDB documentation tree.
|
||||
|
||||
Run from the repo root (no arguments) or pass paths to validate explicitly.
|
||||
The script scans Markdown (`.md`) and Doxygen narrative (`.txt`) files under
|
||||
``doc/`` and checks two classes of cross-reference for staleness:
|
||||
|
||||
1. ``#include <path/to/header.h>`` lines that appear inside Markdown
|
||||
``cpp``/``cuda``/``c``/``c++`` fenced code blocks or inside Doxygen
|
||||
``@code``/``\\code`` blocks. Each include is resolved to a real file in
|
||||
``openvdb/``, ``openvdb_ax/``, ``openvdb_houdini/`` or ``nanovdb/``.
|
||||
|
||||
2. ``https://github.com/AcademySoftwareFoundation/openvdb/blob/<ref>/<path>``
|
||||
URLs. The ``<path>`` portion is checked against the local checkout.
|
||||
|
||||
The script exits non-zero on any unresolved reference and prints a
|
||||
``file:line`` style error so the failure is actionable in CI logs. It is
|
||||
intentionally dependency-free so it can run in a minimal Python container.
|
||||
|
||||
This guards against the class of bug tracked in issue #2161, where renames
|
||||
under ``nanovdb/util/ -> nanovdb/tools/`` and ``nanovdb/util/IO.h ->
|
||||
nanovdb/io/IO.h`` silently left the docs referencing paths that no longer
|
||||
exist.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import re
|
||||
import sys
|
||||
from pathlib import Path
|
||||
from typing import Iterable, List, Sequence, Tuple
|
||||
|
||||
REPO_ROOT = Path(__file__).resolve().parent.parent
|
||||
|
||||
# Map a top-level include namespace to one or more on-disk directories that it
|
||||
# resolves against. ``#include <nanovdb/io/IO.h>`` resolves to
|
||||
# ``nanovdb/nanovdb/io/IO.h`` because the repo uses a double-named layout;
|
||||
# ``#include <houdini_utils/ParmFactory.h>`` resolves to
|
||||
# ``openvdb_houdini/openvdb_houdini/ParmFactory.h`` because the Houdini plugin
|
||||
# CMake configuration synthesises a ``houdini_utils/`` subtree at build time
|
||||
# (see ``openvdb_houdini/openvdb_houdini/CMakeLists.txt``).
|
||||
INCLUDE_NAMESPACE_ROOTS = {
|
||||
"openvdb": ("openvdb/openvdb", "openvdb"),
|
||||
"openvdb_ax": ("openvdb_ax/openvdb_ax", "openvdb_ax"),
|
||||
"openvdb_houdini": ("openvdb_houdini/openvdb_houdini", "openvdb_houdini"),
|
||||
"nanovdb": ("nanovdb/nanovdb", "nanovdb"),
|
||||
"houdini_utils": ("openvdb_houdini/openvdb_houdini",),
|
||||
}
|
||||
|
||||
# Top-level include path components that come from outside this repo. When a
|
||||
# header's leading component matches one of these, we skip resolution entirely.
|
||||
# Houdini SDK headers (``UT/``, ``GA/``, ``GEO_*``, etc.) live in the Houdini
|
||||
# install, not in our checkout.
|
||||
EXTERNAL_INCLUDE_PREFIXES = (
|
||||
"boost/",
|
||||
"tbb/",
|
||||
"cuda", # cuda_runtime.h, cuda.h, ...
|
||||
"thrust/",
|
||||
"Eigen/",
|
||||
"OpenEXR/",
|
||||
"Imath/",
|
||||
"openexr/",
|
||||
"GL/",
|
||||
# Houdini SDK prefixes
|
||||
"UT/",
|
||||
"GA/",
|
||||
"GU/",
|
||||
"GEO/",
|
||||
"GT/",
|
||||
"GR/",
|
||||
"OP/",
|
||||
"PRM/",
|
||||
"SOP/",
|
||||
"SYS/",
|
||||
"CH/",
|
||||
"DEP/",
|
||||
"PI/",
|
||||
"RE/",
|
||||
# Standard library headers (no '/' is the usual signal, but list a few
|
||||
# explicitly to be safe).
|
||||
"stdio.h",
|
||||
"iostream",
|
||||
"vector",
|
||||
"string",
|
||||
"memory",
|
||||
"cstdint",
|
||||
)
|
||||
|
||||
# Match a Markdown fenced code block whose language is one of cpp/cuda/c/c++.
|
||||
_MARKDOWN_FENCE_RE = re.compile(
|
||||
r"^```(?:cpp|cuda|c\+\+|c)\s*$(?P<body>.*?)^```\s*$",
|
||||
re.DOTALL | re.MULTILINE,
|
||||
)
|
||||
|
||||
# Doxygen ``@code``/``\code`` ... ``@endcode``/``\endcode`` blocks. The
|
||||
# language hint (``@code{.cpp}``) is optional.
|
||||
_DOXY_CODE_RE = re.compile(
|
||||
r"[@\\]code(?:\{[^}]*\})?\s*$(?P<body>.*?)^[@\\]endcode\s*$",
|
||||
re.DOTALL | re.MULTILINE,
|
||||
)
|
||||
|
||||
_INCLUDE_RE = re.compile(r"#\s*include\s*<([^>\n]+)>")
|
||||
|
||||
# Match URLs pointing into a blob in this repo. ``<ref>`` may be a branch
|
||||
# name or a sha; ``<path>`` is the portion that must exist on disk today.
|
||||
_GITHUB_BLOB_RE = re.compile(
|
||||
r"https?://github\.com/AcademySoftwareFoundation/openvdb/blob/"
|
||||
r"(?P<ref>[^/\s]+)/(?P<path>[^\s)\"'#?]+)"
|
||||
)
|
||||
|
||||
|
||||
def is_external_include(header: str) -> bool:
|
||||
"""Return True for headers we cannot resolve from this repo."""
|
||||
head, _, _ = header.partition("/")
|
||||
if head in INCLUDE_NAMESPACE_ROOTS:
|
||||
return False
|
||||
return any(header.startswith(p) for p in EXTERNAL_INCLUDE_PREFIXES) or "/" not in header
|
||||
|
||||
|
||||
def resolve_include(header: str) -> Path | None:
|
||||
"""Resolve ``#include <header>`` to a path on disk, or None if not found."""
|
||||
head, _, rest = header.partition("/")
|
||||
roots = INCLUDE_NAMESPACE_ROOTS.get(head)
|
||||
if roots is None or not rest:
|
||||
return None
|
||||
for root in roots:
|
||||
candidate = REPO_ROOT / root / rest
|
||||
if candidate.is_file():
|
||||
return candidate
|
||||
return None
|
||||
|
||||
|
||||
def iter_code_block_lines(text: str) -> Iterable[Tuple[int, str]]:
|
||||
"""Yield (line_number, line_text) for every line inside a code block.
|
||||
|
||||
Line numbers are 1-based and refer to the original ``text``. Handles both
|
||||
Markdown fences (```cpp ...```) and Doxygen ``@code``/``\\code`` blocks.
|
||||
"""
|
||||
for match in _MARKDOWN_FENCE_RE.finditer(text):
|
||||
body_start = match.start("body")
|
||||
yield from _lines_with_offsets(text, match.group("body"), body_start)
|
||||
for match in _DOXY_CODE_RE.finditer(text):
|
||||
body_start = match.start("body")
|
||||
yield from _lines_with_offsets(text, match.group("body"), body_start)
|
||||
|
||||
|
||||
def _lines_with_offsets(full_text: str, body: str, body_offset: int) -> Iterable[Tuple[int, str]]:
|
||||
base_line = full_text.count("\n", 0, body_offset) + 1
|
||||
for i, line in enumerate(body.splitlines()):
|
||||
yield base_line + i, line
|
||||
|
||||
|
||||
def find_doc_files(extra_paths: Sequence[str]) -> List[Path]:
|
||||
"""Return the list of doc files to scan.
|
||||
|
||||
Without arguments, scan ``doc/**/*.md`` and ``doc/**/*.txt``. With
|
||||
arguments, scan only those files (resolved relative to the repo root).
|
||||
"""
|
||||
if extra_paths:
|
||||
return [
|
||||
(Path(p) if Path(p).is_absolute() else REPO_ROOT / p).resolve()
|
||||
for p in extra_paths
|
||||
]
|
||||
doc_dir = REPO_ROOT / "doc"
|
||||
return sorted(
|
||||
list(doc_dir.rglob("*.md")) + list(doc_dir.rglob("*.txt"))
|
||||
)
|
||||
|
||||
|
||||
def check_file(path: Path) -> List[str]:
|
||||
"""Return a list of human-readable error strings for the given doc file."""
|
||||
errors: List[str] = []
|
||||
try:
|
||||
text = path.read_text(encoding="utf-8")
|
||||
except (OSError, UnicodeDecodeError) as exc:
|
||||
return [f"{path}: failed to read: {exc}"]
|
||||
|
||||
rel = path.relative_to(REPO_ROOT) if path.is_relative_to(REPO_ROOT) else path
|
||||
|
||||
for line_no, line in iter_code_block_lines(text):
|
||||
for include_match in _INCLUDE_RE.finditer(line):
|
||||
header = include_match.group(1).strip()
|
||||
if is_external_include(header):
|
||||
continue
|
||||
if resolve_include(header) is None:
|
||||
errors.append(
|
||||
f"{rel}:{line_no}: include <{header}> does not resolve "
|
||||
"to a file in this checkout"
|
||||
)
|
||||
|
||||
for url_match in _GITHUB_BLOB_RE.finditer(text):
|
||||
ref = url_match.group("ref")
|
||||
url_path = url_match.group("path")
|
||||
on_disk = REPO_ROOT / url_path
|
||||
if not on_disk.exists():
|
||||
# Compute the 1-based line number of the URL for the error report.
|
||||
line_no = text.count("\n", 0, url_match.start()) + 1
|
||||
errors.append(
|
||||
f"{rel}:{line_no}: github URL "
|
||||
f"AcademySoftwareFoundation/openvdb/blob/{ref}/{url_path} "
|
||||
"does not exist in this checkout"
|
||||
)
|
||||
|
||||
return errors
|
||||
|
||||
|
||||
def main(argv: Sequence[str]) -> int:
|
||||
files = find_doc_files(argv[1:])
|
||||
total_errors: List[str] = []
|
||||
for path in files:
|
||||
if not path.exists():
|
||||
total_errors.append(f"{path}: file does not exist")
|
||||
continue
|
||||
total_errors.extend(check_file(path))
|
||||
|
||||
if total_errors:
|
||||
print("Documentation reference validation FAILED.", file=sys.stderr)
|
||||
print("", file=sys.stderr)
|
||||
for err in total_errors:
|
||||
print(err, file=sys.stderr)
|
||||
print("", file=sys.stderr)
|
||||
print(
|
||||
f"{len(total_errors)} broken reference(s) across "
|
||||
f"{len(files)} file(s).",
|
||||
file=sys.stderr,
|
||||
)
|
||||
return 1
|
||||
|
||||
print(f"OK: {len(files)} doc file(s) validated, no broken references.")
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main(sys.argv))
|
||||
@@ -1,24 +0,0 @@
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
# SPDX-FileCopyrightText: Copyright (c) 2019-2023 Lars Melchior and contributors
|
||||
|
||||
set(CPM_DOWNLOAD_VERSION 0.40.2)
|
||||
set(CPM_HASH_SUM "c8cdc32c03816538ce22781ed72964dc864b2a34a310d3b7104812a5ca2d835d")
|
||||
|
||||
if(CPM_SOURCE_CACHE)
|
||||
set(CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
|
||||
elseif(DEFINED ENV{CPM_SOURCE_CACHE})
|
||||
set(CPM_DOWNLOAD_LOCATION "$ENV{CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
|
||||
else()
|
||||
set(CPM_DOWNLOAD_LOCATION "${CMAKE_BINARY_DIR}/cmake/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
|
||||
endif()
|
||||
|
||||
# Expand relative path. This is important if the provided path contains a tilde (~)
|
||||
get_filename_component(CPM_DOWNLOAD_LOCATION ${CPM_DOWNLOAD_LOCATION} ABSOLUTE)
|
||||
|
||||
file(DOWNLOAD
|
||||
https://github.com/cpm-cmake/CPM.cmake/releases/download/v${CPM_DOWNLOAD_VERSION}/CPM.cmake
|
||||
${CPM_DOWNLOAD_LOCATION} EXPECTED_HASH SHA256=${CPM_HASH_SUM}
|
||||
)
|
||||
|
||||
include(${CPM_DOWNLOAD_LOCATION})
|
||||
+33
-71
@@ -1,5 +1,5 @@
|
||||
# Copyright Contributors to the OpenVDB Project
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MPL-2.0
|
||||
#
|
||||
#[=======================================================================[.rst:
|
||||
|
||||
@@ -88,7 +88,7 @@ may be provided to tell this module where to look.
|
||||
|
||||
#]=======================================================================]
|
||||
|
||||
cmake_minimum_required(VERSION 3.24)
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
include(GNUInstallDirs)
|
||||
|
||||
mark_as_advanced(
|
||||
@@ -188,6 +188,20 @@ list(APPEND _BLOSC_LIBRARYDIR_SEARCH_DIRS
|
||||
${SYSTEM_LIBRARY_PATHS}
|
||||
)
|
||||
|
||||
# Library suffix handling
|
||||
|
||||
set(_BLOSC_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||
|
||||
if(WIN32)
|
||||
if(BLOSC_USE_STATIC_LIBS)
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib")
|
||||
endif()
|
||||
else()
|
||||
if(BLOSC_USE_STATIC_LIBS)
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(Blosc_LIB_COMPONENTS "")
|
||||
# NOTE: Search for debug version first (see vcpkg hack)
|
||||
list(APPEND BLOSC_BUILD_TYPES DEBUG RELEASE)
|
||||
@@ -230,6 +244,11 @@ foreach(BUILD_TYPE ${BLOSC_BUILD_TYPES})
|
||||
set(CMAKE_IGNORE_PATH ${_BLOSC_CMAKE_IGNORE_PATH})
|
||||
endforeach()
|
||||
|
||||
# Reset library suffix
|
||||
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ${_BLOSC_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||
unset(_BLOSC_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES)
|
||||
|
||||
if(Blosc_LIBRARY_DEBUG AND Blosc_LIBRARY_RELEASE)
|
||||
# if the generator is multi-config or if CMAKE_BUILD_TYPE is set for
|
||||
# single-config generators, set optimized and debug libraries
|
||||
@@ -357,76 +376,19 @@ if(NOT TARGET Blosc::blosc)
|
||||
set_target_properties(Blosc::blosc PROPERTIES
|
||||
INTERFACE_LINK_DIRECTORIES
|
||||
"\$<\$<CONFIG:Release>:${Blosc_RELEASE_LIBRARY_DIRS}>;\$<\$<CONFIG:Debug>:${Blosc_DEBUG_LIBRARY_DIRS}>")
|
||||
target_link_libraries(Blosc::blosc INTERFACE
|
||||
$<$<CONFIG:Release>:lz4;snappy;zlib>
|
||||
$<$<CONFIG:Debug>:lz4d;snappyd;zlibd>)
|
||||
|
||||
set(BLOSC_EXTERNAL_LIBRARIES lz4 snappy zlib zstd)
|
||||
|
||||
foreach(BLOSC_EXTERNAL_LIB ${BLOSC_EXTERNAL_LIBRARIES})
|
||||
|
||||
foreach(BUILD_TYPE ${BLOSC_BUILD_TYPES})
|
||||
set(_BLOSC_CMAKE_IGNORE_PATH ${CMAKE_IGNORE_PATH})
|
||||
|
||||
if(VCPKG_TOOLCHAIN)
|
||||
if(BUILD_TYPE STREQUAL RELEASE)
|
||||
list(APPEND CMAKE_IGNORE_PATH ${Blosc_DEBUG_LIBRARY_DIRS})
|
||||
else()
|
||||
list(APPEND CMAKE_IGNORE_PATH ${Blosc_RELEASE_LIBRARY_DIRS})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
find_library(${BLOSC_EXTERNAL_LIB}_LIBRARY_${BUILD_TYPE} ${BLOSC_EXTERNAL_LIB}
|
||||
${_FIND_BLOSC_ADDITIONAL_OPTIONS}
|
||||
PATHS ${_BLOSC_LIBRARYDIR_SEARCH_DIRS}
|
||||
PATH_SUFFIXES ${CMAKE_INSTALL_LIBDIR} lib64 lib)
|
||||
|
||||
if(NOT ${BLOSC_EXTERNAL_LIB}_LIBRARY_${BUILD_TYPE})
|
||||
if(BUILD_TYPE STREQUAL DEBUG)
|
||||
find_library(${BLOSC_EXTERNAL_LIB}_LIBRARY_${BUILD_TYPE} "${BLOSC_EXTERNAL_LIB}d"
|
||||
${_FIND_BLOSC_ADDITIONAL_OPTIONS}
|
||||
PATHS ${_BLOSC_LIBRARYDIR_SEARCH_DIRS}
|
||||
PATH_SUFFIXES ${CMAKE_INSTALL_LIBDIR} lib64 lib)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(CMAKE_IGNORE_PATH ${_BLOSC_CMAKE_IGNORE_PATH})
|
||||
endforeach()
|
||||
|
||||
if(${BLOSC_EXTERNAL_LIB}_LIBRARY_DEBUG AND ${BLOSC_EXTERNAL_LIB}_LIBRARY_RELEASE)
|
||||
# if the generator is multi-config or if CMAKE_BUILD_TYPE is set for
|
||||
# single-config generators, set optimized and debug libraries
|
||||
get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
||||
if(_isMultiConfig OR CMAKE_BUILD_TYPE)
|
||||
set(${BLOSC_EXTERNAL_LIB}_LIBRARY optimized ${${BLOSC_EXTERNAL_LIB}_LIBRARY_RELEASE} debug ${${BLOSC_EXTERNAL_LIB}_LIBRARY_DEBUG})
|
||||
else()
|
||||
# For single-config generators where CMAKE_BUILD_TYPE has no value,
|
||||
# just use the release libraries
|
||||
set(${BLOSC_EXTERNAL_LIB}_LIBRARY ${${BLOSC_EXTERNAL_LIB}_LIBRARY_RELEASE})
|
||||
endif()
|
||||
# FIXME: This probably should be set for both cases
|
||||
set(${BLOSC_EXTERNAL_LIB}_LIBRARIES optimized ${${BLOSC_EXTERNAL_LIB}_LIBRARY_RELEASE} debug ${${BLOSC_EXTERNAL_LIB}_LIBRARY_DEBUG})
|
||||
endif()
|
||||
|
||||
# if only the release version was found, set the debug variable also to the release version
|
||||
if(${BLOSC_EXTERNAL_LIB}_LIBRARY_RELEASE AND NOT ${BLOSC_EXTERNAL_LIB}_LIBRARY_DEBUG)
|
||||
set(${BLOSC_EXTERNAL_LIB}_LIBRARY_DEBUG ${${BLOSC_EXTERNAL_LIB}_LIBRARY_RELEASE})
|
||||
set(${BLOSC_EXTERNAL_LIB}_LIBRARY ${${BLOSC_EXTERNAL_LIB}_LIBRARY_RELEASE})
|
||||
set(${BLOSC_EXTERNAL_LIB}_LIBRARIES ${${BLOSC_EXTERNAL_LIB}_LIBRARY_RELEASE})
|
||||
endif()
|
||||
|
||||
# if only the debug version was found, set the release variable also to the debug version
|
||||
if(${BLOSC_EXTERNAL_LIB}_LIBRARY_DEBUG AND NOT ${BLOSC_EXTERNAL_LIB}_LIBRARY_RELEASE)
|
||||
set(${BLOSC_EXTERNAL_LIB}_LIBRARY_RELEASE ${${BLOSC_EXTERNAL_LIB}_LIBRARY_DEBUG})
|
||||
set(${BLOSC_EXTERNAL_LIB}_LIBRARY ${${BLOSC_EXTERNAL_LIB}_LIBRARY_DEBUG})
|
||||
set(${BLOSC_EXTERNAL_LIB}_LIBRARIES ${${BLOSC_EXTERNAL_LIB}_LIBRARY_DEBUG})
|
||||
endif()
|
||||
|
||||
if(${BLOSC_EXTERNAL_LIB}_LIBRARY_RELEASE OR ${BLOSC_EXTERNAL_LIB}_LIBRARY_DEBUG)
|
||||
target_link_libraries(Blosc::blosc INTERFACE
|
||||
$<$<CONFIG:Release>:${${BLOSC_EXTERNAL_LIB}_LIBRARY_RELEASE}>
|
||||
$<$<CONFIG:Debug>:${${BLOSC_EXTERNAL_LIB}_LIBRARY_DEBUG}>)
|
||||
endif()
|
||||
|
||||
endforeach()
|
||||
if(BLOSC_USE_STATIC_LIBS)
|
||||
target_link_libraries(Blosc::blosc INTERFACE
|
||||
$<$<CONFIG:Release>:zstd_static>
|
||||
$<$<CONFIG:Debug>:zstd_staticd>)
|
||||
else()
|
||||
target_link_libraries(Blosc::blosc INTERFACE
|
||||
$<$<CONFIG:Release>:zstd>
|
||||
$<$<CONFIG:Debug>:zstdd>)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
|
||||
@@ -0,0 +1,225 @@
|
||||
# Copyright Contributors to the OpenVDB Project
|
||||
# SPDX-License-Identifier: MPL-2.0
|
||||
#
|
||||
#[=======================================================================[.rst:
|
||||
|
||||
FindCppUnit
|
||||
-----------
|
||||
|
||||
Find CppUnit include dirs and libraries
|
||||
|
||||
Use this module by invoking find_package with the form::
|
||||
|
||||
find_package(CppUnit
|
||||
[version] [EXACT] # Minimum or EXACT version
|
||||
[REQUIRED] # Fail with error if CppUnit is not found
|
||||
)
|
||||
|
||||
|
||||
IMPORTED Targets
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
``CppUnit::cppunit``
|
||||
This module defines IMPORTED target CppUnit::cppunit, if CppUnit has been
|
||||
found.
|
||||
|
||||
Result Variables
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
This will define the following variables:
|
||||
|
||||
``CppUnit_FOUND``
|
||||
True if the system has the CppUnit library.
|
||||
``CppUnit_VERSION``
|
||||
The version of the CppUnit library which was found.
|
||||
``CppUnit_INCLUDE_DIRS``
|
||||
Include directories needed to use CppUnit.
|
||||
``CppUnit_LIBRARIES``
|
||||
Libraries needed to link to CppUnit.
|
||||
``CppUnit_LIBRARY_DIRS``
|
||||
CppUnit library directories.
|
||||
|
||||
Cache Variables
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
The following cache variables may also be set:
|
||||
|
||||
``CppUnit_INCLUDE_DIR``
|
||||
The directory containing ``cppunit/Portability.h``.
|
||||
``CppUnit_LIBRARY``
|
||||
The path to the CppUnit library.
|
||||
|
||||
Hints
|
||||
^^^^^
|
||||
|
||||
Instead of explicitly setting the cache variables, the following variables
|
||||
may be provided to tell this module where to look.
|
||||
|
||||
``CppUnit_ROOT``
|
||||
Preferred installation prefix.
|
||||
``CPPUNIT_INCLUDEDIR``
|
||||
Preferred include directory e.g. <prefix>/include
|
||||
``CPPUNIT_LIBRARYDIR``
|
||||
Preferred library directory e.g. <prefix>/lib
|
||||
``SYSTEM_LIBRARY_PATHS``
|
||||
Global list of library paths intended to be searched by and find_xxx call
|
||||
``CPPUNIT_USE_STATIC_LIBS``
|
||||
Only search for static cppunit libraries
|
||||
``DISABLE_CMAKE_SEARCH_PATHS``
|
||||
Disable CMakes default search paths for find_xxx calls in this module
|
||||
|
||||
#]=======================================================================]
|
||||
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
include(GNUInstallDirs)
|
||||
|
||||
|
||||
mark_as_advanced(
|
||||
CppUnit_INCLUDE_DIR
|
||||
CppUnit_LIBRARY
|
||||
)
|
||||
|
||||
set(_FIND_CPPUNIT_ADDITIONAL_OPTIONS "")
|
||||
if(DISABLE_CMAKE_SEARCH_PATHS)
|
||||
set(_FIND_CPPUNIT_ADDITIONAL_OPTIONS NO_DEFAULT_PATH)
|
||||
endif()
|
||||
|
||||
# Set _CPPUNIT_ROOT based on a user provided root var. Xxx_ROOT and ENV{Xxx_ROOT}
|
||||
# are prioritised over the legacy capitalized XXX_ROOT variables for matching
|
||||
# CMake 3.12 behaviour
|
||||
# @todo deprecate -D and ENV CPPUNIT_ROOT from CMake 3.12
|
||||
if(CppUnit_ROOT)
|
||||
set(_CPPUNIT_ROOT ${CppUnit_ROOT})
|
||||
elseif(DEFINED ENV{CppUnit_ROOT})
|
||||
set(_CPPUNIT_ROOT $ENV{CppUnit_ROOT})
|
||||
elseif(CPPUNIT_ROOT)
|
||||
set(_CPPUNIT_ROOT ${CPPUNIT_ROOT})
|
||||
elseif(DEFINED ENV{CPPUNIT_ROOT})
|
||||
set(_CPPUNIT_ROOT $ENV{CPPUNIT_ROOT})
|
||||
endif()
|
||||
|
||||
# Additionally try and use pkconfig to find cppunit
|
||||
if(USE_PKGCONFIG)
|
||||
if(NOT DEFINED PKG_CONFIG_FOUND)
|
||||
find_package(PkgConfig)
|
||||
endif()
|
||||
pkg_check_modules(PC_CppUnit QUIET cppunit)
|
||||
endif()
|
||||
|
||||
# ------------------------------------------------------------------------
|
||||
# Search for CppUnit include DIR
|
||||
# ------------------------------------------------------------------------
|
||||
|
||||
set(_CPPUNIT_INCLUDE_SEARCH_DIRS "")
|
||||
list(APPEND _CPPUNIT_INCLUDE_SEARCH_DIRS
|
||||
${CPPUNIT_INCLUDEDIR}
|
||||
${_CPPUNIT_ROOT}
|
||||
${PC_CppUnit_INCLUDEDIR}
|
||||
${SYSTEM_LIBRARY_PATHS}
|
||||
)
|
||||
|
||||
# Look for a standard cppunit header file.
|
||||
find_path(CppUnit_INCLUDE_DIR cppunit/Portability.h
|
||||
${_FIND_CPPUNIT_ADDITIONAL_OPTIONS}
|
||||
PATHS ${_CPPUNIT_INCLUDE_SEARCH_DIRS}
|
||||
PATH_SUFFIXES ${CMAKE_INSTALL_INCLUDEDIR} include
|
||||
)
|
||||
|
||||
if(EXISTS "${CppUnit_INCLUDE_DIR}/cppunit/Portability.h")
|
||||
file(STRINGS "${CppUnit_INCLUDE_DIR}/cppunit/Portability.h"
|
||||
_cppunit_version_string REGEX "#define CPPUNIT_VERSION "
|
||||
)
|
||||
string(REGEX REPLACE "#define CPPUNIT_VERSION +\"(.+)\".*$" "\\1"
|
||||
_cppunit_version_string "${_cppunit_version_string}"
|
||||
)
|
||||
string(STRIP "${_cppunit_version_string}" CppUnit_VERSION)
|
||||
unset(_cppunit_version_string )
|
||||
endif()
|
||||
|
||||
# ------------------------------------------------------------------------
|
||||
# Search for CppUnit lib DIR
|
||||
# ------------------------------------------------------------------------
|
||||
|
||||
set(_CPPUNIT_LIBRARYDIR_SEARCH_DIRS "")
|
||||
list(APPEND _CPPUNIT_LIBRARYDIR_SEARCH_DIRS
|
||||
${CPPUNIT_LIBRARYDIR}
|
||||
${_CPPUNIT_ROOT}
|
||||
${PC_CppUnit_LIBDIR}
|
||||
${SYSTEM_LIBRARY_PATHS}
|
||||
)
|
||||
|
||||
# Library suffix handling
|
||||
|
||||
set(_CPPUNIT_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||
|
||||
if(WIN32)
|
||||
if(CPPUNIT_USE_STATIC_LIBS)
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib")
|
||||
else()
|
||||
list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES "_dll.lib")
|
||||
endif()
|
||||
else()
|
||||
if(CPPUNIT_USE_STATIC_LIBS)
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Build suffix directories
|
||||
|
||||
find_library(CppUnit_LIBRARY cppunit
|
||||
${_FIND_CPPUNIT_ADDITIONAL_OPTIONS}
|
||||
PATHS ${_CPPUNIT_LIBRARYDIR_SEARCH_DIRS}
|
||||
PATH_SUFFIXES ${CMAKE_INSTALL_LIBDIR} lib64 lib
|
||||
)
|
||||
|
||||
# Reset library suffix
|
||||
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ${_CPPUNIT_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||
unset(_CPPUNIT_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES)
|
||||
|
||||
# ------------------------------------------------------------------------
|
||||
# Cache and set CppUnit_FOUND
|
||||
# ------------------------------------------------------------------------
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(CppUnit
|
||||
FOUND_VAR CppUnit_FOUND
|
||||
REQUIRED_VARS
|
||||
CppUnit_LIBRARY
|
||||
CppUnit_INCLUDE_DIR
|
||||
VERSION_VAR CppUnit_VERSION
|
||||
)
|
||||
|
||||
if(CppUnit_FOUND)
|
||||
# Configure lib type. If XXX_USE_STATIC_LIBS, we always assume a static
|
||||
# lib is in use. If win32, we can't mark the import .libs as shared, so
|
||||
# these are always marked as UNKNOWN. Otherwise, infer from extension.
|
||||
set(CPPUNIT_LIB_TYPE UNKNOWN)
|
||||
if(CPPUNIT_USE_STATIC_LIBS)
|
||||
set(CPPUNIT_LIB_TYPE STATIC)
|
||||
elseif(UNIX)
|
||||
get_filename_component(_CPPUNIT_EXT ${CppUnit_LIBRARY} EXT)
|
||||
if(_CPPUNIT_EXT STREQUAL ".a")
|
||||
set(CPPUNIT_LIB_TYPE STATIC)
|
||||
elseif(_CPPUNIT_EXT STREQUAL ".so" OR
|
||||
_CPPUNIT_EXT STREQUAL ".dylib")
|
||||
set(CPPUNIT_LIB_TYPE SHARED)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(CppUnit_LIBRARIES ${CppUnit_LIBRARY})
|
||||
set(CppUnit_INCLUDE_DIRS ${CppUnit_INCLUDE_DIR})
|
||||
|
||||
get_filename_component(CppUnit_LIBRARY_DIRS ${CppUnit_LIBRARY} DIRECTORY)
|
||||
|
||||
if(NOT TARGET CppUnit::cppunit)
|
||||
add_library(CppUnit::cppunit ${CPPUNIT_LIB_TYPE} IMPORTED)
|
||||
set_target_properties(CppUnit::cppunit PROPERTIES
|
||||
IMPORTED_LOCATION "${CppUnit_LIBRARIES}"
|
||||
INTERFACE_COMPILE_OPTIONS "${PC_CppUnit_CFLAGS_OTHER}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${CppUnit_INCLUDE_DIRS}"
|
||||
)
|
||||
endif()
|
||||
elseif(CppUnit_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "Unable to find CppUnit")
|
||||
endif()
|
||||
@@ -0,0 +1,447 @@
|
||||
# Copyright Contributors to the OpenVDB Project
|
||||
# SPDX-License-Identifier: MPL-2.0
|
||||
#
|
||||
#[=======================================================================[.rst:
|
||||
|
||||
FindIlmBase
|
||||
-----------
|
||||
|
||||
Find IlmBase include dirs and libraries
|
||||
|
||||
Use this module by invoking find_package with the form::
|
||||
|
||||
find_package(IlmBase
|
||||
[version] [EXACT] # Minimum or EXACT version
|
||||
[REQUIRED] # Fail with error if IlmBase is not found
|
||||
[COMPONENTS <libs>...] # IlmBase libraries by their canonical name
|
||||
# e.g. "Half" for "libHalf"
|
||||
)
|
||||
|
||||
IMPORTED Targets
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
``IlmBase::Half``
|
||||
The Half library target.
|
||||
``IlmBase::Iex``
|
||||
The Iex library target.
|
||||
``IlmBase::IexMath``
|
||||
The IexMath library target.
|
||||
``IlmBase::IlmThread``
|
||||
The IlmThread library target.
|
||||
``IlmBase::Imath``
|
||||
The Imath library target.
|
||||
|
||||
Result Variables
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
This will define the following variables:
|
||||
|
||||
``IlmBase_FOUND``
|
||||
True if the system has the IlmBase library.
|
||||
``IlmBase_VERSION``
|
||||
The version of the IlmBase library which was found.
|
||||
``IlmBase_INCLUDE_DIRS``
|
||||
Include directories needed to use IlmBase.
|
||||
``IlmBase_RELEASE_LIBRARIES``
|
||||
Libraries needed to link to the release version of IlmBase.
|
||||
``IlmBase_RELEASE_LIBRARY_DIRS``
|
||||
IlmBase release library directories.
|
||||
``IlmBase_DEBUG_LIBRARIES``
|
||||
Libraries needed to link to the debug version of IlmBase.
|
||||
``IlmBase_DEBUG_LIBRARY_DIRS``
|
||||
IlmBase debug library directories.
|
||||
``IlmBase_{COMPONENT}_FOUND``
|
||||
True if the system has the named IlmBase component.
|
||||
|
||||
Deprecated - use [RELEASE|DEBUG] variants:
|
||||
|
||||
``IlmBase_LIBRARIES``
|
||||
Libraries needed to link to IlmBase.
|
||||
``IlmBase_LIBRARY_DIRS``
|
||||
IlmBase library directories.
|
||||
|
||||
Cache Variables
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
The following cache variables may also be set:
|
||||
|
||||
``IlmBase_INCLUDE_DIR``
|
||||
The directory containing ``IlmBase/config-auto.h``.
|
||||
``IlmBase_{COMPONENT}_LIBRARY``
|
||||
Individual component libraries for IlmBase. may include target_link_libraries() debug/optimized keywords.
|
||||
``IlmBase_{COMPONENT}_LIBRARY_RELEASE``
|
||||
Individual component libraries for IlmBase release
|
||||
``IlmBase_{COMPONENT}_LIBRARY_DEBUG``
|
||||
Individual component libraries for IlmBase debug
|
||||
|
||||
Hints
|
||||
^^^^^
|
||||
|
||||
Instead of explicitly setting the cache variables, the following variables
|
||||
may be provided to tell this module where to look.
|
||||
|
||||
``IlmBase_ROOT``
|
||||
Preferred installation prefix.
|
||||
``ILMBASE_INCLUDEDIR``
|
||||
Preferred include directory e.g. <prefix>/include
|
||||
``ILMBASE_LIBRARYDIR``
|
||||
Preferred library directory e.g. <prefix>/lib
|
||||
``ILMBASE_DEBUG_SUFFIX``
|
||||
Suffix of the debug version of ilmbase libs. Defaults to "_d".
|
||||
``SYSTEM_LIBRARY_PATHS``
|
||||
Global list of library paths intended to be searched by and find_xxx call
|
||||
``ILMBASE_USE_STATIC_LIBS``
|
||||
Only search for static ilmbase libraries
|
||||
``DISABLE_CMAKE_SEARCH_PATHS``
|
||||
Disable CMakes default search paths for find_xxx calls in this module
|
||||
|
||||
#]=======================================================================]
|
||||
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
include(GNUInstallDirs)
|
||||
|
||||
|
||||
mark_as_advanced(
|
||||
IlmBase_INCLUDE_DIR
|
||||
IlmBase_LIBRARY
|
||||
)
|
||||
|
||||
set(_FIND_ILMBASE_ADDITIONAL_OPTIONS "")
|
||||
if(DISABLE_CMAKE_SEARCH_PATHS)
|
||||
set(_FIND_ILMBASE_ADDITIONAL_OPTIONS NO_DEFAULT_PATH)
|
||||
endif()
|
||||
|
||||
set(_ILMBASE_COMPONENT_LIST
|
||||
Half
|
||||
Iex
|
||||
IexMath
|
||||
IlmThread
|
||||
Imath
|
||||
)
|
||||
|
||||
if(IlmBase_FIND_COMPONENTS)
|
||||
set(ILMBASE_COMPONENTS_PROVIDED TRUE)
|
||||
set(_IGNORED_COMPONENTS "")
|
||||
foreach(COMPONENT ${IlmBase_FIND_COMPONENTS})
|
||||
if(NOT ${COMPONENT} IN_LIST _ILMBASE_COMPONENT_LIST)
|
||||
list(APPEND _IGNORED_COMPONENTS ${COMPONENT})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if(_IGNORED_COMPONENTS)
|
||||
message(STATUS "Ignoring unknown components of IlmBase:")
|
||||
foreach(COMPONENT ${_IGNORED_COMPONENTS})
|
||||
message(STATUS " ${COMPONENT}")
|
||||
endforeach()
|
||||
list(REMOVE_ITEM IlmBase_FIND_COMPONENTS ${_IGNORED_COMPONENTS})
|
||||
endif()
|
||||
else()
|
||||
set(ILMBASE_COMPONENTS_PROVIDED FALSE)
|
||||
set(IlmBase_FIND_COMPONENTS ${_ILMBASE_COMPONENT_LIST})
|
||||
endif()
|
||||
|
||||
# Set _ILMBASE_ROOT based on a user provided root var. Xxx_ROOT and ENV{Xxx_ROOT}
|
||||
# are prioritised over the legacy capitalized XXX_ROOT variables for matching
|
||||
# CMake 3.12 behaviour
|
||||
# @todo deprecate -D and ENV ILMBASE_ROOT from CMake 3.12
|
||||
if(IlmBase_ROOT)
|
||||
set(_ILMBASE_ROOT ${IlmBase_ROOT})
|
||||
elseif(DEFINED ENV{IlmBase_ROOT})
|
||||
set(_ILMBASE_ROOT $ENV{IlmBase_ROOT})
|
||||
elseif(ILMBASE_ROOT)
|
||||
set(_ILMBASE_ROOT ${ILMBASE_ROOT})
|
||||
elseif(DEFINED ENV{ILMBASE_ROOT})
|
||||
set(_ILMBASE_ROOT $ENV{ILMBASE_ROOT})
|
||||
endif()
|
||||
|
||||
# Additionally try and use pkconfig to find IlmBase
|
||||
if(USE_PKGCONFIG)
|
||||
if(NOT DEFINED PKG_CONFIG_FOUND)
|
||||
find_package(PkgConfig)
|
||||
endif()
|
||||
if(PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(PC_IlmBase QUIET ilmbase)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# ------------------------------------------------------------------------
|
||||
# Search for IlmBase include DIR
|
||||
# ------------------------------------------------------------------------
|
||||
|
||||
set(_ILMBASE_INCLUDE_SEARCH_DIRS "")
|
||||
list(APPEND _ILMBASE_INCLUDE_SEARCH_DIRS
|
||||
${ILMBASE_INCLUDEDIR}
|
||||
${_ILMBASE_ROOT}
|
||||
${PC_IlmBase_INCLUDEDIR}
|
||||
${SYSTEM_LIBRARY_PATHS}
|
||||
)
|
||||
|
||||
# Look for a standard IlmBase header file.
|
||||
find_path(IlmBase_INCLUDE_DIR IlmBaseConfig.h
|
||||
${_FIND_ILMBASE_ADDITIONAL_OPTIONS}
|
||||
PATHS ${_ILMBASE_INCLUDE_SEARCH_DIRS}
|
||||
PATH_SUFFIXES ${CMAKE_INSTALL_INCLUDEDIR}/OpenEXR include/OpenEXR OpenEXR
|
||||
)
|
||||
|
||||
if(EXISTS "${IlmBase_INCLUDE_DIR}/IlmBaseConfig.h")
|
||||
# Get the ILMBASE version information from the config header
|
||||
file(STRINGS "${IlmBase_INCLUDE_DIR}/IlmBaseConfig.h"
|
||||
_ilmbase_version_major_string REGEX "#define ILMBASE_VERSION_MAJOR "
|
||||
)
|
||||
string(REGEX REPLACE "#define ILMBASE_VERSION_MAJOR" ""
|
||||
_ilmbase_version_major_string "${_ilmbase_version_major_string}"
|
||||
)
|
||||
string(STRIP "${_ilmbase_version_major_string}" IlmBase_VERSION_MAJOR)
|
||||
|
||||
file(STRINGS "${IlmBase_INCLUDE_DIR}/IlmBaseConfig.h"
|
||||
_ilmbase_version_minor_string REGEX "#define ILMBASE_VERSION_MINOR "
|
||||
)
|
||||
string(REGEX REPLACE "#define ILMBASE_VERSION_MINOR" ""
|
||||
_ilmbase_version_minor_string "${_ilmbase_version_minor_string}"
|
||||
)
|
||||
string(STRIP "${_ilmbase_version_minor_string}" IlmBase_VERSION_MINOR)
|
||||
|
||||
unset(_ilmbase_version_major_string)
|
||||
unset(_ilmbase_version_minor_string)
|
||||
|
||||
set(IlmBase_VERSION ${IlmBase_VERSION_MAJOR}.${IlmBase_VERSION_MINOR})
|
||||
endif()
|
||||
|
||||
# ------------------------------------------------------------------------
|
||||
# Search for ILMBASE lib DIR
|
||||
# ------------------------------------------------------------------------
|
||||
|
||||
if(NOT DEFINED ILMBASE_DEBUG_SUFFIX)
|
||||
set(ILMBASE_DEBUG_SUFFIX _d)
|
||||
endif()
|
||||
|
||||
set(_ILMBASE_LIBRARYDIR_SEARCH_DIRS "")
|
||||
|
||||
# Append to _ILMBASE_LIBRARYDIR_SEARCH_DIRS in priority order
|
||||
|
||||
list(APPEND _ILMBASE_LIBRARYDIR_SEARCH_DIRS
|
||||
${ILMBASE_LIBRARYDIR}
|
||||
${_ILMBASE_ROOT}
|
||||
${PC_IlmBase_LIBDIR}
|
||||
${SYSTEM_LIBRARY_PATHS}
|
||||
)
|
||||
|
||||
set(IlmBase_LIB_COMPONENTS "")
|
||||
list(APPEND ILM_BUILD_TYPES RELEASE DEBUG)
|
||||
|
||||
foreach(COMPONENT ${IlmBase_FIND_COMPONENTS})
|
||||
foreach(BUILD_TYPE ${ILM_BUILD_TYPES})
|
||||
|
||||
set(_TMP_SUFFIX "")
|
||||
if(BUILD_TYPE STREQUAL DEBUG)
|
||||
set(_TMP_SUFFIX ${ILMBASE_DEBUG_SUFFIX})
|
||||
endif()
|
||||
|
||||
set(_IlmBase_Version_Suffix "-${IlmBase_VERSION_MAJOR}_${IlmBase_VERSION_MINOR}")
|
||||
set(_ILMBASE_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||
|
||||
if(WIN32)
|
||||
if(ILMBASE_USE_STATIC_LIBS)
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES "${_TMP_SUFFIX}.lib")
|
||||
endif()
|
||||
list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES "${_IlmBase_Version_Suffix}${_TMP_SUFFIX}.lib")
|
||||
else()
|
||||
if(ILMBASE_USE_STATIC_LIBS)
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES "${_TMP_SUFFIX}.a")
|
||||
else()
|
||||
if(APPLE)
|
||||
list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES "${_IlmBase_Version_Suffix}${_TMP_SUFFIX}.dylib")
|
||||
else()
|
||||
list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES "${_IlmBase_Version_Suffix}${_TMP_SUFFIX}.so")
|
||||
endif()
|
||||
endif()
|
||||
list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES "${_IlmBase_Version_Suffix}${_TMP_SUFFIX}.a")
|
||||
endif()
|
||||
|
||||
# Find the lib
|
||||
find_library(IlmBase_${COMPONENT}_LIBRARY_${BUILD_TYPE} ${COMPONENT}
|
||||
${_FIND_ILMBASE_ADDITIONAL_OPTIONS}
|
||||
PATHS ${_ILMBASE_LIBRARYDIR_SEARCH_DIRS}
|
||||
PATH_SUFFIXES ${CMAKE_INSTALL_LIBDIR} lib64 lib
|
||||
)
|
||||
|
||||
if(EXISTS ${IlmBase_${COMPONENT}_LIBRARY_${BUILD_TYPE}})
|
||||
list(APPEND IlmBase_LIB_COMPONENTS ${IlmBase_${COMPONENT}_LIBRARY_${BUILD_TYPE}})
|
||||
list(APPEND IlmBase_LIB_COMPONENTS_${BUILD_TYPE} ${IlmBase_${COMPONENT}_LIBRARY_${BUILD_TYPE}})
|
||||
endif()
|
||||
|
||||
# Reset library suffix
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ${_ILMBASE_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||
unset(_ILMBASE_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES)
|
||||
unset(_IlmBase_Version_Suffix)
|
||||
unset(_TMP_SUFFIX)
|
||||
endforeach()
|
||||
|
||||
if(IlmBase_${COMPONENT}_LIBRARY_DEBUG AND IlmBase_${COMPONENT}_LIBRARY_RELEASE)
|
||||
# if the generator is multi-config or if CMAKE_BUILD_TYPE is set for
|
||||
# single-config generators, set optimized and debug libraries
|
||||
get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
||||
if(_isMultiConfig OR CMAKE_BUILD_TYPE)
|
||||
set(IlmBase_${COMPONENT}_LIBRARY optimized ${IlmBase_${COMPONENT}_LIBRARY_RELEASE} debug ${IlmBase_${COMPONENT}_LIBRARY_DEBUG})
|
||||
else()
|
||||
# For single-config generators where CMAKE_BUILD_TYPE has no value,
|
||||
# just use the release libraries
|
||||
set(IlmBase_${COMPONENT}_LIBRARY ${IlmBase_${COMPONENT}_LIBRARY_RELEASE})
|
||||
endif()
|
||||
# FIXME: This probably should be set for both cases
|
||||
set(IlmBase_${COMPONENT}_LIBRARIES optimized ${IlmBase_${COMPONENT}_LIBRARY_RELEASE} debug ${IlmBase_${COMPONENT}_LIBRARY_DEBUG})
|
||||
endif()
|
||||
|
||||
# if only the release version was found, set the debug variable also to the release version
|
||||
if(IlmBase_${COMPONENT}_LIBRARY_RELEASE AND NOT IlmBase_${COMPONENT}_LIBRARY_DEBUG)
|
||||
set(IlmBase_${COMPONENT}_LIBRARY_DEBUG ${IlmBase_${COMPONENT}_LIBRARY_RELEASE})
|
||||
set(IlmBase_${COMPONENT}_LIBRARY ${IlmBase_${COMPONENT}_LIBRARY_RELEASE})
|
||||
set(IlmBase_${COMPONENT}_LIBRARIES ${IlmBase_${COMPONENT}_LIBRARY_RELEASE})
|
||||
endif()
|
||||
|
||||
# if only the debug version was found, set the release variable also to the debug version
|
||||
if(IlmBase_${COMPONENT}_LIBRARY_DEBUG AND NOT IlmBase_${COMPONENT}_LIBRARY_RELEASE)
|
||||
set(IlmBase_${COMPONENT}_LIBRARY_RELEASE ${IlmBase_${COMPONENT}_LIBRARY_DEBUG})
|
||||
set(IlmBase_${COMPONENT}_LIBRARY ${IlmBase_${COMPONENT}_LIBRARY_DEBUG})
|
||||
set(IlmBase_${COMPONENT}_LIBRARIES ${IlmBase_${COMPONENT}_LIBRARY_DEBUG})
|
||||
endif()
|
||||
|
||||
# If the debug & release library ends up being the same, omit the keywords
|
||||
if("${IlmBase_${COMPONENT}_LIBRARY_RELEASE}" STREQUAL "${IlmBase_${COMPONENT}_LIBRARY_DEBUG}")
|
||||
set(IlmBase_${COMPONENT}_LIBRARY ${IlmBase_${COMPONENT}_LIBRARY_RELEASE} )
|
||||
set(IlmBase_${COMPONENT}_LIBRARIES ${IlmBase_${COMPONENT}_LIBRARY_RELEASE} )
|
||||
endif()
|
||||
|
||||
if(IlmBase_${COMPONENT}_LIBRARY)
|
||||
set(IlmBase_${COMPONENT}_FOUND TRUE)
|
||||
else()
|
||||
set(IlmBase_${COMPONENT}_FOUND FALSE)
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# ------------------------------------------------------------------------
|
||||
# Cache and set ILMBASE_FOUND
|
||||
# ------------------------------------------------------------------------
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(IlmBase
|
||||
FOUND_VAR IlmBase_FOUND
|
||||
REQUIRED_VARS
|
||||
IlmBase_INCLUDE_DIR
|
||||
IlmBase_LIB_COMPONENTS
|
||||
VERSION_VAR IlmBase_VERSION
|
||||
HANDLE_COMPONENTS
|
||||
)
|
||||
|
||||
if(NOT IlmBase_FOUND)
|
||||
if(IlmBase_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "Unable to find IlmBase")
|
||||
endif()
|
||||
return()
|
||||
endif()
|
||||
|
||||
# Partition release/debug lib vars
|
||||
|
||||
set(IlmBase_RELEASE_LIBRARIES "")
|
||||
set(IlmBase_RELEASE_LIBRARY_DIRS "")
|
||||
set(IlmBase_DEBUG_LIBRARIES "")
|
||||
set(IlmBase_DEBUG_LIBRARY_DIRS "")
|
||||
foreach(LIB ${IlmBase_LIB_COMPONENTS_RELEASE})
|
||||
get_filename_component(_ILM_LIBDIR ${LIB} DIRECTORY)
|
||||
list(APPEND IlmBase_RELEASE_LIBRARIES ${LIB})
|
||||
list(APPEND IlmBase_RELEASE_LIBRARY_DIRS ${_ILM_LIBDIR})
|
||||
endforeach()
|
||||
|
||||
foreach(LIB ${IlmBase_LIB_COMPONENTS_DEBUG})
|
||||
get_filename_component(_ILM_LIBDIR ${LIB} DIRECTORY)
|
||||
list(APPEND IlmBase_DEBUG_LIBRARIES ${LIB})
|
||||
list(APPEND IlmBase_DEBUG_LIBRARY_DIRS ${_ILM_LIBDIR})
|
||||
endforeach()
|
||||
|
||||
list(REMOVE_DUPLICATES IlmBase_RELEASE_LIBRARY_DIRS)
|
||||
list(REMOVE_DUPLICATES IlmBase_DEBUG_LIBRARY_DIRS)
|
||||
|
||||
set(IlmBase_LIBRARIES ${IlmBase_RELEASE_LIBRARIES})
|
||||
set(IlmBase_LIBRARY_DIRS ${IlmBase_RELEASE_LIBRARY_DIRS})
|
||||
|
||||
# We have to add both include and include/OpenEXR to the include
|
||||
# path in case OpenEXR and IlmBase are installed separately.
|
||||
#
|
||||
# Make sure we get the absolute path to avoid issues where
|
||||
# /usr/include/OpenEXR/../ is picked up and passed to gcc from cmake
|
||||
# which won't correctly compute /usr/include as an implicit system
|
||||
# dir if the path is relative:
|
||||
#
|
||||
# https://github.com/AcademySoftwareFoundation/openvdb/issues/632
|
||||
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70129
|
||||
|
||||
set(_IlmBase_Parent_Dir "")
|
||||
get_filename_component(_IlmBase_Parent_Dir
|
||||
${IlmBase_INCLUDE_DIR}/../ ABSOLUTE)
|
||||
|
||||
set(IlmBase_INCLUDE_DIRS)
|
||||
list(APPEND IlmBase_INCLUDE_DIRS
|
||||
${_IlmBase_Parent_Dir}
|
||||
${IlmBase_INCLUDE_DIR}
|
||||
)
|
||||
unset(_IlmBase_Parent_Dir)
|
||||
|
||||
# Configure imported targets
|
||||
|
||||
foreach(COMPONENT ${IlmBase_FIND_COMPONENTS})
|
||||
# Configure lib type. If XXX_USE_STATIC_LIBS, we always assume a static
|
||||
# lib is in use. If win32, we can't mark the import .libs as shared, so
|
||||
# these are always marked as UNKNOWN. Otherwise, infer from extension.
|
||||
set(ILMBASE_${COMPONENT}_LIB_TYPE UNKNOWN)
|
||||
if(ILMBASE_USE_STATIC_LIBS)
|
||||
set(ILMBASE_${COMPONENT}_LIB_TYPE STATIC)
|
||||
elseif(UNIX)
|
||||
get_filename_component(_ILMBASE_${COMPONENT}_EXT ${IlmBase_${COMPONENT}_LIBRARY_RELEASE} EXT)
|
||||
if(${_ILMBASE_${COMPONENT}_EXT} STREQUAL ".a")
|
||||
set(ILMBASE_${COMPONENT}_LIB_TYPE STATIC)
|
||||
elseif(${_ILMBASE_${COMPONENT}_EXT} STREQUAL ".so" OR
|
||||
${_ILMBASE_${COMPONENT}_EXT} STREQUAL ".dylib")
|
||||
set(ILMBASE_${COMPONENT}_LIB_TYPE SHARED)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(IlmBase_${COMPONENT}_DEFINITIONS)
|
||||
|
||||
# Add the OPENEXR_DLL define if the library is not static on WIN32
|
||||
if(WIN32)
|
||||
if(NOT ILMBASE_${COMPONENT}_LIB_TYPE STREQUAL STATIC)
|
||||
list(APPEND IlmBase_${COMPONENT}_DEFINITIONS OPENEXR_DLL)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT TARGET IlmBase::${COMPONENT})
|
||||
add_library(IlmBase::${COMPONENT} ${ILMBASE_${COMPONENT}_LIB_TYPE} IMPORTED)
|
||||
set_target_properties(IlmBase::${COMPONENT} PROPERTIES
|
||||
INTERFACE_COMPILE_OPTIONS "${PC_IlmBase_CFLAGS_OTHER}"
|
||||
INTERFACE_COMPILE_DEFINITIONS "${IlmBase_${COMPONENT}_DEFINITIONS}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${IlmBase_INCLUDE_DIRS}")
|
||||
|
||||
# Standard location
|
||||
set_target_properties(IlmBase::${COMPONENT} PROPERTIES
|
||||
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
|
||||
IMPORTED_LOCATION "${IlmBase_${COMPONENT}_LIBRARY}")
|
||||
|
||||
# Release location
|
||||
if(EXISTS "${IlmBase_${COMPONENT}_LIBRARY_RELEASE}")
|
||||
set_property(TARGET IlmBase::${COMPONENT} APPEND PROPERTY
|
||||
IMPORTED_CONFIGURATIONS RELEASE)
|
||||
set_target_properties(IlmBase::${COMPONENT} PROPERTIES
|
||||
IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX"
|
||||
IMPORTED_LOCATION_RELEASE "${IlmBase_${COMPONENT}_LIBRARY_RELEASE}")
|
||||
endif()
|
||||
|
||||
# Debug location
|
||||
if(EXISTS "${IlmBase_${COMPONENT}_LIBRARY_DEBUG}")
|
||||
set_property(TARGET IlmBase::${COMPONENT} APPEND PROPERTY
|
||||
IMPORTED_CONFIGURATIONS DEBUG)
|
||||
set_target_properties(IlmBase::${COMPONENT} PROPERTIES
|
||||
IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "CXX"
|
||||
IMPORTED_LOCATION_DEBUG "${IlmBase_${COMPONENT}_LIBRARY_DEBUG}")
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
@@ -1,5 +1,5 @@
|
||||
# Copyright Contributors to the OpenVDB Project
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MPL-2.0
|
||||
#
|
||||
#[=======================================================================[.rst:
|
||||
|
||||
@@ -64,7 +64,7 @@ may be provided to tell this module where to look.
|
||||
|
||||
#]=======================================================================]
|
||||
|
||||
cmake_minimum_required(VERSION 3.24)
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
include(GNUInstallDirs)
|
||||
|
||||
|
||||
@@ -114,7 +114,7 @@ list(APPEND _JEMALLOC_LIBRARYDIR_SEARCH_DIRS
|
||||
|
||||
set(_JEMALLOC_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||
|
||||
if(MSVC)
|
||||
if(WIN32)
|
||||
if(JEMALLOC_USE_STATIC_LIBS)
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib")
|
||||
else()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# Copyright Contributors to the OpenVDB Project
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MPL-2.0
|
||||
#
|
||||
#[=======================================================================[.rst:
|
||||
|
||||
@@ -87,7 +87,7 @@ may be provided to tell this module where to look.
|
||||
|
||||
#]=======================================================================]
|
||||
|
||||
cmake_minimum_required(VERSION 3.24)
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
include(GNUInstallDirs)
|
||||
|
||||
|
||||
@@ -185,7 +185,7 @@ list(APPEND _LOG4CPLUS_LIBRARYDIR_SEARCH_DIRS
|
||||
|
||||
set(_LOG4CPLUS_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||
|
||||
if(MSVC)
|
||||
if(WIN32)
|
||||
if(LOG4CPLUS_USE_STATIC_LIBS)
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib")
|
||||
endif()
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
include (FindPackageHandleStandardArgs)
|
||||
|
||||
if(NCCL_ROOT)
|
||||
set(_NCCL_ROOT ${NCCL_ROOT})
|
||||
elseif(DEFINED ENV{NCCL_ROOT})
|
||||
set(_NCCL_ROOT $ENV{NCCL_ROOT})
|
||||
endif()
|
||||
|
||||
set(_NCCL_INCLUDE_SEARCH_DIRS "")
|
||||
list(APPEND _NCCL_INCLUDE_SEARCH_DIRS
|
||||
${_NCCL_ROOT}/include
|
||||
)
|
||||
find_path(NCCL_INCLUDE_DIR
|
||||
NAMES nccl.h
|
||||
PATHS ${_NCCL_INCLUDE_SEARCH_DIRS}
|
||||
)
|
||||
|
||||
set(_NCCL_LIBRARY_SEARCH_DIRS "")
|
||||
list(APPEND _NCCL_LIBRARY_SEARCH_DIRS
|
||||
${_NCCL_ROOT}/bin
|
||||
)
|
||||
find_library(NCCL_LIBRARY
|
||||
NAMES nccl
|
||||
PATHS ${_NCCL_LIBRARY_SEARCH_DIRS}
|
||||
)
|
||||
|
||||
find_package_handle_standard_args(NCCL REQUIRED_VARS NCCL_INCLUDE_DIR NCCL_LIBRARY)
|
||||
|
||||
if (NCCL_FOUND)
|
||||
mark_as_advanced(NCCL_INCLUDE_DIR)
|
||||
mark_as_advanced(NCCL_LIBRARY)
|
||||
endif()
|
||||
|
||||
if (NCCL_FOUND AND NOT TARGET NCCL::NCCL)
|
||||
add_library(NCCL::NCCL SHARED IMPORTED)
|
||||
if(MSVC)
|
||||
string(REPLACE ".lib" ".dll" NCCL_DLL ${NCCL_LIBRARY})
|
||||
set_property(TARGET NCCL::NCCL PROPERTY IMPORTED_LOCATION ${NCCL_DLL})
|
||||
set_property(TARGET NCCL::NCCL PROPERTY IMPORTED_IMPLIB ${NCCL_LIBRARY})
|
||||
else()
|
||||
set_property(TARGET NCCL::NCCL PROPERTY IMPORTED_LOCATION ${NCCL_LIBRARY})
|
||||
endif()
|
||||
target_include_directories(NCCL::NCCL INTERFACE ${NCCL_INCLUDE_DIR})
|
||||
endif()
|
||||
@@ -1,5 +1,5 @@
|
||||
# Copyright Contributors to the OpenVDB Project
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MPL-2.0
|
||||
#
|
||||
#[=======================================================================[.rst:
|
||||
|
||||
@@ -93,7 +93,7 @@ may be provided to tell this module where to look.
|
||||
|
||||
#]=======================================================================]
|
||||
|
||||
cmake_minimum_required(VERSION 3.24)
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
include(GNUInstallDirs)
|
||||
|
||||
|
||||
|
||||
+70
-79
@@ -1,5 +1,5 @@
|
||||
# Copyright Contributors to the OpenVDB Project
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MPL-2.0
|
||||
#
|
||||
#[=======================================================================[.rst:
|
||||
|
||||
@@ -18,7 +18,6 @@ Use this module by invoking find_package with the form::
|
||||
# "pyopenvdb" for the python plugin
|
||||
# "openvdb_ax" for the OpenVDB AX extension
|
||||
# "openvdb_houdini" for the houdini plugin
|
||||
# "nanovdb" for the nanovdb extension
|
||||
)
|
||||
|
||||
IMPORTED Targets
|
||||
@@ -34,8 +33,6 @@ IMPORTED Targets
|
||||
The openvdb houdini library target.
|
||||
``OpenVDB::openvdb_ax``
|
||||
The openvdb_ax library target.
|
||||
``OpenVDB::nanovdb``
|
||||
The nanovdb library target.
|
||||
|
||||
Result Variables
|
||||
^^^^^^^^^^^^^^^^
|
||||
@@ -64,8 +61,6 @@ This will define the following variables:
|
||||
True if the OpenVDB Library has been built with log4cplus support
|
||||
``OpenVDB_USES_IMATH_HALF``
|
||||
True if the OpenVDB Library has been built with Imath half support
|
||||
``OpenVDB_USES_DELAYED_LOADING``
|
||||
True if the OpenVDB Library has been built with delayed-loading
|
||||
``OpenVDB_ABI``
|
||||
Set if this module was able to determine the ABI number the located
|
||||
OpenVDB Library was built against. Unset otherwise.
|
||||
@@ -109,7 +104,7 @@ may be provided to tell this module where to look.
|
||||
|
||||
#]=======================================================================]
|
||||
|
||||
cmake_minimum_required(VERSION 3.24)
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
include(GNUInstallDirs)
|
||||
|
||||
|
||||
@@ -132,7 +127,6 @@ set(_OPENVDB_COMPONENT_LIST
|
||||
pyopenvdb
|
||||
openvdb_ax
|
||||
openvdb_houdini
|
||||
nanovdb
|
||||
)
|
||||
|
||||
if(OpenVDB_FIND_COMPONENTS)
|
||||
@@ -278,16 +272,6 @@ foreach(COMPONENT ${OpenVDB_FIND_COMPONENTS})
|
||||
${CMAKE_INSTALL_INCLUDEDIR}
|
||||
include
|
||||
)
|
||||
elseif(${COMPONENT} STREQUAL "nanovdb")
|
||||
# Look for NanoVDB.h
|
||||
find_path(OpenVDB_${COMPONENT}_INCLUDE_DIR NanoVDB.h
|
||||
${_FIND_OPENVDB_ADDITIONAL_OPTIONS}
|
||||
PATHS ${_VDB_COMPONENT_SEARCH_DIRS}
|
||||
PATH_SUFFIXES
|
||||
${CMAKE_INSTALL_INCLUDEDIR}/nanovdb
|
||||
${CMAKE_INSTALL_INCLUDEDIR}
|
||||
include
|
||||
)
|
||||
endif()
|
||||
unset(_VDB_COMPONENT_SEARCH_DIRS)
|
||||
endforeach()
|
||||
@@ -334,8 +318,10 @@ set(_OPENVDB_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||
|
||||
set(OPENVDB_PYTHON_PATH_SUFFIXES
|
||||
lib64/python
|
||||
lib64/python2.7
|
||||
lib64/python3
|
||||
lib/python
|
||||
lib/python2.7
|
||||
lib/python3
|
||||
)
|
||||
|
||||
@@ -357,7 +343,7 @@ list(REMOVE_DUPLICATES OPENVDB_PYTHON_PATH_SUFFIXES)
|
||||
list(REMOVE_DUPLICATES OPENVDB_LIB_PATH_SUFFIXES)
|
||||
|
||||
# Static library setup
|
||||
if(MSVC)
|
||||
if(WIN32)
|
||||
if(OPENVDB_USE_STATIC_LIBS)
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib")
|
||||
endif()
|
||||
@@ -370,7 +356,6 @@ endif()
|
||||
set(OpenVDB_LIB_COMPONENTS "")
|
||||
|
||||
foreach(COMPONENT ${OpenVDB_FIND_COMPONENTS})
|
||||
message("COMPONENT = " ${COMPONENT})
|
||||
set(LIB_NAME ${COMPONENT})
|
||||
|
||||
# Add in extra component paths
|
||||
@@ -392,9 +377,6 @@ foreach(COMPONENT ${OpenVDB_FIND_COMPONENTS})
|
||||
elseif(${COMPONENT} STREQUAL "openvdb_je")
|
||||
# alias to the result of openvdb which should be handled first
|
||||
set(OpenVDB_${COMPONENT}_LIBRARY ${OpenVDB_openvdb_LIBRARY})
|
||||
elseif(${COMPONENT} STREQUAL "nanovdb")
|
||||
# alias to the result of openvdb which should be handled first
|
||||
set(OpenVDB_${COMPONENT}_LIBRARY ${OpenVDB_openvdb_LIBRARY})
|
||||
else()
|
||||
find_library(OpenVDB_${COMPONENT}_LIBRARY ${LIB_NAME}
|
||||
${_FIND_OPENVDB_ADDITIONAL_OPTIONS}
|
||||
@@ -404,19 +386,10 @@ foreach(COMPONENT ${OpenVDB_FIND_COMPONENTS})
|
||||
endif()
|
||||
|
||||
list(APPEND OpenVDB_LIB_COMPONENTS ${OpenVDB_${COMPONENT}_LIBRARY})
|
||||
if(${COMPONENT} STREQUAL "nanovdb")
|
||||
# nanovdb is headers-only, no lib component
|
||||
if(OpenVDB_${COMPONENT}_INCLUDE_DIR)
|
||||
set(OpenVDB_${COMPONENT}_FOUND TRUE)
|
||||
else()
|
||||
set(OpenVDB_${COMPONENT}_FOUND FALSE)
|
||||
endif()
|
||||
if(OpenVDB_${COMPONENT}_LIBRARY)
|
||||
set(OpenVDB_${COMPONENT}_FOUND TRUE)
|
||||
else()
|
||||
if(OpenVDB_${COMPONENT}_LIBRARY)
|
||||
set(OpenVDB_${COMPONENT}_FOUND TRUE)
|
||||
else()
|
||||
set(OpenVDB_${COMPONENT}_FOUND FALSE)
|
||||
endif()
|
||||
set(OpenVDB_${COMPONENT}_FOUND FALSE)
|
||||
endif()
|
||||
unset(_VDB_COMPONENT_SEARCH_DIRS)
|
||||
endforeach()
|
||||
@@ -432,6 +405,7 @@ unset(_OPENVDB_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES)
|
||||
# ------------------------------------------------------------------------
|
||||
# Cache and set OPENVDB_FOUND
|
||||
# ------------------------------------------------------------------------
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(OpenVDB
|
||||
FOUND_VAR OpenVDB_FOUND
|
||||
@@ -464,7 +438,7 @@ if(NOT _OPENVDB_HAS_NEW_VERSION_HEADER)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT OpenVDB_FIND_QUIETLY)
|
||||
if(NOT OpenVDB_FIND_QUIET)
|
||||
if(NOT OpenVDB_ABI)
|
||||
message(WARNING "Unable to determine OpenVDB ABI version from OpenVDB "
|
||||
"installation. The library major version \"${OpenVDB_MAJOR_VERSION}\" "
|
||||
@@ -490,10 +464,46 @@ endif()
|
||||
|
||||
find_package(TBB REQUIRED COMPONENTS tbb)
|
||||
|
||||
if(NOT OPENVDB_USE_STATIC_LIBS AND NOT Boost_USE_STATIC_LIBS)
|
||||
# @note Both of these must be set for Boost 1.70 (VFX2020) to link against
|
||||
# boost shared libraries (more specifically libraries built with -fPIC).
|
||||
# http://boost.2283326.n4.nabble.com/CMake-config-scripts-broken-in-1-70-td4708957.html
|
||||
# https://github.com/boostorg/boost_install/commit/160c7cb2b2c720e74463865ef0454d4c4cd9ae7c
|
||||
set(BUILD_SHARED_LIBS ON)
|
||||
set(Boost_USE_STATIC_LIBS OFF)
|
||||
endif()
|
||||
|
||||
find_package(Boost REQUIRED COMPONENTS iostreams system)
|
||||
|
||||
# Add deps for pyopenvdb
|
||||
# @todo track for numpy
|
||||
|
||||
if(pyopenvdb IN_LIST OpenVDB_FIND_COMPONENTS)
|
||||
find_package(Python REQUIRED)
|
||||
find_package(PythonLibs REQUIRED)
|
||||
|
||||
# Boost python handling - try and find both python and pythonXx (version suffixed).
|
||||
# Prioritize the version suffixed library, failing if neither exist.
|
||||
|
||||
find_package(Boost ${MINIMUM_BOOST_VERSION}
|
||||
QUIET COMPONENTS python${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR}
|
||||
)
|
||||
|
||||
if(TARGET Boost::python${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR})
|
||||
set(BOOST_PYTHON_LIB "python${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR}")
|
||||
message(STATUS "Found boost_python${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR}")
|
||||
else()
|
||||
find_package(Boost ${MINIMUM_BOOST_VERSION} QUIET COMPONENTS python)
|
||||
if(TARGET Boost::python)
|
||||
set(BOOST_PYTHON_LIB "python")
|
||||
message(STATUS "Found non-suffixed boost_python, assuming to be python version "
|
||||
"\"${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}\" compatible"
|
||||
)
|
||||
else()
|
||||
message(FATAL_ERROR "Unable to find boost_python or "
|
||||
"boost_python${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR}."
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Add deps for openvdb_ax
|
||||
@@ -522,7 +532,6 @@ set(OpenVDB_USES_BLOSC ${USE_BLOSC})
|
||||
set(OpenVDB_USES_ZLIB ${USE_ZLIB})
|
||||
set(OpenVDB_USES_LOG4CPLUS ${USE_LOG4CPLUS})
|
||||
set(OpenVDB_USES_IMATH_HALF ${USE_IMATH_HALF})
|
||||
set(OpenVDB_USES_DELAYED_LOADING ${OPENVDB_USE_DELAYED_LOADING})
|
||||
set(OpenVDB_DEFINITIONS)
|
||||
|
||||
if(WIN32)
|
||||
@@ -538,10 +547,6 @@ if(WIN32)
|
||||
list(APPEND OpenVDB_DEFINITIONS NOMINMAX)
|
||||
endif()
|
||||
|
||||
if(MINGW)
|
||||
list(APPEND OpenVDB_DEFINITIONS _USE_MATH_DEFINES)
|
||||
endif()
|
||||
|
||||
if(OpenVDB_ABI)
|
||||
# Newer version of OpenVDB defines this in version.h, but it is are also
|
||||
# provided here to maintain backwards compatibility with header include
|
||||
@@ -555,7 +560,6 @@ if(_OPENVDB_HAS_NEW_VERSION_HEADER)
|
||||
OPENVDB_GET_VERSION_DEFINE(${_OPENVDB_VERSION_HEADER} "OPENVDB_USE_IMATH_HALF" OpenVDB_USES_IMATH_HALF)
|
||||
OPENVDB_GET_VERSION_DEFINE(${_OPENVDB_VERSION_HEADER} "OPENVDB_USE_BLOSC" OpenVDB_USES_BLOSC)
|
||||
OPENVDB_GET_VERSION_DEFINE(${_OPENVDB_VERSION_HEADER} "OPENVDB_USE_ZLIB" OpenVDB_USES_ZLIB)
|
||||
OPENVDB_GET_VERSION_DEFINE(${_OPENVDB_VERSION_HEADER} "OPENVDB_USE_DELAYED_LOADING" OpenVDB_USES_DELAYED_LOADING)
|
||||
elseif(NOT OPENVDB_USE_STATIC_LIBS)
|
||||
# Use GetPrerequisites to see which libraries this OpenVDB lib has linked to
|
||||
# which we can query for optional deps. This basically runs ldd/otoll/objdump
|
||||
@@ -602,11 +606,6 @@ elseif(NOT OPENVDB_USE_STATIC_LIBS)
|
||||
if(NOT ${_HAS_DEP} EQUAL -1)
|
||||
set(OpenVDB_USES_IMATH_HALF ON)
|
||||
endif()
|
||||
|
||||
string(FIND ${PREREQUISITE} "boost_iostreams" _HAS_DEP)
|
||||
if(NOT ${_HAS_DEP} EQUAL -1)
|
||||
set(OpenVDB_USES_DELAYED_LOADING ON)
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
unset(_OPENVDB_PREREQUISITE_LIST)
|
||||
@@ -625,11 +624,19 @@ if(OpenVDB_USES_LOG4CPLUS)
|
||||
endif()
|
||||
|
||||
if(OpenVDB_USES_IMATH_HALF)
|
||||
find_package(Imath REQUIRED CONFIG)
|
||||
endif()
|
||||
find_package(Imath CONFIG)
|
||||
if (NOT TARGET Imath::Imath)
|
||||
find_package(IlmBase REQUIRED COMPONENTS Half)
|
||||
endif()
|
||||
|
||||
if(OpenVDB_USES_DELAYED_LOADING)
|
||||
find_package(Boost REQUIRED COMPONENTS iostreams)
|
||||
if(WIN32)
|
||||
# @note OPENVDB_OPENEXR_STATICLIB is old functionality and should be removed
|
||||
if(OPENEXR_USE_STATIC_LIBS OR
|
||||
(${ILMBASE_LIB_TYPE} STREQUAL STATIC_LIBRARY) OR
|
||||
(${IMATH_LIB_TYPE} STREQUAL STATIC_LIBRARY))
|
||||
list(APPEND OpenVDB_DEFINITIONS OPENVDB_OPENEXR_STATICLIB)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(UNIX)
|
||||
@@ -637,19 +644,17 @@ if(UNIX)
|
||||
endif()
|
||||
|
||||
# Set deps. Note that the order here is important. If we're building against
|
||||
# Houdini we must include Imath deps first to ensure the users chosen
|
||||
# Houdini 17.5 we must include IlmBase deps first to ensure the users chosen
|
||||
# namespaced headers are correctly prioritized. Otherwise other include paths
|
||||
# from shared installs (including houdini) may pull in the wrong headers
|
||||
|
||||
set(_OPENVDB_VISIBLE_DEPENDENCIES "")
|
||||
|
||||
if(OpenVDB_USES_DELAYED_LOADING)
|
||||
list(APPEND _OPENVDB_VISIBLE_DEPENDENCIES Boost::iostreams)
|
||||
list(APPEND OpenVDB_DEFINITIONS OPENVDB_USE_DELAYED_LOADING)
|
||||
endif()
|
||||
set(_OPENVDB_VISIBLE_DEPENDENCIES
|
||||
Boost::iostreams
|
||||
Boost::system
|
||||
)
|
||||
|
||||
if(OpenVDB_USES_IMATH_HALF)
|
||||
list(APPEND _OPENVDB_VISIBLE_DEPENDENCIES Imath::Imath)
|
||||
list(APPEND _OPENVDB_VISIBLE_DEPENDENCIES $<TARGET_NAME_IF_EXISTS:IlmBase::Half> $<TARGET_NAME_IF_EXISTS:Imath::Imath>)
|
||||
endif()
|
||||
|
||||
if(OpenVDB_USES_LOG4CPLUS)
|
||||
@@ -720,7 +725,7 @@ if(NOT TARGET OpenVDB::openvdb)
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${OpenVDB_INCLUDE_DIR}"
|
||||
IMPORTED_LINK_DEPENDENT_LIBRARIES "${_OPENVDB_HIDDEN_DEPENDENCIES}" # non visible deps
|
||||
INTERFACE_LINK_LIBRARIES "${_OPENVDB_VISIBLE_DEPENDENCIES}" # visible deps (headers)
|
||||
INTERFACE_COMPILE_FEATURES cxx_std_17
|
||||
INTERFACE_COMPILE_FEATURES cxx_std_14
|
||||
)
|
||||
endif()
|
||||
|
||||
@@ -742,8 +747,8 @@ if(OpenVDB_pyopenvdb_LIBRARY)
|
||||
set_target_properties(OpenVDB::pyopenvdb PROPERTIES
|
||||
IMPORTED_LOCATION "${OpenVDB_pyopenvdb_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${OpenVDB_pyopenvdb_INCLUDE_DIR};${PYTHON_INCLUDE_DIR}"
|
||||
INTERFACE_LINK_LIBRARIES "OpenVDB::openvdb;${PYTHON_LIBRARIES}"
|
||||
INTERFACE_COMPILE_FEATURES cxx_std_17
|
||||
INTERFACE_LINK_LIBRARIES "OpenVDB::openvdb;Boost::${BOOST_PYTHON_LIB};${PYTHON_LIBRARIES}"
|
||||
INTERFACE_COMPILE_FEATURES cxx_std_14
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
@@ -757,7 +762,7 @@ if(OpenVDB_openvdb_houdini_LIBRARY)
|
||||
IMPORTED_LOCATION "${OpenVDB_openvdb_houdini_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${OpenVDB_openvdb_houdini_INCLUDE_DIR}"
|
||||
INTERFACE_LINK_LIBRARIES "OpenVDB::openvdb;Houdini"
|
||||
INTERFACE_COMPILE_FEATURES cxx_std_17
|
||||
INTERFACE_COMPILE_FEATURES cxx_std_14
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
@@ -787,24 +792,10 @@ if(OpenVDB_openvdb_ax_LIBRARY)
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${OpenVDB_openvdb_ax_INCLUDE_DIR}"
|
||||
INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${LLVM_INCLUDE_DIRS}"
|
||||
INTERFACE_LINK_LIBRARIES "OpenVDB::openvdb;${LLVM_LIBS}"
|
||||
INTERFACE_COMPILE_FEATURES cxx_std_17
|
||||
INTERFACE_COMPILE_FEATURES cxx_std_14
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# OpenVDB::nanovdb
|
||||
|
||||
if(OpenVDB_nanovdb_LIBRARY)
|
||||
if(NOT TARGET OpenVDB::nanovdb)
|
||||
add_library(OpenVDB::nanovdb INTERFACE IMPORTED)
|
||||
set_target_properties(OpenVDB::nanovdb PROPERTIES
|
||||
IMPORTED_LOCATION "${OpenVDB_nanovdb_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${OpenVDB_nanovdb_INCLUDE_DIR}"
|
||||
INTERFACE_LINK_LIBRARIES "OpenVDB::openvdb;"
|
||||
INTERFACE_COMPILE_FEATURES cxx_std_17
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
unset(_OPENVDB_VISIBLE_DEPENDENCIES)
|
||||
unset(_OPENVDB_HIDDEN_DEPENDENCIES)
|
||||
|
||||
+33
-71
@@ -1,5 +1,5 @@
|
||||
# Copyright Contributors to the OpenVDB Project
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MPL-2.0
|
||||
#
|
||||
#[=======================================================================[.rst:
|
||||
|
||||
@@ -34,7 +34,7 @@ This will define the following variables:
|
||||
|
||||
``Tbb_FOUND``
|
||||
True if the system has the Tbb library.
|
||||
``Tbb_VERSION`` ``TBB_VERSION``
|
||||
``Tbb_VERSION``
|
||||
The version of the Tbb library which was found.
|
||||
``Tbb_INCLUDE_DIRS``
|
||||
Include directories needed to use Tbb.
|
||||
@@ -93,7 +93,7 @@ may be provided to tell this module where to look.
|
||||
|
||||
#]=======================================================================]
|
||||
|
||||
cmake_minimum_required(VERSION 3.24)
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
include(GNUInstallDirs)
|
||||
|
||||
|
||||
@@ -162,72 +162,51 @@ list(APPEND _TBB_INCLUDE_SEARCH_DIRS
|
||||
${SYSTEM_LIBRARY_PATHS}
|
||||
)
|
||||
|
||||
if(NOT Tbb_INCLUDE_DIR)
|
||||
# Look for a legacy tbb header file.
|
||||
find_path(Tbb_LEGACY_INCLUDE_DIR tbb/tbb_stddef.h
|
||||
${_FIND_TBB_ADDITIONAL_OPTIONS}
|
||||
PATHS ${_TBB_INCLUDE_SEARCH_DIRS}
|
||||
PATH_SUFFIXES ${CMAKE_INSTALL_INCLUDEDIR} include
|
||||
)
|
||||
else()
|
||||
set(Tbb_LEGACY_INCLUDE_DIR ${Tbb_INCLUDE_DIR})
|
||||
endif()
|
||||
|
||||
# Look for a new tbb header installation
|
||||
# From TBB 2021, tbb_stddef is removed and the directory include/tbb is
|
||||
# simply an alias for include/oneapi/tbb. Try and find the version header
|
||||
# in oneapi/tbb
|
||||
find_path(Tbb_INCLUDE_DIR oneapi/tbb/version.h
|
||||
# Look for a standard tbb header file.
|
||||
find_path(Tbb_INCLUDE_DIR tbb/tbb_stddef.h
|
||||
${_FIND_TBB_ADDITIONAL_OPTIONS}
|
||||
PATHS ${_TBB_INCLUDE_SEARCH_DIRS}
|
||||
PATH_SUFFIXES ${CMAKE_INSTALL_INCLUDEDIR} include
|
||||
)
|
||||
|
||||
set(_tbb_legacy_version_file "${Tbb_LEGACY_INCLUDE_DIR}/tbb/tbb_stddef.h")
|
||||
set(_tbb_version_file "${Tbb_INCLUDE_DIR}/oneapi/tbb/version.h")
|
||||
set(_tbb_version_file "${Tbb_INCLUDE_DIR}/tbb/tbb_stddef.h")
|
||||
|
||||
if(EXISTS ${_tbb_legacy_version_file})
|
||||
if(EXISTS ${_tbb_version_file})
|
||||
message(WARNING "
|
||||
FindTBB located both an old and new tbb installation.
|
||||
old: ${_tbb_legacy_version_file}
|
||||
new: ${_tbb_version_file}
|
||||
The NEWER versioned installation will be used. You can set TBB_INCLUDEDIR
|
||||
to control FindTBB.cmake search, or explicitly set Tbb_INCLUDE_DIR to the
|
||||
desired location.
|
||||
")
|
||||
else()
|
||||
set(_tbb_version_file "${_tbb_legacy_version_file}")
|
||||
set(Tbb_INCLUDE_DIR ${Tbb_LEGACY_INCLUDE_DIR} CACHE STRING "" FORCE)
|
||||
endif()
|
||||
if(NOT EXISTS ${_tbb_version_file})
|
||||
# From TBB 2021, tbb_stddef is removed and the directory include/tbb is
|
||||
# simply an alias for include/oneapi/tbb. Try and find the version header
|
||||
# in oneapi/tbb
|
||||
find_path(Tbb_INCLUDE_DIR oneapi/tbb/version.h
|
||||
${_FIND_TBB_ADDITIONAL_OPTIONS}
|
||||
PATHS ${_TBB_INCLUDE_SEARCH_DIRS}
|
||||
PATH_SUFFIXES ${CMAKE_INSTALL_INCLUDEDIR} include
|
||||
)
|
||||
set(_tbb_version_file "${Tbb_INCLUDE_DIR}/oneapi/tbb/version.h")
|
||||
endif()
|
||||
|
||||
|
||||
if(EXISTS ${_tbb_version_file})
|
||||
file(STRINGS ${_tbb_version_file} _tbb_version_major_string REGEX "#define TBB_VERSION_MAJOR " )
|
||||
string(REGEX REPLACE "#define TBB_VERSION_MAJOR" "" _tbb_version_major_string "${_tbb_version_major_string}")
|
||||
file(STRINGS ${_tbb_version_file}
|
||||
_tbb_version_major_string REGEX "#define TBB_VERSION_MAJOR "
|
||||
)
|
||||
string(REGEX REPLACE "#define TBB_VERSION_MAJOR" ""
|
||||
_tbb_version_major_string "${_tbb_version_major_string}"
|
||||
)
|
||||
string(STRIP "${_tbb_version_major_string}" Tbb_VERSION_MAJOR)
|
||||
|
||||
file(STRINGS ${_tbb_version_file} _tbb_version_minor_string REGEX "#define TBB_VERSION_MINOR ")
|
||||
string(REGEX REPLACE "#define TBB_VERSION_MINOR" "" _tbb_version_minor_string "${_tbb_version_minor_string}")
|
||||
file(STRINGS ${_tbb_version_file}
|
||||
_tbb_version_minor_string REGEX "#define TBB_VERSION_MINOR "
|
||||
)
|
||||
string(REGEX REPLACE "#define TBB_VERSION_MINOR" ""
|
||||
_tbb_version_minor_string "${_tbb_version_minor_string}"
|
||||
)
|
||||
string(STRIP "${_tbb_version_minor_string}" Tbb_VERSION_MINOR)
|
||||
|
||||
file(STRINGS ${_tbb_version_file} _tbb_binary_version_string REGEX "#define __TBB_BINARY_VERSION ")
|
||||
string(REGEX REPLACE "#define __TBB_BINARY_VERSION" "" _tbb_binary_version_string "${_tbb_binary_version_string}")
|
||||
string(STRIP "${_tbb_binary_version_string}" Tbb_BINARY_VERSION)
|
||||
|
||||
unset(_tbb_version_major_string)
|
||||
unset(_tbb_version_minor_string)
|
||||
unset(_tbb_binary_version_string)
|
||||
|
||||
# Set both for compatibility reasons, TBB's CONFIG files only set the latter
|
||||
set(Tbb_VERSION ${Tbb_VERSION_MAJOR}.${Tbb_VERSION_MINOR})
|
||||
set(TBB_VERSION ${Tbb_VERSION})
|
||||
endif()
|
||||
|
||||
unset(_tbb_version_file)
|
||||
unset(_tbb_legacy_version_file)
|
||||
unset(Tbb_LEGACY_INCLUDE_DIR)
|
||||
|
||||
# ------------------------------------------------------------------------
|
||||
# Search for TBB lib DIR
|
||||
@@ -252,7 +231,7 @@ if(NOT DEFINED TBB_DEBUG_SUFFIX)
|
||||
endif()
|
||||
set(_TBB_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||
|
||||
if(MSVC)
|
||||
if(WIN32)
|
||||
if(TBB_USE_STATIC_LIBS)
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib")
|
||||
endif()
|
||||
@@ -276,22 +255,8 @@ foreach(COMPONENT ${TBB_FIND_COMPONENTS})
|
||||
find_library(Tbb_${COMPONENT}_LIBRARY_${BUILD_TYPE} ${_TBB_LIB_NAME}
|
||||
${_FIND_TBB_ADDITIONAL_OPTIONS}
|
||||
PATHS ${_TBB_LIBRARYDIR_SEARCH_DIRS}
|
||||
PATH_SUFFIXES ${CMAKE_INSTALL_LIBDIR} lib64 lib)
|
||||
|
||||
# If we didn't find the library, prepend Tbb_BINARY_VERSION to each possible
|
||||
# component name and try again. As of TBB 2021, TBB decides to version some
|
||||
# of its libraries on some of its platforms...
|
||||
if(NOT Tbb_${COMPONENT}_LIBRARY_${BUILD_TYPE} AND Tbb_BINARY_VERSION)
|
||||
set(_TBB_LIB_NAME "${COMPONENT}${Tbb_BINARY_VERSION}")
|
||||
if(BUILD_TYPE STREQUAL DEBUG)
|
||||
set(_TBB_LIB_NAME "${_TBB_LIB_NAME}${TBB_DEBUG_SUFFIX}")
|
||||
endif()
|
||||
|
||||
find_library(Tbb_${COMPONENT}_LIBRARY_${BUILD_TYPE} ${_TBB_LIB_NAME}
|
||||
${_FIND_TBB_ADDITIONAL_OPTIONS}
|
||||
PATHS ${_TBB_LIBRARYDIR_SEARCH_DIRS}
|
||||
PATH_SUFFIXES ${CMAKE_INSTALL_LIBDIR} lib64 lib)
|
||||
endif()
|
||||
PATH_SUFFIXES ${CMAKE_INSTALL_LIBDIR} lib64 lib
|
||||
)
|
||||
|
||||
# On Unix, TBB sometimes uses linker scripts instead of symlinks, so parse the linker script
|
||||
# and correct the library name if so
|
||||
@@ -447,8 +412,7 @@ foreach(COMPONENT ${TBB_FIND_COMPONENTS})
|
||||
set_target_properties(TBB::${COMPONENT} PROPERTIES
|
||||
INTERFACE_COMPILE_OPTIONS "${PC_Tbb_CFLAGS_OTHER}"
|
||||
INTERFACE_COMPILE_DEFINITIONS "${Tbb_${COMPONENT}_DEFINITIONS}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${Tbb_INCLUDE_DIR}"
|
||||
INTERFACE_LINK_DIRECTORIES "${Tbb_LIBRARY_DIRS}")
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${Tbb_INCLUDE_DIR}")
|
||||
|
||||
# Standard location
|
||||
set_target_properties(TBB::${COMPONENT} PROPERTIES
|
||||
@@ -461,9 +425,7 @@ foreach(COMPONENT ${TBB_FIND_COMPONENTS})
|
||||
IMPORTED_CONFIGURATIONS RELEASE)
|
||||
set_target_properties(TBB::${COMPONENT} PROPERTIES
|
||||
IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX"
|
||||
IMPORTED_LOCATION_RELEASE "${Tbb_${COMPONENT}_LIBRARY_RELEASE}"
|
||||
MAP_IMPORTED_CONFIG_MINSIZEREL Release
|
||||
MAP_IMPORTED_CONFIG_RELWITHDEBINFO Release)
|
||||
IMPORTED_LOCATION_RELEASE "${Tbb_${COMPONENT}_LIBRARY_RELEASE}")
|
||||
endif()
|
||||
|
||||
# Debug location
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# Copyright Contributors to the OpenVDB Project
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MPL-2.0
|
||||
#
|
||||
#[=======================================================================[.rst:
|
||||
|
||||
@@ -47,7 +47,7 @@ The following variables may be provided to tell this module where to look.
|
||||
# Find the glfw3 installation and use glfw's CMake to initialize
|
||||
# the glfw lib
|
||||
|
||||
cmake_minimum_required(VERSION 3.24)
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
|
||||
set(_FIND_GLFW3_ADDITIONAL_OPTIONS "")
|
||||
if(DISABLE_CMAKE_SEARCH_PATHS)
|
||||
@@ -109,11 +109,16 @@ endif()
|
||||
set(glfw3_FIND_VERSION ${MINIMUM_GLFW_VERSION})
|
||||
find_package(glfw3 ${MINIMUM_GLFW_VERSION} REQUIRED)
|
||||
|
||||
if(OPENVDB_FUTURE_DEPRECATION AND FUTURE_MINIMUM_GLFW_VERSION)
|
||||
if(glfw3_VERSION VERSION_LESS ${FUTURE_MINIMUM_GLFW_VERSION})
|
||||
message(DEPRECATION "Support for GLFW versions < ${FUTURE_MINIMUM_GLFW_VERSION} "
|
||||
"is deprecated and will be removed.")
|
||||
endif()
|
||||
# We only use find_package_handle_standard_args to verify and print
|
||||
# appropriate messages. This now explicitly errors in 3.19...
|
||||
# @todo Improve this entire GLFW3 search
|
||||
# https://gitlab.kitware.com/cmake/cmake/-/issues/21505
|
||||
if(${CMAKE_VERSION} VERSION_LESS 3.19)
|
||||
find_package(PackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(glfw3
|
||||
REQUIRED_VARS glfw3_DIR glfw3_FOUND
|
||||
VERSION_VAR glfw3_VERSION
|
||||
)
|
||||
endif()
|
||||
|
||||
unset(glfw3_FIND_VERSION)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# Copyright Contributors to the OpenVDB Project
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MPL-2.0
|
||||
#
|
||||
#[=======================================================================[.rst:
|
||||
|
||||
@@ -49,6 +49,8 @@ overwrite user provided values.
|
||||
``ZLIB_LIBRARY``
|
||||
``OPENEXR_INCLUDEDIR``
|
||||
``OPENEXR_LIBRARYDIR``
|
||||
``ILMBASE_INCLUDEDIR``
|
||||
``ILMBASE_LIBRARYDIR``
|
||||
``TBB_INCLUDEDIR``
|
||||
``TBB_LIBRARYDIR``
|
||||
``BLOSC_INCLUDEDIR``
|
||||
@@ -73,10 +75,8 @@ may be provided to tell this module where to look.
|
||||
# Find the Houdini installation and use Houdini's CMake to initialize
|
||||
# the Houdini lib
|
||||
|
||||
cmake_minimum_required(VERSION 3.24)
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
|
||||
# Include utility functions for version information
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/OpenVDBUtils.cmake)
|
||||
|
||||
set(_FIND_HOUDINI_ADDITIONAL_OPTIONS "")
|
||||
if(DISABLE_CMAKE_SEARCH_PATHS)
|
||||
@@ -288,11 +288,7 @@ endif()
|
||||
|
||||
# Jemalloc
|
||||
|
||||
# * On Mac OSX, linking against Jemalloc < 4.3.0 seg-faults with this error:
|
||||
# malloc: *** malloc_zone_unregister() failed for 0xaddress
|
||||
# As of Houdini 20, it still ships with Jemalloc 3.6.0, so don't expose it
|
||||
# on Mac OSX (https://github.com/jemalloc/jemalloc/issues/420).
|
||||
if(NOT APPLE AND NOT JEMALLOC_LIBRARYDIR)
|
||||
if(NOT JEMALLOC_LIBRARYDIR)
|
||||
set(JEMALLOC_LIBRARYDIR ${HOUDINI_LIB_DIR})
|
||||
endif()
|
||||
|
||||
@@ -305,10 +301,21 @@ if(NOT OPENEXR_LIBRARYDIR)
|
||||
set(OPENEXR_LIBRARYDIR ${HOUDINI_LIB_DIR})
|
||||
endif()
|
||||
|
||||
# IlmBase
|
||||
|
||||
if(NOT ILMBASE_INCLUDEDIR)
|
||||
set(ILMBASE_INCLUDEDIR ${HOUDINI_INCLUDE_DIR})
|
||||
endif()
|
||||
if(NOT ILMBASE_LIBRARYDIR)
|
||||
set(ILMBASE_LIBRARYDIR ${HOUDINI_LIB_DIR})
|
||||
endif()
|
||||
|
||||
# Boost - currently must be provided as VDB is not fully configured to
|
||||
# use Houdini's namespaced hboost
|
||||
|
||||
# Versions of Houdini >= 17.5 have some namespaced libraries (IlmBase/OpenEXR).
|
||||
# Add the required suffix as part of the cmake lib suffix searches
|
||||
|
||||
if(APPLE)
|
||||
list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES "_sidefx.dylib")
|
||||
elseif(UNIX)
|
||||
@@ -324,82 +331,79 @@ endif()
|
||||
# Explicitly configure the OpenVDB ABI version depending on the Houdini
|
||||
# version.
|
||||
|
||||
find_file(_houdini_openvdb_version_file "openvdb/version.h"
|
||||
PATHS ${HOUDINI_INCLUDE_DIR}
|
||||
NO_DEFAULT_PATH)
|
||||
if(_houdini_openvdb_version_file)
|
||||
OPENVDB_VERSION_FROM_HEADER("${_houdini_openvdb_version_file}"
|
||||
ABI OPENVDB_HOUDINI_ABI)
|
||||
endif()
|
||||
unset(_houdini_openvdb_version_file)
|
||||
if(NOT OPENVDB_HOUDINI_ABI)
|
||||
message(WARNING "Unknown version of Houdini, assuming OpenVDB ABI=${OpenVDB_MAJOR_VERSION}, "
|
||||
if(Houdini_VERSION_MAJOR_MINOR VERSION_EQUAL 18.0)
|
||||
set(OPENVDB_HOUDINI_ABI 6)
|
||||
elseif(Houdini_VERSION_MAJOR_MINOR VERSION_EQUAL 18.5)
|
||||
set(OPENVDB_HOUDINI_ABI 7)
|
||||
else()
|
||||
message(WARNING "Unknown version of Houdini, assuming OpenVDB ABI=8, "
|
||||
"but if this not correct, the CMake flag -DOPENVDB_HOUDINI_ABI=<N> can override this value.")
|
||||
set(OPENVDB_HOUDINI_ABI ${OpenVDB_MAJOR_VERSION})
|
||||
set(OPENVDB_HOUDINI_ABI 8)
|
||||
endif()
|
||||
|
||||
# ------------------------------------------------------------------------
|
||||
# Configure libstc++ CXX11 ABI
|
||||
# Configure GCC CXX11 ABI
|
||||
# ------------------------------------------------------------------------
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
# Assume we're using libstdc++
|
||||
message(STATUS "Configuring CXX11 ABI for Houdini compatibility...")
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
if((CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 5.1) OR
|
||||
(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 5.1))
|
||||
message(STATUS "GCC >= 5.1 detected. Configuring GCC CXX11 ABI for Houdini compatibility...")
|
||||
|
||||
execute_process(COMMAND echo "#include <string>"
|
||||
COMMAND ${CMAKE_CXX_COMPILER} "-x" "c++" "-E" "-dM" "-"
|
||||
COMMAND grep "-F" "_GLIBCXX_USE_CXX11_ABI"
|
||||
TIMEOUT 10
|
||||
RESULT_VARIABLE QUERIED_GCC_CXX11_ABI_SUCCESS
|
||||
OUTPUT_VARIABLE _GCC_CXX11_ABI)
|
||||
execute_process(COMMAND echo "#include <string>"
|
||||
COMMAND ${CMAKE_CXX_COMPILER} "-x" "c++" "-E" "-dM" "-"
|
||||
COMMAND grep "-F" "_GLIBCXX_USE_CXX11_ABI"
|
||||
TIMEOUT 10
|
||||
RESULT_VARIABLE QUERIED_GCC_CXX11_ABI_SUCCESS
|
||||
OUTPUT_VARIABLE _GCC_CXX11_ABI)
|
||||
|
||||
set(GLIBCXX_USE_CXX11_ABI "UNKNOWN")
|
||||
set(GLIBCXX_USE_CXX11_ABI "UNKNOWN")
|
||||
|
||||
if(NOT QUERIED_GCC_CXX11_ABI_SUCCESS)
|
||||
string(FIND ${_GCC_CXX11_ABI} "_GLIBCXX_USE_CXX11_ABI 0" GCC_OLD_CXX11_ABI)
|
||||
string(FIND ${_GCC_CXX11_ABI} "_GLIBCXX_USE_CXX11_ABI 1" GCC_NEW_CXX11_ABI)
|
||||
if(NOT (${GCC_OLD_CXX11_ABI} EQUAL -1))
|
||||
set(GLIBCXX_USE_CXX11_ABI 0)
|
||||
if(NOT QUERIED_GCC_CXX11_ABI_SUCCESS)
|
||||
string(FIND ${_GCC_CXX11_ABI} "_GLIBCXX_USE_CXX11_ABI 0" GCC_OLD_CXX11_ABI)
|
||||
string(FIND ${_GCC_CXX11_ABI} "_GLIBCXX_USE_CXX11_ABI 1" GCC_NEW_CXX11_ABI)
|
||||
if(NOT (${GCC_OLD_CXX11_ABI} EQUAL -1))
|
||||
set(GLIBCXX_USE_CXX11_ABI 0)
|
||||
endif()
|
||||
if(NOT (${GCC_NEW_CXX11_ABI} EQUAL -1))
|
||||
set(GLIBCXX_USE_CXX11_ABI 1)
|
||||
endif()
|
||||
endif()
|
||||
if(NOT (${GCC_NEW_CXX11_ABI} EQUAL -1))
|
||||
set(GLIBCXX_USE_CXX11_ABI 1)
|
||||
|
||||
# Try and query the Houdini CXX11 ABI. Allow it to be provided by users to
|
||||
# override this logic should Houdini's CMake ever change
|
||||
|
||||
if(NOT DEFINED HOUDINI_CXX11_ABI)
|
||||
get_target_property(houdini_interface_compile_options
|
||||
Houdini INTERFACE_COMPILE_OPTIONS)
|
||||
set(HOUDINI_CXX11_ABI "UNKNOWN")
|
||||
if("-D_GLIBCXX_USE_CXX11_ABI=0" IN_LIST houdini_interface_compile_options)
|
||||
set(HOUDINI_CXX11_ABI 0)
|
||||
elseif("-D_GLIBCXX_USE_CXX11_ABI=1" IN_LIST houdini_interface_compile_options)
|
||||
set(HOUDINI_CXX11_ABI 1)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Try and query the Houdini CXX11 ABI. Allow it to be provided by users to
|
||||
# override this logic should Houdini's CMake ever change
|
||||
message(STATUS " GCC CXX11 ABI : ${GLIBCXX_USE_CXX11_ABI}")
|
||||
message(STATUS " Houdini CXX11 ABI : ${HOUDINI_CXX11_ABI}")
|
||||
|
||||
if(NOT DEFINED HOUDINI_CXX11_ABI)
|
||||
get_target_property(houdini_interface_compile_options
|
||||
Houdini INTERFACE_COMPILE_OPTIONS)
|
||||
set(HOUDINI_CXX11_ABI "UNKNOWN")
|
||||
if("-D_GLIBCXX_USE_CXX11_ABI=0" IN_LIST houdini_interface_compile_options)
|
||||
set(HOUDINI_CXX11_ABI 0)
|
||||
elseif("-D_GLIBCXX_USE_CXX11_ABI=1" IN_LIST houdini_interface_compile_options)
|
||||
if(${HOUDINI_CXX11_ABI} STREQUAL "UNKNOWN")
|
||||
message(WARNING "Unable to determine Houdini CXX11 ABI. Assuming newer ABI "
|
||||
"has been used.")
|
||||
set(HOUDINI_CXX11_ABI 1)
|
||||
endif()
|
||||
|
||||
if(${GLIBCXX_USE_CXX11_ABI} EQUAL ${HOUDINI_CXX11_ABI})
|
||||
message(STATUS " Current CXX11 ABI matches Houdini configuration "
|
||||
"(_GLIBCXX_USE_CXX11_ABI=${HOUDINI_CXX11_ABI}).")
|
||||
else()
|
||||
message(WARNING "A potential mismatch was detected between the CXX11 ABI "
|
||||
"of GCC and Houdini. The following ABI configuration will be used: "
|
||||
"-D_GLIBCXX_USE_CXX11_ABI=${HOUDINI_CXX11_ABI}. See: "
|
||||
"https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dual_abi.html and "
|
||||
"https://vfxplatform.com/#footnote-gcc6 for more information.")
|
||||
endif()
|
||||
|
||||
add_definitions(-D_GLIBCXX_USE_CXX11_ABI=${HOUDINI_CXX11_ABI})
|
||||
endif()
|
||||
|
||||
message(STATUS " GNU CXX11 ABI : ${GLIBCXX_USE_CXX11_ABI}")
|
||||
message(STATUS " Houdini CXX11 ABI : ${HOUDINI_CXX11_ABI}")
|
||||
|
||||
if(${HOUDINI_CXX11_ABI} STREQUAL "UNKNOWN")
|
||||
message(WARNING "Unable to determine Houdini CXX11 ABI. Assuming newer ABI "
|
||||
"has been used.")
|
||||
set(HOUDINI_CXX11_ABI 1)
|
||||
endif()
|
||||
|
||||
if(${GLIBCXX_USE_CXX11_ABI} EQUAL ${HOUDINI_CXX11_ABI})
|
||||
message(STATUS " Current CXX11 ABI matches Houdini configuration "
|
||||
"(_GLIBCXX_USE_CXX11_ABI=${HOUDINI_CXX11_ABI}).")
|
||||
else()
|
||||
message(WARNING "A potential mismatch was detected between the CXX11 ABI "
|
||||
"of libstdc++ and Houdini. The following ABI configuration will be used: "
|
||||
"-D_GLIBCXX_USE_CXX11_ABI=${HOUDINI_CXX11_ABI}. See: "
|
||||
"https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dual_abi.html and "
|
||||
"https://vfxplatform.com/#footnote-gcc6 for more information.")
|
||||
endif()
|
||||
|
||||
add_definitions(-D_GLIBCXX_USE_CXX11_ABI=${HOUDINI_CXX11_ABI})
|
||||
endif()
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# Copyright Contributors to the OpenVDB Project
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MPL-2.0
|
||||
#
|
||||
#[=======================================================================[.rst:
|
||||
|
||||
@@ -51,7 +51,7 @@ variables may be provided to tell this module where to look.
|
||||
# Find the Maya installation and use Maya's CMake to initialize
|
||||
# the Maya lib
|
||||
|
||||
cmake_minimum_required(VERSION 3.24)
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
|
||||
|
||||
set(_FIND_MAYA_ADDITIONAL_OPTIONS "")
|
||||
|
||||
+6
-118
@@ -1,5 +1,5 @@
|
||||
# Copyright Contributors to the OpenVDB Project
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MPL-2.0
|
||||
#
|
||||
#[=======================================================================[.rst:
|
||||
|
||||
@@ -57,7 +57,7 @@ The following functions are provided:
|
||||
|
||||
#]=======================================================================]
|
||||
|
||||
cmake_minimum_required(VERSION 3.24)
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
|
||||
|
||||
function(OPENVDB_GET_VERSION_DEFINE HEADER KEY VALUE)
|
||||
@@ -83,8 +83,8 @@ function(OPENVDB_GET_VERSION_DEFINE HEADER KEY VALUE)
|
||||
endfunction()
|
||||
|
||||
|
||||
###############################################################################
|
||||
###############################################################################
|
||||
########################################################################
|
||||
########################################################################
|
||||
|
||||
|
||||
function(OPENVDB_VERSION_FROM_HEADER OPENVDB_VERSION_FILE)
|
||||
@@ -120,8 +120,8 @@ function(OPENVDB_VERSION_FROM_HEADER OPENVDB_VERSION_FILE)
|
||||
endfunction()
|
||||
|
||||
|
||||
###############################################################################
|
||||
###############################################################################
|
||||
########################################################################
|
||||
########################################################################
|
||||
|
||||
|
||||
function(OPENVDB_ABI_VERSION_FROM_PRINT OPENVDB_PRINT)
|
||||
@@ -162,115 +162,3 @@ function(OPENVDB_ABI_VERSION_FROM_PRINT OPENVDB_PRINT)
|
||||
set(${_VDB_ABI} ${_OpenVDB_ABI} PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
###############################################################################
|
||||
## @brief Compute the enumerated ISA value for x86/x86_64 architectures that
|
||||
## VCL will use during compilation of OpenVDB. The value is stored in the
|
||||
## VCL_INSTRSET variable. Possible values are:
|
||||
## 0: Unknown or error
|
||||
## 2: SSE2
|
||||
## 3: SSE3
|
||||
## 4: SSSE3
|
||||
## 5: SSE4.1
|
||||
## 6: SSE4.2
|
||||
## 7: AVX
|
||||
## 8: AVX2
|
||||
## 9: AVX512F
|
||||
## 10: AVX512BW/DQ/VL
|
||||
function(OPENVDB_COMPUTE_X86_INSTRSET_FROM_VCL VCL_INSTRSET)
|
||||
# Append project specific flags
|
||||
set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
|
||||
if(OPENVDB_SIMD STREQUAL "AVX")
|
||||
set(CMAKE_REQUIRED_FLAGS "-mavx;-msse4.2")
|
||||
elseif(OPENVDB_SIMD STREQUAL "SSE42")
|
||||
set(CMAKE_REQUIRED_FLAGS "-msse4.2")
|
||||
endif()
|
||||
|
||||
# Figure out that the INSTRSET macro would expand to.
|
||||
# @note would be much faster with try_run but this way doesn't involve
|
||||
# invoking bad instruction sets on unsupported ISAs on the build machine.
|
||||
include(CheckCXXSourceCompiles)
|
||||
check_cxx_source_compiles([[
|
||||
#include "${CMAKE_SOURCE_DIR}/ext/vcl/openvdb/ext/vcl/instrset.h"
|
||||
int main() { static_assert(INSTRSET == 10); return 0; } ]] COMPUTE_VCL_INSTRSET__AVX512VL_DQ_BW__)
|
||||
if(COMPUTE_VCL_INSTRSET__AVX512VL_DQ_BW__)
|
||||
set(${VCL_INSTRSET} 10 PARENT_SCOPE)
|
||||
set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})
|
||||
return()
|
||||
endif()
|
||||
check_cxx_source_compiles([[
|
||||
#include "${CMAKE_SOURCE_DIR}/ext/vcl/openvdb/ext/vcl/instrset.h"
|
||||
int main() { static_assert(INSTRSET == 9); return 0; } ]] COMPUTE_VCL_INSTRSET__AVX512F__)
|
||||
if(COMPUTE_VCL_INSTRSET__AVX512F__)
|
||||
set(${VCL_INSTRSET} 9 PARENT_SCOPE)
|
||||
set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})
|
||||
return()
|
||||
endif()
|
||||
check_cxx_source_compiles([[
|
||||
#include "${CMAKE_SOURCE_DIR}/ext/vcl/openvdb/ext/vcl/instrset.h"
|
||||
int main() { static_assert(INSTRSET == 8); return 0; } ]] COMPUTE_VCL_INSTRSET__AVX2__)
|
||||
if(COMPUTE_VCL_INSTRSET__AVX2__)
|
||||
set(${VCL_INSTRSET} 8 PARENT_SCOPE)
|
||||
set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})
|
||||
return()
|
||||
endif()
|
||||
check_cxx_source_compiles([[
|
||||
#include "${CMAKE_SOURCE_DIR}/ext/vcl/openvdb/ext/vcl/instrset.h"
|
||||
int main() { static_assert(INSTRSET == 7); return 0; } ]] COMPUTE_VCL_INSTRSET__AVX__)
|
||||
if(COMPUTE_VCL_INSTRSET__AVX__)
|
||||
set(${VCL_INSTRSET} 7 PARENT_SCOPE)
|
||||
set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})
|
||||
return()
|
||||
endif()
|
||||
check_cxx_source_compiles([[
|
||||
#include "${CMAKE_SOURCE_DIR}/ext/vcl/openvdb/ext/vcl/instrset.h"
|
||||
int main() { static_assert(INSTRSET == 6); return 0; } ]] COMPUTE_VCL_INSTRSET__SSE4_2__)
|
||||
if(COMPUTE_VCL_INSTRSET__SSE4_2__)
|
||||
set(${VCL_INSTRSET} 6 PARENT_SCOPE)
|
||||
set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})
|
||||
return()
|
||||
endif()
|
||||
check_cxx_source_compiles([[
|
||||
#include "${CMAKE_SOURCE_DIR}/ext/vcl/openvdb/ext/vcl/instrset.h"
|
||||
int main() { static_assert(INSTRSET == 5); return 0; } ]] COMPUTE_VCL_INSTRSET__SSE4_1__)
|
||||
if(COMPUTE_VCL_INSTRSET__SSE4_1__)
|
||||
set(${VCL_INSTRSET} 5 PARENT_SCOPE)
|
||||
set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})
|
||||
return()
|
||||
endif()
|
||||
check_cxx_source_compiles([[
|
||||
#include "${CMAKE_SOURCE_DIR}/ext/vcl/openvdb/ext/vcl/instrset.h"
|
||||
int main() { static_assert(INSTRSET == 4); return 0; } ]] COMPUTE_VCL_INSTRSET__SSSE3__)
|
||||
if(COMPUTE_VCL_INSTRSET__SSSE3__)
|
||||
set(${VCL_INSTRSET} 4 PARENT_SCOPE)
|
||||
set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})
|
||||
return()
|
||||
endif()
|
||||
check_cxx_source_compiles([[
|
||||
#include "${CMAKE_SOURCE_DIR}/ext/vcl/openvdb/ext/vcl/instrset.h"
|
||||
int main() { static_assert(INSTRSET == 3); return 0; } ]] COMPUTE_VCL_INSTRSET__SSE3__)
|
||||
if(COMPUTE_VCL_INSTRSET__SSE3__)
|
||||
set(${VCL_INSTRSET} 3 PARENT_SCOPE)
|
||||
set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})
|
||||
return()
|
||||
endif()
|
||||
check_cxx_source_compiles([[
|
||||
#include "${CMAKE_SOURCE_DIR}/ext/vcl/openvdb/ext/vcl/instrset.h"
|
||||
int main() { static_assert(INSTRSET == 2); return 0; } ]] COMPUTE_VCL_INSTRSET__SSE2__)
|
||||
if(COMPUTE_VCL_INSTRSET__SSE2__)
|
||||
set(${VCL_INSTRSET} 2 PARENT_SCOPE)
|
||||
set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})
|
||||
return()
|
||||
endif()
|
||||
check_cxx_source_compiles([[
|
||||
#include "${CMAKE_SOURCE_DIR}/ext/vcl/openvdb/ext/vcl/instrset.h"
|
||||
int main() { static_assert(INSTRSET == 1); return 0; } ]] COMPUTE_VCL_INSTRSET__SSE__)
|
||||
if(COMPUTE_VCL_INSTRSET__SSE__)
|
||||
set(${VCL_INSTRSET} 1 PARENT_SCOPE)
|
||||
set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})
|
||||
return()
|
||||
endif()
|
||||
# Unknown or error
|
||||
set(${VCL_INSTRSET} 0 PARENT_SCOPE)
|
||||
set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})
|
||||
endfunction()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# Copyright Contributors to the OpenVDB Project
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MPL-2.0
|
||||
#
|
||||
#[=======================================================================[.rst:
|
||||
|
||||
@@ -16,7 +16,7 @@ existing from a previous run of cmake.
|
||||
|
||||
#]=======================================================================]
|
||||
|
||||
cmake_minimum_required(VERSION 3.24)
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
|
||||
set(MANIFEST "${CMAKE_CURRENT_BINARY_DIR}/install_manifest.txt")
|
||||
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
# Copyright Contributors to the OpenVDB Project
|
||||
# SPDX-License-Identifier: MPL-2.0
|
||||
#
|
||||
#[=======================================================================[.rst:
|
||||
|
||||
FindNumPy
|
||||
-----------
|
||||
|
||||
Find NumPy include dirs and libraries.
|
||||
|
||||
Note that this is limited functionality which has been modified and
|
||||
back-ported from Kitware's CMake (3.14) python support module which
|
||||
finds NumPy exclusively by calling methods through a python interpreter.
|
||||
It's expected that python has already been found through CMake.
|
||||
|
||||
Use this module by invoking find_package with the form::
|
||||
|
||||
find_package(NumPy
|
||||
[version] [EXACT] # Minimum or EXACT version
|
||||
[REQUIRED] # Fail with error if NumPy is not found
|
||||
)
|
||||
|
||||
IMPORTED Targets
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
``Python::NumPy``
|
||||
The NumPy library target.
|
||||
|
||||
Result Variables
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
This will define the following variables:
|
||||
|
||||
``Python_NumPy_FOUND``
|
||||
True if the system has the NumPy library.
|
||||
``Python_NumPy_VERSION``
|
||||
The version of the NumPy library which was found.
|
||||
``Python_NumPy_INCLUDE_DIRS``
|
||||
Include directories needed to use NumPy.
|
||||
|
||||
#]=======================================================================]
|
||||
|
||||
set(_PYTHON_PREFIX Python)
|
||||
|
||||
if(NOT ${_PYTHON_PREFIX}_EXECUTABLE)
|
||||
message(FATAL_ERROR "Unable to locate NumPy without first locating Python "
|
||||
"using find_package(). Alternatively, ensure that the variable "
|
||||
"${_PYTHON_PREFIX}_EXECUTABLE is set to your python executable.")
|
||||
endif()
|
||||
|
||||
execute_process(
|
||||
COMMAND "${${_PYTHON_PREFIX}_EXECUTABLE}" -c
|
||||
"from __future__ import print_function\ntry: import numpy; print(numpy.get_include())\nexcept:pass\n"
|
||||
RESULT_VARIABLE _${_PYTHON_PREFIX}_RESULT
|
||||
OUTPUT_VARIABLE _${_PYTHON_PREFIX}_NumPy_PATH
|
||||
ERROR_QUIET
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
if (NOT _${_PYTHON_PREFIX}_RESULT)
|
||||
find_path(${_PYTHON_PREFIX}_NumPy_INCLUDE_DIR
|
||||
NAMES "numpy/arrayobject.h" "numpy/numpyconfig.h"
|
||||
HINTS "${_${_PYTHON_PREFIX}_NumPy_PATH}"
|
||||
NO_DEFAULT_PATH)
|
||||
endif()
|
||||
if(${_PYTHON_PREFIX}_NumPy_INCLUDE_DIR)
|
||||
set(${_PYTHON_PREFIX}_NumPy_INCLUDE_DIRS "${${_PYTHON_PREFIX}_NumPy_INCLUDE_DIR}")
|
||||
set(${_PYTHON_PREFIX}_NumPy_FOUND TRUE)
|
||||
endif()
|
||||
if(${_PYTHON_PREFIX}_NumPy_FOUND)
|
||||
execute_process(
|
||||
COMMAND "${${_PYTHON_PREFIX}_EXECUTABLE}" -c
|
||||
"from __future__ import print_function\ntry: import numpy; print(numpy.__version__)\nexcept:pass\n"
|
||||
RESULT_VARIABLE _${_PYTHON_PREFIX}_RESULT
|
||||
OUTPUT_VARIABLE _${_PYTHON_PREFIX}_NumPy_VERSION)
|
||||
if (NOT _${_PYTHON_PREFIX}_RESULT)
|
||||
set(${_PYTHON_PREFIX}_NumPy_VERSION "${_${_PYTHON_PREFIX}_NumPy_VERSION}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Note no found var here - ${_PYTHON_PREFIX}_NumPy_FOUND is used to match
|
||||
# later CMake functionality
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(NumPy
|
||||
REQUIRED_VARS
|
||||
${_PYTHON_PREFIX}_NumPy_INCLUDE_DIR
|
||||
VERSION_VAR ${_PYTHON_PREFIX}_NumPy_VERSION
|
||||
)
|
||||
|
||||
if (${_PYTHON_PREFIX}_NumPy_FOUND AND NOT TARGET ${_PYTHON_PREFIX}::NumPy)
|
||||
add_library(${_PYTHON_PREFIX}::NumPy INTERFACE IMPORTED)
|
||||
set_property(TARGET ${_PYTHON_PREFIX}::NumPy
|
||||
PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${${_PYTHON_PREFIX}_NumPy_INCLUDE_DIR}")
|
||||
endif()
|
||||
@@ -0,0 +1,66 @@
|
||||
|
||||
# Build Types
|
||||
set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE}
|
||||
CACHE STRING [=[Choose the type of build. CMake natively supports the following options: None Debug Release
|
||||
RelWithDebInfo MinSizeRel. OpenVDB additionally supports the following sanitizers and tools:
|
||||
coverage tsan asan lsan msan ubsan]=]
|
||||
FORCE)
|
||||
|
||||
# Note that the thread, address and memory sanitizers are incompatible with each other
|
||||
set(EXTRA_BUILD_TYPES coverage tsan asan lsan msan ubsan)
|
||||
|
||||
# Set all build flags to empty (unless they have been provided)
|
||||
|
||||
# DebugNoInfo - An internal build type only used by the OpenVDB CI. no optimizations, no symbols, asserts enabled
|
||||
set(CMAKE_CXX_FLAGS_DebugNoInfo "" CACHE STRING "Flags used by the C++ compiler during DebugNoInfo builds.")
|
||||
|
||||
# Requires add_link_options from 3.13
|
||||
if(${CMAKE_VERSION} VERSION_LESS 3.13)
|
||||
if(${CMAKE_BUILD_TYPE} IN_LIST EXTRA_BUILD_TYPES)
|
||||
message(FATAL_ERROR "Build type ${CMAKE_BUILD_TYPE} requires CMake version 3.13 or higher.")
|
||||
endif()
|
||||
return()
|
||||
endif()
|
||||
cmake_minimum_required(VERSION 3.13)
|
||||
|
||||
foreach(TYPE ${EXTRA_BUILD_TYPES})
|
||||
set(CMAKE_CXX_FLAGS_${U_TYPE} "" CACHE STRING "Flags used by the C++ compiler during ${TYPE} builds.")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS_${U_TYPE} "" CACHE STRING "Flags used by the linker during ${TYPE} builds.")
|
||||
set(CMAKE_EXE_LINKER_FLAGS_${U_TYPE} "" CACHE STRING "Flags used by the linker during ${TYPE} builds.")
|
||||
endforeach()
|
||||
|
||||
# Init generator options - we use generator expressions to allow builds with both
|
||||
# clang and GCC. Sanitizers are currently only configured for clang and GCC.
|
||||
# @todo from CMake 3.15, switch to comma list of CXX_COMPILER_ID.
|
||||
|
||||
# Coverage
|
||||
add_compile_options("$<$<CONFIG:COVERAGE>:--coverage>")
|
||||
add_link_options("$<$<CONFIG:COVERAGE>:--coverage>")
|
||||
|
||||
# ThreadSanitizer
|
||||
add_compile_options("$<$<AND:$<CONFIG:TSAN>,$<OR:$<CXX_COMPILER_ID:GNU>,$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>>:-fsanitize=thread>")
|
||||
add_compile_options("$<$<AND:$<CONFIG:TSAN>,$<OR:$<CXX_COMPILER_ID:GNU>,$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>>:-g;-O1>")
|
||||
add_link_options("$<$<AND:$<CONFIG:TSAN>,$<OR:$<CXX_COMPILER_ID:GNU>,$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>>:-fsanitize=thread>")
|
||||
|
||||
# AddressSanitize
|
||||
add_compile_options("$<$<AND:$<CONFIG:ASAN>,$<OR:$<CXX_COMPILER_ID:GNU>,$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>>:-fsanitize=address>")
|
||||
add_compile_options("$<$<AND:$<CONFIG:ASAN>,$<OR:$<CXX_COMPILER_ID:GNU>,$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>>:-fno-omit-frame-pointer;-g;-O1>")
|
||||
add_compile_options("$<$<AND:$<CONFIG:ASAN>,$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>>:-fsanitize-address-use-after-scope;-fno-optimize-sibling-calls>")
|
||||
# -fsanitize-address-use-after-scope added in GCC 7
|
||||
add_compile_options("$<$<AND:$<CONFIG:ASAN>,$<CXX_COMPILER_ID:GNU>,$<VERSION_GREATER_EQUAL:$<CXX_COMPILER_VERSION>,7.0.0>>:-fsanitize-address-use-after-scope>")
|
||||
add_link_options("$<$<AND:$<CONFIG:ASAN>,$<OR:$<CXX_COMPILER_ID:GNU>,$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>>:-fsanitize=address>")
|
||||
|
||||
# LeakSanitizer
|
||||
add_compile_options("$<$<AND:$<CONFIG:LSAN>,$<OR:$<CXX_COMPILER_ID:GNU>,$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>>:-fsanitize=leak>")
|
||||
add_compile_options("$<$<AND:$<CONFIG:LSAN>,$<OR:$<CXX_COMPILER_ID:GNU>,$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>>:-fno-omit-frame-pointer;-g;-O1>")
|
||||
add_link_options("$<$<AND:$<CONFIG:LSAN>,$<OR:$<CXX_COMPILER_ID:GNU>,$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>>:-fsanitize=leak>")
|
||||
|
||||
# MemorySanitizer
|
||||
add_compile_options("$<$<AND:$<CONFIG:MSAN>,$<OR:$<CXX_COMPILER_ID:GNU>,$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>>:-fsanitize=memory>")
|
||||
add_compile_options("$<$<AND:$<CONFIG:MSAN>,$<OR:$<CXX_COMPILER_ID:GNU>,$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>>:-fno-omit-frame-pointer;-g;-O2>")
|
||||
add_compile_options("$<$<AND:$<CONFIG:MSAN>,$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>>:--fno-optimize-sibling-calls;-fsanitize-memory-track-origins=2>")
|
||||
add_link_options("$<$<AND:$<CONFIG:MSAN>,$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>>:-fsanitize=memory>")
|
||||
|
||||
# UndefinedBehaviour
|
||||
add_compile_options("$<$<AND:$<CONFIG:UBSAN>,$<OR:$<CXX_COMPILER_ID:GNU>,$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>>:-fsanitize=undefined>")
|
||||
add_link_options("$<$<AND:$<CONFIG:UBSAN>,$<OR:$<CXX_COMPILER_ID:GNU>,$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>>:-fsanitize=undefined>")
|
||||
@@ -1,404 +0,0 @@
|
||||
# Copyright Contributors to the OpenVDB Project
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
#[=======================================================================[
|
||||
|
||||
CXX and CMAKE_CXX options and definitions for OpenVDB build types
|
||||
|
||||
#]=======================================================================]
|
||||
|
||||
cmake_minimum_required(VERSION 3.24)
|
||||
|
||||
###############################################################################
|
||||
|
||||
# General CMake and CXX settings
|
||||
|
||||
if(FUTURE_MINIMUM_CMAKE_VERSION)
|
||||
if(${CMAKE_VERSION} VERSION_LESS ${FUTURE_MINIMUM_CMAKE_VERSION})
|
||||
message(DEPRECATION "Support for CMake versions < ${FUTURE_MINIMUM_CMAKE_VERSION} "
|
||||
"is deprecated and will be removed.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_CXX_STANDARD)
|
||||
set(CMAKE_CXX_STANDARD ${MINIMUM_CXX_STANDARD} CACHE STRING
|
||||
"The C++ standard whose features are requested to build OpenVDB components." FORCE)
|
||||
elseif(CMAKE_CXX_STANDARD LESS ${MINIMUM_CXX_STANDARD})
|
||||
message(FATAL_ERROR "Provided C++ Standard is less than the supported minimum."
|
||||
"Required is at least \"${MINIMUM_CXX_STANDARD}\" (found ${CMAKE_CXX_STANDARD})")
|
||||
endif()
|
||||
if(OPENVDB_FUTURE_DEPRECATION AND FUTURE_MINIMUM_CXX_STANDARD)
|
||||
if(CMAKE_CXX_STANDARD LESS ${FUTURE_MINIMUM_CXX_STANDARD})
|
||||
message(DEPRECATION "C++ < 17 is deprecated and will be removed.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Configure MS Runtime
|
||||
|
||||
if(WIN32 AND CMAKE_MSVC_RUNTIME_LIBRARY)
|
||||
message(STATUS "CMAKE_MSVC_RUNTIME_LIBRARY set to target ${CMAKE_MSVC_RUNTIME_LIBRARY}")
|
||||
|
||||
# Configure Boost library varient on Windows
|
||||
if(NOT Boost_USE_STATIC_RUNTIME)
|
||||
set(Boost_USE_STATIC_RUNTIME OFF)
|
||||
if(CMAKE_MSVC_RUNTIME_LIBRARY STREQUAL MultiThreaded OR
|
||||
CMAKE_MSVC_RUNTIME_LIBRARY STREQUAL MultiThreadedDebug)
|
||||
set(Boost_USE_STATIC_RUNTIME ON)
|
||||
endif()
|
||||
endif()
|
||||
if(NOT Boost_USE_DEBUG_RUNTIME)
|
||||
set(Boost_USE_DEBUG_RUNTIME OFF)
|
||||
if(CMAKE_MSVC_RUNTIME_LIBRARY STREQUAL MultiThreadedDebugDLL OR
|
||||
CMAKE_MSVC_RUNTIME_LIBRARY STREQUAL MultiThreadedDebug)
|
||||
set(Boost_USE_DEBUG_RUNTIME ON)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
|
||||
set(CMAKE_DISABLE_SOURCE_CHANGES ON)
|
||||
set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)
|
||||
|
||||
if(OPENVDB_ENABLE_RPATH)
|
||||
# Configure rpath for installation base on the following:
|
||||
# https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/RPATH-handling
|
||||
set(CMAKE_SKIP_BUILD_RPATH FALSE)
|
||||
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
|
||||
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
||||
# @todo make relocatable?
|
||||
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
|
||||
endif()
|
||||
|
||||
# For CMake's find Threads module which brings in pthread - This flag
|
||||
# forces the compiler -pthread flag vs -lpthread
|
||||
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
|
||||
|
||||
###############################################################################
|
||||
|
||||
# Compiler version checks
|
||||
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS MINIMUM_CLANG_VERSION)
|
||||
message(FATAL_ERROR "Insufficient clang++ version. Minimum required is "
|
||||
"\"${MINIMUM_CLANG_VERSION}\". Found version \"${CMAKE_CXX_COMPILER_VERSION}\""
|
||||
)
|
||||
endif()
|
||||
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS MINIMUM_GCC_VERSION)
|
||||
message(FATAL_ERROR "Insufficient g++ version. Minimum required is "
|
||||
"\"${MINIMUM_GCC_VERSION}\". Found version \"${CMAKE_CXX_COMPILER_VERSION}\""
|
||||
)
|
||||
endif()
|
||||
if(OPENVDB_FUTURE_DEPRECATION AND FUTURE_MINIMUM_GCC_VERSION)
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS FUTURE_MINIMUM_GCC_VERSION)
|
||||
message(DEPRECATION "Support for GCC versions < ${FUTURE_MINIMUM_GCC_VERSION} "
|
||||
"is deprecated and will be removed.")
|
||||
endif()
|
||||
endif()
|
||||
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS MINIMUM_ICC_VERSION)
|
||||
message(FATAL_ERROR "Insufficient ICC version. Minimum required is "
|
||||
"\"${MINIMUM_ICC_VERSION}\". Found version \"${CMAKE_CXX_COMPILER_VERSION}\""
|
||||
)
|
||||
endif()
|
||||
if(OPENVDB_FUTURE_DEPRECATION AND FUTURE_MINIMUM_ICC_VERSION)
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS FUTURE_MINIMUM_ICC_VERSION)
|
||||
message(DEPRECATION "Support for ICC versions < ${FUTURE_MINIMUM_ICC_VERSION} "
|
||||
"is deprecated and will be removed.")
|
||||
endif()
|
||||
endif()
|
||||
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS MINIMUM_MSVC_VERSION)
|
||||
message(FATAL_ERROR "Insufficient MSVC version. Minimum required is "
|
||||
"\"${MINIMUM_MSVC_VERSION}\". Found version \"${CMAKE_CXX_COMPILER_VERSION}\""
|
||||
)
|
||||
endif()
|
||||
if(OPENVDB_FUTURE_DEPRECATION AND FUTURE_MINIMUM_MSVC_VERSION)
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS FUTURE_MINIMUM_MSVC_VERSION)
|
||||
message(DEPRECATION "Support for MSVC versions < ${FUTURE_MINIMUM_MSVC_VERSION} "
|
||||
"is deprecated and will be removed.")
|
||||
endif()
|
||||
endif()
|
||||
else()
|
||||
message(WARNING "Unsupported CXX compiler ${CMAKE_CXX_COMPILER_ID}")
|
||||
endif()
|
||||
|
||||
###############################################################################
|
||||
|
||||
# x86 ISA selection
|
||||
|
||||
if(CMAKE_SYSTEM_PROCESSOR MATCHES "(x86)|(X86)|(amd64)|(AMD64)")
|
||||
if(OPENVDB_X86_INSTRSET GREATER_EQUAL 1)
|
||||
add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:-msse>")
|
||||
endif()
|
||||
if(OPENVDB_X86_INSTRSET GREATER_EQUAL 2)
|
||||
add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:-msse2>")
|
||||
endif()
|
||||
if(OPENVDB_X86_INSTRSET GREATER_EQUAL 3)
|
||||
add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:-msse3>")
|
||||
endif()
|
||||
if(OPENVDB_X86_INSTRSET GREATER_EQUAL 4)
|
||||
add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:-mssse3>")
|
||||
endif()
|
||||
if(OPENVDB_X86_INSTRSET GREATER_EQUAL 5)
|
||||
add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:-msse4.1>")
|
||||
endif()
|
||||
if(OPENVDB_X86_INSTRSET GREATER_EQUAL 6)
|
||||
add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:-msse4.2>")
|
||||
endif()
|
||||
if(OPENVDB_X86_INSTRSET GREATER_EQUAL 7)
|
||||
add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:-mavx>")
|
||||
endif()
|
||||
if(OPENVDB_X86_INSTRSET GREATER_EQUAL 8)
|
||||
add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:-mavx2>")
|
||||
endif()
|
||||
if(OPENVDB_X86_INSTRSET GREATER_EQUAL 9)
|
||||
add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:-mavx512f>")
|
||||
endif()
|
||||
if(OPENVDB_X86_INSTRSET GREATER_EQUAL 10)
|
||||
add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:-mavx512bw>")
|
||||
add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:-mavx512dq>")
|
||||
add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:-mavx512vl>")
|
||||
endif()
|
||||
elseif(OPENVDB_X86_INSTRSET GREATER 0)
|
||||
message(WARNING "OPENVDB_X86_INSTRSET has been set but has no effect when building for ${CMAKE_SYSTEM_PROCESSOR}.")
|
||||
endif()
|
||||
|
||||
###############################################################################
|
||||
|
||||
# Increase the number of sections that an object file can contain
|
||||
add_compile_options("$<$<COMPILE_LANG_AND_ID:CXX,MSVC>:/bigobj>")
|
||||
# Enable MSVC options that make it behave like other compilers
|
||||
add_compile_options("$<$<COMPILE_LANG_AND_ID:CXX,MSVC>:/permissive->")
|
||||
add_compile_options("$<$<COMPILE_LANG_AND_ID:CXX,MSVC>:/Zc:throwingNew>")
|
||||
add_compile_options("$<$<COMPILE_LANG_AND_ID:CXX,MSVC>:/Zc:inline>")
|
||||
# Excludes APIs such as Cryptography, DDE, RPC, Shell, and Windows Sockets
|
||||
add_compile_definitions("$<$<CXX_COMPILER_ID:MSVC>:WIN32_LEAN_AND_MEAN>")
|
||||
# Disable non-secure CRT library function warnings
|
||||
# https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/
|
||||
# compiler-warning-level-3-c4996?view=vs-2019#unsafe-crt-library-functions
|
||||
add_compile_definitions("$<$<CXX_COMPILER_ID:MSVC>:_CRT_SECURE_NO_WARNINGS>")
|
||||
# Disable POSIX function name warnings
|
||||
# https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/
|
||||
# compiler-warning-level-3-c4996?view=vs-2019#posix-function-names
|
||||
add_compile_definitions("$<$<CXX_COMPILER_ID:MSVC>:_CRT_NONSTDC_NO_WARNINGS>")
|
||||
|
||||
if(MSVC_MP_THREAD_COUNT AND MSVC_MP_THREAD_COUNT GREATER 1)
|
||||
# If a user has explicitly requested a parallel build, configure this during CMake
|
||||
add_compile_options("$<$<COMPILE_LANG_AND_ID:CXX,MSVC>:/MP${MSVC_MP_THREAD_COUNT}>")
|
||||
|
||||
# If building with multiple threads with MSVC, delay generation of PDB files
|
||||
# until the end of compilation to speed up their generation (invoke mspdbsrv once).
|
||||
# This assumes /Zi is being used to generate PDBs (CMakes default)
|
||||
add_compile_options("$<$<AND:$<CONFIG:Debug>,$<COMPILE_LANG_AND_ID:CXX,MSVC>>:/Zf>")
|
||||
endif()
|
||||
|
||||
if(MSVC_COMPRESS_PDB)
|
||||
# /Zi enables PDBs - CMake seems to default to creating PDBs as the defacto way
|
||||
# of handling debug symbols. As these PDBs can be very large, we attempt to compress
|
||||
# them here with various settings. This disable incremental linking and can make
|
||||
# stack traces more confusing.
|
||||
# https://devblogs.microsoft.com/cppblog/shrink-my-program-database-pdb-file/
|
||||
|
||||
# First, generate comdats to allow the linker to remove unused data
|
||||
add_compile_options("$<$<AND:$<CONFIG:Debug>,$<COMPILE_LANG_AND_ID:CXX,MSVC>>:/Gy>")
|
||||
# Remove unreferenced packaged functions and data from comdats
|
||||
add_link_options("$<$<AND:$<CONFIG:Debug>,$<COMPILE_LANG_AND_ID:CXX,MSVC>>:/OPT:REF>")
|
||||
# Fold duplicate comdat data (1 iteration)
|
||||
add_link_options("$<$<AND:$<CONFIG:Debug>,$<COMPILE_LANG_AND_ID:CXX,MSVC>>:/OPT:ICF>")
|
||||
# Generally compress the generated pdbs as they are being created
|
||||
add_link_options("$<$<AND:$<CONFIG:Debug>,$<COMPILE_LANG_AND_ID:CXX,MSVC>>:/PDBCOMPRESS>")
|
||||
endif()
|
||||
|
||||
if(OPENVDB_CXX_STRICT)
|
||||
message(STATUS "Configuring CXX warnings")
|
||||
# Clang/AppleClang
|
||||
add_compile_options("$<$<COMPILE_LANG_AND_ID:CXX,Clang,AppleClang>:-Werror>")
|
||||
add_compile_options("$<$<COMPILE_LANG_AND_ID:CXX,Clang,AppleClang>:-Wall>")
|
||||
add_compile_options("$<$<COMPILE_LANG_AND_ID:CXX,Clang,AppleClang>:-Wextra>")
|
||||
add_compile_options("$<$<COMPILE_LANG_AND_ID:CXX,Clang,AppleClang>:-Wconversion>")
|
||||
add_compile_options("$<$<COMPILE_LANG_AND_ID:CXX,Clang,AppleClang>:-Wnon-virtual-dtor>")
|
||||
add_compile_options("$<$<COMPILE_LANG_AND_ID:CXX,Clang,AppleClang>:-Wover-aligned>")
|
||||
add_compile_options("$<$<COMPILE_LANG_AND_ID:CXX,Clang,AppleClang>:-Wimplicit-fallthrough>")
|
||||
add_compile_options("$<$<AND:$<CXX_COMPILER_ID:GNU>,$<VERSION_GREATER_EQUAL:$<CXX_COMPILER_VERSION>,9.3.0>>:-Wimplicit-fallthrough>")
|
||||
# Only check global constructors for libraries (we should really check for
|
||||
# executables too but gtest relies on these types of constructors for its
|
||||
# framework). nanobind also incorporates these constructors so skip it as well.
|
||||
add_compile_options("$<$<AND:$<NOT:$<OR:$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>,$<STREQUAL:$<TARGET_PROPERTY:NAME>,nanobind-static>>>,$<COMPILE_LANG_AND_ID:CXX,Clang,AppleClang>>:-Wglobal-constructors>")
|
||||
add_compile_options("$<$<COMPILE_LANG_AND_ID:CXX,Clang,AppleClang>:-Wno-sign-conversion>")
|
||||
# GNU
|
||||
add_compile_options("$<$<COMPILE_LANG_AND_ID:CXX,GNU>:-Werror>")
|
||||
add_compile_options("$<$<COMPILE_LANG_AND_ID:CXX,GNU>:-Wall>")
|
||||
add_compile_options("$<$<COMPILE_LANG_AND_ID:CXX,GNU>:-Wextra>")
|
||||
add_compile_options("$<$<COMPILE_LANG_AND_ID:CXX,GNU>:-Wcast-align>")
|
||||
add_compile_options("$<$<COMPILE_LANG_AND_ID:CXX,GNU>:-Wdisabled-optimization>")
|
||||
add_compile_options("$<$<COMPILE_LANG_AND_ID:CXX,GNU>:-Woverloaded-virtual>")
|
||||
add_compile_options("$<$<COMPILE_LANG_AND_ID:CXX,GNU>:-Wnon-virtual-dtor>")
|
||||
# Disable select warnings for the nanobind static library
|
||||
add_compile_options("$<$<AND:$<NOT:$<OR:$<STREQUAL:$<TARGET_PROPERTY:NAME>,nanobind-static>,$<STREQUAL:$<TARGET_PROPERTY:NAME>,openvdb_python>,$<STREQUAL:$<TARGET_PROPERTY:NAME>,nanovdb_python>>>,$<COMPILE_LANG_AND_ID:CXX,GNU>>:-pedantic>")
|
||||
add_compile_options("$<$<AND:$<NOT:$<OR:$<STREQUAL:$<TARGET_PROPERTY:NAME>,nanobind-static>,$<STREQUAL:$<TARGET_PROPERTY:NAME>,openvdb_python>,$<STREQUAL:$<TARGET_PROPERTY:NAME>,nanovdb_python>>>,$<COMPILE_LANG_AND_ID:CXX,GNU>>:-Wcast-qual>")
|
||||
add_compile_options("$<$<AND:$<NOT:$<OR:$<STREQUAL:$<TARGET_PROPERTY:NAME>,nanobind-static>,$<STREQUAL:$<TARGET_PROPERTY:NAME>,openvdb_python>,$<STREQUAL:$<TARGET_PROPERTY:NAME>,nanovdb_python>>>,$<COMPILE_LANG_AND_ID:CXX,GNU>>:-Wconversion>")
|
||||
add_compile_options("$<$<AND:$<OR:$<STREQUAL:$<TARGET_PROPERTY:NAME>,nanobind-static>,$<STREQUAL:$<TARGET_PROPERTY:NAME>,openvdb_python>,$<STREQUAL:$<TARGET_PROPERTY:NAME>,nanovdb_python>>,$<COMPILE_LANG_AND_ID:CXX,GNU>>:-Wno-unused-variable>")
|
||||
add_compile_options("$<$<AND:$<OR:$<STREQUAL:$<TARGET_PROPERTY:NAME>,nanobind-static>,$<STREQUAL:$<TARGET_PROPERTY:NAME>,openvdb_python>,$<STREQUAL:$<TARGET_PROPERTY:NAME>,nanovdb_python>>,$<COMPILE_LANG_AND_ID:CXX,GNU>>:-Wno-unused-but-set-parameter>")
|
||||
else()
|
||||
# NO OPENVDB_CXX_STRICT, suppress some warnings
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||
message(STATUS "Suppressing some noisy MSVC CXX warnings, "
|
||||
"set OPENVDB_CXX_STRICT=ON to re-enable them.")
|
||||
endif()
|
||||
# Conversion from int64_t to long
|
||||
add_compile_options("$<$<COMPILE_LANG_AND_ID:CXX,MSVC>:/wd4244>")
|
||||
# It's not possible to use STL types in DLL interfaces in a portable and
|
||||
# reliable way so disable this warning
|
||||
add_compile_options("$<$<COMPILE_LANG_AND_ID:CXX,MSVC>:/wd4251>")
|
||||
# Conversion from size_t to uLong
|
||||
add_compile_options("$<$<COMPILE_LANG_AND_ID:CXX,MSVC>:/wd4267>")
|
||||
# Non dll-interface class used as base for dll-interface class
|
||||
add_compile_options("$<$<COMPILE_LANG_AND_ID:CXX,MSVC>:/wd4275>")
|
||||
# Truncation from 'int' to 'bool'
|
||||
add_compile_options("$<$<COMPILE_LANG_AND_ID:CXX,MSVC>:/wd4305>")
|
||||
endif()
|
||||
|
||||
if(USE_COLORED_OUTPUT)
|
||||
message(STATUS "Enabling colored compiler output")
|
||||
add_compile_options("$<$<COMPILE_LANG_AND_ID:CXX,Clang,AppleClang>:-fcolor-diagnostics>")
|
||||
add_compile_options("$<$<COMPILE_LANG_AND_ID:CXX,GNU>:-fdiagnostics-color=always>")
|
||||
endif()
|
||||
|
||||
###############################################################################
|
||||
|
||||
# Build Types
|
||||
|
||||
if(NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE Release)
|
||||
endif()
|
||||
|
||||
set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE}
|
||||
CACHE STRING [=[Choose the type of build. CMake natively supports the following options: None Debug Release
|
||||
RelWithDebInfo MinSizeRel. OpenVDB additionally supports the following sanitizers and tools:
|
||||
coverage tsan asan lsan msan ubsan]=]
|
||||
FORCE)
|
||||
|
||||
if(CMAKE_BUILD_TYPE EQUAL coverage)
|
||||
# use .gcno extension instead of .cc.gcno
|
||||
# @note This is an undocumented internal cmake var and does not work
|
||||
# with multi config generators
|
||||
set(CMAKE_CXX_OUTPUT_EXTENSION_REPLACE 1)
|
||||
endif()
|
||||
|
||||
# Note that the thread, address and memory sanitizers are incompatible with each other
|
||||
set(EXTRA_BUILD_TYPES coverage tsan asan lsan msan ubsan abicheck)
|
||||
|
||||
# Set all build flags to empty (unless they have been provided)
|
||||
|
||||
# DebugNoInfo - An internal build type only used by the OpenVDB CI. no optimizations, no symbols, asserts enabled
|
||||
set(CMAKE_CXX_FLAGS_DebugNoInfo "" CACHE STRING "Flags used by the C++ compiler during DebugNoInfo builds.")
|
||||
|
||||
foreach(TYPE ${EXTRA_BUILD_TYPES})
|
||||
set(CMAKE_CXX_FLAGS_${U_TYPE} "" CACHE STRING "Flags used by the C++ compiler during ${TYPE} builds.")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS_${U_TYPE} "" CACHE STRING "Flags used by the linker during ${TYPE} builds.")
|
||||
set(CMAKE_EXE_LINKER_FLAGS_${U_TYPE} "" CACHE STRING "Flags used by the linker during ${TYPE} builds.")
|
||||
endforeach()
|
||||
|
||||
# Init generator options - we use generator expressions to allow builds with both
|
||||
# clang and GCC. Sanitizers are currently only configured for clang and GCC.
|
||||
|
||||
# Coverage
|
||||
# --coverage uses -fprofile-arcs -ftest-coverage (compiling) and -lgcov (linking)
|
||||
# @note consider -fprofile-abs-path from gcc 10
|
||||
# @todo consider using clang with source analysis: -fprofile-instr-generate -fcoverage-mapping.
|
||||
# https://clang.llvm.org/docs/SourceBasedCodeCoverage.html
|
||||
# note that clang also works with gcov (--coverage)
|
||||
# @note Ideally we'd use no optimisations (-O0) with --coverage, but a complete
|
||||
# run of all unit tests takes upwards of a day without them. Thread usage also
|
||||
# impacts total runtime. -Og implies -O1 but without optimisations "that would
|
||||
# otherwise interfere with debugging". This still massively effects branch
|
||||
# coverage tracking compared to -O0 so we should look to improve the speed of
|
||||
# some of the unit tests and also experiment with clang.
|
||||
add_compile_options("$<$<AND:$<CONFIG:COVERAGE>,$<COMPILE_LANG_AND_ID:CXX,GNU,Clang,AppleClang>>:--coverage;-Og>")
|
||||
add_link_options("$<$<AND:$<CONFIG:COVERAGE>,$<COMPILE_LANG_AND_ID:CXX,GNU,Clang,AppleClang>>:--coverage>")
|
||||
|
||||
# ThreadSanitizer
|
||||
add_compile_options("$<$<AND:$<CONFIG:TSAN>,$<COMPILE_LANG_AND_ID:CXX,GNU,Clang,AppleClang>>:-fsanitize=thread>")
|
||||
add_compile_options("$<$<AND:$<CONFIG:TSAN>,$<COMPILE_LANG_AND_ID:CXX,GNU,Clang,AppleClang>>:-g;-O1>")
|
||||
add_link_options("$<$<AND:$<CONFIG:TSAN>,$<COMPILE_LANG_AND_ID:CXX,GNU,Clang,AppleClang>>:-fsanitize=thread>")
|
||||
|
||||
# AddressSanitize
|
||||
add_compile_options("$<$<AND:$<CONFIG:ASAN>,$<COMPILE_LANG_AND_ID:CXX,GNU,Clang,AppleClang>>:-fsanitize=address>")
|
||||
add_compile_options("$<$<AND:$<CONFIG:ASAN>,$<COMPILE_LANG_AND_ID:CXX,GNU,Clang,AppleClang>>:-fno-omit-frame-pointer;-g;-O1>")
|
||||
add_compile_options("$<$<AND:$<CONFIG:ASAN>,$<COMPILE_LANG_AND_ID:CXX,Clang,AppleClang>>:-fsanitize-address-use-after-scope;-fno-optimize-sibling-calls>")
|
||||
# -fsanitize-address-use-after-scope added in GCC 7
|
||||
add_compile_options("$<$<AND:$<CONFIG:ASAN>,$<COMPILE_LANG_AND_ID:CXX,GNU>,$<VERSION_GREATER_EQUAL:$<CXX_COMPILER_VERSION>,7.0.0>>:-fsanitize-address-use-after-scope>")
|
||||
add_link_options("$<$<AND:$<CONFIG:ASAN>,$<COMPILE_LANG_AND_ID:CXX,GNU,Clang,AppleClang>>:-fsanitize=address>")
|
||||
|
||||
# LeakSanitizer
|
||||
add_compile_options("$<$<AND:$<CONFIG:LSAN>,$<COMPILE_LANG_AND_ID:CXX,GNU,Clang,AppleClang>>:-fsanitize=leak>")
|
||||
add_compile_options("$<$<AND:$<CONFIG:LSAN>,$<COMPILE_LANG_AND_ID:CXX,GNU,Clang,AppleClang>>:-fno-omit-frame-pointer;-g;-O1>")
|
||||
add_link_options("$<$<AND:$<CONFIG:LSAN>,$<COMPILE_LANG_AND_ID:CXX,GNU,Clang,AppleClang>>:-fsanitize=leak>")
|
||||
|
||||
# MemorySanitizer
|
||||
add_compile_options("$<$<AND:$<CONFIG:MSAN>,$<COMPILE_LANG_AND_ID:CXX,GNU,Clang,AppleClang>>:-fsanitize=memory>")
|
||||
add_compile_options("$<$<AND:$<CONFIG:MSAN>,$<COMPILE_LANG_AND_ID:CXX,GNU,Clang,AppleClang>>:-fno-omit-frame-pointer;-g;-O2>")
|
||||
add_compile_options("$<$<AND:$<CONFIG:MSAN>,$<COMPILE_LANG_AND_ID:CXX,Clang,AppleClang>>:--fno-optimize-sibling-calls;-fsanitize-memory-track-origins=2>")
|
||||
add_link_options("$<$<AND:$<CONFIG:MSAN>,$<COMPILE_LANG_AND_ID:CXX,Clang,AppleClang>>:-fsanitize=memory>")
|
||||
|
||||
# UndefinedBehaviour
|
||||
add_compile_options("$<$<AND:$<CONFIG:UBSAN>,$<COMPILE_LANG_AND_ID:CXX,GNU,Clang,AppleClang>>:-fsanitize=undefined>")
|
||||
add_link_options("$<$<AND:$<CONFIG:UBSAN>,$<COMPILE_LANG_AND_ID:CXX,GNU,Clang,AppleClang>>:-fsanitize=undefined>")
|
||||
|
||||
# ABI Check. This build type is expected to work with the abi-dumper/abi-compliance-checker
|
||||
# binaries which expect specific debug information. In particular, for GCC versions >= 11
|
||||
# we have to explicitly select dwarf versions < 5 as the abi-dumper doesn't support dwarf5
|
||||
# and will always incorrectly report successful ABI checks
|
||||
# https://github.com/lvc/abi-dumper/issues/33
|
||||
add_compile_options("$<$<CONFIG:ABICHECK>:-gdwarf-4;-g3;-ggdb;-Og>")
|
||||
|
||||
# CMAKE_BUILD_TYPE is ignored for multi config generators i.e. MSVS
|
||||
|
||||
get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
||||
if(NOT _isMultiConfig)
|
||||
message(STATUS "CMake Build Type: ${CMAKE_BUILD_TYPE}")
|
||||
endif()
|
||||
if(OPENVDB_ENABLE_ASSERTS)
|
||||
message(STATUS "OpenVDB asserts are ENABLED")
|
||||
endif()
|
||||
|
||||
# Intialize extra build type targets where possible
|
||||
|
||||
if(NOT TARGET gcov_html)
|
||||
find_program(GCOVR_PATH gcovr)
|
||||
if(NOT GCOVR_PATH AND CMAKE_BUILD_TYPE STREQUAL "coverage")
|
||||
message(WARNING "Unable to initialize gcovr target. coverage build types will still generate gcno files.")
|
||||
elseif(GCOVR_PATH)
|
||||
# init gcov commands
|
||||
set(GCOVR_HTML_FOLDER_CMD ${CMAKE_COMMAND} -E make_directory ${PROJECT_BINARY_DIR}/gcov_html)
|
||||
set(GCOVR_HTML_CMD
|
||||
${GCOVR_PATH} --html --html-details -r ${PROJECT_SOURCE_DIR} --object-directory=${PROJECT_BINARY_DIR}
|
||||
-o gcov_html/index.html
|
||||
)
|
||||
|
||||
# Add a custom target which converts .gcda files to a html report using gcovr.
|
||||
# Note that this target does NOT run ctest or any binaries - that is left to
|
||||
# the implementor of the gcov workflow. Typically, the order of operations
|
||||
# would be:
|
||||
# - run CMake with unit tests on
|
||||
# - ctest
|
||||
# - make gcov_html
|
||||
add_custom_target(gcov_html
|
||||
COMMAND ${GCOVR_HTML_FOLDER_CMD}
|
||||
COMMAND ${GCOVR_HTML_CMD}
|
||||
BYPRODUCTS ${PROJECT_BINARY_DIR}/gcov_html/index.html # report directory
|
||||
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
|
||||
VERBATIM
|
||||
COMMENT "Running gcovr to produce HTML code coverage report."
|
||||
)
|
||||
|
||||
# Show info where to find the report
|
||||
add_custom_command(TARGET gcov_html POST_BUILD
|
||||
COMMAND ;
|
||||
COMMENT "Open ./gcov_html/index.html in your browser to view the coverage report."
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
@@ -1,85 +0,0 @@
|
||||
# Copyright Contributors to the OpenVDB Project
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
#[=======================================================================[
|
||||
|
||||
Current and future version requirements for all OpenVDB dependencies,
|
||||
including compilers, language features and OpenVDB's ABI.
|
||||
|
||||
#]=======================================================================]
|
||||
|
||||
cmake_minimum_required(VERSION 3.24)
|
||||
|
||||
###############################################################################
|
||||
|
||||
# Configure minimum version requirements - some are treated specially and fall
|
||||
# outside of the DISABLE_DEPENDENCY_VERSION_CHECKS catch
|
||||
set(MINIMUM_CXX_STANDARD 17)
|
||||
|
||||
# @note ABI always enforced so the correct deprecation messages are available.
|
||||
# OPENVDB_USE_DEPRECATED_ABI_<VERSION> should be used to circumvent this
|
||||
math(EXPR MINIMUM_OPENVDB_ABI_VERSION "${OpenVDB_MAJOR_VERSION}-2")
|
||||
math(EXPR FUTURE_OPENVDB_ABI_VERSION "${OpenVDB_MAJOR_VERSION}+1")
|
||||
|
||||
# List of deprecated but supported OpenVDB ABIs for this version of OpenVDB
|
||||
math(EXPR _PREV_ABI "${OpenVDB_MAJOR_VERSION}-1")
|
||||
set(OPENVDB_DEPRECATED_ABI_LIST ${MINIMUM_OPENVDB_ABI_VERSION} ${_PREV_ABI})
|
||||
unset(_PREV_ABI)
|
||||
|
||||
if(NOT DISABLE_DEPENDENCY_VERSION_CHECKS)
|
||||
# @note Currently tracking CY2024 of the VFX platform where available
|
||||
# (that is, our minimum requirements are for the current VFX platform)
|
||||
# minus 2 years to be able to build with legacy ABI)
|
||||
|
||||
# @Note Compiler versions are not really a hard and fast rule, you just need
|
||||
# a compiler with complete support for our MINIMUM_CXX_STANDARD (currently 17).
|
||||
# What's usually important is that the version of libstdc++ and glibc in use
|
||||
# matches. Compilers other than GCC should provide options to ensure this
|
||||
# targetting e.g. --gcc-toolchain and -fgnuc-version with Clang.
|
||||
set(MINIMUM_GCC_VERSION 11.2.1)
|
||||
set(MINIMUM_CLANG_VERSION 5.0)
|
||||
set(MINIMUM_ICC_VERSION 19)
|
||||
set(MINIMUM_MSVC_VERSION 19.30) # 1928 (Visual Studio 2019 Version 16.8 + 16.9)
|
||||
|
||||
set(MINIMUM_BOOST_VERSION 1.82)
|
||||
set(MINIMUM_OPENEXR_VERSION 3.2)
|
||||
set(MINIMUM_IMATH_VERSION 3.2)
|
||||
set(MINIMUM_ZLIB_VERSION 1.2.7)
|
||||
set(MINIMUM_TBB_VERSION 2020.3)
|
||||
set(MINIMUM_LLVM_VERSION 15.0.0)
|
||||
set(MINIMUM_BLOSC_VERSION 1.17.0)
|
||||
set(MINIMUM_GLFW_VERSION 3.3)
|
||||
|
||||
set(MINIMUM_PYTHON_VERSION 3.11)
|
||||
|
||||
set(MINIMUM_GOOGLETEST_VERSION 1.10)
|
||||
set(MINIMUM_LOG4CPLUS_VERSION 2.0)
|
||||
set(MINIMUM_HOUDINI_VERSION 20.5)
|
||||
|
||||
# These always promote warnings rather than errors
|
||||
set(MINIMUM_MAYA_VERSION 2017)
|
||||
set(MINIMUM_DOXYGEN_VERSION 1.8.8)
|
||||
endif()
|
||||
|
||||
# VFX 24 deprecations to transition to MINIMUM_* variables in OpenVDB 14.0.0
|
||||
# @note At the time of writing, any variables that are commented out don't
|
||||
# have target transitional versions.
|
||||
|
||||
# set(FUTURE_MINIMUM_GCC_VERSION 11.2.1)
|
||||
# set(FUTURE_MINIMUM_MSVC_VERSION 19.30)
|
||||
# set(FUTURE_MINIMUM_ICC_VERSION 19)
|
||||
|
||||
# set(FUTURE_MINIMUM_CXX_STANDARD 20)
|
||||
set(FUTURE_MINIMUM_CMAKE_VERSION 4.0)
|
||||
set(FUTURE_MINIMUM_OPENEXR_VERSION 3.3)
|
||||
set(FUTURE_MINIMUM_IMATH_VERSION 3.3)
|
||||
set(FUTURE_MINIMUM_TBB_VERSION 2021)
|
||||
set(FUTURE_MINIMUM_BOOST_VERSION 1.85)
|
||||
#set(FUTURE_MINIMUM_GLFW_VERSION 3.3)
|
||||
#set(FUTURE_MINIMUM_LOG4CPLUS_VERSION 2.0)
|
||||
set(FUTURE_MINIMUM_NANOBIND_VERSION 2.5.0)
|
||||
|
||||
# set(FUTURE_MINIMUM_BLOSC_VERSION 1.17.0)
|
||||
# set(FUTURE_MINIMUM_PYTHON_VERSION 3.11)
|
||||
# set(FUTURE_MINIMUM_HOUDINI_VERSION 20.0)
|
||||
set(FUTURE_MINIMUM_LLVM_VERSION 18.0.0)
|
||||
@@ -1,15 +0,0 @@
|
||||
#################################################################################
|
||||
## This file is loaded by the Leak/Address Sanitizer build for the unit tests. ##
|
||||
## It can be used to ignore various errors reported by the sanitizer. This is ##
|
||||
## especially useful with upstream issues (e.g. boost/tbb). For help defining ##
|
||||
## suppression rules, see: ##
|
||||
## https://clang.llvm.org/docs/AddressSanitizer.html ##
|
||||
## The build is configured with CMAKE_BUILD_TYPE=asan or lsan ##
|
||||
#################################################################################
|
||||
|
||||
##### Upstream #####
|
||||
|
||||
# Leaks from TBB init which occur due to tbb teardown issues
|
||||
# https://github.com/oneapi-src/oneTBB/issues/206
|
||||
# Should be fixed in oneTBB. Ignore them for now
|
||||
leak:tbb::internal::task_stream<3>::initialize*
|
||||
@@ -1,27 +0,0 @@
|
||||
#################################################################################
|
||||
## This file is loaded by the Undefined Behaviour Sanitizer build for the unit ##
|
||||
## tests. It can be used to ignore various errors reported by the sanitizer. ##
|
||||
## This is especially useful with upstream issues (e.g. boost/tbb). For help ##
|
||||
## defining suppression rules, see: ##
|
||||
## https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html ##
|
||||
## The build is configured with CMAKE_BUILD_TYPE=ubsan. ##
|
||||
#################################################################################
|
||||
|
||||
##### Upstream #####
|
||||
|
||||
# Lots of warnings from TBB, ignore them
|
||||
alignment:tbb/concurrent_hash_map.h
|
||||
vptr:tbb/parallel_reduce.h
|
||||
vptr:tbb/task.h
|
||||
|
||||
##### OpenVDB #####
|
||||
|
||||
# Some 2s complement tests, ignore the negative shifts
|
||||
# @todo Should address these
|
||||
shift-base:TestMultiResGrid.cc
|
||||
shift-base:openvdb/math/Coord.h
|
||||
|
||||
##### OpenVDB AX #####
|
||||
|
||||
# Ignore overflows reported from old OpenSimplexNoise
|
||||
signed-integer-overflow:openvdb_ax/math/OpenSimplexNoise.cc
|
||||
+19
-135
@@ -1,5 +1,5 @@
|
||||
# Copyright Contributors to the OpenVDB Project
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MPL-2.0
|
||||
#
|
||||
#[=======================================================================[
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#]=======================================================================]
|
||||
|
||||
cmake_minimum_required(VERSION 3.24)
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
project(OpenVDBDocs LANGUAGES NONE)
|
||||
|
||||
include(GNUInstallDirs)
|
||||
@@ -21,20 +21,11 @@ include(GNUInstallDirs)
|
||||
# all documentation is included.
|
||||
option(OPENVDB_DOXYGEN_AX "Build AX documentation" ON)
|
||||
option(OPENVDB_DOXYGEN_HOUDINI "Build Houdini documentation" ON)
|
||||
option(OPENVDB_DOXYGEN_NANOVDB "Build NanoVDB documentation" ON)
|
||||
option(OPENVDB_DOXYGEN_INTERNAL [=[
|
||||
Enable documentation of methods and classes which have been explicitly marked as internal
|
||||
]=] OFF)
|
||||
# When enabled, Doxygen's WARN_AS_ERROR=FAIL_ON_WARNINGS makes any warning fail
|
||||
# the docs build (it still generates the docs and writes the full warning log
|
||||
# first, then exits non-zero). CI turns this ON -- see .github/workflows/docs.yml
|
||||
# -- so net-new doc warnings fail the PR that introduces them. Defaults OFF so a
|
||||
# local doc build isn't blocked by a stray warning from a different Doxygen
|
||||
# version; pass -DOPENVDB_DOXYGEN_WARN_AS_ERROR=ON to gate locally too.
|
||||
option(OPENVDB_DOXYGEN_WARN_AS_ERROR
|
||||
"Treat Doxygen warnings as errors" OFF)
|
||||
|
||||
find_package(Doxygen 1.0...<1.15.0 REQUIRED doxygen)
|
||||
find_package(Doxygen REQUIRED doxygen)
|
||||
if(MINIMUM_DOXYGEN_VERSION)
|
||||
if(DOXYGEN_VERSION VERSION_LESS MINIMUM_DOXYGEN_VERSION)
|
||||
message(WARNING "The doxygen-config doxyfile has been generated with version "
|
||||
@@ -49,11 +40,10 @@ set(DOXY_FILES
|
||||
openvdb/openvdb/io
|
||||
openvdb/openvdb/math
|
||||
openvdb/openvdb/points
|
||||
openvdb/openvdb/thread
|
||||
openvdb/openvdb/python/pyopenvdb.h
|
||||
openvdb/openvdb/tools
|
||||
openvdb/openvdb/tree
|
||||
openvdb/openvdb/util
|
||||
ext/imath/openvdb/math
|
||||
doc/build.txt
|
||||
doc/changes.txt
|
||||
doc/codingstyle.txt
|
||||
@@ -65,93 +55,28 @@ set(DOXY_FILES
|
||||
doc/points.txt
|
||||
doc/python.txt)
|
||||
|
||||
if(OPENVDB_DOXYGEN_INTERNAL)
|
||||
list(APPEND
|
||||
openvdb/openvdb/points/impl
|
||||
openvdb/openvdb/tools/impl)
|
||||
endif()
|
||||
|
||||
if(NOT OPENVDB_DOXYGEN_INTERNAL)
|
||||
# Hide implementation-detail symbols in the lowercase `internal` namespaces
|
||||
# (the project convention for non-public helpers). Note: do NOT add a
|
||||
# capital-I "*Internal*" glob here -- it also matches the public
|
||||
# tree::InternalNode (and nanovdb::InternalNode) class, silently dropping it
|
||||
# from the docs and breaking every \link to it (e.g. InternalNode::childCount
|
||||
# in doc/changes.txt) while its RootNode/LeafNode siblings resolve fine.
|
||||
set(DOXYGEN_EXCLUDE_SYMBOLS
|
||||
"*internal*")
|
||||
endif()
|
||||
|
||||
set(DOXYGEN_PROJECT_NAME "OpenVDB")
|
||||
set(DOXYGEN_PROJECT_LOGO "${CMAKE_CURRENT_SOURCE_DIR}/img/openvdb_logo.png")
|
||||
set(DOXYGEN_PROJECT_NUMBER "${OpenVDB_VERSION}")
|
||||
set(DOXYGEN_PROJECT_BRIEF "")
|
||||
set(DOXYGEN_FILE_PATTERNS *.h *h.in) # headers only
|
||||
set(DOXYGEN_EXTENSION_MAPPING .in=C) # parse CMake config headers as C
|
||||
set(DOXYGEN_IMAGE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/img")
|
||||
set(DOXYGEN_IMAGE_PATH "doc/img")
|
||||
set(DOXYGEN_RECURSIVE NO)
|
||||
set(DOXYGEN_NUM_PROC_THREADS 0) # detects from system
|
||||
|
||||
# Enable \snippet resolution against the on-disk example sources. Paths in
|
||||
# \snippet directives are resolved relative to EXAMPLE_PATH, so referring to
|
||||
# `nanovdb/nanovdb/examples/ex_xxx/yyy.cc` from a doc page works as written.
|
||||
set(DOXYGEN_EXAMPLE_PATH "${CMAKE_SOURCE_DIR}")
|
||||
set(DOXYGEN_EXAMPLE_PATTERNS *.cc *.cpp *.cu *.cuh *.h *.txt)
|
||||
set(DOXYGEN_EXAMPLE_RECURSIVE YES)
|
||||
|
||||
# Always capture Doxygen warnings to a logfile so CI can publish it as an
|
||||
# artifact and contributors can see exactly what's broken.
|
||||
set(DOXYGEN_WARN_LOGFILE "${CMAKE_CURRENT_BINARY_DIR}/doxygen.warnings.log")
|
||||
if(OPENVDB_DOXYGEN_WARN_AS_ERROR)
|
||||
# FAIL_ON_WARNINGS keeps generating docs but exits non-zero at the end if
|
||||
# any warning was emitted. Requires Doxygen >= 1.9.x.
|
||||
set(DOXYGEN_WARN_AS_ERROR FAIL_ON_WARNINGS)
|
||||
# Don't suppress messages so contributors can see warnings during the build.
|
||||
set(DOXYGEN_QUIET NO)
|
||||
else()
|
||||
set(DOXYGEN_QUIET YES)
|
||||
endif()
|
||||
set(DOXYGEN_QUIET YES)
|
||||
|
||||
set(DOXYGEN_GENERATE_HTML YES)
|
||||
set(DOXYGEN_GENERATE_MAN NO)
|
||||
set(DOXYGEN_GENERATE_LATEX NO)
|
||||
set(DOXYGEN_GENERATE_TODOLIST NO)
|
||||
set(DOXYGEN_HTML_TIMESTAMP NO) # for simpler website diffs
|
||||
|
||||
# Render math formulas via MathJax instead of LaTeX -> PNG. This removes the
|
||||
# entire `latex`/`dvips`/`gs` toolchain dependency from both local doc builds
|
||||
# and CI (see .github/workflows/docs.yml), eliminates a class of cross-platform
|
||||
# install pain, and produces crisper, selectable math in the rendered HTML.
|
||||
set(DOXYGEN_USE_MATHJAX YES)
|
||||
set(DOXYGEN_MATHJAX_VERSION MathJax_3) # default JS bundle loaded from a CDN
|
||||
set(DOXYGEN_HTML_COLORSTYLE_HUE 4)
|
||||
set(DOXYGEN_HTML_COLORSTYLE_SAT 222)
|
||||
set(DOXYGEN_HTML_TIMESTAMP NO) # for simpler website diffs
|
||||
|
||||
set(DOXYGEN_EXTRACT_ALL YES)
|
||||
set(DOXYGEN_EXTRACT_STATIC YES)
|
||||
set(DOXYGEN_EXTRACT_LOCAL_CLASSES NO)
|
||||
|
||||
# Configuration for doxygen-awesome-css
|
||||
# {
|
||||
set(DOXYGEN_HTML_COLORSTYLE_HUE 209)
|
||||
set(DOXYGEN_HTML_COLORSTYLE_SAT 255)
|
||||
set(DOXYGEN_HTML_COLORSTYLE_GAMMA 113)
|
||||
set(DOXYGEN_GENERATE_TREEVIEW YES)
|
||||
set(DOXYGEN_DISABLE_INDEX NO)
|
||||
set(DOXYGEN_FULL_SIDEBAR NO)
|
||||
set(DOXYGEN_HTML_HEADER
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/header.html")
|
||||
set(DOXYGEN_HTML_EXTRA_STYLESHEET
|
||||
"${CMAKE_SOURCE_DIR}/ext/doxygen-awesome/doxygen-awesome.css"
|
||||
"${CMAKE_SOURCE_DIR}/ext/doxygen-awesome/doxygen-awesome-sidebar-only.css"
|
||||
"${CMAKE_SOURCE_DIR}/ext/doxygen-awesome/doxygen-awesome-sidebar-only-darkmode-toggle.css"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/openvdb.css")
|
||||
set(DOXYGEN_HTML_EXTRA_FILES
|
||||
"${CMAKE_SOURCE_DIR}/ext/doxygen-awesome/doxygen-awesome-paragraph-link.js"
|
||||
"${CMAKE_SOURCE_DIR}/ext/doxygen-awesome/doxygen-awesome-fragment-copy-button.js"
|
||||
"${CMAKE_SOURCE_DIR}/ext/doxygen-awesome/doxygen-awesome-darkmode-toggle.js")
|
||||
set(DOXYGEN_HTML_COPY_CLIPBOARD NO) # required with Doxygen >= 1.10.0
|
||||
set(DOXYGEN_HTML_COLORSTYLE LIGHT) # required with Doxygen >= 1.9.5
|
||||
# }
|
||||
|
||||
# Allow for root directory paths to be listed (e.g. openvdb/io/File.h)
|
||||
# Rather than just the file names (e.g. File.h). This makes it far
|
||||
# easier to navigate the docs
|
||||
@@ -159,13 +84,11 @@ set(DOXYGEN_FULL_PATH_NAMES YES)
|
||||
set(DOXYGEN_STRIP_FROM_PATH
|
||||
"${CMAKE_SOURCE_DIR}/openvdb"
|
||||
"${CMAKE_SOURCE_DIR}/openvdb_ax"
|
||||
"${CMAKE_SOURCE_DIR}/nanovdb"
|
||||
"${CMAKE_SOURCE_DIR}/openvdb_houdini"
|
||||
"${CMAKE_SOURCE_DIR}")
|
||||
set(DOXYGEN_STRIP_FROM_INC_PATH
|
||||
"${CMAKE_SOURCE_DIR}/openvdb"
|
||||
"${CMAKE_SOURCE_DIR}/openvdb_ax"
|
||||
"${CMAKE_SOURCE_DIR}/nanovdb"
|
||||
"${CMAKE_SOURCE_DIR}/openvdb_houdini")
|
||||
|
||||
# Shows which source files generated the respected doxygen docs
|
||||
@@ -182,13 +105,12 @@ set(DOXYGEN_HIDE_SCOPE_NAMES YES)
|
||||
set(DOXYGEN_INLINE_INHERITED_MEMB YES)
|
||||
set(DOXYGEN_MACRO_EXPANSION YES)
|
||||
# @todo use dot with class diagrams for relevant classes
|
||||
set(DOXYGEN_HAVE_DOT NO)
|
||||
set(DOXYGEN_CLASS_GRAPH NO)
|
||||
set(DOXYGEN_CLASS_DIAGRAMS NO)
|
||||
|
||||
|
||||
set(DOXYGEN_ALIASES
|
||||
[[ijk="(<i>i</i>, \;<i>j</i>, \;<i>k</i>)"]]
|
||||
[[xyz="(<i>x</i>, \;<i>y</i>, \;<i>z</i>)"]]
|
||||
[[ijk="(<i>i</i>, <i>j</i>, <i>k</i>)"]]
|
||||
[[xyz="(<i>x</i>, <i>y</i>, <i>z</i>)"]]
|
||||
[[const="<tt>const</tt>"]]
|
||||
"\"vdbnamespace=openvdb::v${OpenVDB_MAJOR_VERSION}_${OpenVDB_MINOR_VERSION}\""
|
||||
[["hunamespace=houdini_utils"]]
|
||||
@@ -216,18 +138,12 @@ set(DOXYGEN_PREDEFINED
|
||||
"OPENVDB_VERSION_NAME=v${OpenVDB_MAJOR_VERSION}_${OpenVDB_MINOR_VERSION}"
|
||||
"OPENVDB_ABI_VERSION_NUMBER=${OpenVDB_MAJOR_VERSION}"
|
||||
[[__declspec(x):= __attribute__(x):=]]
|
||||
# Strip the symbol-visibility/export macro so Doxygen doesn't fold it into a
|
||||
# declaration's name. Doxygen tolerates `class OPENVDB_API X` but mis-parses
|
||||
# `enum OPENVDB_API X` (e.g. half::FromBitsTag in ext/imath/.../Half.h),
|
||||
# reporting the enum as a documented-but-undeclared symbol.
|
||||
"OPENVDB_API="
|
||||
# Replace the deprecated macros with doxygen deprecated comments. This ensures
|
||||
# that every bit of deprecated C++ is listed in the doxygen deprecated list,
|
||||
# even if it was not properly tagged
|
||||
[["OPENVDB_DEPRECATED=/** \deprecated */"]]
|
||||
[["OPENVDB_DEPRECATED_MESSAGE(x)=/** \deprecated x */"]]
|
||||
"OPENVDB_USE_LOG4CPLUS="
|
||||
"OPENVDB_UBSAN_SUPPRESS=")
|
||||
"OPENVDB_USE_LOG4CPLUS=")
|
||||
|
||||
set(DOXYGEN_ENABLED_SECTIONS "")
|
||||
|
||||
@@ -269,9 +185,9 @@ if(OPENVDB_DOXYGEN_HOUDINI)
|
||||
list(APPEND DOXY_FILES
|
||||
doc/houdini.txt
|
||||
openvdb_houdini/openvdb_houdini/AttributeTransferUtil.h
|
||||
openvdb_houdini/openvdb_houdini/reference/GEO_PrimVDB.h
|
||||
openvdb_houdini/openvdb_houdini/reference/GU_PrimVDB.h
|
||||
openvdb_houdini/openvdb_houdini/GEO_PrimVDB.h
|
||||
openvdb_houdini/openvdb_houdini/GT_GEOPrimCollectVDB.h
|
||||
openvdb_houdini/openvdb_houdini/GU_PrimVDB.h
|
||||
openvdb_houdini/openvdb_houdini/GU_VDBPointTools.h
|
||||
openvdb_houdini/openvdb_houdini/GeometryUtil.h
|
||||
openvdb_houdini/openvdb_houdini/ParmFactory.h
|
||||
@@ -284,9 +200,7 @@ if(OPENVDB_DOXYGEN_HOUDINI)
|
||||
endif()
|
||||
|
||||
if(OPENVDB_DOXYGEN_AX)
|
||||
# AX docs use @f$ inline and @f[ block math. Formula font size also applies
|
||||
# under MathJax (set above). The amsmath package the AX docs assume is
|
||||
# bundled by default in MathJax v3, so no extra extensions are required.
|
||||
set(DOXYGEN_EXTRA_PACKAGES amsmath) # for math formatting
|
||||
set(DOXYGEN_FORMULA_FONTSIZE 14)
|
||||
list(APPEND DOXYGEN_ENABLED_SECTIONS "OPENVDB_AX")
|
||||
|
||||
@@ -298,43 +212,13 @@ if(OPENVDB_DOXYGEN_AX)
|
||||
doc/ax/doc.txt
|
||||
openvdb_ax/openvdb_ax
|
||||
openvdb_ax/openvdb_ax/ast
|
||||
openvdb_ax/openvdb_ax/cmd
|
||||
openvdb_ax/openvdb_ax/codegen
|
||||
openvdb_ax/openvdb_ax/compiler
|
||||
openvdb_ax/openvdb_ax/grammar
|
||||
openvdb_ax/openvdb_ax/grammar/generated
|
||||
openvdb_ax/openvdb_ax/math)
|
||||
endif()
|
||||
|
||||
if(OPENVDB_DOXYGEN_NANOVDB)
|
||||
list(APPEND DOXYGEN_ENABLED_SECTIONS "NANOVDB")
|
||||
|
||||
list(APPEND DOXY_FILES
|
||||
doc/nanovdb/doc.md
|
||||
doc/nanovdb/FAQ.md
|
||||
doc/nanovdb/SourceTree.md
|
||||
doc/nanovdb/HowToBuild.md
|
||||
doc/nanovdb/HelloWorld.md
|
||||
nanovdb/nanovdb
|
||||
nanovdb/nanovdb/util
|
||||
nanovdb/nanovdb/examples/ex_bump_pool_buffer
|
||||
nanovdb/nanovdb/examples/ex_collide_level_set
|
||||
nanovdb/nanovdb/examples/ex_make_custom_nanovdb
|
||||
nanovdb/nanovdb/examples/ex_make_funny_nanovdb
|
||||
nanovdb/nanovdb/examples/ex_make_nanovdb_sphere
|
||||
nanovdb/nanovdb/examples/ex_make_typed_grids
|
||||
nanovdb/nanovdb/examples/ex_map_pool_buffer
|
||||
nanovdb/nanovdb/examples/ex_modify_nanovdb_thrust
|
||||
nanovdb/nanovdb/examples/ex_openvdb_to_nanovdb
|
||||
nanovdb/nanovdb/examples/ex_openvdb_to_nanovdb_accessor
|
||||
nanovdb/nanovdb/examples/ex_openvdb_to_nanovdb_cuda
|
||||
nanovdb/nanovdb/examples/ex_raytrace_fog_volume
|
||||
nanovdb/nanovdb/examples/ex_raytrace_level_set
|
||||
nanovdb/nanovdb/examples/ex_read_nanovdb_sphere
|
||||
nanovdb/nanovdb/examples/ex_read_nanovdb_sphere_accessor
|
||||
nanovdb/nanovdb/examples/ex_read_nanovdb_sphere_accessor_cuda
|
||||
nanovdb/nanovdb/examples/ex_util
|
||||
nanovdb/nanovdb/examples/ex_vox_to_nanovdb
|
||||
nanovdb/nanovdb/examples/ex_write_nanovdb_grids)
|
||||
openvdb_ax/openvdb_ax/math
|
||||
openvdb_ax/openvdb_ax/test)
|
||||
endif()
|
||||
|
||||
set(DOXYGEN_VERBATIM_VARS DOXYGEN_ALIASES DOXYGEN_PREDEFINED)
|
||||
|
||||
+291
-233
@@ -1,13 +1,14 @@
|
||||
/**
|
||||
<div style="width:800px;text-align:justify;">
|
||||
|
||||
@page ax AX Language Documentation
|
||||
@page ax AX
|
||||
|
||||
@section axlanguage Intro
|
||||
@section axlanguage AX Language Documentation
|
||||
@par
|
||||
Welcome to the AX Language documentation. These docs provide detailed
|
||||
information on the AX language including syntax, data types, available
|
||||
functionality (including OpenVDB specific methods) execution structure and
|
||||
control flow. See the @ref axcplusplus documentation for the C++ developer
|
||||
control flow. See the @subpage axcplusplus documentation for the C++ developer
|
||||
documentation.
|
||||
@note
|
||||
Some sections of this document are still to be completed. Please get in touch
|
||||
@@ -107,8 +108,8 @@ function (see @ref axprogramexample) and whilst there are ways to achieve
|
||||
reductions, it is an example which would be better suited to a custom C++
|
||||
implementation.
|
||||
@par
|
||||
For details of extending AX for custom geometry, see the @ref axcplusplus
|
||||
developer documentation. Note that custom geometry support requires `C++` extension.
|
||||
For details of extending AX for custom geometry, see the @subpage axcplusplus
|
||||
developer documentation. Note that custom geometry support requires C++ extension.
|
||||
|
||||
|
||||
@subsection axprogramexample A Program Example
|
||||
@@ -132,20 +133,20 @@ The following explains the above example in relation to OpenVDB data; OpenVDB
|
||||
points and OpenVDB volumes. The example demonstrates reading from a value on
|
||||
some input, either a point attribute or a voxel value, and storing the
|
||||
result in a @ref axdecls "local variable". Importantly, the attribute being
|
||||
accessed has the name `myattribute` and the type `float`. The first statement:
|
||||
accessed has the name @b `myattribute` and the type @b `float`. The first statement:
|
||||
<!-- A -->@code{.c}
|
||||
float temp = float@myattribute;
|
||||
@endcode
|
||||
Invokes a @b read from this attribute (see @ref axattribaccess), retrieving the
|
||||
value from the geometry and storing it in the variable `temp` to be used in
|
||||
value from the geometry and storing it in the variable @b `temp` to be used in
|
||||
the AX program. The second statement:
|
||||
@code{.c}
|
||||
if (temp > 0.0f) float@myattribute = 0.0f;
|
||||
@endcode
|
||||
Performs a comparison of this value with `0.0f` and, if the value is greater
|
||||
than `0.0f`, performs a @b write to the geometry in the form of
|
||||
`float@myattribute = 0.0f;` which sets the value of this attribute on the
|
||||
geometry to `0.0f`.
|
||||
Performs a comparison of this value with @b `0.0f` and, if the value is greater
|
||||
than @b `0.0f`, performs a @b write to the geometry in the form of
|
||||
<b>`float@myattribute = 0.0f;`</b> which sets the value of this attribute on the
|
||||
geometry to @b `0.0f`.
|
||||
@par
|
||||
For OpenVDB Points, this kernel is run over every point in an OpenVDB Points
|
||||
Grid. In simple pseudo code:
|
||||
@@ -154,7 +155,7 @@ foreach(point in pointgrid)
|
||||
run_ax_kernel(point)
|
||||
done()
|
||||
@endcode
|
||||
Where `pointgrid` is a single Point Data Grid. For OpenVDB volumes the kernel
|
||||
Where @b `pointgrid` is a single Point Data Grid. For OpenVDB volumes the kernel
|
||||
is run over each voxel in a provided grid:
|
||||
@code{.unparsed}
|
||||
foreach(grid in grids)
|
||||
@@ -164,8 +165,8 @@ foreach(grid in grids)
|
||||
done()
|
||||
@endcode
|
||||
@par
|
||||
Where `grids` can comprise of any number of OpenVDB volumes. In this program,
|
||||
only a floating point grid with the name `myattribute` will be updated. Each
|
||||
Where @b `grids` can comprise of any number of OpenVDB volumes. In this program,
|
||||
only a floating point grid with the name @b `myattribute` will be updated. Each
|
||||
voxel in this grid will have it's value compared in the same way as the points
|
||||
example given above.
|
||||
|
||||
@@ -281,9 +282,9 @@ missing types from OpenVDB.
|
||||
|
||||
@subsection axscalars Scalars
|
||||
@par
|
||||
AX Supports boolean, integer and floating point scalar types. `int` and
|
||||
`int32` represent 32-bit integer values and `int64` represents a 64-bit
|
||||
value. `float` and `double` represent 32-bit and 64-bit floating point
|
||||
AX Supports boolean, integer and floating point scalar types. @b `int` and
|
||||
@b `int32` represent 32-bit integer values and @b `int64` represents a 64-bit
|
||||
value. @b `float` and @b `double` represent 32-bit and 64-bit floating point
|
||||
values respectively. All scalars, excluding bools, are signed; there are no
|
||||
other unsigned scalar types in AX.
|
||||
@par Integer Overflow and Floating Point Truncation
|
||||
@@ -308,10 +309,10 @@ int64 a = 2147483648l; // one more than can be held in an int (note the last let
|
||||
int b = a; // implicit conversion. "b" is set to -2147483648
|
||||
@endcode
|
||||
@par Infinite and NaN values
|
||||
Floating point values have two additional intrinsic states; `inf` and `nan`.
|
||||
Floating point values have two additional intrinsic states; @b `inf` and @b `nan`.
|
||||
These states can occur during invalid floating point arithmetic. AX performs no
|
||||
checks on arithmetic to catch these values. A typical example of both `inf`
|
||||
and `nan` values are division by zero expressions:
|
||||
checks on arithmetic to catch these values. A typical example of both @b `inf`
|
||||
and @b `nan` values are division by zero expressions:
|
||||
@code
|
||||
float a = 1.0f/0.0f;
|
||||
print(a); // prints "inf"
|
||||
@@ -336,16 +337,16 @@ There is currently support for vectors of sizes 2, 3 and 4 elements. The suffix
|
||||
letter on the vector types denotes the contained elements precision, with the
|
||||
number corresponding to the vector size. For example, @b `vec2i` denotes a vector
|
||||
of two 32-bit integer elements. There are no native types for vectors with
|
||||
`bool`, `int16` or `int64` elements, so these are not supported.
|
||||
@b `bool`, @b `int16` or @b `int64` elements, so these are not supported.
|
||||
@par Matrices
|
||||
Matrices are stored in row major layout (lexographical access order) which
|
||||
matches the representation of a matrix in OpenVDB. Matrix support consists of
|
||||
`float` and `double` precision elements with dimensions either `3x3` or
|
||||
`4x4` (total size of 9 and 16 elements respectively). There are no integer or
|
||||
@b `float` and @b `double` precision elements with dimensions either @b `3x3` or
|
||||
@b `4x4` (total size of 9 and 16 elements respectively). There are no integer or
|
||||
boolean matrix types. Similiar to vectors, the suffix letter on the type denotes
|
||||
the contained elements precision, with the number corresponding to the matrix
|
||||
dimension. A matrix of type `mat3d` therefor corresponds to a `3x3` matrix
|
||||
(9 elements) with `double` precision elements.
|
||||
dimension. A matrix of type @b `mat3d` therefor corresponds to a @b `3x3` matrix
|
||||
(9 elements) with @b `double` precision elements.
|
||||
@par Element Access
|
||||
As elements of all matrix and vector types are stored contiguously, they can be
|
||||
accessed by the @ref axvecaccessop "[] operator". Vector elements can also be
|
||||
@@ -369,10 +370,10 @@ performing matrix projections (transformations) on vector arguments.
|
||||
Strings are an array of characters stored in a unique AX type which is
|
||||
incompatible with @ref axopaccess "container accesses". As such, string support
|
||||
is currently fairly limited. Characters themselves (users may know this as a
|
||||
`char` type) have no frontend type, so a `string` type must be used for
|
||||
@b `char` type) have no frontend type, so a @b `string` type must be used for
|
||||
any number of characters (including the empty string). String literals are
|
||||
represented by enclosing any number of @ref axtokens "supported AX characters"
|
||||
by quotes `" "`.
|
||||
by quotes <b>\" \"</b>.
|
||||
|
||||
@subsection axtypeprecedence Implicit conversion / type precedence
|
||||
@par
|
||||
@@ -440,9 +441,9 @@ depending on the operand types.
|
||||
<th colspan="9"> Operators
|
||||
</th></tr>
|
||||
<tr style="text-align:center">
|
||||
<td style="border-right-width: thick" colspan="4"> @ref axopbinary </td>
|
||||
<td style="border-right-width: thick" colspan="3"> @ref axopunary </td>
|
||||
<td colspan="2"> Other </td></tr>
|
||||
<td bgcolor="#ffc4c4" style="border-right-width: thick" colspan="4"> @ref axopbinary </td>
|
||||
<td bgcolor="#ffc4c4" style="border-right-width: thick" colspan="3"> @ref axopunary </td>
|
||||
<td bgcolor="#ffc4c4" colspan="2"> Other </td></tr>
|
||||
<tr style="text-align:center">
|
||||
<td> @ref axopassignment </td>
|
||||
<td> @ref axopbinarithmetic </td>
|
||||
@@ -455,33 +456,50 @@ depending on the operand types.
|
||||
<td> @ref axopother </td></tr>
|
||||
<tr style="text-align:center">
|
||||
<td><p> <!-- *********************** COLUMN ASSIGNMENT *********************** -->
|
||||
`a = b`<br/>`a += b`<br/>`a -= b`<br/>`a *= b`<br/>`a /= b`<br/>`a %= b`<br/>
|
||||
`a &= b`<br/>`a |= b`<br/>`a ^= b`<br/>`a <<= b`<br/>`a >>= b`
|
||||
<code>
|
||||
a = b<br/>a += b<br/>a -= b<br/>a *= b<br/>a /= b<br/>a %= b<br/>
|
||||
a &= b<br/>a |= b<br/>a ^= b<br/>a <<= b<br/>a >>= b
|
||||
</code>
|
||||
</p></td>
|
||||
<td><p> <!-- *********************** COLUMN ARITH *********************** -->
|
||||
`a + b`<br/>`a - b`<br/>`a * b`<br/>`a / b`<br/>`a % b`<br/>`a & b`<br/>`a | b`<br/>
|
||||
`a ^ b`<br/>`a << b`<br/>`a >> b`
|
||||
</p></td>
|
||||
<code>
|
||||
a + b<br/>a - b<br/>a * b<br/>a / b<br/>a % b<br/>a & b<br/>a | b<br/>
|
||||
a ^ b<br/>a << b<br/>a >> b
|
||||
</code></p></td>
|
||||
<td><p> <!-- *********************** COLUMN COMP *********************** -->
|
||||
`a == b`<br/>`a != b`<br/>`a < b`<br/>`a > b`<br/>`a <= b`<br/>`a >= b`
|
||||
<code>
|
||||
a == b<br/>a != b<br/>a < b<br/>a > b<br/>a <= b<br/>a >= b
|
||||
</code>
|
||||
</p></td>
|
||||
<td style="border-right-width: thick"><p> <!-- *********************** COLUMN LOGICAL *********************** -->
|
||||
`a && b`<br/>`a || b`
|
||||
<code>
|
||||
a && b<br/>a || b
|
||||
</code>
|
||||
</p></td>
|
||||
<td><p> <!-- *********************** COLUMN ARITH *********************** -->
|
||||
`+a`<br/>`-a`<br/>`~a`
|
||||
<code>
|
||||
+a<br/>-a<br/>~a
|
||||
</code>
|
||||
</p></td>
|
||||
<td><p> <!-- *********************** COLUMN LOGICAL *********************** -->
|
||||
`!a`
|
||||
<code>
|
||||
!a
|
||||
</code>
|
||||
</p></td>
|
||||
<td style="border-right-width: thick"><p> <!-- *********************** COLUMN INC/DEC *********************** -->
|
||||
`++a`<br/>`--a`<br/>`a++`<br/>`a--`
|
||||
<code>
|
||||
++a<br/>\-\-a<br/>a++<br/>a\-\-
|
||||
</code>
|
||||
</p></td>
|
||||
<td><p> <!-- *********************** COLUMN OTHER *********************** -->
|
||||
`a[]`<br/>`a[,]`<br/>`a.b`
|
||||
<code>
|
||||
a[]<br/>a[,]<br/>a.b
|
||||
</code>
|
||||
</p></td>
|
||||
<td><p> <!-- *********************** COLUMN OTHER *********************** -->
|
||||
`a(...)`<br/>`a, b`<br/>`a ? b : c`<br/>`a ?: c`<br/>`{ a,b ... }`
|
||||
<code>
|
||||
a(...)<br/>a, b<br/>a ? b : c<br/>{ a,b ... }
|
||||
</code>
|
||||
</p></td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -504,34 +522,34 @@ assignment operators have the following forms:
|
||||
@par
|
||||
<table>
|
||||
<tr><th>Operator Name</th><th>Operator Syntax</th><th>Returns</th></tr>
|
||||
<tr><td>Simple assignment</td><td> @a lhs <b>`=`</b> @a rhs </td>
|
||||
<td rowspan="11">Reference to @a lhs</td></tr>
|
||||
<tr><td>Addition assignment</td><td> @a lhs <b>`+=`</b> @a rhs </td></tr>
|
||||
<tr><td>Subtraction assignment</td><td> @a lhs <b>`-=`</b> @a rhs </td></tr>
|
||||
<tr><td>Multiplication assignment</td><td> @a lhs <b>`*=`</b> @a rhs </td></tr>
|
||||
<tr><td>Division assignment</td><td> @a lhs <b>`/=`</b> @a rhs </td></tr>
|
||||
<tr><td>Modulo assignment</td><td> @a lhs <b>`%=`</b> @a rhs </td></tr>
|
||||
<tr><td>Bitwise AND assignment</td><td> @a lhs <b>`&=`</b> @a rhs </td></tr>
|
||||
<tr><td>Bitwise OR assignment</td><td> @a lhs <b>`|=`</b> @a rhs </td></tr>
|
||||
<tr><td>Bitwise XOR assignment</td><td> @a lhs <b>`^=`</b> @a rhs </td></tr>
|
||||
<tr><td>Bitwise shift left assignment</td><td> @a lhs <b>`<<=`</b> @a rhs </td></tr>
|
||||
<tr><td>Bitwise shift right assignment</td><td> @a lhs <b>`>>=`</b> @a rhs </td></tr>
|
||||
<tr><td>Simple assignment</td><td bgcolor="#ffc4c4"> @a `lhs` <b>`=`</b> @a `rhs` </td><td>Reference to @a `lhs`</td></tr>
|
||||
<tr><td>Addition assignment</td><td bgcolor="#ffc4c4"> @a `lhs` <b>`+=`</b> @a `rhs` </td><td>Reference to @a `lhs`</td></tr>
|
||||
<tr><td>Subtraction assignment</td><td bgcolor="#ffc4c4"> @a `lhs` <b>`-=`</b> @a `rhs` </td><td>Reference to @a `lhs`</td></tr>
|
||||
<tr><td>Multiplication assignment</td><td bgcolor="#ffc4c4"> @a `lhs` <b>`*=`</b> @a `rhs` </td><td>Reference to @a `lhs`</td></tr>
|
||||
<tr><td>Division assignment</td><td bgcolor="#ffc4c4"> @a `lhs` <b>`/=`</b> @a `rhs` </td><td>Reference to @a `lhs`</td></tr>
|
||||
<tr><td>Modulo assignment</td><td bgcolor="#ffc4c4"> @a `lhs` <b>`%=`</b> @a `rhs` </td><td>Reference to @a `lhs`</td></tr>
|
||||
<tr><td>Bitwise AND assignment</td><td bgcolor="#ffc4c4"> @a `lhs` <b>`&=`</b> @a `rhs` </td><td>Reference to @a `lhs`</td></tr>
|
||||
<tr><td>Bitwise OR assignment</td><td bgcolor="#ffc4c4"> @a `lhs` <b>`|=`</b> @a `rhs` </td><td>Reference to @a `lhs`</td></tr>
|
||||
<tr><td>Bitwise XOR assignment</td><td bgcolor="#ffc4c4"> @a `lhs` <b>`^=`</b> @a `rhs` </td><td>Reference to @a `lhs`</td></tr>
|
||||
<tr><td>Bitwise shift left assignment</td><td bgcolor="#ffc4c4"> @a `lhs` <b>`<<=`</b> @a `rhs` </td><td>Reference to @a `lhs`</td></tr>
|
||||
<tr><td>Bitwise shift right assignment</td><td bgcolor="#ffc4c4"> @a `lhs` <b>`>>=`</b> @a `rhs` </td><td>Reference to @a `lhs`</td></tr>
|
||||
</table>
|
||||
@par
|
||||
These can be further categorised into two types; direct assignment, which is
|
||||
comprised only of the <b>simple assignment</b> operator, and compound assignments,
|
||||
which is the set of all other assignment operators.
|
||||
@par Direct Assignment
|
||||
Direct assignments replace the contents of the `lhs` with a copy of the `rhs`:
|
||||
Direct assignments replace the contents of the @b `lhs` with a copy of the @b
|
||||
`rhs`:
|
||||
@par
|
||||
<table><tr>
|
||||
<td> @a lhs <b>=</b> @a rhs </td>
|
||||
<td bgcolor="#ffc4c4"> @a `lhs` <b>= </b> @a `rhs` </td>
|
||||
</tr></table>
|
||||
@par
|
||||
The `rhs` side is not modified and the `lhs` is not read - only written
|
||||
to. If the `rhs` type does not match the `lhs` type, the `rhs` is first
|
||||
implicitly converted into a new temporary with the `lhs` type before being
|
||||
copied into the `lhs`. The following combination of AX type categories are
|
||||
The @b `rhs` side is not modified and the @b `lhs` is not read - only written
|
||||
to. If the @b `rhs` type does not match the @b `lhs` type, the @b `rhs` is first
|
||||
implicitly converted into a new temporary with the @b `lhs` type before being
|
||||
copied into the @b `lhs`. The following combination of AX type categories are
|
||||
supported for direct assignment (if an operation is not listed, it is not
|
||||
supported):
|
||||
@par
|
||||
@@ -551,14 +569,15 @@ supported):
|
||||
<td style="border-top-width: thick">@ref axscalars "scalar"</td>
|
||||
<td style="border-top-width:thick;text-align:left">
|
||||
Each element of the vector is set to the right hand side scalar. i.e.
|
||||
`a[0] = b; ... a[n-1] = b;` where `n` is the size of the vector. If the
|
||||
scalar type does not match element type of vector, the scalar is copied and
|
||||
@ref axtypeprecedence "implicitly cast" to that type.</td>
|
||||
<br/> `a[0] = b; ... a[n-1] = b;` <br/>
|
||||
where `n` is the size of the vector. If the scalar type does not match
|
||||
element type of vector, the scalar is copied and @ref axtypeprecedence
|
||||
"implicitly cast" to that type.</td>
|
||||
</tr>
|
||||
<tr style="text-align:center"><td>@ref axvecmats "vector"</td>
|
||||
<td style="text-align:left">
|
||||
Component wise assignment i.e. `a[0] = b; ... a[n-1] = b;` where `n` is the size
|
||||
of the vector.
|
||||
<td style="text-align:left">Component wise assignment i.e.
|
||||
<br/> `a[0] = b; ... a[n-1] = b;` <br/>
|
||||
where `n` is the size of the vector.
|
||||
<!-- A -->@code{.c}
|
||||
vec3f a = 0, b = 1;
|
||||
a = b;
|
||||
@@ -593,7 +612,7 @@ of matrix, the scalar is copied and @ref axtypeprecedence "implicitly cast" to
|
||||
that type.</td>
|
||||
<tr style="text-align:center"><td>@ref axvecmats "matrix"</td>
|
||||
<td style="text-align:left">Component wise assignment i.e.
|
||||
<br/> `a[0] = b[0]; ... a[n-1] = b[n-1];` <br/>
|
||||
<br/> `a[0] = b[0]; ... a[n-1] = b[n-1];` <br/>
|
||||
where `n` is the @b total size of the matrix.
|
||||
<!-- A -->@code{.c}
|
||||
mat4f a = 0, b = 1;
|
||||
@@ -626,27 +645,25 @@ int a = 1; // assign a from an integer literal of value 1
|
||||
c = a; // assign components of c (x/y/z) to the result of float(a)
|
||||
@endcode
|
||||
@par Compound Assignment
|
||||
Compound assignments replace the the contents of the `lhs` with the result of
|
||||
a @ref axopbinarithmetic "binary arithmetic" operation of the `lhs` with the
|
||||
`rhs`:
|
||||
Compound assignments replace the the contents of the @b `lhs` with the result of
|
||||
a @ref axopbinarithmetic "binary arithmetic" operation of the @b `lhs` with the
|
||||
@b `rhs`:
|
||||
@par
|
||||
<table>
|
||||
<tr><td> @a lhs @b op @a rhs </td></tr>
|
||||
<tr><td bgcolor="#ffc4c4"> @a `lhs` @b op @a `rhs` </td></tr>
|
||||
</table>
|
||||
|
||||
Where @b op is one of:
|
||||
|
||||
Where @b op is one of :
|
||||
<table><tr>
|
||||
<td> <b>`+=`</b></td>
|
||||
<td> <b>`-=`</b></td>
|
||||
<td> <b>`*=`</b></td>
|
||||
<td> <b>`/=`</b></td>
|
||||
<td> <b>`%=`</b></td>
|
||||
<td> <b>`&=`</b></td>
|
||||
<td> <b>`|=`</b></td>
|
||||
<td> <b>`^=`</b></td>
|
||||
<td> <b>`<<=`</b></td>
|
||||
<td> <b>`>>= `</b></td>
|
||||
<td bgcolor="#ffc4c4"> <b>`+=`</b></td>
|
||||
<td bgcolor="#ffc4c4"> <b>`-=`</b></td>
|
||||
<td bgcolor="#ffc4c4"> <b>`*=`</b></td>
|
||||
<td bgcolor="#ffc4c4"> <b>`/=`</b></td>
|
||||
<td bgcolor="#ffc4c4"> <b>`%=`</b></td>
|
||||
<td bgcolor="#ffc4c4"> <b>`&=`</b></td>
|
||||
<td bgcolor="#ffc4c4"> <b>`|=`</b></td>
|
||||
<td bgcolor="#ffc4c4"> <b>`^=`</b></td>
|
||||
<td bgcolor="#ffc4c4"> <b>`<<=`</b></td>
|
||||
<td bgcolor="#ffc4c4"> <b>`>>= `</b></td>
|
||||
</tr></table>
|
||||
@par
|
||||
The behaviour of a given compound assignment (for example `a += b`) is similar
|
||||
@@ -663,8 +680,8 @@ int a = 1;
|
||||
++a += 1; // equal to a = ++a + 1 which is equal to 3
|
||||
@endcode
|
||||
@par
|
||||
The `rhs` side is not modified, however the `lhs` is both read from and
|
||||
written to. Note that the arithmetic operation may cast either `lhs` or
|
||||
The @b `rhs` side is not modified, however the @b `lhs` is both read from and
|
||||
written to. Note that the arithmetic operation may cast either @b `lhs` or @b
|
||||
`rhs` following the rules of AX's @ref axopbinarithmetic
|
||||
"arithmetic type precedence". See the @ref axopbinarithmetic
|
||||
"arithmetic operations" section for more information on arithmetic type
|
||||
@@ -703,7 +720,7 @@ b = c; // b becomes 4
|
||||
a = b; // a becomes float(4)
|
||||
@endcode
|
||||
@par
|
||||
Importantly, `a` receives the result of any previous implicit casts to the
|
||||
Importantly, @b `a` receives the result of any previous implicit casts to the
|
||||
right hand side of its binary assignment.
|
||||
|
||||
|
||||
@@ -720,20 +737,20 @@ container types). Binary arithmetic operations have the following forms:
|
||||
@par
|
||||
<table>
|
||||
<tr><th>Operator Name</th><th>Operator Syntax</th><th>Returns</th></tr>
|
||||
<tr><td>Addition</td><td> @a lhs <b>`+`</b> @a rhs </td><td>The sum of both operands</td></tr>
|
||||
<tr><td>Subtraction</td><td> @a lhs <b>`-`</b> @a rhs </td><td>The first operand minus the second operand</td></tr>
|
||||
<tr><td>Multiplication</td><td> @a lhs <b>`*`</b> @a rhs </td><td>The product of both operands</td></tr>
|
||||
<tr><td>Division</td><td> @a lhs <b>`/`</b> @a rhs </td><td>The first operand divided by the second operand</td></tr>
|
||||
<tr><td>Modulo</td><td> @a lhs <b>`%`</b> @a rhs </td><td>The @b floored modulo operator. See @ref axbinmultop "Multiplicative operands"</td></tr>
|
||||
<tr><td>Bitwise AND</td><td> @a lhs <b>`&`</b> @a rhs </td>
|
||||
<tr><td>Addition</td><td bgcolor="#ffc4c4"> @a `lhs` <b>`+`</b> @a `rhs` </td><td>The sum of both operands</td></tr>
|
||||
<tr><td>Subtraction</td><td bgcolor="#ffc4c4"> @a `lhs` <b>`-`</b> @a `rhs` </td><td>The first operand minus the second operand</td></tr>
|
||||
<tr><td>Multiplication</td><td bgcolor="#ffc4c4"> @a `lhs` <b>`*`</b> @a `rhs` </td><td>The product of both operands</td></tr>
|
||||
<tr><td>Division</td><td bgcolor="#ffc4c4"> @a `lhs` <b>`/`</b> @a `rhs` </td><td>The first operand divided by the second operand</td></tr>
|
||||
<tr><td>Modulo</td><td bgcolor="#ffc4c4"> @a `lhs` <b>`%`</b> @a `rhs` </td><td>The @b floored modulo operator. See @ref axbinmultop "Multiplicative operands"</td></tr>
|
||||
<tr><td>Bitwise AND</td><td bgcolor="#ffc4c4"> @a `lhs` <b>`&`</b> @a `rhs` </td>
|
||||
<td>The @b integral bitwise AND result of each bit in the first operand applied to the bit at the same location in the second operand</td></tr>
|
||||
<tr><td>Bitwise OR</td><td> @a lhs <b>`|`</b> @a rhs </td>
|
||||
<tr><td>Bitwise OR</td><td bgcolor="#ffc4c4"> @a `lhs` <b>`|`</b> @a `rhs` </td>
|
||||
<td>The @b integral bitwise OR result of each bit in the first operand applied to the bit at the same location in the second operand</td></tr>
|
||||
<tr><td>Bitwise XOR</td><td> @a lhs <b>`^`</b> @a rhs </td>
|
||||
<tr><td>Bitwise XOR</td><td bgcolor="#ffc4c4"> @a `lhs` <b>`^`</b> @a `rhs` </td>
|
||||
<td>The @b integral bitwise XOR result of each bit in the first operand applied to the bit at the same location in the second operand</td></tr>
|
||||
<tr><td>Bitwise shift left</td><td> @a lhs <b>`<<`</b> @a rhs </td>
|
||||
<tr><td>Bitwise shift left</td><td bgcolor="#ffc4c4"> @a `lhs` <b>`<<`</b> @a `rhs` </td>
|
||||
<td>The @b integral bitwise left shift of the first operand by the second operand</td></tr>
|
||||
<tr><td>Bitwise shift right</td><td> @a lhs <b>`>>`</b> @a rhs </td>
|
||||
<tr><td>Bitwise shift right</td><td bgcolor="#ffc4c4"> @a `lhs` <b>`>>`</b> @a `rhs` </td>
|
||||
<td>The @b integral bitwise right shift of the first operand by the second operand</td></tr>
|
||||
</table>
|
||||
@anchor axbinadditiveop
|
||||
@@ -742,13 +759,13 @@ Binary additive operations perform summations on the input arguments. They have
|
||||
the following forms:
|
||||
@par
|
||||
<table>
|
||||
<tr><td> @a lhs @b + @a rhs </td></tr>
|
||||
<tr><td> @a lhs @b - @a rhs </td></tr>
|
||||
<tr><td bgcolor="#ffc4c4"> @a `lhs` @b `+` @a `rhs` </td></tr>
|
||||
<tr><td bgcolor="#ffc4c4"> @a `lhs` @b `-` @a `rhs` </td></tr>
|
||||
</table>
|
||||
@par
|
||||
After @ref axtypeprecedence "implicit conversion", the result of the binary
|
||||
operation with the arithmetic `+` (@ref axtokens "plus token") is the sum of
|
||||
the operands, and the result of the binary operation with the arithmetic `-`
|
||||
operation with the arithmetic @b `+` (@ref axtokens "plus token") is the sum of
|
||||
the operands, and the result of the binary operation with the arithmetic @b `-`
|
||||
(@ref axtokens "minus token") token is the second operand subtracted from the
|
||||
first operand. The following combination of AX type categories are supported for
|
||||
additive operations (if an operation is not listed, it is not supported):
|
||||
@@ -853,19 +870,19 @@ c - b; // valid vec - scalar
|
||||
The binary multiplicative operands have the following forms:
|
||||
@par
|
||||
<table>
|
||||
<tr><td> @a lhs `*` @a rhs </td></tr>
|
||||
<tr><td> @a lhs `/` @a rhs </td></tr>
|
||||
<tr><td> @a lhs `%` @a rhs </td></tr>
|
||||
<tr><td bgcolor="#ffc4c4"> @a `lhs` @b `*` @a `rhs` </td></tr>
|
||||
<tr><td bgcolor="#ffc4c4"> @a `lhs` @b `/` @a `rhs` </td></tr>
|
||||
<tr><td bgcolor="#ffc4c4"> @a `lhs` @b `%` @a `rhs` </td></tr>
|
||||
</table>
|
||||
@par
|
||||
After @ref axtypeprecedence "implicit conversion", the result of the binary
|
||||
operation:
|
||||
- with the arithmetic `*` (@ref axtokens "asterisk token") is:
|
||||
- with the arithmetic @b `*` (@ref axtokens "asterisk token") is:
|
||||
- the product of the operands
|
||||
- @b OR performs matrix multiplication for vector and matrix types.
|
||||
- with the arithmetic `/` (@ref axtokens "forward slash token") is the first
|
||||
- with the arithmetic @b `/` (@ref axtokens "forward slash token") is the first
|
||||
operand divided by the second operand.
|
||||
- with the arithmetic `%` (@ref axtokens "percentage token") is the
|
||||
- with the arithmetic @b `%` (@ref axtokens "percentage token") is the
|
||||
@b floored modulo operations .i.e. the expression `d % D` returns the result
|
||||
`D - d * floor(D/d)`. This is in contrast to truncated modulo operations
|
||||
`D - d * (D/d)` where the division is truncated.
|
||||
@@ -877,7 +894,7 @@ mean that the relationship properties between `%` and `/` differ when either
|
||||
@b `d` or @b `D` is negative. i.e.:
|
||||
`(d/D)*D + (d%D) != d`
|
||||
@note
|
||||
The multiplicative operation `*` has important behaviour for vectors and
|
||||
The multiplicative operation @b `*` has important behaviour for vectors and
|
||||
matrix types.
|
||||
@par
|
||||
The following combination of AX type categories are supported for multiplicative
|
||||
@@ -890,7 +907,7 @@ operations (if an operation is not listed, it is not supported):
|
||||
<tr style="text-align:center"><td rowspan="3">@ref axscalars "scalar"</td><td rowspan="2">`* / %`</td><td rowspan="1">@ref axscalars "scalar"</td>
|
||||
<td style="text-align:left">Returns the result of the scalar multiplication, division or remainder of the division respectively. </td>
|
||||
</tr>
|
||||
<tr style="text-align:center"><td>@ref axvecmats "vector"</td>
|
||||
<tr style="text-align:center"><td>@ref axvecmats "vector"</td></td>
|
||||
<td style="text-align:left" rowspan="1">
|
||||
Performs per component binary operations (after
|
||||
@ref axtypeprecedence "implicit conversion") with the left hand side scalar to
|
||||
@@ -1079,27 +1096,27 @@ Floating point multiplication is communicative (`a * b = b * a`) but is not
|
||||
Binary bitwise operations have the following forms:
|
||||
@par
|
||||
<table>
|
||||
<tr><td> @a lhs <b> `&` </b> @a rhs </td></tr>
|
||||
<tr><td> @a lhs <b> `|` </b> @a rhs </td></tr>
|
||||
<tr><td> @a lhs <b> `^` </b> @a rhs </td></tr>
|
||||
<tr><td> @a lhs <b> `<<` </b> @a rhs </td></tr>
|
||||
<tr><td> @a lhs <b> `>>` </b> @a rhs </td></tr>
|
||||
<tr><td bgcolor="#ffc4c4"> @a `lhs` @b `&` @a `rhs` </td></tr>
|
||||
<tr><td bgcolor="#ffc4c4"> @a `lhs` <b> `|` </b> @a `rhs` </td></tr>
|
||||
<tr><td bgcolor="#ffc4c4"> @a `lhs` @b `^` @a `rhs` </td></tr>
|
||||
<tr><td bgcolor="#ffc4c4"> @a `lhs` @b `<<` @a `rhs` </td></tr>
|
||||
<tr><td bgcolor="#ffc4c4"> @a `lhs` @b `>>` @a `rhs` </td></tr>
|
||||
</table>
|
||||
@par
|
||||
These operations only run on @b integral operands. After @ref axtypeprecedence
|
||||
"implicit conversion", the result of the binary operation:
|
||||
- with the @b & (@ref axtokens "ampersand token") is the result of the
|
||||
- with the @b `&` (@ref axtokens "ampersand token") is the result of the
|
||||
logical AND operation on each pair of the corresponding bits of the input
|
||||
operands.
|
||||
- with the <b> | </b> (@ref axtokens "pipe token") is the result of the
|
||||
- with the <b> `|` </b> (@ref axtokens "pipe token") is the result of the
|
||||
logical OR operation on each pair of the corresponding bits of the input
|
||||
operands.
|
||||
- with the @b ^ (@ref axtokens "hat token") is the result of the
|
||||
- with the @b `^` (@ref axtokens "hat token") is the result of the
|
||||
logical XOR operation on each pair of the corresponding bits of the input
|
||||
operands.
|
||||
- with the @b << (@ref axtokens "less than tokens") is the value shifted left
|
||||
- with the @b `<<` (@ref axtokens "less than tokens") is the value shifted left
|
||||
with zeros shifted in on the right.
|
||||
- with the @b >> (@ref axtokens "greater than tokens") is the value shifted
|
||||
- with the @b `>>` (@ref axtokens "greater than tokens") is the value shifted
|
||||
right with zeros shifted in on the left.
|
||||
@par
|
||||
<table>
|
||||
@@ -1127,17 +1144,17 @@ is of type @b `bool`. Binary comparison operations have the following forms:
|
||||
@par
|
||||
<table>
|
||||
<tr><th>Operator Name</th><th>Operator Syntax</th><th>Returns</th></tr>
|
||||
<tr><td>Equal to</td><td> @a lhs <b>`==`</b> @a rhs </td>
|
||||
<tr><td>Equal to</td><td bgcolor="#ffc4c4"> @a `lhs` <b>`==`</b> @a `rhs` </td>
|
||||
<td>Returns `true` if both operands are equal</td></tr>
|
||||
<tr><td>Not equal to</td><td> @a lhs <b>`!=`</b> @a rhs </td>
|
||||
<tr><td>Not equal to</td><td bgcolor="#ffc4c4"> @a `lhs` <b>`!=`</b> @a `rhs` </td>
|
||||
<td>Returns `true` if operands are not equal</td></tr>
|
||||
<tr><td>Less than</td><td> @a lhs <b>`<`</b> @a rhs </td>
|
||||
<tr><td>Less than</td><td bgcolor="#ffc4c4"> @a `lhs` <b>`<`</b> @a `rhs` </td>
|
||||
<td>Returns `true` the left hand side value is less than the right hand side</td></tr>
|
||||
<tr><td>Greater than</td><td> @a lhs <b>`>`</b> @a rhs </td>
|
||||
<tr><td>Greater than</td><td bgcolor="#ffc4c4"> @a `lhs` <b>`>`</b> @a `rhs` </td>
|
||||
<td>Returns `true` the left hand side value is greater than the right hand side</td></tr>
|
||||
<tr><td>Less than or equal to</td><td> @a lhs <b>`<=`</b> @a rhs </td>
|
||||
<tr><td>Less than or equal to</td><td bgcolor="#ffc4c4"> @a `lhs` <b>`<=`</b> @a `rhs` </td>
|
||||
<td>Returns `true` the left hand side value is less than or equal to the right hand side</td></tr>
|
||||
<tr><td>Greater than or equal to</td><td> @a lhs <b>`>=`</b> @a rhs </td>
|
||||
<tr><td>Greater than or equal to</td><td bgcolor="#ffc4c4"> @a `lhs` <b>`>=`</b> @a `rhs` </td>
|
||||
<td>Returns `true` the left hand side value is greater than or equal to the right hand side</td></tr>
|
||||
</table>
|
||||
@par
|
||||
@@ -1148,11 +1165,10 @@ operations (if an operation is not listed, it is not supported):
|
||||
<tr style="text-align:center">
|
||||
<th>Left Operand Type</th><th>Binary Op(s)</th><th>Right Operand Type</th><th>Description</th>
|
||||
</tr>
|
||||
<tr style="text-align:center"><td rowspan="3">@ref axscalars "scalar"</td><td rowspan="1">`== != < > <= >=`</td><td>@ref axscalars "scalar"</td>
|
||||
<tr style="text-align:center"><td rowspan="3">@ref axscalars "scalar"</td><td rowspan="3">`== != < > <= >=`</td><td>@ref axscalars "scalar"</td>
|
||||
<td style="text-align:left">Returns the result of the scalar comparison.</td>
|
||||
</tr>
|
||||
<tr style="text-align:center">
|
||||
<td rowspan="2">`== !=`</td>
|
||||
<td>@ref axvecmats "vector"</td>
|
||||
<td style="text-align:left" rowspan="2">
|
||||
Performs per component comparisons (after
|
||||
@@ -1179,12 +1195,11 @@ for (int i = 1; i < 3; ++i) c &= a[i] == b;
|
||||
</tr>
|
||||
<tr style="text-align:center">
|
||||
<td style="border-top-width: thick" rowspan="2">@ref axvecmats "vector"</td>
|
||||
<td style="border-top-width: thick; text-align:center" rowspan="1">`== != < > <= >=`</td>
|
||||
<td style="border-top-width: thick; text-align:center" rowspan="2">`== != < > <= >=`</td>
|
||||
<td style="border-top-width: thick">@ref axscalars "scalar"</td>
|
||||
<td style="border-top-width: thick;text-align:left">Same as `scalar op vector`</td>
|
||||
</tr>
|
||||
<tr style="text-align:center">
|
||||
<td rowspan="1">`== !=`</td>
|
||||
<td>@ref axvecmats "vector"</td>
|
||||
<td style="text-align:left">
|
||||
Performs binary comparison operations (after
|
||||
@@ -1205,13 +1220,11 @@ for (int i = 1; i < 3; ++i) c &= a[i] == b[i];
|
||||
</tr>
|
||||
<tr style="text-align:center">
|
||||
<td style="border-top-width: thick" rowspan="2">@ref axvecmats "matrix"</td>
|
||||
<td style="border-top-width: thick; text-align:center" rowspan="1">`== != < > <= >=`</td>
|
||||
<td style="border-top-width: thick; text-align:center" rowspan="2">`== != < > <= >=`</td>
|
||||
<td style="border-top-width: thick">@ref axscalars "scalar"</td>
|
||||
<td style="border-top-width: thick;text-align:left">Same as `scalar op matrix`</td>
|
||||
</tr>
|
||||
<tr style="text-align:center">
|
||||
<td rowspan="1">`== !=`</td>
|
||||
<td>@ref axvecmats "matrix"</td>
|
||||
<tr style="text-align:center"><td>@ref axvecmats "matrix"</td>
|
||||
<td style="text-align:left">
|
||||
Performs binary comparison operations (after
|
||||
@ref axtypeprecedence "implicit conversion") on each pair corresponding
|
||||
@@ -1247,10 +1260,10 @@ They have the following forms:
|
||||
@par
|
||||
<table>
|
||||
<tr><th>Operator Name</th><th>Operator Syntax</th><th>Returns</th></tr>
|
||||
<tr><td>AND</td><td> @a lhs <b>`&&`</b> @a rhs </td>
|
||||
<tr><td>AND</td><td bgcolor="#ffc4c4"> @a `lhs` <b>`&&`</b> @a `rhs` </td>
|
||||
<td>Returns true if both operands are true. Otherwise, the result is false. This
|
||||
operator is short-circuiting.</td></tr>
|
||||
<tr><td>Inclusive OR</td><td> @a lhs <b>`||`</b> @a rhs </td>
|
||||
<tr><td>Inclusive OR</td><td bgcolor="#ffc4c4"> @a `lhs` <b>`||`</b> @a `rhs` </td>
|
||||
<td>Returns true if either the first or the second operand is true. This operator
|
||||
is short-circuiting.</td></tr>
|
||||
</table>
|
||||
@@ -1283,14 +1296,14 @@ Arithmetic unary operators are comprised of arithemtic and bitwise operators.
|
||||
@par
|
||||
<table>
|
||||
<tr><th>Operator Name</th><th>Operator Syntax</th><th>Returns</th></tr>
|
||||
<tr><td>Unary plus</td><td> `+a` </td>
|
||||
<td>Returns the value of its operand, `a`</td>
|
||||
<tr><td>Unary plus</td><td bgcolor="#ffc4c4"> <b>`+`</b>@a `a` </td>
|
||||
<td>Returns the value of its operand, @b `a`</td>
|
||||
</tr>
|
||||
<tr><td>Unary minus</td><td> `-a` </td>
|
||||
<td>Returns the negative representation of `a`</td>
|
||||
<tr><td>Unary minus</td><td bgcolor="#ffc4c4"> <b>`-`</b>@a `a` </td>
|
||||
<td>Returns the negative representation of @b `a`</td>
|
||||
</tr>
|
||||
<tr><td>Bitwise NOT</td><td> `~a` </td>
|
||||
<td>Returns the bitwise NOT (one's complement) value of `a`. This operator
|
||||
<tr><td>Bitwise NOT</td><td bgcolor="#ffc4c4"> <b>`~`</b>@a `a` </td>
|
||||
<td>Returns the bitwise NOT (one's complement) value of @b `a`. This operator
|
||||
is only valid on integral element types.</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -1348,7 +1361,7 @@ Logical unary operators consist of a single operand.
|
||||
@par
|
||||
<table>
|
||||
<tr><th>Operator Name</th><th>Operator Syntax</th><th>Returns</th></tr>
|
||||
<tr><td>Logical NOT</td><td> `!a` </td>
|
||||
<tr><td>Logical NOT</td><td bgcolor="#ffc4c4"> <b>`!`</b>@a `a` </td>
|
||||
<td>Returns true if the operand is false. Otherwise, returns false.</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -1392,10 +1405,10 @@ each component of a vector or matrix. They have the following forms:
|
||||
@par
|
||||
<table>
|
||||
<tr><th>Operator Name</th><th>Operator Syntax</th><th>Returns</th></tr>
|
||||
<tr><td>Pre-increment</td><td> `++a` </td><td>Returns a reference to the incremented result.</td>
|
||||
<tr><td>Post-increment</td><td> `a++` </td><td>Returns a copy of the incremented result.</td>
|
||||
<tr><td>Pre-decrement</td><td> `--a` </td><td>Returns a reference to the decremented result.</td>
|
||||
<tr><td>Post-decrement</td><td> `a--` </td><td>Returns a copy of the decremented result.</td>
|
||||
<tr><td>Pre-increment</td><td bgcolor="#ffc4c4"> <b>`++`</b>@a `a` </td><td>Returns a reference to the incremented result.</td>
|
||||
<tr><td>Post-increment</td><td bgcolor="#ffc4c4">@a `a`<b>`++`</b> </td><td>Returns a copy of the incremented result.</td>
|
||||
<tr><td>Pre-decrement</td><td bgcolor="#ffc4c4"> <b>`--`</b>@a `a` </td><td>Returns a reference to the decremented result.</td>
|
||||
<tr><td>Post-decrement</td><td bgcolor="#ffc4c4"> @a `a`<b>`--`</b> </td><td>Returns a copy of the decremented result.</td>
|
||||
</tr>
|
||||
</table>
|
||||
@par
|
||||
@@ -1427,20 +1440,20 @@ the following forms:
|
||||
<tr><th>Operator Name</th><th>Operator Syntax</th><th>Returns</th></tr>
|
||||
<tr style="text-align:left">
|
||||
<td>Dot Component Access</td>
|
||||
<td> <em>`vector`</em> <b>.</b> `component` </td>
|
||||
<td>Reference to component `component` of `vector`</td>
|
||||
<td bgcolor="#ffc4c4"> <em>`vector`</em> <b>.</b> @a `component` </td>
|
||||
<td>Reference to component @a `component` of @a `vector`</td>
|
||||
</tr>
|
||||
<tr style="text-align:left">
|
||||
<td>Container Component Access</td>
|
||||
<td> <em>`container`</em> <b>[</b> `exp` <b>]</b> </td>
|
||||
<td>Reference to component at index `exp` of `container`</td>
|
||||
<td bgcolor="#ffc4c4"> <em>`container`</em> <b>[</b> @a `exp` <b>]</b> </td>
|
||||
<td>Reference to component at index @a `exp` of @a `container`</td>
|
||||
</tr>
|
||||
<tr style="text-align:left">
|
||||
<td>Matrix Component Access</td>
|
||||
<td> <em>`matrix`</em> <b>[</b> `exp1`, <em>`exp2`</em> <b>]</b> </td>
|
||||
<td bgcolor="#ffc4c4"> <em>`matrix`</em> <b>[</b> @a `exp1`, <em>`exp2`</em> <b>]</b> </td>
|
||||
<td>Reference to component in row <b><em>`exp1`</em></b>, column <b><em>`exp2`</em></b>.
|
||||
Also equal to returning a reference to component at index: <b><em> `[exp1 * dimension + exp2]` </em></b>
|
||||
of `matrix` where `dimension` is the the size of the matrix</td>
|
||||
Also equal to returning a reference to component at index: <b><em> `[exp1 * dimension + exp2]` </em></b>
|
||||
of @a `matrix` where @a `dimension` is the the size of the matrix</td>
|
||||
</tr>
|
||||
</table>
|
||||
@par
|
||||
@@ -1454,11 +1467,11 @@ container.
|
||||
The dot operator <b>.</b> is only valid for vector types. It has the form:
|
||||
@par
|
||||
<table><tr>
|
||||
<td> `vector` <b>.</b> `component` </td>
|
||||
<td bgcolor="#ffc4c4"> @a `vector` <b>.</b> @a `component` </td>
|
||||
</tr></table>
|
||||
@par
|
||||
Where component is one of the below supported component letters. It only provides
|
||||
access for the first three elements of any vector (for `vec2` types, only the
|
||||
access for the first three elements of any vector (for @b `vec2` types, only the
|
||||
first 2 components are accessible). Accessing a vector using the dot operator is
|
||||
fundamentally the same as using the <b>`[]`</b> operator with the corresponding
|
||||
integer index.
|
||||
@@ -1475,12 +1488,12 @@ a_{0}\quad a_{1}\quad a_{2}
|
||||
@f]
|
||||
| Component | Access Index | Result |
|
||||
|:-----------:|:--------------:|:-------------:|
|
||||
| `A.x` | 0 | @f$ a_{0} @f$ |
|
||||
| `A.r` | 0 | @f$ a_{0} @f$ |
|
||||
| `A.y` | 1 | @f$ a_{1} @f$ |
|
||||
| `A.g` | 1 | @f$ a_{1} @f$ |
|
||||
| `A.z` | 2 | @f$ a_{2} @f$ |
|
||||
| `A.b` | 2 | @f$ a_{2} @f$ |
|
||||
| @b `A.x` | 0 | @f$ a_{0} @f$ |
|
||||
| @b `A.r` | 0 | @f$ a_{0} @f$ |
|
||||
| @b `A.y` | 1 | @f$ a_{1} @f$ |
|
||||
| @b `A.g` | 1 | @f$ a_{1} @f$ |
|
||||
| @b `A.z` | 2 | @f$ a_{2} @f$ |
|
||||
| @b `A.b` | 2 | @f$ a_{2} @f$ |
|
||||
</center>
|
||||
@par
|
||||
This operator can provide more immediately readability when working with
|
||||
@@ -1490,12 +1503,12 @@ expressions that focus on colour or Cartesian coordinate systems.
|
||||
The <b>`[]`</b> operator is valid for both vectors and matrices. It has the form:
|
||||
@par
|
||||
<table><tr>
|
||||
<td> `container` <b>[</b><em>`exp`</em><b>]</b> </td>
|
||||
<td bgcolor="#ffc4c4"> @a `container` <b>[</b><em>`exp`</em><b>]</b> </td>
|
||||
</tr></table>
|
||||
@par
|
||||
`exp` is expected to evaluate to a value which is castable to an integer
|
||||
@a `exp` is expected to evaluate to a value which is castable to an integer
|
||||
following the @ref axopassignment "assignment casting" rules and falls within
|
||||
the valid size of the `container`. <b>No bounds checking is performed</b>.
|
||||
the valid size of the @a `container`. <b>No bounds checking is performed</b>.
|
||||
@par
|
||||
As matrices are also an array of contigous values, they can be accessed in the
|
||||
same way. This can make some operations much simplier; a typical example being
|
||||
@@ -1516,16 +1529,16 @@ for (int i = 0; i < 16; ++i) b[i] = i;
|
||||
The <b>`[,]`</b> operator is only valid for matrices. It has the form:
|
||||
@par
|
||||
<table><tr>
|
||||
<td> `matrix` <b>[</b><em>`exp1`</em>, <em>`exp2`</em><b>]</b> </td>
|
||||
<td bgcolor="#ffc4c4"> @a `matrix` <b>[</b><em>`exp1`</em>, <em>`exp2`</em><b>]</b> </td>
|
||||
</tr></table>
|
||||
@par
|
||||
`exp1` and `exp2` are expected to evaluate to a value which is castable to
|
||||
@a `exp1` and @a `exp2` are expected to evaluate to a value which is castable to
|
||||
an integer following the @ref axopassignment "assignment casting" rules and
|
||||
falls within the valid size of the `matrix` dimensions. <b>No bounds checking
|
||||
falls within the valid size of the @a `matrix` dimensions. <b>No bounds checking
|
||||
is performed</b>. In general it is more readable to use this operator when
|
||||
accessing specific elements, where `exp1` is the row index and `exp2` is
|
||||
accessing specific elements, where @b `exp1` is the row index and @b `exp2` is
|
||||
the column index. The tables below show the different access patterns for
|
||||
`3x3` and `4x4` matrices.
|
||||
@b `3x3` and @b `4x4` matrices.
|
||||
@par
|
||||
<!-- A -->@code{.c}
|
||||
mat3f a;
|
||||
@@ -1538,26 +1551,22 @@ for (int i = 0; i < 3; ++i)
|
||||
<tr style="text-align:center">
|
||||
<td style="border:none" colspan=3>
|
||||
@f[
|
||||
{
|
||||
A=\begin{bmatrix}
|
||||
a_{00}\quad a_{01}\quad a_{02}\\
|
||||
a_{10}\quad a_{11}\quad a_{12}\\
|
||||
a_{20}\quad a_{21}\quad a_{22}\\
|
||||
\end{bmatrix}
|
||||
}
|
||||
@f]
|
||||
</td>
|
||||
<td style="border:none"></td>
|
||||
<td style="border:none" colspan=3>
|
||||
@f[
|
||||
{
|
||||
A=\begin{bmatrix}
|
||||
a_{00}\quad a_{01}\quad a_{02}\quad a_{03}\\
|
||||
a_{10}\quad a_{11}\quad a_{12}\quad a_{13}\\
|
||||
a_{20}\quad a_{21}\quad a_{22}\quad a_{23}\\
|
||||
a_{30}\quad a_{31}\quad a_{32}\quad a_{33}\\
|
||||
\end{bmatrix}
|
||||
}
|
||||
@f]
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1571,62 +1580,112 @@ a_{30}\quad a_{31}\quad a_{32}\quad a_{33}\\
|
||||
<th>Result</th>
|
||||
</tr>
|
||||
<tr style="text-align:center">
|
||||
<td>`A[0]`</td><td>`A[0,0]`</td><td>@f$ a_{00} @f$</td>
|
||||
<td>`A[0]`</td><td>`A[0,0]`</td><td>@f$ a_{00} @f$</td>
|
||||
<td><code>A[0]</code></td>
|
||||
<td><code>A[0,0]</code></td>
|
||||
<td>@f$ a_{00} @f$</td>
|
||||
<td><code>A[0]</code></td>
|
||||
<td><code>A[0,0]</code></td>
|
||||
<td>@f$ a_{00} @f$</td>
|
||||
</tr>
|
||||
<tr style="text-align:center">
|
||||
<td>`A[1]`</td><td>`A[0,1]`</td><td>@f$ a_{01} @f$</td>
|
||||
<td>`A[1]`</td><td>`A[0,1]`</td><td>@f$ a_{01} @f$</td>
|
||||
<td><code>A[1]</code></td>
|
||||
<td><code>A[0,1]</code></td>
|
||||
<td>@f$ a_{01} @f$</td>
|
||||
<td><code>A[1]</code></td>
|
||||
<td><code>A[0,1]</code></td>
|
||||
<td>@f$ a_{01} @f$</td>
|
||||
</tr>
|
||||
<tr style="text-align:center">
|
||||
<td>`A[2]`</td><td>`A[0,2]`</td><td>@f$ a_{02} @f$</td>
|
||||
<td>`A[2]`</td><td>`A[0,2]`</td><td>@f$ a_{02} @f$</td>
|
||||
<td><code>A[2]</code></td>
|
||||
<td><code>A[0,2]</code></td>
|
||||
<td>@f$ a_{02} @f$</td>
|
||||
<td><code>A[2]</code></td>
|
||||
<td><code>A[0,2]</code></td>
|
||||
<td>@f$ a_{02} @f$</td>
|
||||
</tr>
|
||||
<tr style="text-align:center">
|
||||
<td>`A[3]`</td><td>`A[1,0]`</td><td>@f$ a_{10} @f$</td>
|
||||
<td>`A[3]`</td><td>`A[0,3]`</td><td>@f$ a_{03} @f$</td>
|
||||
<td><code>A[3]</code></td>
|
||||
<td><code>A[1,0]</code></td>
|
||||
<td>@f$ a_{10} @f$</td>
|
||||
<td><code>A[3]</code></td>
|
||||
<td><code>A[0,3]</code></td>
|
||||
<td>@f$ a_{03} @f$</td>
|
||||
</tr>
|
||||
<tr style="text-align:center">
|
||||
<td>`A[4]`</td><td>`A[1,1]`</td><td>@f$ a_{10} @f$</td>
|
||||
<td>`A[4]`</td><td>`A[1,0]`</td><td>@f$ a_{10} @f$</td>
|
||||
<td><code>A[4]</code></td>
|
||||
<td><code>A[1,1]</code></td>
|
||||
<td>@f$ a_{10} @f$</td>
|
||||
<td><code>A[4]</code></td>
|
||||
<td><code>A[1,0]</code></td>
|
||||
<td>@f$ a_{10} @f$</td>
|
||||
</tr>
|
||||
<tr style="text-align:center">
|
||||
<td>`A[5]`</td><td>`A[1,2]`</td><td>@f$ a_{12} @f$</td>
|
||||
<td>`A[5]`</td><td>`A[1,1]`</td><td>@f$ a_{11} @f$</td>
|
||||
<td><code>A[5]</code></td>
|
||||
<td><code>A[1,2]</code></td>
|
||||
<td>@f$ a_{12} @f$</td>
|
||||
<td><code>A[5]</code></td>
|
||||
<td><code>A[1,1]</code></td>
|
||||
<td>@f$ a_{11} @f$</td>
|
||||
</tr>
|
||||
<tr style="text-align:center">
|
||||
<td>`A[6]`</td><td>`A[2,0]`</td><td>@f$ a_{20} @f$</td>
|
||||
<td>`A[6]`</td><td>`A[1,2]`</td><td>@f$ a_{12} @f$</td>
|
||||
<td><code>A[6]</code></td>
|
||||
<td><code>A[2,0]</code></td>
|
||||
<td>@f$ a_{20} @f$</td>
|
||||
<td><code>A[6]</code></td>
|
||||
<td><code>A[1,2]</code></td>
|
||||
<td>@f$ a_{12} @f$</td>
|
||||
</tr>
|
||||
<tr style="text-align:center">
|
||||
<td>`A[7]`</td><td>`A[2,1]`</td><td>@f$ a_{21} @f$</td>
|
||||
<td>`A[7]`</td><td>`A[1,3]`</td><td>@f$ a_{13} @f$</td>
|
||||
<td><code>A[7]</code></td>
|
||||
<td><code>A[2,1]</code></td>
|
||||
<td>@f$ a_{21} @f$</td>
|
||||
<td><code>A[7]</code></td>
|
||||
<td><code>A[1,3]</code></td>
|
||||
<td>@f$ a_{13} @f$</td>
|
||||
</tr>
|
||||
<tr style="text-align:center">
|
||||
<td>`A[8]`</td><td>`A[2,2]`</td><td>@f$ a_{22} @f$</td>
|
||||
<td>`A[8]`</td><td>`A[2,0]`</td><td>@f$ a_{20} @f$</td>
|
||||
<td><code>A[8]</code></td>
|
||||
<td><code>A[2,2]</code></td>
|
||||
<td>@f$ a_{22} @f$</td>
|
||||
<td><code>A[8]</code></td>
|
||||
<td><code>A[2,0]</code></td>
|
||||
<td>@f$ a_{20} @f$</td>
|
||||
</tr> <!-- ******************** MAT4 DATA ONLY ******************** -->
|
||||
<tr style="text-align:center">
|
||||
<td style="border:right;" colspan="4" rowspan="7"></td>
|
||||
<td>`A[9]`</td><td>`A[2,1]`</td><td>@f$ a_{21} @f$</td>
|
||||
<td style="border:none;" colspan="3" rowspan="7"></td>
|
||||
<td><code>A[9]</code></td>
|
||||
<td><code>A[2,1]</code></td>
|
||||
<td>@f$ a_{21} @f$</td>
|
||||
</tr>
|
||||
<tr style="text-align:center">
|
||||
<td>`A[10]`</td><td>`A[2,2]`</td><td>@f$ a_{22} @f$</td>
|
||||
<td><code>A[10]</code></td>
|
||||
<td><code>A[2,2]</code></td>
|
||||
<td>@f$ a_{22} @f$</td>
|
||||
</tr>
|
||||
<tr style="text-align:center">
|
||||
<td>`A[11]`</td><td>`A[2,3]`</td><td>@f$ a_{23} @f$</td>
|
||||
<td><code>A[11]</code></td>
|
||||
<td><code>A[2,3]</code></td>
|
||||
<td>@f$ a_{23} @f$</td>
|
||||
</tr>
|
||||
<tr style="text-align:center">
|
||||
<td>`A[12]`</td><td>`A[3,0]`</td><td>@f$ a_{30} @f$</td>
|
||||
<td><code>A[12]</code></td>
|
||||
<td><code>A[3,0]</code></td>
|
||||
<td>@f$ a_{30} @f$</td>
|
||||
</tr>
|
||||
<tr style="text-align:center">
|
||||
<td>`A[13]`</td><td>`A[3,1]`</td><td>@f$ a_{31} @f$</td>
|
||||
<td><code>A[13]</code></td>
|
||||
<td><code>A[3,1]</code></td>
|
||||
<td>@f$ a_{31} @f$</td>
|
||||
</tr>
|
||||
<tr style="text-align:center">
|
||||
<td>`A[14]`</td><td>`A[3,2]`</td><td>@f$ a_{32} @f$</td>
|
||||
<td><code>A[14]</code></td>
|
||||
<td><code>A[3,2]</code></td>
|
||||
<td>@f$ a_{32} @f$</td>
|
||||
</tr>
|
||||
<tr style="text-align:center">
|
||||
<td>`A[15]`</td><td>`A[3,3]`</td><td>@f$ a_{33} @f$</td>
|
||||
<td><code>A[15]</code></td>
|
||||
<td><code>A[3,3]</code></td>
|
||||
<td>@f$ a_{33} @f$</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@@ -1640,27 +1699,22 @@ section. They have the following forms:
|
||||
<tr><th>Operator Name</th><th>Operator Syntax</th><th>Returns</th></tr>
|
||||
<tr style="text-align:left">
|
||||
<td>Call / Explicit Cast</td>
|
||||
<td> `a(...)` </td>
|
||||
<td bgcolor="#ffc4c4"> <em>`a`</em><b>`(...)`</b></td>
|
||||
<td>Returns the result of a function call or inbuilt explicit cast</td>
|
||||
</tr>
|
||||
<tr style="text-align:left">
|
||||
<td>Comma</td>
|
||||
<td> `a, b, ...` </td>
|
||||
<td>Returns the value of the last expression after chained evaluation</td>
|
||||
<td bgcolor="#ffc4c4"> <em>`a`</em><b>,</b> <em>`b`</em></td>
|
||||
<td>Returns the value of @b `b` after chained evaluation</td>
|
||||
</tr>
|
||||
<tr style="text-align:left">
|
||||
<td>Ternary Conditional</td>
|
||||
<td> `a ? b : c` </td>
|
||||
<td> `b` if `a` is true, `c` otherwise.</td>
|
||||
</tr>
|
||||
<tr style="text-align:left">
|
||||
<td>Ternary Conditional</td>
|
||||
<td> `a ? : c` </td>
|
||||
<td> `a` if `a` is true, `c` otherwise.</td>
|
||||
<td bgcolor="#ffc4c4"> <em>`a`</em> <b>`?`</b> <em>`b`</em> <b>`:`</b><em>`c`</em></td>
|
||||
<td>@b `b` if @b `a` is @b true, @b `c` otherwise.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Vector/Matrix Initializer</td>
|
||||
<td>`{ a, b, ... }`</td>
|
||||
<td bgcolor="#ffc4c4"> <b>`{`</b> <em> `a, `</em> `b `<b>`... }`</b> </td>
|
||||
<td>Returns a temporary vector or matrix</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -1670,10 +1724,10 @@ The function call operator provides the ability to invoke functions @b or invoke
|
||||
a supported explicit cast. It has the form:
|
||||
@par
|
||||
<table><tr>
|
||||
<td> `func(a, b, c, ...)` </td>
|
||||
<td bgcolor="#ffc4c4"> <em> `func(a, b, c, ...)` </em></td>
|
||||
</tr></table>
|
||||
@par
|
||||
Where `func` is a function name @b or a valid explicit cast typename. Explicit
|
||||
Where @b `func` is a function name @b or a valid explicit cast typename. Explicit
|
||||
casts are only supported for @ref axscalars "scalar types". For example:
|
||||
<!-- A -->@code{.c}
|
||||
int a = int(1.1f);
|
||||
@@ -1682,7 +1736,7 @@ a = int(b.x);
|
||||
@endcode
|
||||
@par
|
||||
Whilst explicit casts take only a single argument, the operator itself supports
|
||||
multiple or empty arguments for function calls. When multiple arguments are
|
||||
multiple or empty arguments for function calls. Whe multiple arguments are
|
||||
provided, they are parsed from first to last and processed in reverse order.
|
||||
@b However, the order of runtime evaluation is @b unspecified i.e. they may
|
||||
evaluate in any order. Each function parameter is initialized with its
|
||||
@@ -1695,10 +1749,10 @@ functions.
|
||||
The Comma operator has the form:
|
||||
@par
|
||||
<table><tr>
|
||||
<td>`a, b, ...`</td>
|
||||
<td bgcolor="#ffc4c4"><em>`a`</em><b>`,` </b><em>`b`</em></td>
|
||||
</tr></table>
|
||||
@par
|
||||
Where `a` and `b` are expressions. Chained expressions evaluate each
|
||||
Where @b `a` and @b `b` are expressions. Chained expressions evaluate each
|
||||
expression in syntactical order (first to last), discarding any return value
|
||||
except for the last expression, which is returned from the entire list. Note that
|
||||
although return values for any expression but the last are discarded, their side
|
||||
@@ -1722,33 +1776,32 @@ The ternary conditional operator can be thought of as an in-line @ref axbranchin
|
||||
a single expression that will be returned. It has the form:
|
||||
@par
|
||||
<table><tr>
|
||||
<td>`a ? b : c`</td>
|
||||
<td bgcolor="#ffc4c4"><em>`a`</em> <b>`?`</b> <em>`b`</em> <b>`:`</b><em>`c`</em></td>
|
||||
</tr></table>
|
||||
Where @b `a` is the condition, evaluated and converted to @b bool, and @b `b` and @b
|
||||
`c` are expressions of the same or implicit-castable types. @b `b` is evaluated and
|
||||
returned if the condition is @b true, @b `c` is evaluated and returned if the
|
||||
condition is @b false. Only the expression out of @b `b` and @b `c` that is
|
||||
returned will be evaluated. Expressions with no return value (a.k.a @b `void`)
|
||||
are supported as long as @b `b` and @b `c` are both of this type.
|
||||
@par
|
||||
Where `a` is the condition, evaluated and converted to @b bool, and `b` and
|
||||
`c` are expressions of the same or implicit-castable types. `b` is evaluated and
|
||||
returned if the condition is @b true, `c` is evaluated and returned if the
|
||||
condition is @b false. Only the expression out of `b` and `c` that is
|
||||
returned will be evaluated. Expressions with no return value (a.k.a `void`)
|
||||
are supported as long as `b` and `c` are both of this type.
|
||||
@par
|
||||
Also supported is the 'Elvis' operator, `a ? : c` (or `?:`).
|
||||
Here, `a` is evaluated once, and if when converted to @b bool is @b true, `a` is
|
||||
returned, otherwise `c` is evaluated and returned. In this case, `a` and
|
||||
Also supported is the 'Elvis' operator, <b>`a` `?` `:` `c`</b> (or `?:`).
|
||||
Here, @b `a` is evaluated once, and if when converted to @b bool is @b true, @b `a` is
|
||||
returned, otherwise @b `c` is evaluated and returned. In this case, @b `a` and @b
|
||||
`c` must be the same or implicit-castable types, and both implicit-castable to @b bool.
|
||||
|
||||
@anchor axvecmatinit
|
||||
@par Vector/Matrix Initializer
|
||||
@ref axvecmats "Vectors and matrices" can be represented as local variables (e.g.
|
||||
`vec3f`), external attributes or parameters (e.g. `vec3f@attrib`) or as
|
||||
@b `vec3f`), external attributes or parameters (e.g. @b `vec3f@attrib`) or as
|
||||
temporary values using the vector/matrix initializer syntax. This operator has
|
||||
the form:
|
||||
@par
|
||||
<table><tr>
|
||||
<td> `{ a, b, ... }`</td>
|
||||
<td bgcolor="#ffc4c4"> <b>`{`</b> <em>`a, b `</em><b>`... }`</b> </td>
|
||||
</tr></table>
|
||||
@par
|
||||
Where `a` and `b` are expressions returning a scalar value. When this
|
||||
Where @b `a` and @b `b` are expressions returning a scalar value. When this
|
||||
operator is invoked with a specific number of arguments, a vector or matrix is
|
||||
implicitly created with a copy of those arguments which can be assigned to an
|
||||
existing container of matching size. Expression in the operator are evaluated
|
||||
@@ -1776,7 +1829,7 @@ The temporary container evaluates all expressions and uses the @b highest rankin
|
||||
type (as defined by @ref axtypeprecedence "arithmetic type precedence") to infer
|
||||
the element type of the container, implicitly casting all other types to that
|
||||
type where necessary. In the above example, the temporary created forms a
|
||||
`mat3d`, before being implicitly cast to a `mat3f` due to the assignment.
|
||||
@b `mat3d`, before being implicitly cast to a @b `mat3f` due to the assignment.
|
||||
|
||||
|
||||
@subsection axopprecedence Operator Precedence
|
||||
@@ -1947,10 +2000,10 @@ can be used to assign any scalar a value.
|
||||
@par
|
||||
<table>
|
||||
<tr><th>Type</th><th>Literal Tokens</th></tr>
|
||||
<tr><td>`bool`</td><td>Tokens `true` and `false`</td></tr>
|
||||
<tr><td>`bool`</td><td>Tokens @b `true` and @b `false`</td></tr>
|
||||
<tr><td>`int32`</td><td>No suffix, automatically infered from integral literals</td></tr>
|
||||
<tr><td>`int64`</td><td>The letter `l` e.g. @code int64 a = 10l; @endcode</td></tr>
|
||||
<tr><td>`float`</td><td>The letter `f` e.g. @code float a = 0.0f; @endcode</td></tr>
|
||||
<tr><td>`int64`</td><td>The letter @b `l` e.g. @code int64 a = 10l; @endcode</td></tr>
|
||||
<tr><td>`float`</td><td>The letter @b `f` e.g. @code float a = 0.0f; @endcode</td></tr>
|
||||
<tr><td>`double`</td><td>No suffix, automatically infered from floating point literals.</td></tr>
|
||||
<tr><td>`string`</td><td>Character strings wrapped in double quotes @b \" @b \"</td></tr>
|
||||
</table>
|
||||
@@ -1968,6 +2021,7 @@ can be used to assign any scalar a value.
|
||||
@subsection axattribaccess Attribute Access
|
||||
<!-- codecs not supported, how are points and volumes sampled (point vs volume) -->
|
||||
|
||||
<!--
|
||||
Further, the active states of
|
||||
OpenVDB voxels change which voxels AX will process. The defined behavior for all
|
||||
cases is shown below.
|
||||
@@ -2006,6 +2060,8 @@ foreach(ActiveVoxel in surface)
|
||||
DensityIndexSpaceCoord = density.transformToIndex(SurfaceWorldSpaceCoord);
|
||||
ActiveVoxel = density.getValue(DensityIndexSpaceCoord);
|
||||
@endcode
|
||||
done()
|
||||
-->
|
||||
|
||||
|
||||
@subsection axexternalaccess External Parameter Access
|
||||
@@ -2048,4 +2104,6 @@ AX Roadmap as a near future feature.
|
||||
|
||||
@section axvexsupport AX VEX Support
|
||||
|
||||
</div>
|
||||
|
||||
*/
|
||||
|
||||
+12
-9
@@ -1,8 +1,9 @@
|
||||
/**
|
||||
<div style="width:800px;text-align:justify;">
|
||||
|
||||
@page axcplusplus AX C++ Documentation
|
||||
@page axcplusplus OpenVDB AX
|
||||
|
||||
@section axcdocs Intro
|
||||
@section axcdocs AX C++ Documentation
|
||||
@par
|
||||
The following documentation focuses on the C++ design and API of OpenVDB AX,
|
||||
@b not the front end AX language. For the latter, see the
|
||||
@@ -26,6 +27,7 @@ API doxygen comments or contact us for more information.
|
||||
- @ref vdbaxcompiler
|
||||
- @ref vdbaxbinary
|
||||
- @ref vdbaxtoaxtypes
|
||||
- @ref vdbaxextend
|
||||
|
||||
<hr>
|
||||
|
||||
@@ -116,7 +118,7 @@ parser is accessed through the @b ast module.
|
||||
@par
|
||||
The @b ast module provides:
|
||||
- The complete implemenation of an @ref AST.h "AX abstract syntax tree"
|
||||
- The @vdblink::ax::ast::parse ax::ast::parse()@endlink method
|
||||
- The openvdb::ax::ast::parse() method
|
||||
- The @vdblink::ax::ast::Visitor AST Visitor@endlink
|
||||
- AST scanners and tools
|
||||
@par
|
||||
@@ -126,7 +128,7 @@ The complete AST hierarchy is visualized by the @vdblink::ax::ast::Node doxygen
|
||||
class graph for an openvdb::ax::ast::Node@endlink, which represents the top most
|
||||
node in the AST. The AST API exists in a nested namespace (`openvdb::ax::ast`)
|
||||
and can be used by clients for more granular control and modifications to an AST.
|
||||
Importantly, the AST API contains the `openvdb::ax::ast::parse()` method, which
|
||||
Importantly, the AST API contains the openvdb::ax::ast::parse() method, which
|
||||
invokes the C/C++ functions built by the grammar to iteratively construct an
|
||||
AST from a provided character string.
|
||||
@par
|
||||
@@ -137,7 +139,7 @@ branches. All these methods use the @vdblink::ax::ast::Visitor AX visitor
|
||||
framework@endlink, a visitor pattern traversal class strongly influenced by
|
||||
<A HREF="https://clang.llvm.org/doxygen/classclang_1_1RecursiveASTVisitor.html">
|
||||
Clang's RecursiveVisitor</A>. Clients can use the AX visitor to implement their
|
||||
own AST analysis or modifications.
|
||||
own AST analysis or modifications (see @ref vdbaxextend).
|
||||
|
||||
@subsubsection vdbaxastscanners Scanners
|
||||
@par
|
||||
@@ -283,11 +285,11 @@ AX ASTs to verify access patterns of your data.
|
||||
@subsubsection vdbaxcompilercustomdata Custom Data
|
||||
@par
|
||||
The AX language provides two main tokens to access memory which has not been
|
||||
allocated by AX itself. The first token, `@` (the "at" symbol), is designed to
|
||||
allocated by AX itself. The first token, @b \@ (the "at" symbol), is designed to
|
||||
provide read/write access to geometry attributes. The second token is the dollar
|
||||
character `$`. This allows <b>read only</b> access to custom data that can be
|
||||
character @b $. This allows <b>read only</b> access to custom data that can be
|
||||
modified in C++ i.e. outside the scope of an AX program. In the same way as the
|
||||
`@attribute` syntax, the value of this data can change without the need for AX
|
||||
@b \@attribute syntax, the value of this data can change without the need for AX
|
||||
to re-compile the program. It is, however, solely on the C++ clients of AX to
|
||||
make sure that this data is setup correctly when integrating AX into their
|
||||
applications.
|
||||
@@ -485,9 +487,10 @@ Vec4IGrid::registerGrid();
|
||||
@endcode
|
||||
|
||||
<hr>
|
||||
<!--@section vdbaxextend Extending OpenVDB AX-->
|
||||
@section vdbaxextend Extending OpenVDB AX
|
||||
<!--@subsection vdbaxcustomtraversal Custom AST Traversal-->
|
||||
<!--@subsection vdbaxcustomtraversal Designing an Executable-->
|
||||
<!--@subsection vdbaxcustomtraversal Geometry Callbacks-->
|
||||
<!--@subsection vdbaxcustomtraversal Custom Code Generation-->
|
||||
</div>
|
||||
*/
|
||||
|
||||
+16
-14
@@ -1,4 +1,5 @@
|
||||
/**
|
||||
<div style="width:800px;text-align:justify;">
|
||||
|
||||
@page axexamples AX Code Examples
|
||||
|
||||
@@ -29,12 +30,12 @@ These examples demonstrate how to use AX on OpenVDB points grids.
|
||||
@subsection axexamplepointbasic Basic point attributes
|
||||
@par
|
||||
Below is a small example which demonstrates working with a few point attributes.
|
||||
The `@` symbol is the identifier for an AX attribute. The type of each attribute
|
||||
is specified before the `@` symbol and the name is specified afterwards. For
|
||||
example: `int@count` would imply an @b integer attribute called @b count.
|
||||
The @ symbol is the identifier for an AX attribute. The type of each attribute
|
||||
is specified before the @ symbol and the name is specified afterwards. For
|
||||
example: @b `int@count` would imply an @b integer attribute called @b count.
|
||||
@par
|
||||
In this example there are three point attributes: a @b float attribute @b speed,
|
||||
a `vec3f` float attribute @b velocity and a `vec3f` float attribute @b colour.
|
||||
a @b vec3f float attribute @b velocity and a @b vec3f float attribute @b colour.
|
||||
@par
|
||||
This snippet uses the functions @ref axlength "length" and @ref axfit "fit" to
|
||||
give points a colour between black and white based on their speed.
|
||||
@@ -67,8 +68,8 @@ special attribute.
|
||||
@subsection axexamplepointdelete Deleting Points
|
||||
@par
|
||||
This example demonstrates a simple way of removing points from a VDB points grid.
|
||||
It uses a combination of @ref axrand "rand()" and @ref axdeletepoint "deletepoint()"
|
||||
to randomly delete roughly half of the points in the input VDB points grid.
|
||||
It uses a combination of @ref axrand and @ref axdeletepoint to randomly delete
|
||||
roughly half of the points in the input VDB points grid.
|
||||
@par
|
||||
<!-- P -->@code{.c}
|
||||
float threshold = 0.5f;
|
||||
@@ -82,7 +83,7 @@ if (rand(int64@id) > threshold) {
|
||||
@endcode
|
||||
@par
|
||||
The @b id attribute in this example is assumed to be a unique @b integer for
|
||||
each point in the VDB points grid such that @ref axrand "rand()" will receive a
|
||||
each point in the VDB points grid such that @ref axrand will receive a
|
||||
different seed value per point producing a good distribution of random values.
|
||||
|
||||
@subsection axexamplepointdrag Applying Drag
|
||||
@@ -113,7 +114,7 @@ v@P += v@v * dt;
|
||||
@endcode
|
||||
@par
|
||||
The final AX command, `v@P += v@v * dt;` writes to the position attribute of
|
||||
the points `v@P`. Whenever position is written to in this way, the AX
|
||||
the points @b `v@P`. Whenever position is written to in this way, the AX
|
||||
`PointExecutable` will move (re-bucket) points in PointDataGrids.
|
||||
|
||||
@subsection axexamplepointcurlnoise Curl Noise
|
||||
@@ -197,12 +198,12 @@ These examples demonstrate how to use AX on VDB volume grids.
|
||||
@subsection axexamplevolumeclamp Volume Clamping
|
||||
@par
|
||||
Below is a small example of reading adn writing to voxels within a VDB volume.
|
||||
As with points, the `@` symbol specifies an access to a named volume, with the
|
||||
As with points, the @ symbol specifies an access to a named volume, with the
|
||||
type of each volume preceding it and the name appearing as a suffix. For
|
||||
example: `float@density` would imply a @b float volume called @b density.
|
||||
@par
|
||||
This snippet uses @ref axclamp "clamp()" function to constrain the @b density
|
||||
attribute between zero and one.
|
||||
This snippet uses @ref axclamp function to constrain the @b density attribute
|
||||
between zero and one.
|
||||
@par
|
||||
<!-- V -->@code{.c}
|
||||
float@density = clamp(float@density, 0.f, 1.f);
|
||||
@@ -233,10 +234,10 @@ vec3f@vel += dt * massInverse * vec3f@force;
|
||||
@par
|
||||
Here we demonstrate how AX can be used to blend two volumes together. Note that
|
||||
only the volumes which are written to are executed over. In the below code,
|
||||
only `@surface_a` is written to. This means that the final blended result,
|
||||
only @b `@surface_a` is written to. This means that the final blended result,
|
||||
stored in `surface_a`, will only be updated in `surface_a`'s topology. Should
|
||||
we want a combined blend of @b non @b overlapping areas of both surface `a` and
|
||||
`b`, we would need to activate `a`'s topology with respect to `b` first.
|
||||
we want a combined blend of @b non @b overlapping areas of both surface a and b,
|
||||
we would need to activate a's topology with respect to b first.
|
||||
@par
|
||||
<!-- V -->@code{.c}
|
||||
// time constants for each run.
|
||||
@@ -262,4 +263,5 @@ mask = clamp(mask, 0.0f, 1.0f);
|
||||
@surface_a = a + (b-a) * mask;
|
||||
@endcode
|
||||
|
||||
</div>
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/**
|
||||
<div style="width:800px;text-align:justify;">
|
||||
|
||||
@page axfunctionlist AX Supported Functions
|
||||
|
||||
@@ -720,7 +721,7 @@ double(int64 seed);
|
||||
@anchor axrand32
|
||||
@par rand32
|
||||
Creates a random number based on the provided 32 bit seed. The number will be in the range of 0 to
|
||||
1\. The same number is produced for the same seed. NOTE: This function does not share the same
|
||||
1. The same number is produced for the same seed. NOTE: This function does not share the same
|
||||
random number generator as rand(). rand32() may provide a higher throughput on some
|
||||
architectures, but will produce different results to rand(). NOTE: If rand32 is called without
|
||||
a seed the previous state of the random number generator is advanced for the currently
|
||||
@@ -880,4 +881,6 @@ int64(int64 dividend; int64 divisor);
|
||||
int32(int32 dividend; int32 divisor);
|
||||
@endcode
|
||||
|
||||
|
||||
</div>
|
||||
*/
|
||||
|
||||
+3
-1
@@ -1,4 +1,5 @@
|
||||
/**
|
||||
<div style="width:800px;text-align:justify;">
|
||||
|
||||
@page openvdbax OpenVDB AX
|
||||
|
||||
@@ -40,6 +41,7 @@ provided:
|
||||
@par
|
||||
- @subpage axexamples "Code Examples" for examples of OpenVDB AX in action.
|
||||
- @subpage axfunctionlist "AX Functions" for a list of all available AX functions.
|
||||
- @ref build "Building OpenVDB" and @ref dependencies "OpenVDB Dependencies" for information on building OpenVDB and <b>OpenVDB AX</b>.
|
||||
- @subpage build "Building OpenVDB" and @subpage dependencies "OpenVDB Dependencies" for information on building OpenVDB and <b>OpenVDB AX</b>.
|
||||
|
||||
</div>
|
||||
*/
|
||||
|
||||
+35
-38
@@ -84,12 +84,12 @@ given FindModule e.g. `FindBlosc.cmake`:
|
||||
path on first runs of CMake (i.e. these variables are not
|
||||
[cached](https://cmake.org/cmake/help/latest/command/set.html#set-cache-entry)).
|
||||
They are listed in priority order. Note that the prefix is always capitalized.
|
||||
- @b XXX_INCLUDEDIR / @b XXX_LIBRARYDIR - Preferred include and library
|
||||
directories
|
||||
- @b Xxx_ROOT - Preferred installation prefix. The given dependency is
|
||||
expected to follow a folder structure `Xxx_ROOT/include` and `Xxx_ROOT/lib`
|
||||
exist. Note that unlike the above, this is the case matching name of the
|
||||
find package .i.e. Blosc_ROOT, TBB_ROOT etc.
|
||||
- @b XXX_INCLUDEDIR / @b XXX_LIBRARYDIR - Preferred include and library
|
||||
directories
|
||||
find package .i.e. Blosc_ROOT, IlmBase_ROOT, TBB_ROOT etc.
|
||||
- @b SYSTEM_LIBRARY_PATHS - A list of paths appended to all include and lib
|
||||
searches.
|
||||
- @b XXX_USE_STATIC_LIBS - Only search for static libraries for the given
|
||||
@@ -154,9 +154,6 @@ for this:
|
||||
that were created using blosc compression. This includes OpenVDB files from
|
||||
Houdini.
|
||||
|
||||
See the note in the [known issues list](@ref depKnownIssues) regarding supported
|
||||
versions of blosc.
|
||||
|
||||
@subsection buildZLibSupport ZLIB Support
|
||||
|
||||
ZLIB is an optional dependency of all OpenVDB components. The documented build
|
||||
@@ -191,10 +188,6 @@ OpenVDB AX Library | The OpenVDB AX library
|
||||
OpenVDB AX Binary | Command line binary for running OpenVDB AX code | OPENVDB_BUILD_AX_BINARIES | OFF |
|
||||
OpenVDB AX Grammar | Allows for re-generation of AX grammar, typically not required | OPENVDB_BUILD_AX_GRAMMAR | OFF |
|
||||
OpenVDB AX Unit Tests | OpenVDB AX's Unit Test suite | OPENVDB_BUILD_AX_UNITTESTS | OFF |
|
||||
NanoVDB | NanoVDB headers | OPENVDB_BUILD_NANOVDB | OFF |
|
||||
NanoVDB Tools | NanoVDB command line tools | NANOVDB_BUILD_TOOLS | OFF |
|
||||
NanoVDB Examples | NanoVDB example binaries and benchmarks | NANOVDB_BUILD_EXAMPLES / NANOVDB_BUILD_BENCHMARK | OFF / OFF |
|
||||
NanoVDB Unit Tests | NanoVDB Unit Test suite | NANOVDB_BUILD_UNITTESTS | OFF |
|
||||
Documentation | The OpenVDB doxygen documentation | OPENVDB_BUILD_DOCS | OFF |
|
||||
|
||||
|
||||
@@ -238,8 +231,11 @@ it's a good idea to read the above section on
|
||||
|
||||
DCC | Supported Version | OpenVDB ABI |
|
||||
-------- | ----------------- | ----------- |
|
||||
Houdini | 20.5 | 11 |
|
||||
Houdini | 21.0 | 12 |
|
||||
Houdini | 18.0 | 6 |
|
||||
Houdini | 18.5 | 7 |
|
||||
Maya | 2017 | Any |
|
||||
Maya | 2018 | Any |
|
||||
Maya | 2019 | Any |
|
||||
|
||||
@subsection buildBuildHou Building Against Houdini
|
||||
|
||||
@@ -254,16 +250,17 @@ OpenVDB components you wish to build.
|
||||
Package | Description | OpenVDB Components |
|
||||
-------------- | --------------------------------------------------------------- | ------------------ |
|
||||
CMake | Cross-platform family of tools designed to help build software | All |
|
||||
C++17 Compiler | Matching Houdini compiler and version | All |
|
||||
Boost | Components: iostreams | All |
|
||||
C++14 Compiler | Matching Houdini compiler and version | All |
|
||||
Boost | Components: system, iostreams, python, thread | All |
|
||||
GoogleTest | A unit testing framework module for C++ | Unit Tests |
|
||||
CppUnit | A unit testing framework module for C++ | Unit Tests (AX) |
|
||||
GLFW | Simple API for OpenGL development | OpenVDB View |
|
||||
Doxygen | Documentation generation from C++ | Documentation |
|
||||
Log4cplus | An optional dependency for improved OpenVDB Logging | Optional (All) |
|
||||
nanobind | C++/python bindings | Optional (Python) |
|
||||
NumPy | Scientific computing with Python | Optional (Python) |
|
||||
LLVM | Target-independent code generation | OpenVDB AX |
|
||||
|
||||
At a minimum a matching C++17 compiler and CMake will be required. See
|
||||
At a minimum, boost, a matching C++14 compiler and CMake will be required. See
|
||||
the full [dependency list](@ref dependencies) for help with downloading and
|
||||
installing the above software. Note that as Blosc and ZLib are provided as part
|
||||
of the Houdini installation `USE_BLOSC` and `USE_ZLIB` should be left `ON`.
|
||||
@@ -288,7 +285,7 @@ Required:
|
||||
|
||||
Optional:
|
||||
|
||||
- [CMAKE_INSTALL_PREFIX](https://cmake.org/cmake/help/latest/variable/CMAKE_INSTALL_PREFIX.html)
|
||||
- @b [CMAKE_INSTALL_PREFIX](https://cmake.org/cmake/help/latest/variable/CMAKE_INSTALL_PREFIX.html)
|
||||
=`/path/to/install/dir` # The location you wish to install OpenVDB to. See
|
||||
the link for default values.
|
||||
- @b OPENVDB_HOUDINI_INSTALL_PREFIX =`/path/to/install/dir` # The location to
|
||||
@@ -342,23 +339,24 @@ Supported versions of maya only ship with TBB.
|
||||
Package | Description | OpenVDB Components |
|
||||
-------------- | --------------------------------------------------------------- | -------------------------------- |
|
||||
CMake | Cross-platform family of tools designed to help build software | All |
|
||||
C++17 Compiler | Matching Houdini compiler and version | All |
|
||||
Boost | Components: iostreams | All |
|
||||
C++14 Compiler | Matching Houdini compiler and version | All |
|
||||
Boost | Components: system, iostreams, python, thread | All |
|
||||
ZLIB | Compression library for disk serialization compression | All |
|
||||
Blosc | Recommended dependency for improved disk compression | All* |
|
||||
GoogleTest | A unit testing framework module for C++ | Unit Tests |
|
||||
CppUnit | A unit testing framework module for C++ | Unit Tests (AX) |
|
||||
GLFW | Simple API for OpenGL development | OpenVDB View |
|
||||
Doxygen | Documentation generation from C++ | Documentation |
|
||||
OpenEXR | EXR serialization support | OpenVDB Render |
|
||||
Imath | Used half precision floating points and EXR serialization support | Optional (All) |
|
||||
IlmBase | Used half precision floating points and EXR serialization support | Optional (All) |
|
||||
Log4cplus | An optional dependency for improved OpenVDB Logging | Optional (All) |
|
||||
nanobind | C++/python bindings | Optional (Python) |
|
||||
NumPy | Scientific computing with Python | Optional (Python) |
|
||||
LLVM | Target-independent code generation | OpenVDB AX |
|
||||
|
||||
|
||||
* See [blosc support](@ref buildBloscSupport)
|
||||
|
||||
At a minimum, boost, a matching C++17 compiler, ZLIB, blosc and CMake will be
|
||||
At a minimum, boost, a matching C++14 compiler, ZLIB, blosc and CMake will be
|
||||
required. See the full [dependency list](@ref dependencies) for help with
|
||||
downloading and installing the above software.
|
||||
|
||||
@@ -381,19 +379,21 @@ Required:
|
||||
|
||||
Optional:
|
||||
|
||||
- [CMAKE_INSTALL_PREFIX](https://cmake.org/cmake/help/latest/variable/CMAKE_INSTALL_PREFIX.html)
|
||||
- @b [CMAKE_INSTALL_PREFIX](https://cmake.org/cmake/help/latest/variable/CMAKE_INSTALL_PREFIX.html)
|
||||
=`/path/to/install/dir` # The location you wish to install OpenVDB to. See
|
||||
the link for default values.
|
||||
- @b OPENVDB_MAYA_INSTALL_PREFIX =`/path/to/install/dir` # The location to
|
||||
install the Maya plugin to. Defaults to the value of `${CMAKE_INSTALL_PREFIX}/maya${Maya_VERSION}`
|
||||
- @b BOOST_ROOT =`/path/to/boost/install` # Path to boost. May not be required,
|
||||
CMake may find it automatically
|
||||
- @b IlmBase_ROOT =`/path/to/ilmbase/install` # Path to ilmbase.
|
||||
|
||||
For example on MacOS and where the build folder has been created inside the
|
||||
OpenVDB source root:
|
||||
|
||||
@code
|
||||
cmake -D BOOST_ROOT=/path/to/boost/install \
|
||||
-D IlmBase_ROOT=/path/to/ilmbase/install \
|
||||
-D Maya_ROOT=/Applications/Autodesk/maya2019/ \
|
||||
-D USE_MAYA=ON \
|
||||
../
|
||||
@@ -449,7 +449,7 @@ Now you can call CMake by providing the absolute or relative path to the root
|
||||
of the OpenVDB source tree. Below are some common options you may want to
|
||||
provide:
|
||||
|
||||
- [CMAKE_INSTALL_PREFIX](https://cmake.org/cmake/help/latest/variable/CMAKE_INSTALL_PREFIX.html)
|
||||
- @b [CMAKE_INSTALL_PREFIX](https://cmake.org/cmake/help/latest/variable/CMAKE_INSTALL_PREFIX.html)
|
||||
=`/path/to/install/dir` # The location you wish to install OpenVDB to. See
|
||||
the link for default values.
|
||||
- @b Xxx_ROOT =`/path/to/Xxx/` # Give CMake a path to where a package has been
|
||||
@@ -508,7 +508,7 @@ You can add the below CMake snippet to your main `CMakeLists.txt` to bring in
|
||||
OpenVDB as a dependency:
|
||||
|
||||
@code{.cmake}
|
||||
cmake_minimum_required(VERSION 3.24)
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
list(APPEND CMAKE_MODULE_PATH "/location/of/openvdb/install/lib/cmake/OpenVDB")
|
||||
find_package(OpenVDB REQUIRED)
|
||||
target_link_libraries(myapp OpenVDB::openvdb)
|
||||
@@ -579,7 +579,8 @@ bypass these checks with `-D DISABLE_DEPENDENCY_VERSION_CHECKS=ON` if necessary.
|
||||
Note that using older or untested dependencies may produce undesired behavior.
|
||||
Older versions in particular are not supported by OpenVDB.
|
||||
|
||||
@b Note: Boost will produce a version error in the format: `Detected version of Boost is too old.`
|
||||
@b Note: Boost will produce a version error in the format `Detected version of
|
||||
Boost is too old.`
|
||||
|
||||
@subsection troubleshoot3 CMake warnings/errors in FindBoost.cmake
|
||||
|
||||
@@ -600,12 +601,8 @@ OpenVDB uses [imported targets](https://cmake.org/cmake/help/latest/command/add_
|
||||
for all its dependencies. For imported Boost compatibility, the following
|
||||
versions of CMake are required:
|
||||
|
||||
- Boost 1.82 requires CMake 3.27.0 or newer.
|
||||
- Boost 1.83 requires CMake 3.27.4 or newer.
|
||||
- Boost 1.84 requires CMake 3.28.2 or newer.
|
||||
- Boost 1.85 requires CMake 3.29.3 or newer.
|
||||
- Boost 1.86 requires CMake 3.30.6, 3.31.1, or newer.
|
||||
- Boost 1.87 requires CMake 3.31.4 or newer.
|
||||
- Boost 1.68, 1.69 require CMake 3.13 or newer.
|
||||
- Boost 1.70 requires CMake 3.14 or newer.
|
||||
|
||||
Use the above list to identify the version of CMake you require for your version
|
||||
of Boost. Note that this may be implemented into the OpenVDB CMake in the future.
|
||||
@@ -631,9 +628,9 @@ Note that you can provide a value for `CMAKE_MSVC_RUNTIME_LIBRARY` which is a
|
||||
native CMake variable to override any CRT selection done by OpenVDB.
|
||||
|
||||
For more information, see the following articles:
|
||||
- Description of CRT selection: https://docs.microsoft.com/en-us/cpp/build/reference/md-mt-ld-use-run-time-library
|
||||
- In depth descriptopn of the CRT on Windows: https://docs.microsoft.com/en-us/cpp/c-runtime-library/crt-library-features
|
||||
- Related errors: https://docs.microsoft.com/en-us/cpp/error-messages/tool-errors/linker-tools-error-lnk2038
|
||||
Description of CRT selection: https://docs.microsoft.com/en-us/cpp/build/reference/md-mt-ld-use-run-time-library
|
||||
In depth descriptopn of the CRT on Windows: https://docs.microsoft.com/en-us/cpp/c-runtime-library/crt-library-features
|
||||
Related errors: https://docs.microsoft.com/en-us/cpp/error-messages/tool-errors/linker-tools-error-lnk2038
|
||||
`CMAKE_MSVC_RUNTIME_LIBRARY` docs: https://cmake.org/cmake/help/latest/variable/CMAKE_MSVC_RUNTIME_LIBRARY.html
|
||||
|
||||
@subsection troubleshoot5 Unexpected value for the Windows CRT with target build artifacts.
|
||||
@@ -655,9 +652,9 @@ usage, it is strongly encouraged to match the selection against your desired
|
||||
build type.
|
||||
|
||||
For more information, see the following articles:
|
||||
- Description of CRT selection: https://docs.microsoft.com/en-us/cpp/build/reference/md-mt-ld-use-run-time-library
|
||||
- In depth descriptopn of the CRT on Windows: https://docs.microsoft.com/en-us/cpp/c-runtime-library/crt-library-features
|
||||
- Related errors: https://docs.microsoft.com/en-us/cpp/error-messages/tool-errors/linker-tools-error-lnk2038
|
||||
Description of CRT selection: https://docs.microsoft.com/en-us/cpp/build/reference/md-mt-ld-use-run-time-library
|
||||
In depth descriptopn of the CRT on Windows: https://docs.microsoft.com/en-us/cpp/c-runtime-library/crt-library-features
|
||||
Related errors: https://docs.microsoft.com/en-us/cpp/error-messages/tool-errors/linker-tools-error-lnk2038
|
||||
`CMAKE_MSVC_RUNTIME_LIBRARY` docs: https://cmake.org/cmake/help/latest/variable/CMAKE_MSVC_RUNTIME_LIBRARY.html
|
||||
|
||||
@subsection troubleshoot6 error LNK2038: mismatch detected for 'RuntimeLibrary'
|
||||
|
||||
+81
-1232
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -7,7 +7,7 @@
|
||||
This document details the coding practices that are used in the OpenVDB
|
||||
codebase. Contributed code should conform to these guidelines to maintain
|
||||
consistency and maintainability. If there is a rule that you would like
|
||||
clarified, changed, or added, please send a note to openvdb-dev@lists.aswf.io.
|
||||
clarified, changed, or added, please send a note to openvdb@gmail.com.
|
||||
|
||||
|
||||
@section sStyleContents Contents
|
||||
|
||||
+106
-101
@@ -9,6 +9,7 @@
|
||||
- @ref depInstallingDependencies
|
||||
- @ref depUsingAptGet
|
||||
- @ref depUsingHomebrew
|
||||
- @ref depManInstall
|
||||
<!-- - @ref depContents -->
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
@@ -34,94 +35,70 @@ Reference Platform, but for those that do, their specified versions are
|
||||
|
||||
@section depComponents OpenVDB Components
|
||||
|
||||
Component | Requirements | Optional
|
||||
----------------------- | ----------------------------------------------- | --------
|
||||
OpenVDB Core Library | CMake, C++17 compiler, TBB::tbb | Blosc, ZLib, Log4cplus, Imath::Imath (included), Boost::iostream, VCL (included)
|
||||
OpenVDB Print | Core Library dependencies | -
|
||||
OpenVDB LOD | Core Library dependencies | -
|
||||
OpenVDB Render | Core Library dependencies | OpenEXR, Imath::Imath, libpng
|
||||
OpenVDB View | Core Library dependencies, OpenGL, GLFW3, GLEW* | -
|
||||
OpenVDB Python | Core Library dependencies, Python, nanobind | -
|
||||
OpenVDB AX | Core Library dependencies, LLVM | Bison, Flex
|
||||
NanoVDB | - | Core Library, CUDA, TBB, Blosc, ZLib
|
||||
OpenVDB UnitTests | Core Library dependencies, GoogleTest, numpy* | -
|
||||
OpenVDB Documentation | Doxygen, Doxygen Awesome (included) | -
|
||||
Component | Requirements | Optional
|
||||
----------------------- | ------------------------------------------------------------------------------------ | --------
|
||||
OpenVDB Core Library | CMake, C++14 compiler, TBB::tbb, Boost::system, Boost::iostream | Blosc, ZLib, Log4cplus, IlmBase::Half
|
||||
OpenVDB Print | Core Library dependencies | -
|
||||
OpenVDB LOD | Core Library dependencies | -
|
||||
OpenVDB Render | Core Library dependencies, OpenEXR, IlmBase | -
|
||||
OpenVDB View | Core Library dependencies, OpenGL, GLFW3, GLEW* | -
|
||||
OpenVDB Python | Core Library dependencies, Python, Boost::python | Boost::numpy, NumPy
|
||||
OpenVDB AX | Core Library dependencies, LLVM | Bison, Flex
|
||||
OpenVDB UnitTests | Core Library dependencies, GoogleTest | CppUnit**
|
||||
OpenVDB Documentation | Doxygen | -
|
||||
|
||||
- @b * GLEW is only required for building the vdb_view binary on Windows.
|
||||
- @b * numpy only required for python binding unit tests
|
||||
- @b ** CppUnit is only required for building the AX unit tests.
|
||||
- @b Note - Bison and Flex are only required for re-generation of the AX
|
||||
grammar which is not typically necessary for the majority of users.
|
||||
|
||||
Note that OpenVDB comes bundled with the following dependencies. Please see
|
||||
their respective license documentation in `ext/THIRD-PARTY.md` for license
|
||||
information.
|
||||
|
||||
- Doxygen Awesome
|
||||
- Imath::Imath
|
||||
- VCL
|
||||
|
||||
@subsection depDependencyTable Dependency Table
|
||||
|
||||
Package | Minimum | Recommended | Description | apt-get | Homebrew | Source
|
||||
--------------- | ------- | ----------- | ----------------------------------------------------------------- | ------- | -------- | ------
|
||||
CMake | 3.24 | Latest | Cross-platform family of tools designed to help build software | Y | Y | https://cmake.org
|
||||
GCC | 11.2.1 | 11.2.1 | C++ 17 Compiler: The GNU Compiler Collection | Y | Y | https://www.gnu.org/software/gcc
|
||||
Clang | 5.0 | Latest | C++ 17 Compiler: A C language family frontend for LLVM | Y | Y | https://clang.llvm.org
|
||||
Intel ICC | 19 | Latest | C++ 17 Compiler: Intels C++ Compiler | Y | Y | https://software.intel.com/en-us/c-compilers
|
||||
MSVC | 19.30 | 19.30 | C++ 17 Compiler: Microsoft Visual C++ Compiler | Y | Y | https://visualstudio.microsoft.com/vs
|
||||
Imath | 3.2 | >= 3.3 | Half precision floating points | Y | Y | http://www.openexr.com
|
||||
OpenEXR | 3.2 | >= 3.3 | EXR serialization support | Y | Y | http://www.openexr.com
|
||||
TBB | 2020.3 | >= 2021 | Threading Building Blocks - template library for task parallelism | Y | Y | https://www.threadingbuildingblocks.org
|
||||
ZLIB | 1.2.7 | Latest | Compression library for disk serialization compression | Y | Y | https://www.zlib.net
|
||||
Boost | 1.82 | >= 1.85 | Components: iostreams | Y | Y | https://www.boost.org
|
||||
VCL | 2.02.0 | >= 2.02.0 | x86 intrinsics and SIMD class wrappers and | Y | Y | https://github.com/vectorclass/version2
|
||||
LLVM | 15.0.0* | 18.0.0 | Target-independent code generation | Y | Y | https://llvm.org/
|
||||
Bison | 3.7.0 | 3.7.0 | General-purpose parser generator | Y | Y | https://www.gnu.org/software/gcc
|
||||
Flex | 2.6.4 | 2.6.4 | Fast lexical analyzer generator | Y | Y | https://github.com/westes/flex
|
||||
Python | 3.10 | 3.11 | The python interpreter and libraries | Y | Y | https://www.python.org
|
||||
nanobind** | 2.0.0 | >= 2.5.0 | C++/python bindings | Y | Y | https://nanobind.readthedocs.io
|
||||
GoogleTest | 1.10 | Latest | A unit testing framework module for C++ | Y | Y | https://github.com/google/googletest
|
||||
Blosc | 1.17.0* | Latest | Recommended dependency for improved disk compression | Y | Y | https://github.com/Blosc/c-blosc/releases
|
||||
Log4cplus | 1.1.2 | Latest | An optional dependency for improved OpenVDB Logging | Y | Y | https://github.com/log4cplus/log4cplus
|
||||
libpng | - | Latest | Library for manipulating PNG images | Y | Y | http://www.libpng.org/pub/png/libpng.html
|
||||
GLFW | 3.3 | Latest | Simple API for OpenGL development | Y | Y | https://www.glfw.org
|
||||
OpenGL | 3.2 | Latest | Environment for developing portable graphics applications | Y | Y | https://www.opengl.org
|
||||
GLEW | 1.0.0 | Latest | A cross-platform OpenGL extension loading library. | Y | Y | http://glew.sourceforge.net
|
||||
CUDA | - | Latest | Parallel computing platform for graphical processing units. | Y | N | https://developer.nvidia.com/cuda-downloads
|
||||
Doxygen | 1.8.8 | <= 1.14.0 | Documentation generation from C++ | Y | Y | http://www.doxygen.nl
|
||||
Doxygen Awesome | 2.0.0 | >= 2.0.0 | Documentation generation from C++ | Y | Y | https://github.com/jothepro/doxygen-awesome-css
|
||||
Package | Minimum | Recommended | Description | apt-get | Homebrew | Source
|
||||
-------------- | ------- | ----------- | ----------------------------------------------------------------- | ------- | -------- | ------
|
||||
CMake | 3.12 | Latest | Cross-platform family of tools designed to help build software | Y | Y | https://cmake.org
|
||||
GCC | 6.3.1 | 6.3.1 | C++ 14 Compiler: The GNU Compiler Collection | Y | Y | https://www.gnu.org/software/gcc
|
||||
Clang | 3.8 | Latest | C++ 14 Compiler: A C language family frontend for LLVM | Y | Y | https://clang.llvm.org
|
||||
Intel ICC | 17 | Latest | C++ 14 Compiler: Intels C++ Compiler | Y | Y | https://software.intel.com/en-us/c-compilers
|
||||
MSVC | 19.10 | Latest | C++ 14 Compiler: Microsoft Visual C++ Compiler | Y | Y | https://visualstudio.microsoft.com/vs
|
||||
IlmBase | 2.2** | 2.3 | Used half precision floating points and EXR serialization support | Y | Y | http://www.openexr.com
|
||||
OpenEXR | 2.2** | 2.3 | EXR serialization support | Y | Y | http://www.openexr.com
|
||||
TBB | 2018 | 2018 | Threading Building Blocks - template library for task parallelism | Y | Y | https://www.threadingbuildingblocks.org
|
||||
ZLIB | 1.2.7 | Latest | Compression library for disk serialization compression | Y | Y | https://www.zlib.net
|
||||
Boost | 1.66 | 1.66 | Components: system, iostreams, python, numpy | Y | Y | https://www.boost.org
|
||||
LLVM | 6.0.0 | 8.0.0 | Target-independent code generation | Y | Y | https://llvm.org/
|
||||
Bison | 3.0.0 | 3.0.5 | General-purpose parser generator | Y | Y | https://www.gnu.org/software/gcc
|
||||
Flex | 2.6 | 2.6.4 | Fast lexical analyzer generator | Y | Y | https://github.com/westes/flex
|
||||
Python | 2.7 | 2.7 | The python interpreter and libraries for C++/python bindings | Y | Y | https://www.python.org
|
||||
NumPy | 1.14.0 | 1.14.0 | Scientific computing with Python | Y | Y | http://www.numpy.org
|
||||
GoogleTest | 1.8 | Latest | A unit testing framework module for C++ | Y | Y | https://github.com/google/googletest
|
||||
CppUnit | 1.10 | Latest | A unit testing framework module for C++ | N | Y | https://freedesktop.org/wiki/Software/cppunit
|
||||
Blosc | 1.5.0 | 1.5.0 | Recommended dependency for improved disk compression | N | N* | https://github.com/Blosc/c-blosc/releases
|
||||
Log4cplus | 1.1.2 | Latest | An optional dependency for improved OpenVDB Logging | Y | Y | https://github.com/log4cplus/log4cplus
|
||||
GLFW | 3.1 | Latest | Simple API for OpenGL development | Y | Y | https://www.glfw.org
|
||||
OpenGL | 3.2 | Latest | Environment for developing portable graphics applications | Y | Y | https://www.opengl.org
|
||||
GLEW | 1.0.0 | Latest | A cross-platform OpenGL extension loading library. | Y | Y | http://glew.sourceforge.net
|
||||
Doxygen | 1.8.8 | 1.8.11 | Documentation generation from C++ | Y | Y | http://www.doxygen.nl
|
||||
|
||||
- @b * See the note in [known issues](@ref depKnownIssues) regarding supported blosc/llvm versions.
|
||||
- @b ** See the note in [known issues](@ref depKnownIssues) regarding supported nanobind build issues.
|
||||
- @b * Blosc 1.16 is only available through Homebrew and currently requires
|
||||
[manual](@ref depManInstall) installation for 1.5.
|
||||
|
||||
- @b ** IlmBase/OpenEXR 2.2 is supported as Houdini 18.0 is shipped with
|
||||
VFX Reference Platform 2019, except for using older versions of these
|
||||
libraries.
|
||||
|
||||
@subsection depKnownIssues Known Issues
|
||||
|
||||
- @b On Linux, LLVM == 17 has symbol issues which makes it incompatible when
|
||||
used with the OpenVDB Python plugin. LLVM versions greater than 18 should be
|
||||
preferred.
|
||||
|
||||
- @b GLFW: Crash with GLFW 3.2.1 when used with EGL on Linux. OpenVDB View may
|
||||
segfault on closure. Fixed in GLFW 3.3
|
||||
|
||||
- @b Blosc: OpenVDB has historically used an old version of blosc (1.5.0) to
|
||||
serialize .vdb files. OpenVDB has moved to a new blosc version minimum of
|
||||
1.17.0. We have tested a range of blosc versions and found that the following
|
||||
versions are NOT compatible with OpenVDB caches written using blosc 1.5.0.
|
||||
Additionally these versions of blosc may generally not be compatible with OpenVDB
|
||||
itself. Avoid using these versions and upgrade to the new minimum of 1.17.0 where
|
||||
possible.
|
||||
- All versions from 1.11.0 through to, but excluding, 1.14.0.
|
||||
- Versions 1.16.0 and 1.16.1.
|
||||
.
|
||||
For more information see:
|
||||
- https://www.blosc.org/posts/new-forward-compat-policy/
|
||||
- https://github.com/Blosc/c-blosc/issues/260
|
||||
- https://github.com/Blosc/c-blosc/issues/261
|
||||
- @b Boost 1.66/1.67 + @b Python3 + @b NumPy: Known issue on UNIX systems
|
||||
which can cause the below python runtime error. Consider updating to Boost 1.68
|
||||
if you require both Python3 and NumPy support:
|
||||
|
||||
- @b nanobind: Nanobind requires a fast-hash-map implementation library called
|
||||
tsl-robin-map. If you're installing nanobind through homebrew, this library
|
||||
may not be installed correctly and OpenVDB's CMake will only produce a warning.
|
||||
Make sure to also: `brew install robin-map`.
|
||||
@code{.sh}
|
||||
RuntimeError: FATAL: module compiled as little endian, but detected different endianness at runtime.
|
||||
@endcode
|
||||
|
||||
@section depInstallingDependencies Installing Dependencies
|
||||
|
||||
@@ -130,47 +107,34 @@ required OpenVDB dependencies.
|
||||
|
||||
@subsection depUsingAptGet Using UNIX apt-get
|
||||
|
||||
You can use apt to automatically install required packages. Note that different
|
||||
Ubuntu distributions will have different versions available. You can use apt
|
||||
pinning to request newer versions of specific package from later distributions
|
||||
if the required version isn't available by default (see
|
||||
[man apt_preferences](https://linux.die.net/man/5/apt_preferences)). For
|
||||
example, the below settings will request TBB specifically from Ubuntu 22.04
|
||||
(Jammy).
|
||||
|
||||
@code{.sh}
|
||||
Package: libtbb-dev
|
||||
Pin: release n=jammy
|
||||
Pin-Priority: 990
|
||||
@endcode
|
||||
|
||||
Alternatively you can install any missing dependencies manually or through
|
||||
other package managers.
|
||||
@b Note: Blosc and CppUnit are unavailable using apt-get. See the other
|
||||
package manager methods or the [manual installation](@ref depManInstall)
|
||||
options.
|
||||
|
||||
@code{.sh}
|
||||
#!/bin/bash
|
||||
# Core library
|
||||
apt-get install cmake # CMake
|
||||
apt-get install libilmbase-dev # IlmBase
|
||||
apt-get install libopenexr-dev # OpenEXR
|
||||
apt-get install libtbb-dev # TBB
|
||||
apt-get install zlibc # zlib
|
||||
apt-get install libboost-system-dev # Boost::system
|
||||
apt-get install libboost-iostreams-dev # Boost::iostream
|
||||
apt-get install libblosc-dev # Blosc
|
||||
# AX
|
||||
apt-get install llvm-15-dev # LLVM
|
||||
apt-get install llvm-8-dev # LLVM
|
||||
# Python
|
||||
apt-get install libboost-python-dev # Boost::python
|
||||
apt-get install libboost-numpy-dev # Boost::numpy
|
||||
apt-get install python-dev # Python
|
||||
pip install nanobind # nanobind
|
||||
apt-get install python-numpy # NumPy
|
||||
# Optional
|
||||
apt-get install libpng-dev # libpng
|
||||
apt-get install libopenexr-dev # OpenEXR
|
||||
apt-get install liblog4cplus-dev # Log4cplus
|
||||
apt-get install googletest # GoogleTest
|
||||
# vdb_view
|
||||
apt-get install libglfw3-dev # GLFW
|
||||
# Documentation
|
||||
apt-get install doxygen # doxygen
|
||||
# CUDA for NanoVDB
|
||||
apt-get install nvidia-cuda-toolkit # CUDA
|
||||
@endcode
|
||||
|
||||
@subsection depUsingHomebrew Using Homebrew
|
||||
@@ -178,28 +142,69 @@ apt-get install nvidia-cuda-toolkit # CUDA
|
||||
[Homebrew](https://brew.sh/) is a package manager for UNIX systems and is
|
||||
an alternative to apt-get or manual installation from source.
|
||||
|
||||
@b Note: Homebrew installs blosc 1.16 by default with no option for previous
|
||||
versions. OpenVDB recommends Blosc version 1.5 as there are known issues with
|
||||
using later versions of blosc. See the
|
||||
[manual installation](@ref depManInstall) options.
|
||||
|
||||
@code{.sh}
|
||||
#!/bin/bash
|
||||
# Core library
|
||||
brew install cmake # CMake
|
||||
brew install ilmbase # IlmBase
|
||||
brew install openexr # OpenEXR
|
||||
brew install tbb # TBB
|
||||
brew install zlib # zlib
|
||||
brew install boost # Boost
|
||||
brew install c-blosc # blosc
|
||||
# AX
|
||||
brew install llvm # LLVM
|
||||
# Python
|
||||
brew install boost-python # Boost-python
|
||||
brew install python # Python
|
||||
brew install nanobind robin-map # nanobind
|
||||
brew install numpy # NumPy
|
||||
# Unit Tests
|
||||
brew install gtest # GoogleTest
|
||||
brew install cppunit # CppUnit
|
||||
# vdb_view
|
||||
brew install glfw # GLFW
|
||||
# vdb_render
|
||||
brew install openexr # OpenEXR
|
||||
brew install libpng # libpng
|
||||
# Documentation
|
||||
brew install doxygen # Doxygen
|
||||
@endcode
|
||||
|
||||
@subsection depManInstall UNIX Manual Installations
|
||||
|
||||
Some dependencies may be unavailable using the above package manager methods.
|
||||
Below are manual installation methods for these packages. Note that you will
|
||||
have to provide your chosen installation locations to the OpenVDB CMake build
|
||||
system when building OpenVDB.
|
||||
|
||||
@b Blosc
|
||||
|
||||
@code{.sh}
|
||||
#!/bin/bash
|
||||
wget https://github.com/Blosc/c-blosc/archive/v1.5.0.zip
|
||||
unzip v1.5.0.zip
|
||||
cd c-blosc-1.5.0
|
||||
# Install to users home directory - you may customise this location
|
||||
mkdir -p $HOME/blosc
|
||||
# Requires CMake
|
||||
cmake -DCMAKE_INSTALL_PREFIX=$HOME/blosc
|
||||
make
|
||||
make install
|
||||
@endcode
|
||||
|
||||
@b CppUnit (for AX Unit Tests)
|
||||
|
||||
@code{.sh}
|
||||
#!/bin/bash
|
||||
wget http://dev-www.libreoffice.org/src/cppunit-1.13.2.tar.gz
|
||||
tar -xvzf cppunit-1.13.2.tar.gz
|
||||
cd cppunit-1.13.2
|
||||
# Install to users home directory - you may customise this location
|
||||
mkdir -p $HOME/cppunit
|
||||
./configure --prefix=$HOME/cppunit
|
||||
make
|
||||
make install
|
||||
@endcode
|
||||
|
||||
*/
|
||||
|
||||
+26
-20
@@ -22,31 +22,40 @@ primarily by
|
||||
- Mihai Aldén
|
||||
- David Hill
|
||||
|
||||
@par Quick Links
|
||||
- @subpage changes "Release Notes"
|
||||
- @subpage dependencies "Dependencies"
|
||||
- @subpage build "Building OpenVDB"
|
||||
- @subpage overview "Overview"
|
||||
- @ref transformsAndMaps "Transforms and Maps"
|
||||
- @ref codeExamples "Cookbook"
|
||||
- @ref faq "FAQ"
|
||||
- @subpage python "OpenVDB Python"
|
||||
- @subpage points "OpenVDB Points"
|
||||
See the @subpage changes "Release Notes" for what’s new in this version
|
||||
of @b OpenVDB.
|
||||
|
||||
See the @subpage dependencies "Dependencies" page for @b OpenVDB requirements.
|
||||
|
||||
See @subpage build "Building OpenVDB" for information on building @b OpenVDB.
|
||||
|
||||
See the @subpage overview "Overview" for an introduction to the library.
|
||||
|
||||
See @subpage transformsAndMaps "Transforms and Maps" for more
|
||||
discussion of the transforms used in @b OpenVDB.
|
||||
|
||||
See the @subpage faq "FAQ" for frequently asked questions about @b OpenVDB.
|
||||
|
||||
See the @subpage codeExamples "Cookbook" to get started using @b OpenVDB.
|
||||
|
||||
See @subpage points "OpenVDB Points" to store point data using @b OpenVDB.
|
||||
|
||||
See @subpage python "Using OpenVDB in Python" to get started with the
|
||||
@b OpenVDB Python module.
|
||||
|
||||
@if OPENVDB_AX
|
||||
- @subpage openvdbax "OpenVDB AX"
|
||||
See @subpage openvdbax "OpenVDB AX" for the AX documentation.
|
||||
@endif
|
||||
|
||||
@if OPENVDB_HOUDINI
|
||||
- @subpage houdini "Houdini Cookbook"
|
||||
See the @subpage houdini "Houdini Cookbook" for help on implementing Houdini nodes.
|
||||
@endif
|
||||
@if NANOVDB
|
||||
- @subpage NanoVDB_MainPage "NanoVDB"
|
||||
@endif
|
||||
- <a href="../code_coverage/index.html">Code Coverage</a>
|
||||
|
||||
Contributors, please familiarize yourselves with our
|
||||
@subpage codingStyle "coding standards".
|
||||
|
||||
|
||||
|
||||
@page overview OpenVDB Overview
|
||||
|
||||
@section Contents
|
||||
@@ -67,9 +76,6 @@ Contributors, please familiarize yourselves with our
|
||||
- @ref subsecNodeIter
|
||||
- @ref subsecValueAccessor
|
||||
- @ref subsecTraversal
|
||||
- @subpage transformsAndMaps "Transforms and Maps"
|
||||
|
||||
|
||||
<!-- - @ref secRegistry -->
|
||||
|
||||
|
||||
@@ -309,7 +315,7 @@ as level sets.
|
||||
(The lower-level @vdblink::tools::GridResampler GridResampler@endlink does not,
|
||||
but it is optimized for level set grids in that it transforms only voxels
|
||||
in the narrow band and relies on
|
||||
@vdblink::tools::signedFloodFill() signed flood fill@endlink to reconstruct
|
||||
@vdblink::Grid::signedFloodFill() signed flood fill@endlink to reconstruct
|
||||
the inside and outside regions.)
|
||||
Other tools whose behavior is affected by the grid class include the
|
||||
@vdblink::tools::divergence() divergence@endlink operator (which has an
|
||||
|
||||
+7
-1
@@ -921,7 +921,7 @@ openvdb::Vec3SGrid::Ptr grid = ...;
|
||||
|
||||
// Construct the rotation matrix.
|
||||
openvdb::math::Mat3s rot45 =
|
||||
openvdb::math::rotation<openvdb::math::Mat3s>(openvdb::math::Y_AXIS, openvdb::math::pi<double>()/4.0);
|
||||
openvdb::math::rotation<openvdb::math::Mat3s>(openvdb::math::Y_AXIS, M_PI_4);
|
||||
|
||||
// Apply the functor to all active values.
|
||||
openvdb::tools::foreach(grid->beginValueOn(), MatMul(rot45));
|
||||
@@ -1199,6 +1199,7 @@ void processTypedGrid(openvdb::GridBase::Ptr grid, OpType& op)
|
||||
else if (grid->isType<openvdb::Vec3IGrid>()) CALL_OP(openvdb::Vec3IGrid);
|
||||
else if (grid->isType<openvdb::Vec3SGrid>()) CALL_OP(openvdb::Vec3SGrid);
|
||||
else if (grid->isType<openvdb::Vec3DGrid>()) CALL_OP(openvdb::Vec3DGrid);
|
||||
else if (grid->isType<openvdb::StringGrid>()) CALL_OP(openvdb::StringGrid);
|
||||
|
||||
#undef CALL_OP
|
||||
}
|
||||
@@ -1220,6 +1221,11 @@ struct PruneOp {
|
||||
{
|
||||
grid->tree().prune(typename GridType::ValueType(tolerance));
|
||||
}
|
||||
// Overload to handle string-valued grids
|
||||
void operator()(openvdb::StringGrid::Ptr grid) const
|
||||
{
|
||||
grid->tree().prune();
|
||||
}
|
||||
};
|
||||
|
||||
// Read all grids from a file.
|
||||
|
||||
+5
-5
@@ -40,10 +40,10 @@ details of VDB are described in the paper
|
||||
<a href="http://www.museth.org/Ken/Publications.html" target="_blank">"VDB: High-Resolution Sparse Volumes with Dynamic Topology"</a>.
|
||||
|
||||
@section sWhatLicense What license is OpenVDB distributed under?
|
||||
OpenVDB is released under the Apache License Version 2.0, which is a
|
||||
free, open source software license developed and maintained by the Apache Software
|
||||
Foundation. For more information about this license, see
|
||||
<a href="https://www.apache.org/licenses/LICENSE-2.0" target="_blank">Apache License, Version 2</a>.
|
||||
OpenVDB is released under the Mozilla Public License Version 2.0, which is a
|
||||
free, open source software license developed and maintained by the Mozilla
|
||||
Foundation. For more information about this license, see the
|
||||
<a href="https://www.mozilla.org/en-US/MPL/" target="_blank">Mozilla FAQ</a>.
|
||||
|
||||
@section sWhatCLA Is there a Contributor License Agreement for OpenVDB?
|
||||
Yes, developers who wish to contribute code to be considered for inclusion
|
||||
@@ -196,7 +196,7 @@ For multithreaded insertion operations we typically assign a separate grid
|
||||
to each thread and then merge the grids as threads terminate.
|
||||
This technique works remarkably well: because OpenVDB
|
||||
is sparse and hierarchical, merging is very efficient.
|
||||
For more details, please consult the @ref codeExamples and
|
||||
For more details, please consult the @subpage codeExamples and
|
||||
Appendix B in the <i>Transactions on Graphics</i> paper.
|
||||
|
||||
@section sMaxRes Is OpenVDB unbounded?
|
||||
|
||||
@@ -1,88 +0,0 @@
|
||||
<!-- HTML header for doxygen 1.15.0-->
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="$langISO">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen $doxygenversion"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<!--BEGIN PROJECT_NAME--><title>$projectname: $title</title><!--END PROJECT_NAME-->
|
||||
<!--BEGIN !PROJECT_NAME--><title>$title</title><!--END !PROJECT_NAME-->
|
||||
<!--BEGIN PROJECT_ICON-->
|
||||
<link rel="icon" href="$relpath^$projecticon" type="image/x-icon" />
|
||||
<!--END PROJECT_ICON-->
|
||||
<link href="$relpath^tabs.css" rel="stylesheet" type="text/css"/>
|
||||
<!--BEGIN FULL_SIDEBAR-->
|
||||
<script type="text/javascript">var page_layout=1;</script>
|
||||
<!--END FULL_SIDEBAR-->
|
||||
<script type="text/javascript" src="$relpath^jquery.js"></script>
|
||||
<script type="text/javascript" src="$relpath^dynsections.js"></script>
|
||||
<!--BEGIN COPY_CLIPBOARD-->
|
||||
<script type="text/javascript" src="$relpath^clipboard.js"></script>
|
||||
<!--END COPY_CLIPBOARD-->
|
||||
$treeview
|
||||
$search
|
||||
$mathjax
|
||||
$darkmode
|
||||
<link href="$relpath^$stylesheet" rel="stylesheet" type="text/css" />
|
||||
$extrastylesheet
|
||||
<script type="text/javascript" src="$relpath^doxygen-awesome-darkmode-toggle.js"></script>
|
||||
<script type="text/javascript">
|
||||
DoxygenAwesomeDarkModeToggle.init()
|
||||
</script>
|
||||
<script type="text/javascript" src="$relpath^doxygen-awesome-fragment-copy-button.js"></script>
|
||||
<script type="text/javascript">
|
||||
DoxygenAwesomeFragmentCopyButton.init()
|
||||
</script>
|
||||
<script type="text/javascript" src="$relpath^doxygen-awesome-paragraph-link.js"></script>
|
||||
<script type="text/javascript">
|
||||
DoxygenAwesomeParagraphLink.init()
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<!--BEGIN FULL_SIDEBAR-->
|
||||
<div id="side-nav" class="ui-resizable side-nav-resizable"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
<!--END FULL_SIDEBAR-->
|
||||
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
|
||||
<!--BEGIN TITLEAREA-->
|
||||
<div id="titlearea">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr id="projectrow">
|
||||
<!--BEGIN PROJECT_LOGO-->
|
||||
<td id="projectlogo"><img alt="Logo" src="$relpath^$projectlogo"$logosize/></td>
|
||||
<!--END PROJECT_LOGO-->
|
||||
<!--BEGIN PROJECT_NAME-->
|
||||
<td id="projectalign">
|
||||
<div id="projectname">$projectname<!--BEGIN PROJECT_NUMBER--><span id="projectnumber"> $projectnumber</span><!--END PROJECT_NUMBER-->
|
||||
</div>
|
||||
<!--BEGIN PROJECT_BRIEF--><div id="projectbrief">$projectbrief</div><!--END PROJECT_BRIEF-->
|
||||
</td>
|
||||
<!--END PROJECT_NAME-->
|
||||
<!--BEGIN !PROJECT_NAME-->
|
||||
<!--BEGIN PROJECT_BRIEF-->
|
||||
<td>
|
||||
<div id="projectbrief">$projectbrief</div>
|
||||
</td>
|
||||
<!--END PROJECT_BRIEF-->
|
||||
<!--END !PROJECT_NAME-->
|
||||
<!--BEGIN DISABLE_INDEX-->
|
||||
<!--BEGIN SEARCHENGINE-->
|
||||
<!--BEGIN !FULL_SIDEBAR-->
|
||||
<td>$searchbox</td>
|
||||
<!--END !FULL_SIDEBAR-->
|
||||
<!--END SEARCHENGINE-->
|
||||
<!--END DISABLE_INDEX-->
|
||||
</tr>
|
||||
<!--BEGIN SEARCHENGINE-->
|
||||
<!--BEGIN FULL_SIDEBAR-->
|
||||
<tr><td colspan="2">$searchbox</td></tr>
|
||||
<!--END FULL_SIDEBAR-->
|
||||
<!--END SEARCHENGINE-->
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!--END TITLEAREA-->
|
||||
<!-- end header part -->
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.0 MiB |
Binary file not shown.
|
Before Width: | Height: | Size: 15 KiB |
+2
-2
@@ -78,7 +78,7 @@ openvdb::math::Transform::Ptr linearTransform =
|
||||
// Rotate the transform by 90 degrees about the X axis.
|
||||
// As a result the j-index will now map into the -z physical direction,
|
||||
// and the k-index will map to the +y physical direction.
|
||||
linearTransform->preRotate(openvdb::math::pi<double>()/2.0, openvdb::math::X_AXIS);
|
||||
linearTransform->preRotate(M_PI/2, openvdb::math::X_AXIS);
|
||||
@endcode
|
||||
|
||||
@subsection sFrustumTransforms Frustum Transforms
|
||||
@@ -302,7 +302,7 @@ convention of right-multiplication of the matrix against a vector:
|
||||
openvdb::math::Mat4d transform = openvdb::math::Mat4d::identity();
|
||||
transform.preScale(openvdb::math::Vec3d(2,3,2));
|
||||
transform.postTranslate(openvdb::math::Vec3d(1,0,0));
|
||||
transform.postRotate(openvdb::math::X_AXIS, openvdb::math::pi<double>()/3.0);
|
||||
transform.postRotate(openvdb::math::X_AXIS, M_PI/3.0);
|
||||
|
||||
// Location of a point in index space
|
||||
openvdb::math::Vec3d indexSpace(1,2,3);
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
# FAQ {#NanoVDB_FAQ}
|
||||
|
||||
* **What is NanoVDB?**
|
||||
|
||||
As the name indicates it's a mini-version of the much bigger OpenVDB library, both in terms of functionality and scope. In fact, a stand-alone C++11 implementation of NanoVDB is available in the file [NanoVDB.h](https://github.com/AcademySoftwareFoundation/openvdb/blob/master/nanovdb/nanovdb/NanoVDB.h) and the C99 equivalent in the files [CNanoVDB.h](https://github.com/AcademySoftwareFoundation/openvdb/blob/master/nanovdb/nanovdb/CNanoVDB.h), and [PNanoVDB.h](https://github.com/AcademySoftwareFoundation/openvdb/blob/master/nanovdb/nanovdb/PNanoVDB.h). However, NanoVDB offers one major advantage over OpenVDB, namely support for GPUs. In short, NanoVDB is a standalone static-topology implementation of the well-known sparse volumetric VDB data structure. In other words, while values can be modified in a NanoVDB grid its tree topology cannot.
|
||||
|
||||
**What graphics API does NanoVDB support?**
|
||||
|
||||
We have tested NanoVDB with CUDA, OpenCL, OpenGL, DirectX 12, OptiX, Vulkan, HLSL, and GLSL. We are also working on adding support for WebGL.
|
||||
|
||||
* **What are the advantages of NanoVDB?**
|
||||
|
||||
Other then the fact that it runs on the GPU, NanoVDB offers several other advantages over OpenVDB. For its limited applications it's generally faster, uses slightly less memory, is implemented in few header files, and has virtually no dependencies on external libraries (other then C++11 or C99). While NanoVDB inherits most of the memory and data access advantages of OpenVDB (e.g. fast random-access by means of inverse tree-traversal), the improved memory layout of NanoVDB actually results in faster read access performance.
|
||||
|
||||
* **What are the limitations of NanoVDB?**
|
||||
|
||||
Other than the fact that NanoVDB obviously lacks many of the features and tools of OpenVDB, the most important limitation of NanoVDB is the fact that it *assumes the topology of the tree structure to be static*. Thus, it is possible to modify the values in a NanoVDB grid, but not its topology, e.g. see [modify_nanovdb_thrust.cu](https://github.com/AcademySoftwareFoundation/openvdb/blob/master/nanovdb/nanovdb/examples/ex_modify_nanovdb_thrust/modify_nanovdb_thrust.cu).
|
||||
|
||||
* **Does NanoVDB work on the CPU as well as the GPU?**
|
||||
|
||||
Yes! In fact, it provides performance advantages on the CPU over OpenVDB, primarily due to the defragmented and more cache-friendly memory layout for spatially coherent voxel access.
|
||||
|
||||
* **What is NanoVDB intended for?**
|
||||
|
||||
Rendering (e.g. ray-tracing) on the GPU or CPU, and other applications that require fast random access into a sparse volumetric data structure (e.g. collision detection for cloth simulations or static boundary conditions in fluid simulations). Additionally, since NanoVDB is essentially a slimmed-down version of the core data structure in OpenVDB, NanoVDB also serves as a great tool to learn about the implementation details of VDB, and can even serve as a starting point for your own sparse data structure.
|
||||
|
||||
* **Does NanoVDB depend on and require CUDA?**
|
||||
|
||||
No, NanoVDB is by design agnostic and works with most graphics APIs, e.g. OpenGL, OpenCL, OptiX, CUDA, HLSL, GLSL, DirectX, and even the CPU! The data structure itself (defined in [NanoVDB.h](https://github.com/AcademySoftwareFoundation/openvdb/blob/master/nanovdb/nanovdb/NanoVDB.h) and [PNanoVDB.h](https://github.com/AcademySoftwareFoundation/openvdb/blob/master/nanovdb/nanovdb/PNanoVDB.h)) only depends on C++11 or C99. However, some of the auxiliary math classes are optionally optimized with intrinsic CUDA calls (e.g. fma in Vec3) and the [DeviceBuffer](https://github.com/AcademySoftwareFoundation/openvdb/blob/master/nanovdb/nanovdb/cuda/DeviceBuffer.h) allocator uses CUDA for explicit memory management. It should be straightforward to replace (or remove) these CUDA dependencies if you so desire.
|
||||
|
||||
* **How does the data structure of NanoVDB compare to that of OpenVDB?**
|
||||
|
||||
Conceptually they are essentially identical (NanoVDB uses the exact same tree configuration), but there are some implementation differences to minimize dependencies on external libraries in NanoVDB (e.g. no boost and std containers), and more importantly, NanoVDB has additional meta-data encoded in tree nodes specifically to accelerate ray-tracing (e.g. min/max values and AABB of active values). Also, NanoVDB is pointer-less and occupies a contiguous block of memory, i.e. de-fragmentized relative to OpenVDB. Effectively, NanoVDB is a linearized version of the well-known OpenVDB data structure with a few additional information baked into the tree nodes!
|
||||
|
||||
* **Are there known issues with NanoVDB?**
|
||||
|
||||
While the are currently no known bugs, there are certainly lots of room for improvements and enhancements. If you have issues or ideas for new feature in NanoVDB please let us know, e.g by submitting a [Github issue](https://github.com/AcademySoftwareFoundation/openvdb/issues).
|
||||
@@ -1,38 +0,0 @@
|
||||
# NanoVDB Hello World Examples {#NanoVDB_HelloWorld}
|
||||
|
||||
The example snippets below are pulled directly from compiled example source
|
||||
files via Doxygen's `\snippet` mechanism, so the code shown here is always
|
||||
in sync with what is built and tested in CI. Enable
|
||||
`-DNANOVDB_BUILD_EXAMPLES=ON` to build them locally.
|
||||
|
||||
## Convert an OpenVDB grid to NanoVDB and use accessors
|
||||
|
||||
[The first example](https://github.com/AcademySoftwareFoundation/openvdb/blob/master/nanovdb/nanovdb/examples/ex_openvdb_to_nanovdb_accessor/openvdb_to_nanovdb_accessor.cc)
|
||||
shows how to convert an OpenVDB level set sphere into a NanoVDB level set, use
|
||||
accessors to print out multiple values from both grids, and save the NanoVDB
|
||||
grid to file. Note that **this example depends on both OpenVDB and NanoVDB**.
|
||||
|
||||
\snippet nanovdb/nanovdb/examples/ex_openvdb_to_nanovdb_accessor/openvdb_to_nanovdb_accessor.cc openvdb_to_nanovdb_accessor
|
||||
|
||||
## Read a NanoVDB grid from a file (host only)
|
||||
|
||||
[The second example](https://github.com/AcademySoftwareFoundation/openvdb/blob/master/nanovdb/nanovdb/examples/ex_read_nanovdb_sphere_accessor/read_nanovdb_sphere_accessor.cc)
|
||||
reads a NanoVDB grid from a file (the one saved in the previous example) and
|
||||
prints out multiple values. Note that **this example does not depend on
|
||||
OpenVDB (nor CUDA), only NanoVDB**.
|
||||
|
||||
\snippet nanovdb/nanovdb/examples/ex_read_nanovdb_sphere_accessor/read_nanovdb_sphere_accessor.cc read_nanovdb_sphere_accessor
|
||||
|
||||
## Read a NanoVDB grid and access it on the CPU and GPU
|
||||
|
||||
[The third example](https://github.com/AcademySoftwareFoundation/openvdb/blob/master/nanovdb/nanovdb/examples/ex_read_nanovdb_sphere_accessor_cuda/read_nanovdb_sphere_accessor_cuda.cu)
|
||||
reads a NanoVDB grid from a file (the one saved in the first example) and
|
||||
prints out multiple values on both the CPU and GPU. Note that **this example
|
||||
does NOT depend on OpenVDB, only NanoVDB and CUDA**.
|
||||
|
||||
\snippet nanovdb/nanovdb/examples/ex_read_nanovdb_sphere_accessor_cuda/read_nanovdb_sphere_accessor_cuda.cu read_nanovdb_sphere_accessor_cuda
|
||||
|
||||
NVCC requires the CUDA kernel to be defined in
|
||||
[a separate .cu file](https://github.com/AcademySoftwareFoundation/openvdb/blob/master/nanovdb/nanovdb/examples/ex_read_nanovdb_sphere_accessor_cuda/read_nanovdb_sphere_accessor_cuda_kernel.cu):
|
||||
|
||||
\snippet nanovdb/nanovdb/examples/ex_read_nanovdb_sphere_accessor_cuda/read_nanovdb_sphere_accessor_cuda_kernel.cu read_nanovdb_sphere_accessor_cuda_kernel
|
||||
@@ -1,55 +0,0 @@
|
||||
# Build instructions {#NanoVDB_HowToBuild}
|
||||
|
||||
Note that NanoVDB can be built in many different ways, in the sense that its many external dependencies are optional. This includes OpenVDB, TBB, graphics APIs like CUDA, OpenGL, and OpenCL, as well as compression like ZLIB and BLOSC.
|
||||
However, since the core data structure in [NanoVDB.h](https://github.com/AcademySoftwareFoundation/openvdb/blob/master/nanovdb/nanovdb/NanoVDB.h) is self-contained, client code may only depend on this single header file.
|
||||
|
||||
Also, note that if the environment variable `VDB_DATA_PATH` is set to a directory containing the OpenVDB files from [the OpenVDB web site](http://www.openvdb.org/download), they will be used for the unit and the benchmark tests. Else a simple narrow-band level set sphere is used. Set the environment variable `VDB_SCRATCH_PATH` to define the path to where images generated in the benchmark tests are stored (defaults to the build directory).
|
||||
|
||||
[//]: # (TODO: add back OPTIX, OPENCL, and OPENGL when these options are added back)
|
||||
To explicitly remove a dependency, `X`, add the argument `-DNANOVDB_USE_X=OFF` where `X = {OPENVDB, TBB, BLOSC, ZLIB, CUDA}`. These options are set in the [NanoVDB root CMakeLists.txt](https://github.com/AcademySoftwareFoundation/openvdb/blob/master/nanovdb/nanovdb/CMakeLists.txt). The same file also defines options to build NanoVDB examples, benchmarks, unit-tests, and command-line tools. The default values for these options are `OFF`. A user can override each of these options by passing, for example, `-DNANOVDB_BUILD_UNITTESTS=ON` flag while running cmake from the command line.
|
||||
|
||||
To see the compiler arguments add `-DCMAKE_VERBOSE_MAKEFILE=ON`.
|
||||
|
||||
## First example: building NanoVDB and OpenVDB core
|
||||
|
||||
NanoVDB is now a module of the larger OpenVDB project. A user can build both libraries together. This will build the OpenVDB core library, install the NanoVDB header files, and build the NanoVDB command-line tools in the `build/nanovdb/cmd` directory. From the 'root' OpenVDB project directory (change the dependency paths to match your environment):
|
||||
```console
|
||||
foo@bar:~$ mkdir build
|
||||
foo@bar:~$ cd build
|
||||
foo@bar:~$ cmake .. -DUSE_NANOVDB=ON -DTBB_ROOT=/path/to/tbb -DBOOST_ROOT=/path/to/boost -DBLOSC_ROOT=/path/to/blosc -DCMAKE_INSTALL_PREFIX=/install/path
|
||||
foo@bar:~$ make -j 4 && make install
|
||||
```
|
||||
Note that the default value of `NANOVDB_USE_OPENVDB` is linked to `OPENVDB_BUILD_CORE` option and can be overriden by passing on `-DNANOVDB_USE_OPENVDB=OFF`. The `Boost` library is included because it is a requirement for building OpenVDB.
|
||||
|
||||
In general, CMake will try to find every optional dependency when a user opts to add an additional dependency. Be sure to check the CMake log to see what dependencies were **not** found.
|
||||
|
||||
## Second example: NanoVDB with no dependencies
|
||||
|
||||
From the 'root' OpenVDB project directory:
|
||||
```console
|
||||
foo@bar:~$ mkdir build
|
||||
foo@bar:~$ cd build
|
||||
foo@bar:~$ cmake .. -DUSE_NANOVDB=ON -DOPENVDB_BUILD_CORE=OFF -DOPENVDB_BUILD_BINARIES=OFF -DNANOVDB_USE_TBB=OFF -DNANOVDB_USE_BLOSC=OFF -DNANOVDB_USE_ZLIB=OFF -DCMAKE_INSTALL_PREFIX=/install/path
|
||||
foo@bar:~$ make -j 4 && make install
|
||||
```
|
||||
|
||||
Another option is to build it from the NanoVDB directory itself, which is much simpler:
|
||||
```console
|
||||
foo@bar:~$ cd nanovdb/nanovdb
|
||||
foo@bar:~$ mkdir build
|
||||
foo@bar:~$ cd build
|
||||
foo@bar:~$ cmake .. -DCMAKE_INSTALL_PREFIX=/install/path
|
||||
foo@bar:~$ make -j 4 && make install
|
||||
```
|
||||
Both options will install the NanoVDB header files to the `/install/path` as well as building `nanovdb_print` and `nanovdb_validate` executable. The path where these executables are installed will be different: in the first option they will be under `build/nanovdb/cmd` directory; whilst in the second option they will be under the `build/cmd/` directory.
|
||||
|
||||
## Third example: build 'everything' in NanoVDB along with OpenVDB core
|
||||
|
||||
From the root OpenVDB directory:
|
||||
```console
|
||||
foo@bar:~$ mkdir build
|
||||
foo@bar:~$ cd build
|
||||
foo@bar:~$ cmake .. -DUSE_NANOVDB=ON -DNANOVDB_BUILD_UNITTESTS=ON -DNANOVDB_BUILD_EXAMPLES=ON -DNANOVDB_BUILD_BENCHMARK=ON -DNANOVDB_USE_INTRINSICS=ON -DNANOVDB_USE_CUDA=ON -DNANOVDB_CUDA_KEEP_PTX=ON -DTBB_ROOT=/path/to/tbb -DBOOST_ROOT=/path/to/boost -DBLOSC_ROOT=/path/to/blosc -DGTEST_ROOT=/path/to/gtest -DCMAKE_INSTALL_PREFIX=/install/path
|
||||
foo@bar:~$ make -j 4 && make install
|
||||
```
|
||||
Note that if you already have the correct version of OpenVDB pre-installed, you can configure CMake to link against that library by passing the arguments `-DOPENVDB_BUILD_CORE=OFF -DOPENVDB_BUILD_BINARIES=OFF -DOPENVDB_ROOT=/path/to/openvdb` when invoking `cmake`.
|
||||
@@ -1,179 +0,0 @@
|
||||
# Source tree structure {#NanoVDB_SourceTree}
|
||||
|
||||
#### Overview of the directory tree of NanoVDB.
|
||||
|
||||
* [NanoVDB.h](https://github.com/AcademySoftwareFoundation/openvdb/blob/master/nanovdb/nanovdb/NanoVDB.h) C++11 implementation of the core data structure and its access methods.
|
||||
* [CNanoVDB.h](https://github.com/AcademySoftwareFoundation/openvdb/blob/master/nanovdb/nanovdb/CNanoVDB.h) Incomplete but useable C99 implementation of the core data structure and its access methods. Designed in particular for use in OpenCL kernels. Note that this relies on zero-sized arrays for the _reserved padding, so will not work on all compilers (with MSVC being a particular example)
|
||||
* [PNanoVDB.h](https://github.com/AcademySoftwareFoundation/openvdb/blob/master/nanovdb/nanovdb/PNanoVDB.h) C99 implementation of the core data structure and its access methods. More complete coverage than CNanoVDB. This version is pointer-less and supports virtually all graphics APIs.
|
||||
* [GridHandle.h](https://github.com/AcademySoftwareFoundation/openvdb/blob/master/nanovdb/nanovdb/GridHandle.h) defines a handler for the memory allocated to a NanoVDB grid.
|
||||
* [io/IO.h](https://github.com/AcademySoftwareFoundation/openvdb/blob/master/nanovdb/nanovdb/io/IO.h) implements I/O support.
|
||||
* [tools/CreateNanoGrid.h](https://github.com/AcademySoftwareFoundation/openvdb/blob/master/nanovdb/nanovdb/tools/CreateNanoGrid.h) defines the converter from OpenVDB to NanoVDB and obviously depends on the OpenVDB library (as the only header file).
|
||||
* [math/Ray.h](https://github.com/AcademySoftwareFoundation/openvdb/blob/master/nanovdb/nanovdb/math/Ray.h) Ray class.
|
||||
* [math/HDDA.h](https://github.com/AcademySoftwareFoundation/openvdb/blob/master/nanovdb/nanovdb/math/HDDA.h) HDDA related.
|
||||
* [math/SampleFromVoxels.h](https://github.com/AcademySoftwareFoundation/openvdb/blob/master/nanovdb/nanovdb/math/SampleFromVoxels.h) interpolation.
|
||||
|
||||
```
|
||||
$ tree
|
||||
.
|
||||
├── CMakeLists.txt
|
||||
├── cmd
|
||||
│ ├── CMakeLists.txt
|
||||
│ ├── convert
|
||||
│ │ └── nanovdb_convert.cc
|
||||
│ ├── print
|
||||
│ │ └── nanovdb_print.cc
|
||||
│ ├── updateFiles.sh
|
||||
│ └── validate
|
||||
│ └── nanovdb_validate.cc
|
||||
├── CNanoVDB.h
|
||||
├── cuda
|
||||
│ ├── DeviceBuffer.h
|
||||
│ ├── GridHandle.cuh
|
||||
│ └── NodeManager.cuh
|
||||
├── docs
|
||||
│ ├── CMakeLists.txt
|
||||
│ ├── codingstyle.txt
|
||||
│ └── doxygen-config
|
||||
├── examples
|
||||
│ ├── CMakeLists.txt
|
||||
│ ├── ex_bump_pool_buffer
|
||||
│ │ └── bump_pool_buffer.cc
|
||||
│ ├── ex_collide_level_set
|
||||
│ │ ├── common.h
|
||||
│ │ ├── main.cc
|
||||
│ │ ├── nanovdb.cu
|
||||
│ │ └── openvdb.cc
|
||||
│ ├── ex_index_grid_cuda
|
||||
│ │ ├── index_grid_cuda.cc
|
||||
│ │ └── index_grid_cuda_kernel.cu
|
||||
│ ├── ex_make_custom_nanovdb
|
||||
│ │ └── make_custom_nanovdb.cc
|
||||
│ ├── ex_make_custom_nanovdb_cuda
|
||||
│ │ ├── make_custom_nanovdb_cuda.cc
|
||||
│ │ └── make_custom_nanovdb_cuda_kernel.cu
|
||||
│ ├── ex_make_funny_nanovdb
|
||||
│ │ └── make_funny_nanovdb.cc
|
||||
│ ├── ex_make_nanovdb_sphere
|
||||
│ │ └── make_nanovdb_sphere.cc
|
||||
│ ├── ex_make_typed_grids
|
||||
│ │ └── make_typed_grids.cc
|
||||
│ ├── ex_map_pool_buffer
|
||||
│ │ └── map_pool_buffer.cc
|
||||
│ ├── ex_modify_nanovdb_thrust
|
||||
│ │ ├── modify_nanovdb_thrust.cc
|
||||
│ │ └── modify_nanovdb_thrust.cu
|
||||
│ ├── ex_nodemanager_cuda
|
||||
│ │ ├── nodemanager_cuda.cc
|
||||
│ │ └── nodemanager_cuda_kernel.cu
|
||||
│ ├── ex_openvdb_to_nanovdb
|
||||
│ │ └── openvdb_to_nanovdb.cc
|
||||
│ ├── ex_openvdb_to_nanovdb_accessor
|
||||
│ │ └── openvdb_to_nanovdb_accessor.cc
|
||||
│ ├── ex_openvdb_to_nanovdb_cuda
|
||||
│ │ ├── openvdb_to_nanovdb_cuda.cc
|
||||
│ │ └── openvdb_to_nanovdb_cuda_kernel.cu
|
||||
│ ├── ex_raytrace_fog_volume
|
||||
│ │ ├── common.h
|
||||
│ │ ├── main.cc
|
||||
│ │ ├── nanovdb.cu
|
||||
│ │ └── openvdb.cc
|
||||
│ ├── ex_raytrace_level_set
|
||||
│ │ ├── common.h
|
||||
│ │ ├── main.cc
|
||||
│ │ ├── nanovdb.cu
|
||||
│ │ └── openvdb.cc
|
||||
│ ├── ex_read_nanovdb_sphere
|
||||
│ │ └── read_nanovdb_sphere.cc
|
||||
│ ├── ex_read_nanovdb_sphere_accessor
|
||||
│ │ └── read_nanovdb_sphere_accessor.cc
|
||||
│ ├── ex_read_nanovdb_sphere_accessor_cuda
|
||||
│ │ ├── read_nanovdb_sphere_accessor_cuda.cu
|
||||
│ │ └── read_nanovdb_sphere_accessor_cuda_kernel.cu
|
||||
│ ├── ex_util
|
||||
│ │ └── ComputePrimitives.h
|
||||
│ ├── ex_voxels_to_grid_cuda
|
||||
│ │ └── ex_voxels_to_grid_cuda.cu
|
||||
│ ├── ex_vox_to_nanovdb
|
||||
│ │ ├── vox_to_nanovdb.cc
|
||||
│ │ └── VoxToNanoVDB.h
|
||||
│ └── ex_write_nanovdb_grids
|
||||
│ └── write_nanovdb_grids.cc
|
||||
├── GridHandle.h
|
||||
├── HostBuffer.h
|
||||
├── io
|
||||
│ └── IO.h
|
||||
├── math
|
||||
│ ├── CSampleFromVoxels.h
|
||||
│ ├── DitherLUT.h
|
||||
│ ├── HDDA.h
|
||||
│ ├── Math.h
|
||||
│ ├── Ray.h
|
||||
│ ├── SampleFromVoxels.h
|
||||
│ └── Stencils.h
|
||||
├── NanoVDB.h
|
||||
├── NodeManager.h
|
||||
├── PNanoVDB.h
|
||||
├── Readme.md
|
||||
├── tools
|
||||
│ ├── CreateNanoGrid.h
|
||||
│ ├── CreatePrimitives.h
|
||||
│ ├── cuda
|
||||
│ │ ├── AddBlindData.cuh
|
||||
│ │ ├── GridChecksum.cuh
|
||||
│ │ ├── GridStats.cuh
|
||||
│ │ ├── GridValidator.cuh
|
||||
│ │ ├── IndexToGrid.cuh
|
||||
│ │ ├── PointsToGrid.cuh
|
||||
│ │ └── SignedFloodFill.cuh
|
||||
│ ├── GridBuilder.h
|
||||
│ ├── GridChecksum.h
|
||||
│ ├── GridStats.h
|
||||
│ ├── GridValidator.h
|
||||
│ └── NanoToOpenVDB.h
|
||||
├── unittest
|
||||
│ ├── CMakeLists.txt
|
||||
│ ├── pnanovdb_validate_strides.h
|
||||
│ ├── TestNanoVDB.cc
|
||||
│ ├── TestNanoVDB.cu
|
||||
│ └── TestOpenVDB.cc
|
||||
└── util
|
||||
├── CpuTimer.h
|
||||
├── CreateNanoGrid.h
|
||||
├── cuda
|
||||
│ ├── CudaAddBlindData.cuh
|
||||
│ ├── CudaDeviceBuffer.h
|
||||
│ ├── CudaGridChecksum.cuh
|
||||
│ ├── CudaGridHandle.cuh
|
||||
│ ├── CudaGridStats.cuh
|
||||
│ ├── CudaGridValidator.cuh
|
||||
│ ├── CudaIndexToGrid.cuh
|
||||
│ ├── CudaNodeManager.cuh
|
||||
│ ├── CudaPointsToGrid.cuh
|
||||
│ ├── CudaSignedFloodFill.cuh
|
||||
│ ├── CudaUtils.h
|
||||
│ ├── GpuTimer.h
|
||||
│ ├── Timer.h
|
||||
│ └── Util.h
|
||||
├── DitherLUT.h
|
||||
├── ForEach.h
|
||||
├── GridBuilder.h
|
||||
├── GridChecksum.h
|
||||
├── GridStats.h
|
||||
├── GridValidator.h
|
||||
├── HDDA.h
|
||||
├── HostBuffer.h
|
||||
├── Invoke.h
|
||||
├── IO.h
|
||||
├── NanoToOpenVDB.h
|
||||
├── NodeManager.h
|
||||
├── OpenToNanoVDB.h
|
||||
├── PrefixSum.h
|
||||
├── Primitives.h
|
||||
├── Range.h
|
||||
├── Ray.h
|
||||
├── Reduce.h
|
||||
├── SampleFromVoxels.h
|
||||
├── Stencils.h
|
||||
├── Timer.h
|
||||
└── Util.h
|
||||
```
|
||||
@@ -1,8 +0,0 @@
|
||||
# NanoVDB {#NanoVDB_MainPage}
|
||||
|
||||
Welcome to the NanoVDB documentation page.
|
||||
|
||||
* @subpage NanoVDB_HowToBuild
|
||||
* @subpage NanoVDB_FAQ
|
||||
* @subpage NanoVDB_SourceTree
|
||||
* @subpage NanoVDB_HelloWorld
|
||||
@@ -1,26 +0,0 @@
|
||||
|
||||
html {
|
||||
/* override light-mode variables here */
|
||||
}
|
||||
|
||||
html.dark-mode {
|
||||
/* define dark-mode variable overrides here */
|
||||
--openvdb-group-header-override: white;
|
||||
}
|
||||
|
||||
/* Fix @name group sections in dark theme appearing strangely */
|
||||
div.groupHeader
|
||||
{
|
||||
box-shadow: none;
|
||||
color: var(--openvdb-group-header-override);
|
||||
}
|
||||
|
||||
/* Apply invert to all images in tables, regardless of nesting, required to
|
||||
properly handle latex formulas in dark theme (for some reason
|
||||
doxygen-awesome only applies this to the first level of nested tables via:
|
||||
html.dark-mode div.contents > table img)
|
||||
*/
|
||||
html.dark-mode div.contents table img
|
||||
{
|
||||
filter: brightness(89%) hue-rotate(180deg) invert();
|
||||
}
|
||||
@@ -21,6 +21,7 @@
|
||||
- @ref secPtIndexFilters
|
||||
- @ref secPtSpaceAndTrans
|
||||
|
||||
|
||||
@section secPtOverview Introduction
|
||||
@anchor openvdbPointsOverview
|
||||
|
||||
|
||||
+10
-6
@@ -1,11 +1,13 @@
|
||||
/**
|
||||
|
||||
@page python OpenVDB Python
|
||||
@page python Using OpenVDB in Python
|
||||
|
||||
This section describes the OpenVDB Python module and includes Python code
|
||||
snippets and some complete programs that illustrate how to perform common tasks.
|
||||
The Python module exposes most of the functionality of the C++
|
||||
@vdblink::Grid Grid@endlink class, including I/O, metadata
|
||||
(An <a href="./python/index.html">API reference</a> is also available,
|
||||
if <a href="http://epydoc.sourceforge.net/">Epydoc</a> is installed.)
|
||||
As of OpenVDB 2.0, the Python module exposes most of the functionality
|
||||
of the C++ @vdblink::Grid Grid@endlink class, including I/O, metadata
|
||||
management, voxel access and iteration, but almost none of the many
|
||||
@ref secToolUtils "tools".
|
||||
We expect to add support for tools in forthcoming releases.
|
||||
@@ -441,9 +443,11 @@ not on their active states or other attributes.
|
||||
|
||||
Large data sets are often handled in Python using
|
||||
<a href="http://www.numpy.org/">NumPy</a>.
|
||||
The @b copyFromArray and @b copyToArray grid methods can be used to exchange
|
||||
data efficiently between scalar-valued grids and three-dimensional NumPy
|
||||
arrays and between vector-valued grids and four-dimensional NumPy arrays.
|
||||
The OpenVDB Python module can optionally be compiled with NumPy support.
|
||||
With NumPy enabled, the @b copyFromArray and @b copyToArray grid methods
|
||||
can be used to exchange data efficiently between scalar-valued grids
|
||||
and three-dimensional NumPy arrays and between vector-valued grids and
|
||||
four-dimensional NumPy arrays.
|
||||
@code{.py}
|
||||
>>> import pyopenvdb as vdb
|
||||
>>> import numpy
|
||||
|
||||
@@ -1,126 +0,0 @@
|
||||
See [LICENSE](LICENSE) for the main open source license of original
|
||||
code written for the OpenVDB project.
|
||||
|
||||
The remainder of this file reproduces the open source licensing details
|
||||
of other projects that have been imported, incorporated into, or derived
|
||||
into parts of OpenVDB.
|
||||
|
||||
In no particular order:
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
BSD 3-Clause License
|
||||
SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
* Imath, Copyright (c) Contributors to the Imath Project.
|
||||
https://github.com/AcademySoftwareFoundation/Imath
|
||||
|
||||
OpenVDB includes a copy of Half.h from the Imath project. This copy can
|
||||
be disabled in favour of using Half.h from the Imath project - but one
|
||||
must be provided either way.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
- Neither the name of the copyright holder nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
MIT License
|
||||
|
||||
* doxygen-awesome Copyright (c) 2021 - 2023 jothepro
|
||||
https://github.com/jothepro/doxygen-awesome-css
|
||||
|
||||
OpenVDB uses doxygen-awesome for stylized html output with doxygen and
|
||||
comes bundled with copies of the css provided by doxygen-awesome. Usage
|
||||
of this css can be disabled.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
Apache 2.0
|
||||
|
||||
* VCL (c) Copyright 2012-2022 Agner Fog.
|
||||
https://github.com/vectorclass/version2
|
||||
|
||||
OpenVDB includes a copy of vectorclass for x86 SIMD intrinsic usage. Usage
|
||||
of VCL is disabled by default and requires the VCL headers to be shipped with
|
||||
OpenVDB installations. This behaviour and usage of VCL can be controlled
|
||||
during OpenVDB configuration. See the full LICENSE terms in:
|
||||
|
||||
vcl/openvdb/ext/vcl/LICENSE
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
Public domain
|
||||
|
||||
* The simplex noise implementation included in OpenVDB AX is Copyright (c)
|
||||
Arthur Tombs. It bears the following notice:
|
||||
|
||||
This is a derivative work based on OpenSimplex by Kurt Spencer:
|
||||
https://gist.github.com/KdotJPG/b1270127455a94ac5d19
|
||||
|
||||
Anyone is free to make use of this software in whatever way they want.
|
||||
Attribution is appreciated, but not required.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
If we have left anything out, it is unintentional. Please let us know.
|
||||
@@ -1,138 +0,0 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
/**
|
||||
|
||||
Doxygen Awesome
|
||||
https://github.com/jothepro/doxygen-awesome-css
|
||||
|
||||
Copyright (c) 2021 - 2025 jothepro
|
||||
|
||||
*/
|
||||
|
||||
class DoxygenAwesomeDarkModeToggle extends HTMLElement {
|
||||
// SVG icons from https://fonts.google.com/icons
|
||||
// Licensed under the Apache 2.0 license:
|
||||
// https://www.apache.org/licenses/LICENSE-2.0.html
|
||||
static lightModeIcon = `<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="24px" viewBox="0 0 24 24" width="24px" fill="#FCBF00"><rect fill="none" height="24" width="24"/><circle cx="12" cy="12" opacity=".3" r="3"/><path d="M12,9c1.65,0,3,1.35,3,3s-1.35,3-3,3s-3-1.35-3-3S10.35,9,12,9 M12,7c-2.76,0-5,2.24-5,5s2.24,5,5,5s5-2.24,5-5 S14.76,7,12,7L12,7z M2,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S1.45,13,2,13z M20,13l2,0c0.55,0,1-0.45,1-1 s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S19.45,13,20,13z M11,2v2c0,0.55,0.45,1,1,1s1-0.45,1-1V2c0-0.55-0.45-1-1-1S11,1.45,11,2z M11,20v2c0,0.55,0.45,1,1,1s1-0.45,1-1v-2c0-0.55-0.45-1-1-1C11.45,19,11,19.45,11,20z M5.99,4.58c-0.39-0.39-1.03-0.39-1.41,0 c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0s0.39-1.03,0-1.41L5.99,4.58z M18.36,16.95 c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0c0.39-0.39,0.39-1.03,0-1.41 L18.36,16.95z M19.42,5.99c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41 s1.03,0.39,1.41,0L19.42,5.99z M7.05,18.36c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06 c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L7.05,18.36z"/></svg>`
|
||||
static darkModeIcon = `<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="24px" viewBox="0 0 24 24" width="24px" fill="#FE9700"><rect fill="none" height="24" width="24"/><path d="M9.37,5.51C9.19,6.15,9.1,6.82,9.1,7.5c0,4.08,3.32,7.4,7.4,7.4c0.68,0,1.35-0.09,1.99-0.27 C17.45,17.19,14.93,19,12,19c-3.86,0-7-3.14-7-7C5,9.07,6.81,6.55,9.37,5.51z" opacity=".3"/><path d="M9.37,5.51C9.19,6.15,9.1,6.82,9.1,7.5c0,4.08,3.32,7.4,7.4,7.4c0.68,0,1.35-0.09,1.99-0.27C17.45,17.19,14.93,19,12,19 c-3.86,0-7-3.14-7-7C5,9.07,6.81,6.55,9.37,5.51z M12,3c-4.97,0-9,4.03-9,9s4.03,9,9,9s9-4.03,9-9c0-0.46-0.04-0.92-0.1-1.36 c-0.98,1.37-2.58,2.26-4.4,2.26c-2.98,0-5.4-2.42-5.4-5.4c0-1.81,0.89-3.42,2.26-4.4C12.92,3.04,12.46,3,12,3L12,3z"/></svg>`
|
||||
static title = "Toggle Light/Dark Mode"
|
||||
|
||||
static prefersLightModeInDarkModeKey = "prefers-light-mode-in-dark-mode"
|
||||
static prefersDarkModeInLightModeKey = "prefers-dark-mode-in-light-mode"
|
||||
|
||||
static _staticConstructor = function() {
|
||||
DoxygenAwesomeDarkModeToggle.enableDarkMode(DoxygenAwesomeDarkModeToggle.userPreference)
|
||||
// Update the color scheme when the browsers preference changes
|
||||
// without user interaction on the website.
|
||||
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', event => {
|
||||
DoxygenAwesomeDarkModeToggle.onSystemPreferenceChanged()
|
||||
})
|
||||
// Update the color scheme when the tab is made visible again.
|
||||
// It is possible that the appearance was changed in another tab
|
||||
// while this tab was in the background.
|
||||
document.addEventListener("visibilitychange", visibilityState => {
|
||||
if (document.visibilityState === 'visible') {
|
||||
DoxygenAwesomeDarkModeToggle.onSystemPreferenceChanged()
|
||||
}
|
||||
});
|
||||
}()
|
||||
|
||||
static init() {
|
||||
$(function() {
|
||||
$(document).ready(function() {
|
||||
const toggleButton = document.createElement('doxygen-awesome-dark-mode-toggle')
|
||||
toggleButton.title = DoxygenAwesomeDarkModeToggle.title
|
||||
toggleButton.updateIcon()
|
||||
|
||||
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', event => {
|
||||
toggleButton.updateIcon()
|
||||
})
|
||||
document.addEventListener("visibilitychange", visibilityState => {
|
||||
if (document.visibilityState === 'visible') {
|
||||
toggleButton.updateIcon()
|
||||
}
|
||||
});
|
||||
|
||||
$(document).ready(function(){
|
||||
document.getElementById("MSearchBox").parentNode.appendChild(toggleButton)
|
||||
})
|
||||
$(window).resize(function(){
|
||||
document.getElementById("MSearchBox").parentNode.appendChild(toggleButton)
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
this.onclick=this.toggleDarkMode
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns `true` for dark-mode, `false` for light-mode system preference
|
||||
*/
|
||||
static get systemPreference() {
|
||||
return window.matchMedia('(prefers-color-scheme: dark)').matches
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns `true` for dark-mode, `false` for light-mode user preference
|
||||
*/
|
||||
static get userPreference() {
|
||||
return (!DoxygenAwesomeDarkModeToggle.systemPreference && localStorage.getItem(DoxygenAwesomeDarkModeToggle.prefersDarkModeInLightModeKey)) ||
|
||||
(DoxygenAwesomeDarkModeToggle.systemPreference && !localStorage.getItem(DoxygenAwesomeDarkModeToggle.prefersLightModeInDarkModeKey))
|
||||
}
|
||||
|
||||
static set userPreference(userPreference) {
|
||||
DoxygenAwesomeDarkModeToggle.darkModeEnabled = userPreference
|
||||
if(!userPreference) {
|
||||
if(DoxygenAwesomeDarkModeToggle.systemPreference) {
|
||||
localStorage.setItem(DoxygenAwesomeDarkModeToggle.prefersLightModeInDarkModeKey, true)
|
||||
} else {
|
||||
localStorage.removeItem(DoxygenAwesomeDarkModeToggle.prefersDarkModeInLightModeKey)
|
||||
}
|
||||
} else {
|
||||
if(!DoxygenAwesomeDarkModeToggle.systemPreference) {
|
||||
localStorage.setItem(DoxygenAwesomeDarkModeToggle.prefersDarkModeInLightModeKey, true)
|
||||
} else {
|
||||
localStorage.removeItem(DoxygenAwesomeDarkModeToggle.prefersLightModeInDarkModeKey)
|
||||
}
|
||||
}
|
||||
DoxygenAwesomeDarkModeToggle.onUserPreferenceChanged()
|
||||
}
|
||||
|
||||
static enableDarkMode(enable) {
|
||||
if(enable) {
|
||||
DoxygenAwesomeDarkModeToggle.darkModeEnabled = true
|
||||
document.documentElement.classList.add("dark-mode")
|
||||
document.documentElement.classList.remove("light-mode")
|
||||
} else {
|
||||
DoxygenAwesomeDarkModeToggle.darkModeEnabled = false
|
||||
document.documentElement.classList.remove("dark-mode")
|
||||
document.documentElement.classList.add("light-mode")
|
||||
}
|
||||
}
|
||||
|
||||
static onSystemPreferenceChanged() {
|
||||
DoxygenAwesomeDarkModeToggle.darkModeEnabled = DoxygenAwesomeDarkModeToggle.userPreference
|
||||
DoxygenAwesomeDarkModeToggle.enableDarkMode(DoxygenAwesomeDarkModeToggle.darkModeEnabled)
|
||||
}
|
||||
|
||||
static onUserPreferenceChanged() {
|
||||
DoxygenAwesomeDarkModeToggle.enableDarkMode(DoxygenAwesomeDarkModeToggle.darkModeEnabled)
|
||||
}
|
||||
|
||||
toggleDarkMode() {
|
||||
DoxygenAwesomeDarkModeToggle.userPreference = !DoxygenAwesomeDarkModeToggle.userPreference
|
||||
this.updateIcon()
|
||||
}
|
||||
|
||||
updateIcon() {
|
||||
if(DoxygenAwesomeDarkModeToggle.darkModeEnabled) {
|
||||
this.innerHTML = DoxygenAwesomeDarkModeToggle.darkModeIcon
|
||||
} else {
|
||||
this.innerHTML = DoxygenAwesomeDarkModeToggle.lightModeIcon
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define("doxygen-awesome-dark-mode-toggle", DoxygenAwesomeDarkModeToggle);
|
||||
@@ -1,66 +0,0 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
/**
|
||||
|
||||
Doxygen Awesome
|
||||
https://github.com/jothepro/doxygen-awesome-css
|
||||
|
||||
Copyright (c) 2022 - 2025 jothepro
|
||||
|
||||
*/
|
||||
|
||||
class DoxygenAwesomeFragmentCopyButton extends HTMLElement {
|
||||
constructor() {
|
||||
super();
|
||||
this.onclick=this.copyContent
|
||||
}
|
||||
static title = "Copy to clipboard"
|
||||
static copyIcon = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M23.04,10.322c0,-2.582 -2.096,-4.678 -4.678,-4.678l-6.918,-0c-2.582,-0 -4.678,2.096 -4.678,4.678c0,-0 0,8.04 0,8.04c0,2.582 2.096,4.678 4.678,4.678c0,-0 6.918,-0 6.918,-0c2.582,-0 4.678,-2.096 4.678,-4.678c0,-0 0,-8.04 0,-8.04Zm-2.438,-0l-0,8.04c-0,1.236 -1.004,2.24 -2.24,2.24l-6.918,-0c-1.236,-0 -2.239,-1.004 -2.239,-2.24l-0,-8.04c-0,-1.236 1.003,-2.24 2.239,-2.24c0,0 6.918,0 6.918,0c1.236,0 2.24,1.004 2.24,2.24Z"/><path d="M5.327,16.748c-0,0.358 -0.291,0.648 -0.649,0.648c0,0 0,0 0,0c-2.582,0 -4.678,-2.096 -4.678,-4.678c0,0 0,-8.04 0,-8.04c0,-2.582 2.096,-4.678 4.678,-4.678l6.918,0c2.168,0 3.994,1.478 4.523,3.481c0.038,0.149 0.005,0.306 -0.09,0.428c-0.094,0.121 -0.239,0.191 -0.392,0.191c-0.451,0.005 -1.057,0.005 -1.457,0.005c-0.238,0 -0.455,-0.14 -0.553,-0.357c-0.348,-0.773 -1.128,-1.31 -2.031,-1.31c-0,0 -6.918,0 -6.918,0c-1.236,0 -2.24,1.004 -2.24,2.24l0,8.04c0,1.236 1.004,2.24 2.24,2.24l0,-0c0.358,-0 0.649,0.29 0.649,0.648c-0,0.353 -0,0.789 -0,1.142Z" style="fill-opacity:0.6;"/></svg>`
|
||||
static successIcon = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path d="M8.084,16.111c-0.09,0.09 -0.212,0.141 -0.34,0.141c-0.127,-0 -0.249,-0.051 -0.339,-0.141c-0.746,-0.746 -2.538,-2.538 -3.525,-3.525c-0.375,-0.375 -0.983,-0.375 -1.357,0c-0.178,0.178 -0.369,0.369 -0.547,0.547c-0.375,0.375 -0.375,0.982 -0,1.357c1.135,1.135 3.422,3.422 4.75,4.751c0.27,0.27 0.637,0.421 1.018,0.421c0.382,0 0.749,-0.151 1.019,-0.421c2.731,-2.732 10.166,-10.167 12.454,-12.455c0.375,-0.375 0.375,-0.982 -0,-1.357c-0.178,-0.178 -0.369,-0.369 -0.547,-0.547c-0.375,-0.375 -0.982,-0.375 -1.357,0c-2.273,2.273 -9.567,9.567 -11.229,11.229Z"/></svg>`
|
||||
static successDuration = 980
|
||||
static init() {
|
||||
$(function() {
|
||||
$(document).ready(function() {
|
||||
if(navigator.clipboard) {
|
||||
const fragments = document.getElementsByClassName("fragment")
|
||||
for(const fragment of fragments) {
|
||||
const fragmentWrapper = document.createElement("div")
|
||||
fragmentWrapper.className = "doxygen-awesome-fragment-wrapper"
|
||||
const fragmentCopyButton = document.createElement("doxygen-awesome-fragment-copy-button")
|
||||
fragmentCopyButton.innerHTML = DoxygenAwesomeFragmentCopyButton.copyIcon
|
||||
fragmentCopyButton.title = DoxygenAwesomeFragmentCopyButton.title
|
||||
|
||||
fragment.parentNode.replaceChild(fragmentWrapper, fragment)
|
||||
fragmentWrapper.appendChild(fragment)
|
||||
fragmentWrapper.appendChild(fragmentCopyButton)
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
copyContent() {
|
||||
const content = this.previousSibling.cloneNode(true)
|
||||
// filter out line number from file listings
|
||||
content.querySelectorAll(".lineno, .ttc").forEach((node) => {
|
||||
node.remove()
|
||||
})
|
||||
let textContent = content.textContent
|
||||
// remove trailing newlines that appear in file listings
|
||||
let numberOfTrailingNewlines = 0
|
||||
while(textContent.charAt(textContent.length - (numberOfTrailingNewlines + 1)) == '\n') {
|
||||
numberOfTrailingNewlines++;
|
||||
}
|
||||
textContent = textContent.substring(0, textContent.length - numberOfTrailingNewlines)
|
||||
navigator.clipboard.writeText(textContent);
|
||||
this.classList.add("success")
|
||||
this.innerHTML = DoxygenAwesomeFragmentCopyButton.successIcon
|
||||
window.setTimeout(() => {
|
||||
this.classList.remove("success")
|
||||
this.innerHTML = DoxygenAwesomeFragmentCopyButton.copyIcon
|
||||
}, DoxygenAwesomeFragmentCopyButton.successDuration);
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define("doxygen-awesome-fragment-copy-button", DoxygenAwesomeFragmentCopyButton)
|
||||
@@ -1,32 +0,0 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
/**
|
||||
|
||||
Doxygen Awesome
|
||||
https://github.com/jothepro/doxygen-awesome-css
|
||||
|
||||
Copyright (c) 2022 - 2025 jothepro
|
||||
|
||||
*/
|
||||
|
||||
class DoxygenAwesomeParagraphLink {
|
||||
// Icon from https://fonts.google.com/icons
|
||||
// Licensed under the Apache 2.0 license:
|
||||
// https://www.apache.org/licenses/LICENSE-2.0.html
|
||||
static icon = `<svg xmlns="http://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M17 7h-4v2h4c1.65 0 3 1.35 3 3s-1.35 3-3 3h-4v2h4c2.76 0 5-2.24 5-5s-2.24-5-5-5zm-6 8H7c-1.65 0-3-1.35-3-3s1.35-3 3-3h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-2zm-3-4h8v2H8z"/></svg>`
|
||||
static title = "Permanent Link"
|
||||
static init() {
|
||||
$(function() {
|
||||
$(document).ready(function() {
|
||||
document.querySelectorAll(".contents a.anchor[id], .contents .groupheader > a[id]").forEach((node) => {
|
||||
let anchorlink = document.createElement("a")
|
||||
anchorlink.setAttribute("href", `#${node.getAttribute("id")}`)
|
||||
anchorlink.setAttribute("title", DoxygenAwesomeParagraphLink.title)
|
||||
anchorlink.classList.add("anchorlink")
|
||||
node.classList.add("anchor")
|
||||
anchorlink.innerHTML = DoxygenAwesomeParagraphLink.icon
|
||||
node.parentElement.appendChild(anchorlink)
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
/**
|
||||
|
||||
Doxygen Awesome
|
||||
https://github.com/jothepro/doxygen-awesome-css
|
||||
|
||||
Copyright (c) 2021 - 2025 jothepro
|
||||
|
||||
*/
|
||||
|
||||
@media screen and (min-width: 768px) {
|
||||
|
||||
#MSearchBox {
|
||||
width: calc(var(--side-nav-fixed-width) - calc(2 * var(--spacing-medium)) - var(--searchbar-height) - 1px);
|
||||
}
|
||||
|
||||
#MSearchField {
|
||||
width: calc(var(--side-nav-fixed-width) - calc(2 * var(--spacing-medium)) - 66px - var(--searchbar-height));
|
||||
}
|
||||
}
|
||||
@@ -1,105 +0,0 @@
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
/**
|
||||
|
||||
Doxygen Awesome
|
||||
https://github.com/jothepro/doxygen-awesome-css
|
||||
|
||||
Copyright (c) 2021 - 2025 jothepro
|
||||
|
||||
*/
|
||||
|
||||
html {
|
||||
/* side nav width. MUST be = `TREEVIEW_WIDTH`.
|
||||
* Make sure it is wide enough to contain the page title (logo + title + version)
|
||||
*/
|
||||
--side-nav-fixed-width: 335px;
|
||||
--menu-display: none;
|
||||
|
||||
--top-height: 120px;
|
||||
--toc-sticky-top: -25px;
|
||||
--toc-max-height: calc(100vh - 2 * var(--spacing-medium) - 25px);
|
||||
}
|
||||
|
||||
#projectname {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
|
||||
@media screen and (min-width: 768px) {
|
||||
html {
|
||||
--searchbar-background: var(--page-background-color);
|
||||
}
|
||||
|
||||
#side-nav {
|
||||
min-width: var(--side-nav-fixed-width);
|
||||
max-width: var(--side-nav-fixed-width);
|
||||
top: var(--top-height);
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
#nav-tree, #side-nav {
|
||||
height: calc(100vh - var(--top-height)) !important;
|
||||
}
|
||||
|
||||
#top {
|
||||
display: block;
|
||||
border-bottom: none;
|
||||
height: var(--top-height);
|
||||
margin-bottom: calc(0px - var(--top-height));
|
||||
max-width: var(--side-nav-fixed-width);
|
||||
overflow: hidden;
|
||||
background: var(--side-nav-background);
|
||||
}
|
||||
|
||||
#main-nav {
|
||||
float: left;
|
||||
padding-right: 0;
|
||||
}
|
||||
|
||||
.ui-resizable-handle {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.ui-resizable-e {
|
||||
width: 0;
|
||||
}
|
||||
|
||||
#nav-path {
|
||||
position: fixed;
|
||||
right: 0;
|
||||
left: calc(var(--side-nav-fixed-width) + 1px);
|
||||
bottom: 0;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
#doc-content {
|
||||
height: calc(100vh - 31px) !important;
|
||||
padding-bottom: calc(3 * var(--spacing-large));
|
||||
padding-top: calc(var(--top-height) - 80px);
|
||||
box-sizing: border-box;
|
||||
margin-left: var(--side-nav-fixed-width) !important;
|
||||
}
|
||||
|
||||
#MSearchBox {
|
||||
width: calc(var(--side-nav-fixed-width) - calc(2 * var(--spacing-medium)));
|
||||
}
|
||||
|
||||
#MSearchField {
|
||||
width: calc(var(--side-nav-fixed-width) - calc(2 * var(--spacing-medium)) - 65px);
|
||||
}
|
||||
|
||||
#MSearchResultsWindow {
|
||||
left: var(--spacing-medium) !important;
|
||||
right: auto;
|
||||
}
|
||||
|
||||
#nav-sync {
|
||||
bottom: 4px;
|
||||
right: auto;
|
||||
left: 300px;
|
||||
width: 35px;
|
||||
top: auto !important;
|
||||
user-select: none;
|
||||
position: fixed
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user