Open mesteban-22 opened 1 month ago
Thanks for reporting this. I was able to reproduce the error. Thanks to @matthewdcong who pointed out that adding target_compile_definitions(nanovdb_test PRIVATE "NANOVDB_USE_OPENVDB")
to the CMakeLists fixes the problem. Here is the CMakeLists I end up using:
cmake_minimum_required(VERSION 3.27)
project(test LANGUAGES CXX CUDA)
include_directories(
/usr/local/cuda/include
)
set(CMAKE_CXX_STANDARD 17)
list(APPEND CMAKE_MODULE_PATH "/usr/local/lib/cmake/OpenVDB")
find_package(OpenVDB "11.0.1" REQUIRED COMPONENTS openvdb nanovdb)
add_executable(nanovdb_test main.cpp)
target_compile_definitions(nanovdb_test PRIVATE "NANOVDB_USE_OPENVDB")
target_link_libraries(nanovdb_test OpenVDB::openvdb OpenVDB::nanovdb)
Environment
Linux Ubuntu 24.04 LTS OpenVDB: 11.0.0 Ubuntu clang version 18.1.8 & Ubuntu 10.5.0-4ubuntu2
Describe the bug
Unable to compile the NanoVDB first example.
To Reproduce
Steps to reproduce the behavior:
NANOVDB_USE_CUDA
,NANOVDB_USE_OPENVDB
CMakeLists.txt
for compiling the exampleinclude_directories( /usr/local/cuda/include )
set(CMAKE_CXX_STANDARD 17)
list(APPEND CMAKE_MODULE_PATH "/usr/local/lib/cmake/OpenVDB") find_package(OpenVDB REQUIRED) add_executable(nanoVDB_test main.cpp)
target_link_libraries(test OpenVDB::openvdb)
In file included from main.cpp:2: /usr/local/include/nanovdb/util/CreateNanoGrid.h:324:58: error: no member named 'map' in 'openvdb::v11_0::Grid<openvdb::v11_0::tree::Tree<openvdb::v11_0::tree::RootNode<openvdb::v11_0::tree::InternalNode<openvdb::v11_0::tree::InternalNode<openvdb::v11_0::tree::LeafNode<float, 3>, 4>, 5>>>>' 324 | const nanovdb::Map& map() const {return this->grid().map();} |' requested here
961 | [&](){this->template processGrid();} );
| ^
/usr/local/include/nanovdb/util/CreateNanoGrid.h:899:34: note: in instantiation of function template specialization 'nanovdb::CreateNanoGrid<openvdb::v11_0::Grid<openvdb::v11_0::tree::Tree<openvdb::v11_0::tree::RootNode<openvdb::v11_0::tree::InternalNode<openvdb::v11_0::tree::InternalNode<openvdb::v11_0::tree::LeafNode<float, 3>, 4>, 5>>>>>::initHandle<float, nanovdb::HostBuffer>' requested here
899 | auto handle = this->template initHandle(pool);
| ^
/usr/local/include/nanovdb/util/CreateNanoGrid.h:1966:31: note: in instantiation of function template specialization 'nanovdb::CreateNanoGrid<openvdb::v11_0::Grid<openvdb::v11_0::tree::Tree<openvdb::v11_0::tree::RootNode<openvdb::v11_0::tree::InternalNode<openvdb::v11_0::tree::InternalNode<openvdb::v11_0::tree::LeafNode<float, 3>, 4>, 5>>>>>::getHandle<float, nanovdb::HostBuffer>' requested here
1966 | return converter.template getHandle<DstBuildT, BufferT>(buffer);
| ^
/home/mesteban/CLionProjects/nanoVDB-test/main.cpp:13:32: note: in instantiation of function template specialization 'nanovdb::createNanoGrid<openvdb::v11_0::Grid<openvdb::v11_0::tree::Tree<openvdb::v11_0::tree::RootNode<openvdb::v11_0::tree::InternalNode<openvdb::v11_0::tree::InternalNode<openvdb::v11_0::tree::LeafNode<float, 3>, 4>, 5>>>>, float, nanovdb::HostBuffer>' requested here
13 | auto handle = nanovdb::createNanoGrid(srcGrid);
| ^
In file included from /home/mesteban/CLionProjects/nanoVDB-test/main.cpp:2:
/usr/local/include/nanovdb/util/CreateNanoGrid.h:325:54: error: no member named 'gridClass' in 'openvdb::v11_0::Grid<openvdb::v11_0::tree::Tree<openvdb::v11_0::tree::RootNode<openvdb::v11_0::tree::InternalNode<openvdb::v11_0::tree::InternalNode<openvdb::v11_0::tree::LeafNode<float, 3>, 4>, 5>>>>'
325 | GridClass gridClass() const {return this->grid().gridClass();}
| (), mapToGridClass(mSrcNodeAcc.gridClass()));
| ^
/usr/local/include/nanovdb/util/CreateNanoGrid.h:961:34: note: in instantiation of function template specialization 'nanovdb::CreateNanoGrid<openvdb::v11_0::Grid<openvdb::v11_0::tree::Tree<openvdb::v11_0::tree::RootNode<openvdb::v11_0::tree::InternalNode<openvdb::v11_0::tree::InternalNode<openvdb::v11_0::tree::LeafNode<float, 3>, 4>, 5>>>>>::processGrid' requested here
961 | [&](){this->template processGrid();} );
| ^
/usr/local/include/nanovdb/util/CreateNanoGrid.h:899:34: note: in instantiation of function template specialization 'nanovdb::CreateNanoGrid<openvdb::v11_0::Grid<openvdb::v11_0::tree::Tree<openvdb::v11_0::tree::RootNode<openvdb::v11_0::tree::InternalNode<openvdb::v11_0::tree::InternalNode<openvdb::v11_0::tree::LeafNode<float, 3>, 4>, 5>>>>>::initHandle<float, nanovdb::HostBuffer>' requested here
899 | auto handle = this->template initHandle(pool);
| ^
/usr/local/include/nanovdb/util/CreateNanoGrid.h:1966:31: note: in instantiation of function template specialization 'nanovdb::CreateNanoGrid<openvdb::v11_0::Grid<openvdb::v11_0::tree::Tree<openvdb::v11_0::tree::RootNode<openvdb::v11_0::tree::InternalNode<openvdb::v11_0::tree::InternalNode<openvdb::v11_0::tree::LeafNode<float, 3>, 4>, 5>>>>>::getHandle<float, nanovdb::HostBuffer>' requested here
1966 | return converter.template getHandle<DstBuildT, BufferT>(buffer);
| ^
main.cpp:13:32: note: in instantiation of function template specialization 'nanovdb::createNanoGrid<openvdb::v11_0::Grid<openvdb::v11_0::tree::Tree<openvdb::v11_0::tree::RootNode<openvdb::v11_0::tree::InternalNode<openvdb::v11_0::tree::InternalNode<openvdb::v11_0::tree::LeafNode<float, 3>, 4>, 5>>>>, float, nanovdb::HostBuffer>' requested here
/home/mesteban/CLionProjects/nanoVDB-test/main.cpp:13:32: note: in instantiation of function template specialization 'nanovdb::createNanoGrid<openvdb::v11_0::Grid<openvdb::v11_0::tree::Tree<openvdb::v11_0::tree::RootNode<openvdb::v11_0::tree::InternalNode<openvdb::v11_0::tree::InternalNode<openvdb::v11_0::tree::LeafNode<float, 3>, 4>, 5>>>>, float, nanovdb::HostBuffer>' requested here
13 | auto handle = nanovdb::createNanoGrid( srcGrid);
| ^
~~~~ ^ /usr/local/include/nanovdb/util/CreateNanoGrid.h:1719:74: note: in instantiation of member function 'nanovdb::NodeAccessor<openvdb::v11_0::Grid<openvdb::v11_0::tree::Tree<openvdb::v11_0::tree::RootNode<openvdb::v11_0::tree::InternalNode<openvdb::v11_0::tree::InternalNode<openvdb::v11_0::tree::LeafNode<float, 3>, 4>, 5>>>>>::map' requested here 1719 | dstData->init({GridFlags::IsBreadthFirst}, mOffset.size, mSrcNodeAcc.map(), | ^ /usr/local/include/nanovdb/util/CreateNanoGrid.h:961:34: note: in instantiation of function template specialization 'nanovdb::CreateNanoGrid<openvdb::v11_0::Grid<openvdb::v11_0::tree::Tree<openvdb::v11_0::tree::RootNode<openvdb::v11_0::tree::InternalNode<openvdb::v11_0::tree::InternalNode<openvdb::v11_0::tree::LeafNode<float, 3>, 4>, 5>>>>>::processGrid~~~~ ^ /usr/local/include/nanovdb/util/CreateNanoGrid.h:1720:85: note: in instantiation of member function 'nanovdb::NodeAccessor<openvdb::v11_0::Grid<openvdb::v11_0::tree::Tree<openvdb::v11_0::tree::RootNode<openvdb::v11_0::tree::InternalNode<openvdb::v11_0::tree::InternalNode<openvdb::v11_0::tree::LeafNode<float, 3>, 4>, 5>>>>>::gridClass' requested here 1720 | mapToGridType