Skip to content

Commit

Permalink
Merge pull request #1677 from Idclip/cmake_fixes
Browse files Browse the repository at this point in the history
Minor CMake Fixes
  • Loading branch information
Idclip authored Oct 10, 2023
2 parents 2d3eabc + efdbd9f commit 172a31c
Show file tree
Hide file tree
Showing 16 changed files with 96 additions and 94 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ax.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ jobs:
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: pybind11
#if: contains(matrix.config.image, '2023') == false
run: ./ci/install_pybind11.sh 2.10.0
- name: timestamp
id: timestamp
shell: bash
Expand Down
17 changes: 8 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ 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
Expand Down Expand Up @@ -85,9 +89,11 @@ jobs:
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: pybind11
#if: contains(matrix.config.image, '2023') == false
run: ./ci/install_pybind11.sh 2.10.0
- name: timestamp
id: timestamp
shell: bash
run: echo "::set-output name=timestamp::`date -u +'%Y-%m-%dT%H:%M:%SZ'`"
- name: ccache
# don't use ccache for debug builds
Expand Down Expand Up @@ -118,7 +124,6 @@ jobs:
# Keep ccache light by stripping out any caches not accessed in the last day
- name: ccache_clean
if: matrix.config.build == 'Release'
shell: bash
run: ccache --evict-older-than 1d

windows:
Expand Down Expand Up @@ -149,15 +154,14 @@ jobs:
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: bash
run: ./ci/install_windows.sh
- name: build
shell: bash
run: >
./ci/build.sh -v
--config=${{ matrix.config.build }}
Expand All @@ -171,11 +175,9 @@ jobs:
-DCMAKE_TOOLCHAIN_FILE=\"${VCPKG_INSTALLATION_ROOT}\\scripts\\buildsystems\\vcpkg.cmake\"
\'
- name: size
shell: bash
# Print the build directy size (monitor if we're hitting runner limits)
run: du -h build
- name: test
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 7 * * 1') || matrix.config.build == 'Release'
Expand All @@ -192,14 +194,12 @@ jobs:
steps:
- uses: actions/checkout@v3
- 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: build
shell: bash
# Also need to disable compiler warnings for ABI 6 and above due to
# the version of clang installed
run: >
Expand All @@ -208,5 +208,4 @@ jobs:
--components=\"core,python,bin,view,render,test\"
--cargs=\"-DOPENVDB_CXX_STRICT=OFF -DOPENVDB_ABI_VERSION_NUMBER=10 -DOPENVDB_SIMD=SSE42\"
- name: test
shell: bash
run: cd build && ctest -V
3 changes: 3 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ jobs:
- uses: actions/checkout@v3
- name: install_doxygen
run: ./ci/install_doxygen.sh 1_8_11
- name: pybind11
#if: contains(matrix.config.image, '2023') == false
run: ./ci/install_pybind11.sh 2.10.0
# - name: install_epydoc
# run: pip install epydoc
- name: install_latex
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/houdini.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ jobs:
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: pybind11
#if: contains(matrix.config.image, '2023') == false
run: ./ci/install_pybind11.sh 2.10.0
- name: timestamp
id: timestamp
shell: bash
Expand Down
72 changes: 43 additions & 29 deletions .github/workflows/weekly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
workflow_dispatch:
inputs:
type:
description: 'The type of CI to run (all, houdini, mac, extra, ax, blosc, abi)'
description: 'The type of CI to run (all, houdini, latest, extra, ax, blosc, abi)'
required: true
default: 'all'

Expand All @@ -21,6 +21,10 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

defaults:
run:
shell: bash

jobs:
#############################################################################
################################## Houdini ##################################
Expand Down Expand Up @@ -72,7 +76,6 @@ jobs:
- uses: actions/checkout@v3
- name: timestamp
id: timestamp
shell: bash
run: echo "::set-output name=timestamp::`date -u +'%Y-%m-%dT%H:%M:%SZ'`"
- name: download_houdini
run: ./ci/download_houdini.sh ${{ matrix.config.houdini_version }} ON
Expand Down Expand Up @@ -119,6 +122,9 @@ jobs:
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: pybind11
#if: contains(container.image, '2023') == false
run: ./ci/install_pybind11.sh 2.10.0
- name: build
run: >
./ci/build.sh -v
Expand All @@ -128,34 +134,43 @@ jobs:
- name: test
run: cd build && ctest -V

# Test latest dependencies, latest compilers and options through homebrew on macos
macos-latest:
# Test latest dependencies, latest compilers and options
latest:
if: |
github.event_name != 'workflow_dispatch' ||
github.event.inputs.type == 'all' ||
github.event.inputs.type == 'mac'
runs-on: macos-12
github.event.inputs.type == 'latest'
runs-on: ${{ matrix.config.runson }}
env:
CXX: ${{ matrix.config.cxx }}
strategy:
matrix:
config:
- { brew_compiler: gcc@13, cmake: '-D CMAKE_CXX_COMPILER=/usr/local/opt/gcc@13/bin/g++-13' }
- { brew_compiler: llvm@16, cmake: '-D CMAKE_CXX_COMPILER=/usr/local/opt/llvm@16/bin/clang++' }
- { runson: ubuntu-latest, cxx: g++, cmake: '' }
- { runson: ubuntu-latest, cxx: clang++, cmake: '' }
# @todo gcc on macos
- { runson: macos-latest, cxx: '', cmake: '-D CMAKE_CXX_COMPILER=/usr/local/opt/llvm@15/bin/clang++' }
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: install
shell: bash
run: ./ci/install_macos.sh latest ${{ matrix.config.brew_compiler }}
- name: build
shell: bash
run: >
./ci/build.sh -v
--build-type=Release
--components=\"core,python,bin,view,render,test\"
--cargs=\"-DOPENVDB_CXX_STRICT=OFF -DCMAKE_CXX_STANDARD=20 ${{ matrix.config.cmake }}\"
- name: test
shell: bash
run: cd build && ctest -V
- 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 llvm-dev libgtest-dev libcppunit-dev pybind11-dev
elif [ "$RUNNER_OS" == "macOS" ]; then
./ci/install_macos_ax.sh 15
brew install googletest
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,axtest,axbin\"
--cargs=\"-DCMAKE_CXX_STANDARD=20 -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/install ${{ matrix.config.cmake }}\"
- name: test
run: cd build && ctest -V

#############################################################################
############################ AX Library Extras ##############################
Expand Down Expand Up @@ -189,6 +204,9 @@ jobs:
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: pybind11
#f: contains(matrix.config.image, '2023') == false
run: ./ci/install_pybind11.sh 2.10.0
- name: build
run: >
./ci/build.sh -v
Expand Down Expand Up @@ -237,7 +255,7 @@ jobs:
#- { cxx: 'clang++', build: 'Release', llvm: '16' } - not supported yet
fail-fast: false
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: install_deps
run: ./ci/install_macos_ax.sh ${{ matrix.config.llvm }}
- name: build
Expand Down Expand Up @@ -282,16 +300,13 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: llvm
shell: bash
run: ./ci/install_llvm_windows.sh ${{ matrix.config.crt }}
- name: install
shell: bash
run: |
vcpkg update
vcpkg install zlib tbb cppunit blosc python3 \
boost-iostreams boost-system boost-any boost-uuid boost-interprocess boost-algorithm pybind11
- name: build
shell: bash
run: >
./ci/build.sh -v
--config=${{ matrix.config.build }}
Expand All @@ -308,12 +323,12 @@ jobs:
${{ 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
shell: bash
run: cd build && ctest -V -C ${{ matrix.config.build }}

#############################################################################
Expand All @@ -336,7 +351,6 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: install_blosc
shell: bash
run: sudo ./ci/install_blosc.sh ${{ matrix.blosc }}
- name: build
run: >
Expand Down Expand Up @@ -365,7 +379,7 @@ jobs:
with:
fetch-depth: 0
- name: install_deps
run: sudo apt-get -q install -y libboost-dev libboost-system-dev libboost-iostreams-dev libtbb-dev libblosc-dev elfutils
run: sudo apt-get -q install -y libboost-dev libboost-iostreams-dev libtbb-dev libblosc-dev elfutils
# abi-compliance-checker and abi-dumper
#
# @note that abi-dumper is available through apt but at the time of writing this
Expand Down
10 changes: 0 additions & 10 deletions ci/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -145,16 +145,6 @@ done

################################################

###### TEMPORARY CHANGE: Install pybind11 2.10.0 as it's not available on the linux docker images yet
if [ $(uname) == "Linux" ]; then
if [ ! -f "/usr/local/include/pybind11/pybind11.h" ]; then
$CI_DIR/install_pybind11.sh 2.10.0
fi
fi
###### TEMPORARY CHANGE: always install pybind11 2.10.0 as it's not available on the docker images yet

################################################

# github actions runners have 8 threads
# https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners
export CMAKE_BUILD_PARALLEL_LEVEL=${PARMS[-j]}
Expand Down
10 changes: 0 additions & 10 deletions cmake/FindOpenVDB.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -491,16 +491,6 @@ endif()
# Add standard dependencies

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)

# Add deps for pyopenvdb
Expand Down
2 changes: 0 additions & 2 deletions nanovdb/nanovdb/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,6 @@ endif()
if(NANOVDB_USE_OPENVDB)
if(NOT OPENVDB_BUILD_CORE AND NOT TARGET OpenVDB::openvdb)
find_package(OpenVDB REQUIRED COMPONENTS openvdb)
# disable the shared libs that OpenVDB's cmake switches ON.
set(BUILD_SHARED_LIBS OFF)
endif()
endif()

Expand Down
9 changes: 0 additions & 9 deletions openvdb/openvdb/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,6 @@ endif()

# Collect and configure lib dependencies

if(OPENVDB_CORE_SHARED 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()

if(OPENVDB_USE_DELAYED_LOADING)
find_package(Boost ${MINIMUM_BOOST_VERSION} REQUIRED COMPONENTS iostreams)
else()
Expand Down
7 changes: 5 additions & 2 deletions openvdb/openvdb/Platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,12 @@
#define OPENVDB_CHECK_GCC(MAJOR, MINOR) 0
#endif

/// OpenVDB now requires C++11
#define OPENVDB_HAS_CXX11 1
/// OpenVDB now requires C++17
#define OPENVDB_HAS_CXX11 1 // kept for backward compatibility

#if __cplusplus >= 202002L
#define OPENVDB_HAS_CXX20
#endif

/// SIMD Intrinsic Headers
#if defined(OPENVDB_USE_SSE42) || defined(OPENVDB_USE_AVX)
Expand Down
2 changes: 1 addition & 1 deletion openvdb/openvdb/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ endif()

# Make sure find_package(Python) is only ever invoked once with all required components
find_package(Python COMPONENTS ${OPENVDB_PYTHON_REQUIRED_COMPONENTS})
find_package(pybind11 ${MINIMUM_PYBIND_VERSION} REQUIRED)
find_package(pybind11 ${MINIMUM_PYBIND_VERSION} CONFIG REQUIRED)

openvdb_check_python_version(Python::Module
"${Python_VERSION}"
Expand Down
8 changes: 4 additions & 4 deletions openvdb/openvdb/tools/MultiResGrid.h
Original file line number Diff line number Diff line change
Expand Up @@ -522,8 +522,8 @@ template<Index Order>
typename TreeType::ValueType MultiResGrid<TreeType>::
sampleValue(const Coord& in_ijk, size_t in_level, size_t out_level) const
{
assert( in_level >= 0 && in_level < mTrees.size() );
assert( out_level >= 0 && out_level < mTrees.size() );
assert( in_level < mTrees.size() );
assert( out_level < mTrees.size() );
const ConstAccessor acc(*mTrees[out_level]);// has disabled registration!
return tools::Sampler<Order>::sample( acc, this->xyz(in_ijk, in_level, out_level) );
}
Expand All @@ -533,8 +533,8 @@ template<Index Order>
typename TreeType::ValueType MultiResGrid<TreeType>::
sampleValue(const Vec3R& in_xyz, size_t in_level, size_t out_level) const
{
assert( in_level >= 0 && in_level < mTrees.size() );
assert( out_level >= 0 && out_level < mTrees.size() );
assert( in_level < mTrees.size() );
assert( out_level < mTrees.size() );
const ConstAccessor acc(*mTrees[out_level]);// has disabled registration!
return tools::Sampler<Order>::sample( acc, this->xyz(in_xyz, in_level, out_level) );
}
Expand Down
Loading

0 comments on commit 172a31c

Please sign in to comment.