AcademySoftwareFoundation / AcademySoftwareFoundation/openvdb
[BUILD] How do I enable BLOSC compression codec?
- Dominant language
- C++
- Stars
- 3.4k
- Forks
- 774
- Avg merge
- 3d 9h
- Merged PRs (30d)
- 34
Description
### Environment
**Operating System:** CentOS Linux release 7.9
**Version:** OpenVDB v10.1.0
**CMake Version:** 3.20.1
**Compiler:** gcc 10.2.0
### Describe the problem
When I try to run my built project, I get
> An exception occurred: "BLOSC compression codec was disabled during build"
which I understand it was disabled during my OpenVDB lib build, even though using a flag `NANOVDB_USE_BLOSC=ON`. Or maybe it was disabled in my project built? Or maybe I'm just not using it correctly?
### To Reproduce
in main.cpp:
```
openvdb::initialize();
openvdb::io::File inputFile("/path/to/input.vdb");
auto grids = inputFile.getGrids();
const std::string outputFile = "/path/to/output.nvdb";
nanovdb::io::Codec codec = nanovdb::io::Codec::BLOSC;
std::ofstream os(outputFile, std::ios::out | std::ios::binary);
for (auto& srcGrid : *grids) {
auto handle = nanovdb::openToNanoVDB(srcGrid);
// ...
nanovdb::io::writeGrid(os, handle, codec);
}
```
### Additional context
I'm building OpenVDB with this:
```
cmake .. \
-DUSE_NANOVDB=ON \
-DNANOVDB_BUILD_UNITTESTS=OFF \
-DNANOVDB_BUILD_EXAMPLES=ON \
-DNANOVDB_USE_INTRINSICS=ON \
-DNANOVDB_USE_CUDA=ON \
-DNANOVDB_CUDA_KEEP_PTX=ON \
-DNANOVDB_USE_OPENVDB=ON \
-DNANOVDB_USE_BLOSC=ON \
-DTBB_ROOT=/path/to/tbb/2020.3 \
-DBOOST_ROOT=/path/to/Boost/1.74.0 \
-DBLOSC_ROOT=/path/to/c-blosc/1.21.0 \
-DCMAKE_INSTALL_PREFIX:PATH=/path/to/my/openvdb/install
```
Contributor guide
Research direction
Start with the CMake command in the issue and the reproducer in main.cpp, then trace how the BLOSC option and dependency affect the reported disabled-codec exception. Done means the project builds with BLOSC enabled and nanovdb::io::writeGrid succeeds using Codec::BLOSC.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake, cpp
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100