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

pybind11::memoryview "from_memory" error #110

Open
mkris0714 opened this issue Mar 5, 2024 · 1 comment
Open

pybind11::memoryview "from_memory" error #110

mkris0714 opened this issue Mar 5, 2024 · 1 comment

Comments

@mkris0714
Copy link

mkris0714 commented Mar 5, 2024

For communication between gym and ns3, I installed the ns3-ai.

but, during the process of ns3 building, the below error was occurred in spite of the installed pybind11 via apt-get.

I have solved the error by re-installing pybind11 via pip global commands: pip install "pybind11[global]"

Why does the error occur ?

[ 1%] Building CXX object src/antenna/CMakeFiles/libantenna-obj.dir/model/cosine-antenna-model.cc.o
[ 1%] Building CXX object src/core/CMakeFiles/libcore-obj.dir/helper/csv-reader.cc.o
[ 1%] Building CXX object src/antenna/CMakeFiles/libantenna-obj.dir/model/isotropic-antenna-model.cc.o
/root/impl_source/netai_impl/learning/environments/ns-allinone-3.38/ns-3.38/contrib/ai/model/gym-interface/py/msg_py_binding.cc: In lambda function:
/root/impl_source/netai_impl/learning/environments/ns-allinone-3.38/ns-3.38/contrib/ai/model/gym-interface/py/msg_py_binding.cc:36:41: error: ‘from_memory’ is not a member of ‘pybind11::memoryview’
36 | return py::memoryview::from_memory((void*)msg.buffer, msg.size);
| ^~~~~~~~~~~
/root/impl_source/netai_impl/learning/environments/ns-allinone-3.38/ns-3.38/contrib/ai/model/gym-interface/py/msg_py_binding.cc: In lambda function:
/root/impl_source/netai_impl/learning/environments/ns-allinone-3.38/ns-3.38/contrib/ai/model/gym-interface/py/msg_py_binding.cc:40:36: error: ‘from_memory’ is not a member of ‘pybind11::memoryview’
40 | return py::memoryview::from_memory((void*)msg.buffer, MSG_BUFFER_SIZE);

@pjzklcb
Copy link

pjzklcb commented Mar 8, 2024

This may due to the version of pybind11. Which version of pybind11 are you using?
I met the same problem when I work on Ubuntu 20.04 with the default pybind11-2.4.3.
I fix the problem by download and install pybind11-2.9.1, which is the default version on Ubuntu 22.04.

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

No branches or pull requests

2 participants