Skip to content

Commit e711ff7

Browse files
committed
Updated build documentation fix some pybind compiler warnings/CI
Signed-off-by: Nick Avramoussis <4256455+Idclip@users.noreply.github.com>
1 parent 0b91c1c commit e711ff7

File tree

8 files changed

+48
-33
lines changed

8 files changed

+48
-33
lines changed

.github/workflows/weekly.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ jobs:
289289
run: |
290290
vcpkg update
291291
vcpkg install zlib tbb cppunit blosc python3 \
292-
boost-iostreams boost-system boost-any boost-uuid boost-interprocess boost-algorithm boost-python
292+
boost-iostreams boost-system boost-any boost-uuid boost-interprocess boost-algorithm pybind11
293293
- name: build
294294
shell: bash
295295
run: >

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ The following provides basic installation examples for the core OpenVDB library.
3939
##### Installing Dependencies (Boost, TBB, Blosc)
4040

4141
```bash
42+
# @note If your distribution does not have required versions, consider using
43+
# apt pinning. See the dependency documentation for more details.
4244
apt-get install -y libboost-iostreams-dev
4345
apt-get install -y libtbb-dev
4446
apt-get install -y libblosc-dev

cmake/config/OpenVDBVersions.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ if(NOT DISABLE_DEPENDENCY_VERSION_CHECKS)
4040
set(MINIMUM_MSVC_VERSION 19.10) # 1910 (Visual Studio 2017 15.0)
4141

4242
set(MINIMUM_BOOST_VERSION 1.73)
43+
set(MINIMUM_PYBIND_VERSION 2.9.1)
4344
set(MINIMUM_ILMBASE_VERSION 2.4)
4445
set(MINIMUM_OPENEXR_VERSION 2.4)
4546
set(MINIMUM_ZLIB_VERSION 1.2.7)

doc/build.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,12 +257,13 @@ Package | Description
257257
-------------- | --------------------------------------------------------------- | ------------------ |
258258
CMake | Cross-platform family of tools designed to help build software | All |
259259
C++17 Compiler | Matching Houdini compiler and version | All |
260-
Boost | Components: iostreams, python, thread | All |
260+
Boost | Components: iostreams | All |
261261
GoogleTest | A unit testing framework module for C++ | Unit Tests |
262262
CppUnit | A unit testing framework module for C++ | Unit Tests (AX) |
263263
GLFW | Simple API for OpenGL development | OpenVDB View |
264264
Doxygen | Documentation generation from C++ | Documentation |
265265
Log4cplus | An optional dependency for improved OpenVDB Logging | Optional (All) |
266+
PyBind11 | C++/python bindings | Optional (Python) |
266267
NumPy | Scientific computing with Python | Optional (Python) |
267268
LLVM | Target-independent code generation | OpenVDB AX |
268269

@@ -346,7 +347,7 @@ Package | Description
346347
-------------- | --------------------------------------------------------------- | -------------------------------- |
347348
CMake | Cross-platform family of tools designed to help build software | All |
348349
C++17 Compiler | Matching Houdini compiler and version | All |
349-
Boost | Components: iostreams, python, thread | All |
350+
Boost | Components: iostreams | All |
350351
ZLIB | Compression library for disk serialization compression | All |
351352
Blosc | Recommended dependency for improved disk compression | All* |
352353
GoogleTest | A unit testing framework module for C++ | Unit Tests |
@@ -356,6 +357,7 @@ Doxygen | Documentation generation from C++
356357
OpenEXR | EXR serialization support | OpenVDB Render |
357358
IlmBase | Used half precision floating points and EXR serialization support | Optional (All) |
358359
Log4cplus | An optional dependency for improved OpenVDB Logging | Optional (All) |
360+
PyBind11 | C++/python bindings | Optional (Python) |
359361
NumPy | Scientific computing with Python | Optional (Python) |
360362
LLVM | Target-independent code generation | OpenVDB AX |
361363

doc/dependencies.txt

Lines changed: 35 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,18 @@ Reference Platform, but for those that do, their specified versions are
3535

3636
@section depComponents OpenVDB Components
3737

38-
Component | Requirements | Optional
39-
----------------------- | ------------------------------------------------- | --------
40-
OpenVDB Core Library | CMake, C++17 compiler, TBB::tbb, Boost::headers | Blosc, ZLib, Log4cplus, IlmBase::Half, Boost::iostream
41-
OpenVDB Print | Core Library dependencies | -
42-
OpenVDB LOD | Core Library dependencies | -
43-
OpenVDB Render | Core Library dependencies | OpenEXR, IlmBase, libpng
44-
OpenVDB View | Core Library dependencies, OpenGL, GLFW3, GLEW* | -
45-
OpenVDB Python | Core Library dependencies, Python, Boost::python | Boost::numpy, NumPy
46-
OpenVDB AX | Core Library dependencies, LLVM | Bison, Flex
47-
NanoVDB | - | Core Library, CUDA, TBB, Blosc, ZLib
48-
OpenVDB UnitTests | Core Library dependencies, GoogleTest | CppUnit**
49-
OpenVDB Documentation | Doxygen | -
38+
Component | Requirements | Optional
39+
----------------------- | ----------------------------------------------- | --------
40+
OpenVDB Core Library | CMake, C++17 compiler, TBB::tbb, Boost::headers | Blosc, ZLib, Log4cplus, IlmBase::Half, Boost::iostream
41+
OpenVDB Print | Core Library dependencies | -
42+
OpenVDB LOD | Core Library dependencies | -
43+
OpenVDB Render | Core Library dependencies | OpenEXR, IlmBase, libpng
44+
OpenVDB View | Core Library dependencies, OpenGL, GLFW3, GLEW* | -
45+
OpenVDB Python | Core Library dependencies, Python, PyBind11 | NumPy
46+
OpenVDB AX | Core Library dependencies, LLVM | Bison, Flex
47+
NanoVDB | - | Core Library, CUDA, TBB, Blosc, ZLib
48+
OpenVDB UnitTests | Core Library dependencies, GoogleTest | CppUnit**
49+
OpenVDB Documentation | Doxygen | -
5050

5151
- @b * GLEW is only required for building the vdb_view binary on Windows.
5252
- @b ** CppUnit is only required for building the AX unit tests.
@@ -62,15 +62,16 @@ GCC | 9.3.1 | 9.3.1 | C++ 17 Compiler: The GNU Compiler Colle
6262
Clang | 5.0 | Latest | C++ 17 Compiler: A C language family frontend for LLVM | Y | Y | https://clang.llvm.org
6363
Intel ICC | 19 | Latest | C++ 17 Compiler: Intels C++ Compiler | Y | Y | https://software.intel.com/en-us/c-compilers
6464
MSVC | 19.28 | Latest | C++ 17 Compiler: Microsoft Visual C++ Compiler | Y | Y | https://visualstudio.microsoft.com/vs
65-
IlmBase | 2.4 | 3.1 | Used half precision floating points and EXR serialization support | Y | Y | http://www.openexr.com
65+
IlmBase | 2.4 | Removed | Used half precision floating points and EXR serialization support | Y | Y | http://www.openexr.com
6666
OpenEXR | 2.4 | 3.1 | EXR serialization support | Y | Y | http://www.openexr.com
6767
TBB | 2020.2 | 2020.3 | Threading Building Blocks - template library for task parallelism | Y | Y | https://www.threadingbuildingblocks.org
6868
ZLIB | 1.2.7 | Latest | Compression library for disk serialization compression | Y | Y | https://www.zlib.net
69-
Boost | 1.73 | 1.76 | Components: headers, iostreams, python, numpy | Y | Y | https://www.boost.org
69+
Boost | 1.73 | 1.76 | Components: headers, iostreams | Y | Y | https://www.boost.org
7070
LLVM | 10.0.0 | 10.0.0* | Target-independent code generation | Y | Y | https://llvm.org/
7171
Bison | 3.0.0 | 3.7.0 | General-purpose parser generator | Y | Y | https://www.gnu.org/software/gcc
7272
Flex | 2.6.0 | 2.6.4 | Fast lexical analyzer generator | Y | Y | https://github.com/westes/flex
73-
Python | 3.7 | 3.7 | The python interpreter and libraries for C++/python bindings | Y | Y | https://www.python.org
73+
Python | 3.7 | 3.7 | The python interpreter and libraries | Y | Y | https://www.python.org
74+
PyBind11 | 2.9.1 | Latest | C++/python bindings | Y | Y | https://pybind11.readthedocs.io
7475
NumPy | 1.19.0 | 1.20.0 | Scientific computing with Python | Y | Y | http://www.numpy.org
7576
GoogleTest | 1.10 | Latest | A unit testing framework module for C++ | Y | Y | https://github.com/google/googletest
7677
CppUnit | 1.10 | Latest | A unit testing framework module for C++ | N | Y | https://freedesktop.org/wiki/Software/cppunit
@@ -95,14 +96,6 @@ Doxygen | 1.8.8 | 1.8.11 | Documentation generation from C++
9596
- @b GLFW: Crash with GLFW 3.2.1 when used with EGL on Linux. OpenVDB View may
9697
segfault on closure. Fixed in GLFW 3.3
9798

98-
- @b Boost 1.66/1.67 + @b Python3 + @b NumPy: Known issue on UNIX systems
99-
which can cause the below python runtime error. Our minimum supported boost
100-
version now superseeds this issue:
101-
102-
@code{.sh}
103-
RuntimeError: FATAL: module compiled as little endian, but detected different endianness at runtime.
104-
@endcode
105-
10699
- @b Blosc: OpenVDB has historically used an old version of blosc (1.5.0) to
107100
serialize .vdb files. OpenVDB has recently moved to a new blosc version minimum
108101
of 1.17.0. We have tested a range of blosc versions and found that the following
@@ -127,6 +120,23 @@ required OpenVDB dependencies.
127120

128121
@subsection depUsingAptGet Using UNIX apt-get
129122

123+
You can use apt to automatically install required packages. Note that different
124+
Ubuntu distributions will have different versions available. You can use apt
125+
pinning to request newer versions of specific package from later distributions
126+
if the required version isn't available by default (see
127+
[man apt_preferences](https://linux.die.net/man/5/apt_preferences)). For
128+
example, the below settings will request TBB specifically from Ubuntu 22.04
129+
(Jammy).
130+
131+
@code{.sh}
132+
Package: libtbb-dev
133+
Pin: release n=jammy
134+
Pin-Priority: 990
135+
@endcode
136+
137+
Alternatively you can install any missing dependencies manually or through
138+
other package managers.
139+
130140
@b Note:CppUnit is unavailable using apt-get. See the other package manager
131141
methods or the [manual installation](@ref depManInstall) options.
132142

@@ -141,8 +151,7 @@ apt-get install libblosc-dev # Blosc
141151
# AX
142152
apt-get install llvm-10-dev # LLVM
143153
# Python
144-
apt-get install libboost-python-dev # Boost::python
145-
apt-get install libboost-numpy-dev # Boost::numpy
154+
apt-get install pybind11-dev # Python
146155
apt-get install python-dev # Python
147156
apt-get install python-numpy # NumPy
148157
# Optional
@@ -175,7 +184,7 @@ brew install c-blosc # blosc
175184
# AX
176185
brew install llvm # LLVM
177186
# Python
178-
brew install boost-python # Boost-python
187+
brew install pybind11 # PyBind11
179188
brew install python # Python
180189
brew install numpy # NumPy
181190
# Unit Tests

openvdb/openvdb/python/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ endif()
107107

108108
# Make sure find_package(Python) is only ever invoked once with all required components
109109
find_package(Python COMPONENTS ${OPENVDB_PYTHON_REQUIRED_COMPONENTS})
110-
find_package(pybind11 REQUIRED)
110+
find_package(pybind11 ${MINIMUM_PYBIND_VERSION} REQUIRED)
111111

112112
openvdb_check_python_version(Python::Module
113113
"${Python_VERSION}"

openvdb/openvdb/python/pyGrid.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ inline ArrayDimVec
385385
arrayDimensions(const py::array& array)
386386
{
387387
ArrayDimVec dims;
388-
for (int i = 0, N = array.ndim(); i < N; ++i) {
388+
for (size_t i = 0, N = array.ndim(); i < N; ++i) {
389389
dims.push_back(array.shape(i));
390390
}
391391
return dims;
@@ -812,7 +812,7 @@ meshToLevelSet(py::array_t<float> pointsObj, py::array_t<Index32> trianglesObj,
812812

813813
template<typename GridType, typename std::enable_if_t<!std::is_scalar<typename GridType::ValueType>::value>* = nullptr>
814814
inline std::tuple<py::array_t<float>, py::array_t<Index32> >
815-
volumeToQuadMesh(const GridType& grid, double isovalue)
815+
volumeToQuadMesh(const GridType&, double)
816816
{
817817
OPENVDB_THROW(TypeError, "volume to mesh conversion is supported only for scalar grids");
818818
}
@@ -839,7 +839,7 @@ volumeToQuadMesh(const GridType& grid, double isovalue)
839839

840840
template<typename GridType, typename std::enable_if_t<!std::is_scalar<typename GridType::ValueType>::value>* = nullptr>
841841
inline std::tuple<py::array_t<float>, py::array_t<Index32>, py::array_t<Index32> >
842-
volumeToMesh(const GridType& grid, double isovalue, double adaptivity)
842+
volumeToMesh(const GridType&, double, double)
843843
{
844844
OPENVDB_THROW(TypeError, "volume to mesh conversion is supported only for scalar grids");
845845
}

pendingchanges/pybind11.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
Python:
22
- OpenVDB Python bindings are now implemented using pybind11 instead of Boost.Python.
3+
[Contributed by Matthew Cong]

0 commit comments

Comments
 (0)