Skip to content

Commit 6c0bd0b

Browse files
authored
Merge pull request #1729 from Idclip/various_improvements
Various improvements
2 parents ee78fb7 + 730dbca commit 6c0bd0b

File tree

14 files changed

+39
-59
lines changed

14 files changed

+39
-59
lines changed

.github/workflows/weekly.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -317,10 +317,7 @@ jobs:
317317
- name: llvm
318318
run: ./ci/install_llvm_windows.sh ${{ matrix.config.crt }}
319319
- name: install
320-
run: |
321-
vcpkg update
322-
vcpkg install zlib tbb cppunit blosc python3 \
323-
boost-iostreams boost-system boost-any boost-uuid boost-interprocess boost-algorithm pybind11
320+
run: ./ci/install_windows.sh
324321
- name: build
325322
run: >
326323
./ci/build.sh -v

CMakeLists.txt

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -357,27 +357,16 @@ include(cmake/config/OpenVDBCXX.cmake)
357357

358358
#########################################################################
359359

360-
# Configure malloc library. Use Jemalloc for Linux and non-Maya, otherwise Tbbmalloc.
361-
# * On Mac OSX, linking against Jemalloc < 4.3.0 seg-faults with this error:
362-
# malloc: *** malloc_zone_unregister() failed for 0xaddress
363-
# Houdini 17.5 and older ships with Jemalloc 3.6.0, so we make Tbbmalloc the default
364-
# on Mac OSX (https://github.com/jemalloc/jemalloc/issues/420). Later versions of
365-
# Jemalloc are thought to work, but haven't been tested.
366-
# * On Windows, we follow SideFX's example in using Tbbmalloc due to the challenges
367-
# of injecting into the Windows runtime to replace the system allocator.
368-
369-
if((OPENVDB_BUILD_BINARIES OR OPENVDB_BUILD_UNITTESTS) AND CONCURRENT_MALLOC STREQUAL "Auto")
370-
if(WIN32 OR APPLE OR USE_MAYA)
360+
# Configure malloc library. Use Jemalloc if available, tbbmalloc otherwise
361+
362+
if(CONCURRENT_MALLOC STREQUAL "Auto")
363+
find_package(Jemalloc QUIET)
364+
if(NOT TARGET Jemalloc::jemalloc)
365+
message(WARNING "Unable to find Jemalloc, attempting to fall back to TBB malloc.
366+
It is recommended to use Jemalloc for optimum performance.")
371367
set(CONCURRENT_MALLOC "Tbbmalloc")
372368
else()
373-
find_package(Jemalloc QUIET)
374-
if(NOT TARGET Jemalloc::jemalloc)
375-
message(WARNING "Unable to find Jemalloc, attempting to fall back to TBB malloc.
376-
It is recommended to use Jemalloc for optimum performance.")
377-
set(CONCURRENT_MALLOC "Tbbmalloc")
378-
else()
379-
set(CONCURRENT_MALLOC "Jemalloc")
380-
endif()
369+
set(CONCURRENT_MALLOC "Jemalloc")
381370
endif()
382371
endif()
383372

ci/install_macos.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ brew install openexr
1414
brew install pybind11 # also installs the dependent python version
1515
brew install tbb
1616
brew install zlib
17+
brew install jemalloc
1718

1819
# Alias python version installed by pybind11 to path
1920
py_version=$(brew info pybind11 --json | \

ci/install_windows.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
set -ex
44

55
vcpkg update
6-
vcpkg install zlib libpng openexr tbb gtest blosc glfw3 glew python3 \
7-
boost-iostreams boost-any boost-uuid boost-interprocess boost-algorithm pybind11 \
6+
vcpkg install zlib libpng openexr tbb gtest blosc glfw3 glew python3 jemalloc \
7+
boost-iostreams boost-interprocess boost-algorithm pybind11 \
88
--clean-after-build

openvdb/openvdb/unittest/TestStreamCompression.cc

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,9 @@
2020
#include <boost/interprocess/mapped_region.hpp>
2121
#include <boost/iostreams/device/array.hpp>
2222
#include <boost/iostreams/stream.hpp>
23-
#include <boost/uuid/uuid_generators.hpp>
24-
#include <boost/uuid/uuid_io.hpp>
25-
#include <boost/version.hpp> // for BOOST_VERSION
2623

2724
#ifdef _WIN32
2825
#include <boost/interprocess/detail/os_file_functions.hpp> // open_existing_file(), close_file()
29-
// boost::interprocess::detail was renamed to boost::interprocess::ipcdetail in Boost 1.48.
30-
// Ensure that both namespaces exist.
31-
namespace boost { namespace interprocess { namespace detail {} namespace ipcdetail {} } }
3226
#include <windows.h>
3327
#else
3428
#include <sys/types.h> // for struct stat
@@ -43,16 +37,6 @@ namespace boost { namespace interprocess { namespace detail {} namespace ipcdeta
4337

4438
#ifdef OPENVDB_USE_BLOSC
4539
#include <blosc.h>
46-
// A Blosc optimization introduced in 1.11.0 uses a slightly smaller block size for
47-
// HCR codecs (LZ4, ZLIB, ZSTD), which otherwise fails a few regression test cases
48-
#if BLOSC_VERSION_MAJOR > 1 || (BLOSC_VERSION_MAJOR == 1 && BLOSC_VERSION_MINOR > 10)
49-
#define BLOSC_HCR_BLOCKSIZE_OPTIMIZATION
50-
#endif
51-
// Blosc 1.14+ writes backwards-compatible data by default.
52-
// http://blosc.org/posts/new-forward-compat-policy/
53-
#if BLOSC_VERSION_MAJOR > 1 || (BLOSC_VERSION_MAJOR == 1 && BLOSC_VERSION_MINOR >= 14)
54-
#define BLOSC_BACKWARDS_COMPATIBLE
55-
#endif
5640
#endif
5741

5842
#ifdef OPENVDB_USE_DELAYED_LOADING
@@ -74,7 +58,6 @@ class ProxyMappedFile
7458
mLastWriteTime = 0;
7559
const char* regionFilename = mMap.get_name();
7660
#ifdef _WIN32
77-
using namespace boost::interprocess::detail;
7861
using namespace boost::interprocess::ipcdetail;
7962
using openvdb::Index64;
8063

openvdb_ax/openvdb_ax/test/CMakeLists.txt

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,18 @@ else()
3939
set(OPENVDBAX_LIB openvdb_ax)
4040
endif()
4141

42+
set(OPENVDB_AX_TEST_DEPENDENT_LIBS ${OPENVDBAX_LIB})
43+
44+
if(CONCURRENT_MALLOC STREQUAL "Jemalloc")
45+
find_package(Jemalloc REQUIRED)
46+
list(APPEND OPENVDB_AX_TEST_DEPENDENT_LIBS Jemalloc::jemalloc)
47+
elseif(CONCURRENT_MALLOC STREQUAL "Tbbmalloc")
48+
find_package(TBB ${MINIMUM_TBB_VERSION} REQUIRED COMPONENTS tbbmalloc)
49+
list(APPEND OPENVDB_AX_TEST_DEPENDENT_LIBS TBB::tbbmalloc)
50+
endif()
51+
4252
find_package(CppUnit ${MINIMUM_CPPUNIT_VERSION} REQUIRED)
53+
list(APPEND OPENVDB_AX_TEST_DEPENDENT_LIBS CppUnit::cppunit)
4354

4455
set(TEST_SOURCE_FILES
4556
ast/TestScanners.cc
@@ -99,9 +110,7 @@ set(TEST_SOURCE_FILES
99110
main.cc
100111
)
101112

102-
add_executable(vdb_ax_test
103-
${TEST_SOURCE_FILES}
104-
)
113+
add_executable(vdb_ax_test ${TEST_SOURCE_FILES})
105114

106115
# @note From Clang 14, fp-contract has been switched to ON by default. Docs in
107116
# Clang versions before 14 state that fp-contract is ON, but it is in fact off.
@@ -119,13 +128,8 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "App
119128
COMPILE_OPTIONS "-ffp-contract=off")
120129
endif()
121130

122-
target_link_libraries(vdb_ax_test
123-
${OPENVDBAX_LIB}
124-
CppUnit::cppunit
125-
)
126-
target_include_directories(vdb_ax_test
127-
PRIVATE ../ .
128-
)
131+
target_link_libraries(vdb_ax_test ${OPENVDB_AX_TEST_DEPENDENT_LIBS})
132+
target_include_directories(vdb_ax_test PRIVATE ../ .)
129133

130134
if(OPENVDB_AX_TEST_PROFILE)
131135
target_compile_definitions(vdb_ax_test PRIVATE "-DPROFILE")

openvdb_houdini/openvdb_houdini/AXUtils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ hax_chramp(const openvdb::ax::FunctionOptions& op)
394394
const void* const data)
395395
{
396396
const openvdb::ax::CustomData* const customData =
397-
static_cast<const openvdb::ax::CustomData* const>(data);
397+
static_cast<const openvdb::ax::CustomData*>(data);
398398
const std::string nameString(name);
399399

400400
const openvdb::Metadata::ConstPtr& meta = customData->getData(nameString);

openvdb_houdini/openvdb_houdini/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,12 @@ foreach(DSO_NAME ${OPENVDB_DSO_NAMES})
304304
add_library(${DSO_NAME} SHARED ${DSO_NAME}.cc)
305305
target_link_libraries(${DSO_NAME} PUBLIC openvdb_houdini)
306306

307+
if(OPENVDB_ENABLE_RPATH)
308+
set_target_properties(${DSO_NAME}
309+
PROPERTIES INSTALL_RPATH
310+
"${CMAKE_INSTALL_RPATH};${OPENVDB_HOUDINI_BIN_INSTALL_PREFIX};${OPENVDB_HOUDINI_LIB_INSTALL_PREFIX}")
311+
endif()
312+
307313
# Call houdini_configure_target to setup the sesi tag information. We set
308314
# INSTDIR to the project build directory and configure the actuall install
309315
# paths ourselves (otherwise cmake will configure the build to build directly

openvdb_houdini/openvdb_houdini/SOP_OpenVDB_Activate.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -529,8 +529,6 @@ class sop_FillSDFOp
529529
template <typename NodeT>
530530
bool operator()(NodeT &node, size_t idx) const
531531
{
532-
using ChildT = typename NodeT::ChildNodeType;
533-
534532
for (auto iter = node.beginChildAll(); iter; ++iter)
535533
{
536534
typename NodeT::ChildNodeType *child;

openvdb_houdini/openvdb_houdini/SOP_OpenVDB_Extrapolate.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,6 @@ SOP_OpenVDB_Extrapolate::Cache::process(
576576
using namespace openvdb::tools;
577577

578578
using SamplerT = openvdb::tools::GridSampler<ExtGridT, openvdb::tools::BoxSampler>;
579-
using ExtValueT = typename ExtGridT::ValueType;
580579

581580
typename FSGridT::Ptr fsGrid = openvdb::gridPtrCast<FSGridT>(lsPrim->getGridPtr());
582581

0 commit comments

Comments
 (0)