Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] I cannot compile my code using NanoVDB #1707

Open
Jaisiero opened this issue Nov 11, 2023 · 0 comments
Open

[BUG] I cannot compile my code using NanoVDB #1707

Jaisiero opened this issue Nov 11, 2023 · 0 comments

Comments

@Jaisiero
Copy link

Jaisiero commented Nov 11, 2023

Hi guys,
I hope somebody could help me to fix this or maybe I should try an earlier commit/version. I'll leave this here anyway in cause it is useful for you guys.

Environment

Operating System: (Ubuntu 22.04)
Version / Commit SHA: (master branch, SHA: 9153c12)
Other: (Ubuntu clang version 17.0.4 (++20231031083134+309d55140c46-1exp120231031083240.62), -std=c++17)

Describe the bug

I was trying to use OpenVDB and everything was fine untill I try to use NanoVDB. I got some some compilation errors:

In file included from ./src/main.cpp:8:
/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();}
      |                                             ~~~~~~~~~~~~ ^
/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<float>' requested here
  961 |             [&](){this->template processGrid<DstBuildT>();} );
      |                                  ^
/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<DstBuildT>(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);
      |                               ^
./src/main.cpp:572:28: 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
  572 |     auto handle = nanovdb::createNanoGrid(*grid);
      |                            ^
In file included from ./src/main.cpp:8:
/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();}
      |                                         ~~~~~~~~~~~~ ^
/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<DstBuildT>(), mapToGridClass<DstBuildT>(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<float>' requested here
  961 |             [&](){this->template processGrid<DstBuildT>();} );
      |                                  ^
/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<DstBuildT>(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);
      |                               ^
./src/main.cpp:572:28: 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
  572 |     auto handle = nanovdb::createNanoGrid(*grid);
      |                            ^
78 warnings and 2 errors generated.
make: *** [Makefile:29: main.o] Error 1
make: Leaving directory '/home/jaisiero/Projects/openvdb_sample'

To Reproduce

The code is very simple yet. I got this code from one of your examples guys. This is line which throws the error:

    // Convert the OpenVDB grid, srcGrid, into a NanoVDB grid handle.
    auto handle = nanovdb::createNanoGrid(*grid);
   

Expected behavior

I wanted to convert my OpenVDB data into NanoVDB and afterwards use it inside an GLSL shader. But I couldn't.

EDIT:
So i figured it out using this macro in my main.cpp before including NanoVDB headers:
#define NANOVDB_USE_OPENVDB

And it worked! Definitely this should be known somewhere.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants