declaration_not_found_t for ompl::base::ProjectionEvaluator and vector< std::string >
Hey, archlinux user here trying to build ompl with python bindings. While running ninja update_bindings I get the following errors.
I'm running python 3.9.7 with pyenv and virtualenvwrapper. Any suggestions?
I've installed the dependencies that show up in cmake and enabled OMPL_BUILD_PYBINDINGS=On.
Edit: hiding user folder structure below
File "<hidden>/.cache/yay/ompl/src/ompl-1.5.2/py-bindings/generate_bindings.py", line 950, in <module>
globals()['ompl_'+module+'_generator_t']()
File "<hidden>/.cache/yay/ompl/src/ompl-1.5.2/py-bindings/generate_bindings.py", line 878, in __init__
code_generator_t.__init__(self, 'util', None, replacement, 1)
File "<hidden>/.cache/yay/ompl/src/ompl-1.5.2/py-bindings/ompl/bindings_generator.py", line 146, in __init__
self.filter_declarations()
File "<hidden>/.cache/yay/ompl/src/ompl-1.5.2/py-bindings/generate_bindings.py", line 893, in filter_declarations
self.std_ns.class_('vector< std::string >').include()
File "<hidden>/.virtualenvs/msc_simulation_env/lib/python3.9/site-packages/pygccxml/declarations/scopedef.py", line 546, in class_
self._find_single(
File "<hidden>/.virtualenvs/msc_simulation_env/lib/python3.9/site-packages/pygccxml/declarations/scopedef.py", line 464, in _find_single
found = matcher.get_single(decl_matcher, decls, False)
File "<hidden>/.virtualenvs/msc_simulation_env/lib/python3.9/site-packages/pygccxml/declarations/scopedef.py", line 90, in get_single
raise runtime_errors.declaration_not_found_t(decl_matcher)
pygccxml.declarations.runtime_errors.declaration_not_found_t: Unable to find declaration. Matcher: [(decl type==class_t) and (name==vector< std::string >)]
File "<hidden>/.cache/yay/ompl/src/ompl-1.5.2/py-bindings/generate_bindings.py", line 950, in <module>
globals()['ompl_'+module+'_generator_t']()
File "<hidden>/.cache/yay/ompl/src/ompl-1.5.2/py-bindings/generate_bindings.py", line 154, in __init__
code_generator_t.__init__(self, 'base', ['bindings/util'], replacement)
File "<hidden>/.cache/yay/ompl/src/ompl-1.5.2/py-bindings/ompl/bindings_generator.py", line 146, in __init__
self.filter_declarations()
File "<hidden>/.cache/yay/ompl/src/ompl-1.5.2/py-bindings/generate_bindings.py", line 163, in filter_declarations
self.std_ns.class_(
File "<hidden>/.virtualenvs/msc_simulation_env/lib/python3.9/site-packages/pygccxml/declarations/scopedef.py", line 546, in class_
self._find_single(
File "<hidden>/.virtualenvs/msc_simulation_env/lib/python3.9/site-packages/pygccxml/declarations/scopedef.py", line 464, in _find_single
found = matcher.get_single(decl_matcher, decls, False)
File "<hidden>/.virtualenvs/msc_simulation_env/lib/python3.9/site-packages/pygccxml/declarations/scopedef.py", line 90, in get_single
raise runtime_errors.declaration_not_found_t(decl_matcher)
pygccxml.declarations.runtime_errors.declaration_not_found_t: Unable to find declaration. Matcher: [(decl type==class_t) and (name==map< std::string, std::shared_ptr< ompl::base::ProjectionEvaluator > >)]```
Can you check if this PR fixes it?
It does not. Error went from generate_bindings.py, line 893 to generate_bindings.py, line 894. Basically the same thing but the declaration matcher changed:
pygccxml.declarations.runtime_errors.declaration_not_found_t: Unable to find declaration. Matcher: [((decl type==class_t) and (name==vector< std::basic_string< char, std::char_traits< char >, std::allocator< char > > >)] (sorry if I had typos, just wrote this by hand)
Before this PR I also tried to build using python3.7 from pyenv and the system's python @ 3.9.7. Same error as before. I tried changing -march as well (suggestion from archlinux AUR). Znver2 (current), native and generic gave me the same results before the PR. I can test them in this PR as well if you'd like to.
Does it have something to do with pyplusplus/pygccxml? Any suggestions on code changes or environment changes/tests I could make to a better debugging? Maybe some package versions?
Just logged the installed versions. Maybe it's boost or eigen's fault?
boost 1.76
gcc 9.4 (had 11 before, tried a downgrade and it didn't helped)
python 3.9.7
pyplusplus 1.8.4
cmake 3.21.3
eigen 3.4.0
flann 1.9.1
libspot 2.9.7
doxygen 1.9.2
pygccxml 2.2.1
castxml 0.4.3-1
also, the full log from this PRs error:
File "<hidden>/ompl/py-bindings/generate_bindings.py", line 951, in <module>
globals()['ompl_'+module+'_generator_t']()
File "<hidden>/ompl/py-bindings/generate_bindings.py", line 879, in __init__
code_generator_t.__init__(self, 'util', None, replacement, 1)
File "<hidden>/ompl/py-bindings/ompl/bindings_generator.py", line 146, in __init__
self.filter_declarations()
File "<hidden>/ompl/py-bindings/generate_bindings.py", line 894, in filter_declarations
self.std_ns.class_(f'vector<{STRING}>').include()
File "<hidden>/.virtualenvs/msc_simulation_env/lib/python3.9/site-packages/pygccxml/declarations/scopedef.py", line 554, in class_
recursive=recursive)
File "<hidden>/.virtualenvs/msc_simulation_env/lib/python3.9/site-packages/pygccxml/declarations/scopedef.py", line 464, in _find_single
found = matcher.get_single(decl_matcher, decls, False)
File "<hidden>/.virtualenvs/msc_simulation_env/lib/python3.9/site-packages/pygccxml/declarations/scopedef.py", line 90, in get_single
raise runtime_errors.declaration_not_found_t(decl_matcher)
pygccxml.declarations.runtime_errors.declaration_not_found_t: Unable to find declaration. Matcher: [(decl type==class_t) and (name==vector< std::basic_string< char, std::char_traits< char >, std::allocator< char > > >)]
Which OS are you using? If it's a recent version of Ubuntu, macOS or Windows 10, I should be able to reproduce this error (which would make it a lot easier to actually fix). You may also want to try using clang++ as your C++ compiler to see if that makes a difference.
I met the same problem. Is it solved?
Sorry for the delay. I'm using Manjaro.
I actually went with another approach and did not fix/retried this issue
Hi is this problem solved for Ubuntu 20.04 and pygccxml version 2.2.1?
A temporary fix:
Replace all std::string inside ompl_util_generator_t.filter_declarations with std::basic_string<char>
Update: it doesn't fix all the problems. I'm guessing it's due to some recent updates to castxml. Here is my castxml version
castxml version 0.4.6
CastXML project maintained and supported by Kitware (kitware.com).
clang version 14.0.5 (Fedora 14.0.5-1.fc36)
Target: x86_64-redhat-linux-gnu
Thread model: posix
InstalledDir:```
Just checked Python binding build on archlinux, with #978 they should work now.
Closing - please follow up if this issue persists.
This error still exists for Ubuntu 20.04.
/usr/lib/pypy3/lib-python/3/importlib/_bootstrap.py:228: DeprecationWarning: invalid escape sequence 'm'
return f(*args, **kwds)
Traceback (most recent call last):
File "/home/rikka/Project/ompl/ompl-1.6.0/py-bindings/generate_bindings.py", line 963, in <module>
globals()['ompl_'+module+'_generator_t']()
File "/home/rikka/Project/ompl/ompl-1.6.0/py-bindings/generate_bindings.py", line 154, in __init__
code_generator_t.__init__(self, 'base', ['bindings/util'], replacement)
File "/home/rikka/Project/ompl/ompl-1.6.0/py-bindings/ompl/bindings_generator.py", line 151, in __init__
self.filter_declarations()
File "/home/rikka/Project/ompl/ompl-1.6.0/py-bindings/generate_bindings.py", line 194, in filter_declarations
self.ompl_ns.class_(f'SpecificParam< {self.string_decl} >').rename('SpecificParamString')
File "/usr/local/lib/python3.8/dist-packages/pygccxml/declarations/scopedef.py", line 554, in class_
recursive=recursive)
File "/usr/local/lib/python3.8/dist-packages/pygccxml/declarations/scopedef.py", line 464, in _find_single
found = matcher.get_single(decl_matcher, decls, False)
File "/usr/local/lib/python3.8/dist-packages/pygccxml/declarations/scopedef.py", line 90, in get_single
raise runtime_errors.declaration_not_found_t(decl_matcher)
pygccxml.declarations.runtime_errors.declaration_not_found_t: Unable to find declaration. Matcher: [(decl type==class_t) and (name==SpecificParam< std::string >)]
See #980 for a potential fix.
Another error has occurred when build geometric. Ubuntu 20.04.
Traceback (most recent call last):
File "/home/rikka/Project/ompl/ompl-1.6.0/py-bindings/generate_bindings.py", line 966, in <module>
globals()['ompl_'+module+'_generator_t']()
File "/home/rikka/Project/ompl/ompl-1.6.0/py-bindings/generate_bindings.py", line 625, in __init__
replacement)
File "/home/rikka/Project/ompl/ompl-1.6.0/py-bindings/ompl/bindings_generator.py", line 156, in __init__
self.mb.split_module('bindings/' + name, use_files_sum_repository=True)
File "/usr/local/lib/python3.8/dist-packages/pyplusplus/module_builder/boost_python_builder.py", line 389, in split_module
, encoding=self.encoding)
File "/usr/local/lib/python3.8/dist-packages/pyplusplus/file_writers/__init__.py", line 37, in write_multiple_files
mfs.write()
File "/usr/local/lib/python3.8/dist-packages/pyplusplus/file_writers/multiple_files.py", line 395, in write
self.split_values_traits()
File "/usr/local/lib/python3.8/dist-packages/pyplusplus/file_writers/multiple_files.py", line 321, in split_values_traits
for trait in self.__value_traits: self.split_value_traits(trait)
File "/usr/local/lib/python3.8/dist-packages/pyplusplus/file_writers/multiple_files.py", line 317, in split_value_traits
, value_traits.create() ) )
File "/usr/local/lib/python3.8/dist-packages/pyplusplus/file_writers/multiple_files.py", line 56, in write_file
raise RuntimeError( os.linesep.join(msg) )
RuntimeError: `Py++` is going to write different content to the same file(bindings/geometric/_Edge__value_traits.pypp.hpp).
For an operational fix, try removing the line src/ompl/geometric/planners/informedtrees/EITstar.h from py-bindings/headers_geometric.txt. It seems there is an unintended naming conflict between EIT* and the other informed planners.
See #979 for a potential fix.
Worked!Thank you very much!
This breaks on main at the moment, when reverting main back to where #980 is committed, works OK
This breaks on main at the moment, when reverting main back to where #980 is committed, works OK
Still facing the issue with ubuntu 18.04, python3, and the command to install is ./install-ompl-ubuntu.sh --python --github.
One thing to notice during the installation process:
${SUDO} pip${PYTHONV} install -vU https://github.com/CastXML/pygccxml/archive/develop.zip this command fails and I replaced it with pip3 install pygccxml.
@lydonchandra Can you elaborate a bit more how did you make it work? e.g., which exact commit did you revert to? Thanks!