Skip to content

Commit

Permalink
Merge branch 'feature/ax' into feature/axcore
Browse files Browse the repository at this point in the history
  • Loading branch information
Idclip committed Sep 21, 2020
2 parents 207f9a2 + 2d7d158 commit 55756ca
Show file tree
Hide file tree
Showing 21 changed files with 339 additions and 52 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,14 @@ jobs:
- name: test
run: ./ci/test.sh

testabi7noblosc:
testabi7lite:
runs-on: ubuntu-16.04
container:
image: aswf/ci-openvdb:2020
steps:
- uses: actions/checkout@v1
- name: build
run: ./ci/build.sh clang++ Release 7 OFF None -DOPENVDB_CXX_STRICT=ON
run: ./ci/build.sh clang++ Release 7 OFF None -DOPENVDB_CXX_STRICT=ON -DUSE_ZLIB=OFF
- name: test
run: ./ci/test.sh

Expand Down
12 changes: 12 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ OpenVDB Version History

Version 7.1.1 - In Development

Improvements:
- util::CpuTimer now uses C++11 chrono instead of TBB.

Houdini:
- Fixed a bug in the OpenVDB Points Convert SOP where the auto voxel
transform was ignoring the contents of packed geometry.
Expand All @@ -11,6 +14,10 @@ Version 7.1.1 - In Development
- Fixed a bug where a Houdini SOP's verb would not be correctly associated
with the corresponding node if the node's internal name was changed.

Bug fixes:
- Fixed a bug which could cause recursive compile time instantiations of
TypeList objects, manifesting in longer compile times.

Build:
- Removed the Makefiles.
- Re-organised the repository layout such that each independent library
Expand All @@ -21,6 +28,11 @@ Version 7.1.1 - In Development
- Fixed various compiler warnings for GCC 9.1.
- Moved to CMake doxygen commands and removed the doxygen-config files for
doxygen documentation.
- Added USE_ZLIB compiler flag that enables zlib compression and defaults
to on.
- Added the OPENVDB_STATICLIB define to all static builds to fix builds on
Windows which use the multithread/DLL-specific version of the CRT.
[Reported by Tobias Rittig]

Version 7.1.0 - August 13, 2020

Expand Down
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ 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
know it to be required.]=] ON)
option(USE_ZLIB [=[
Use zlib while building openvdb components. If OPENVDB_BUILD_CORE is OFF, CMake attempts to query the located
openvdb build configuration to decide on zlib support. ZLib can only be disabled if Blosc is also disabled. ]=] ON)
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
Expand Down Expand Up @@ -151,6 +154,10 @@ elseif(NOT ${OPENVDB_SIMD} IN_LIST _OPENVDB_SIMD_OPTIONS)
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()

# Top-level location for all openvdb headers
set(OPENVDB_INSTALL_INCLUDEDIR "${CMAKE_INSTALL_INCLUDEDIR}/openvdb")

Expand Down
23 changes: 20 additions & 3 deletions cmake/FindOpenVDB.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ This will define the following variables:
True if the system has the named OpenVDB component.
``OpenVDB_USES_BLOSC``
True if the OpenVDB Library has been built with blosc support
``OpenVDB_USES_ZLIB``
True if the OpenVDB Library has been built with zlib support
``OpenVDB_USES_LOG4CPLUS``
True if the OpenVDB Library has been built with log4cplus support
``OpenVDB_USES_EXR``
Expand Down Expand Up @@ -516,6 +518,7 @@ endif()
# the configuration options from the main CMakeLists.txt to allow users
# to manually identify the requirements of OpenVDB builds if they know them.
set(OpenVDB_USES_BLOSC ${USE_BLOSC})
set(OpenVDB_USES_ZLIB ${USE_ZLIB})
set(OpenVDB_USES_LOG4CPLUS ${USE_LOG4CPLUS})
set(OpenVDB_USES_EXR ${USE_EXR})
set(OpenVDB_DEFINITIONS)
Expand All @@ -525,7 +528,11 @@ if(WIN32)
list(APPEND OpenVDB_DEFINITIONS NOMINMAX)
endif()

if(NOT OPENVDB_USE_STATIC_LIBS)
if(OPENVDB_USE_STATIC_LIBS)
if(WIN32)
list(APPEND OpenVDB_DEFINITIONS OPENVDB_STATICLIB)
endif()
else()
if(WIN32)
list(APPEND OpenVDB_DEFINITIONS OPENVDB_DLL)
endif()
Expand Down Expand Up @@ -561,6 +568,11 @@ if(NOT OPENVDB_USE_STATIC_LIBS)
set(OpenVDB_USES_BLOSC ON)
endif()

string(FIND ${PREREQUISITE} "zlib" _HAS_DEP)
if(NOT ${_HAS_DEP} EQUAL -1)
set(OpenVDB_USES_ZLIB ON)
endif()

string(FIND ${PREREQUISITE} "log4cplus" _HAS_DEP)
if(NOT ${_HAS_DEP} EQUAL -1)
set(OpenVDB_USES_LOG4CPLUS ON)
Expand All @@ -579,6 +591,10 @@ if(OpenVDB_USES_BLOSC)
find_package(Blosc REQUIRED)
endif()

if(OpenVDB_USES_ZLIB)
find_package(ZLIB REQUIRED)
endif()

if(OpenVDB_USES_LOG4CPLUS)
find_package(Log4cplus REQUIRED)
endif()
Expand Down Expand Up @@ -648,8 +664,9 @@ if(NOT OPENVDB_USE_STATIC_LIBS)
if(OpenVDB_USES_BLOSC)
list(APPEND _OPENVDB_HIDDEN_DEPENDENCIES Blosc::blosc)
endif()

list(APPEND _OPENVDB_HIDDEN_DEPENDENCIES ZLIB::ZLIB)
if(OpenVDB_USES_ZLIB)
list(APPEND _OPENVDB_HIDDEN_DEPENDENCIES ZLIB::ZLIB)
endif()
endif()

if(openvdb_je IN_LIST OpenVDB_FIND_COMPONENTS)
Expand Down
23 changes: 15 additions & 8 deletions doc/build.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- @ref buildDependencies
- @ref buildMixingDepInstalls
- @ref buildBloscSupport
- @ref buildZLibSupport
- @ref buildVCPKG
- @ref buildComponents
- @ref buildGuide
Expand Down Expand Up @@ -142,16 +143,21 @@ provide direct include/lib paths to isolated software locations.

@subsection buildBloscSupport Blosc Support

Blosc is one of the optional dependencies of all OpenVDB components. It is the
only dependency which is enabled by default. The documented build steps below
treat blosc as a required dependency. There are two reasons for this:
Blosc is an optional dependency of all OpenVDB components. The documented
build steps below treat blosc as a required dependency. There are two reasons
for this:

- Blosc produces significantly smaller `.vdb` files
- If Blosc is disabled, you will not be able to read or use any `.vdb` files
that were created using blosc compression. This includes OpenVDB files from
Houdini.

You can disable Blosc using `-D USE_BLOSC=OFF`.
@subsection buildZLibSupport ZLIB Support

ZLIB is an optional dependency of all OpenVDB components. The documented build
steps below treat ZLib as a required dependency.

You can disable ZLib using `-D USE_ZLIB=OFF` if Blosc is also disabled using `-D USE_BLOSC=OFF`.

@subsection buildVCPKG Building Dependencies using VCPKG

Expand Down Expand Up @@ -209,8 +215,9 @@ Developers may wish to build a standalone version of OpenVDB to take advantage
of newer dependencies and newer library features. See
[here](@ref buildBuildStandalone) for more information.

@b Note: Blosc is treated as a required dependency in these install instructions.
See the [blosc support](@ref buildBloscSupport) section for more information.
@b Note: Blosc and ZLib are treated as required dependencies in these install
instructions. See the [blosc support](@ref buildBloscSupport) and
[zlib support](@ref buildZLibSupport) sections for more information.

@subsection buildBuildHouMaya Building Against Houdini/Maya

Expand Down Expand Up @@ -253,8 +260,8 @@ LLVM | Target-independent code generation

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 is provided as part of the
Houdini installation `USE_BLOSC` should be left `ON`.
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`.

With the necessary dependencies installed, create and enter a directory for
cmake to write to. It's generally useful to create this in the location you've
Expand Down
14 changes: 14 additions & 0 deletions doc/changes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
@par
<B>Version 7.1.1</B> - <I>In Development</I>

@par
Improvements:
- util::CpuTimer now uses C++11 chrono instead of TBB.

@par
Houdini:
- Fixed a bug in the OpenVDB Points Convert SOP where the auto voxel
Expand All @@ -15,6 +19,11 @@ Houdini:
- Fixed a bug where a Houdini SOP's verb would not be correctly associated
with the corresponding node if the node's internal name was changed.

@par
Bug Fixes:
- Fixed a bug which could cause recursive compile time instantiations of
TypeList objects, manifesting in longer compile times.

@par
Build:
- Removed the Makefiles.
Expand All @@ -26,6 +35,11 @@ Build:
- Fixed various compiler warnings for GCC 9.1.
- Moved to CMake doxygen commands and removed the doxygen-config files for
doxygen documentation.
- Added USE_ZLIB compiler flag that enables zlib compression and defaults
to on.
- Added the OPENVDB_STATICLIB define to all static builds to fix builds on
Windows which use the multithread/DLL-specific version of the CRT.
<I>[Reported&nbsp;by&nbsp;Tobias&nbsp;Rittig]</I>


@htmlonly <a name="v7_1_0_changes"></a>@endhtmlonly
Expand Down
2 changes: 1 addition & 1 deletion doc/dependencies.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Reference Platform, but for those that do, their specified versions are

Component | Requirements | Optional
----------------------- | ------------------------------------------------------------------------------------ | --------
OpenVDB Core Library | CMake, C++14 compiler, IlmBase::Half, TBB::tbb, ZLIB, Boost::system, Boost::iostream | Blosc, Log4cplus, OpenEXR::IlmImf
OpenVDB Core Library | CMake, C++14 compiler, IlmBase::Half, TBB::tbb, Boost::system, Boost::iostream | Blosc, ZLib, Log4cplus, OpenEXR::IlmImf
OpenVDB Print | Core Library dependencies | -
OpenVDB LOD | Core Library dependencies | -
OpenVDB Render | Core Library dependencies, OpenEXR, IlmBase | -
Expand Down
17 changes: 13 additions & 4 deletions openvdb/openvdb/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ if(OPENVDB_FUTURE_DEPRECATION AND FUTURE_MINIMUM_TBB_VERSION)
endif()
endif()

find_package(ZLIB ${MINIMUM_ZLIB_VERSION} REQUIRED)

if(USE_LOG4CPLUS)
find_package(Log4cplus ${MINIMUM_LOG4CPLUS_VERSION} REQUIRED)
endif()
Expand All @@ -99,6 +97,10 @@ else()
)
endif()

if(USE_BLOSC OR USE_ZLIB)
find_package(ZLIB ${MINIMUM_ZLIB_VERSION} REQUIRED)
endif()

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).
Expand Down Expand Up @@ -166,9 +168,12 @@ if(USE_BLOSC)
list(APPEND OPENVDB_CORE_DEPENDENT_LIBS Blosc::blosc)
endif()

if(USE_BLOSC OR USE_ZLIB)
list(APPEND OPENVDB_CORE_DEPENDENT_LIBS ZLIB::ZLIB)
endif()

list(APPEND OPENVDB_CORE_DEPENDENT_LIBS
TBB::tbb
ZLIB::ZLIB
)

if(UNIX)
Expand Down Expand Up @@ -400,6 +405,10 @@ if(USE_BLOSC)
list(APPEND OPENVDB_CORE_PRIVATE_DEFINES -DOPENVDB_USE_BLOSC)
endif()

if(USE_BLOSC OR USE_ZLIB)
list(APPEND OPENVDB_CORE_PRIVATE_DEFINES -DOPENVDB_USE_ZLIB)
endif()

# Public defines
if(WIN32)
# @note OPENVDB_OPENEXR_STATICLIB is old functionality from the makefiles
Expand Down Expand Up @@ -429,7 +438,7 @@ if(OPENVDB_CORE_STATIC)
)

target_compile_definitions(openvdb_static
PUBLIC ${OPENVDB_CORE_PUBLIC_DEFINES}
PUBLIC ${OPENVDB_CORE_PUBLIC_DEFINES} -DOPENVDB_STATICLIB
PRIVATE ${OPENVDB_CORE_PRIVATE_DEFINES}
)

Expand Down
8 changes: 5 additions & 3 deletions openvdb/openvdb/Types.h
Original file line number Diff line number Diff line change
Expand Up @@ -696,17 +696,19 @@ struct TypeList
static constexpr int64_t Index = internal::TSHasTypeImpl<Self, T>::Index;

/// @brief Remove any duplicate types from this TypeList by rotating the
/// next valid type left (maintains the order of other types).
/// next valid type left (maintains the order of other types). Optionally
/// combine the result with another TypeList.
/// @details Example:
/// @code
/// {
/// using Types = openvdb::TypeList<Int16, Int32, Int16, float, float, Int64>;
/// }
/// {
/// using UniqueTypes = Types::Unique; // <Int16, Int32, float, Int64>
/// using UniqueTypes = Types::Unique<>; // <Int16, Int32, float, Int64>
/// }
/// @endcode
using Unique = typename internal::TSMakeUniqueImpl<TypeList<>, Ts...>::type;
template<typename ListT = TypeList<>>
using Unique = typename internal::TSMakeUniqueImpl<ListT, Ts...>::type;

/// @brief Append types, or the members of another TypeList, to this list.
/// @details Example:
Expand Down
16 changes: 16 additions & 0 deletions openvdb/openvdb/io/Archive.cc
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,11 @@ namespace io {
#ifdef OPENVDB_USE_BLOSC
const uint32_t Archive::DEFAULT_COMPRESSION_FLAGS = (COMPRESS_BLOSC | COMPRESS_ACTIVE_MASK);
#else
#ifdef OPENVDB_USE_ZLIB
const uint32_t Archive::DEFAULT_COMPRESSION_FLAGS = (COMPRESS_ZIP | COMPRESS_ACTIVE_MASK);
#else
const uint32_t Archive::DEFAULT_COMPRESSION_FLAGS = (COMPRESS_ACTIVE_MASK);
#endif
#endif


Expand Down Expand Up @@ -764,6 +768,18 @@ Archive::hasBloscCompression()
}


//static
bool
Archive::hasZLibCompression()
{
#ifdef OPENVDB_USE_ZLIB
return true;
#else
return false;
#endif
}


void
Archive::setGridCompression(std::ostream& os, const GridBase& grid) const
{
Expand Down
3 changes: 3 additions & 0 deletions openvdb/openvdb/io/Archive.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ class OPENVDB_API Archive
/// Return @c true if the OpenVDB library includes support for the Blosc compressor.
static bool hasBloscCompression();

/// Return @c true if the OpenVDB library includes support for the ZLib compressor.
static bool hasZLibCompression();

/// Return a bit mask specifying compression options for the data stream.
uint32_t compression() const { return mCompression; }
/// @brief Specify whether and how the data stream should be compressed.
Expand Down
Loading

0 comments on commit 55756ca

Please sign in to comment.