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

Python Tests Fail "ImportError: dynamic module does not define module export function (PyInit__base)" #659

Closed
mamoll opened this issue Jun 14, 2019 · 9 comments

Comments

@mamoll
Copy link
Member

mamoll commented Jun 14, 2019

Original report by Anonymous.


Hi,

I couldn't find this issue yet. I ran

#!c++

cmake -DPYTHON_EXEC=/usr/local/bin/python3 -DOMPL_BUILD_PYBINDINGS=ON -DOMPL_BUILD_PYTESTS=ON ../..

make -j 8 update_bindings

make -j 8

and all ran without error. Then I ran the tests

#!c++
make test

All worked except

21:test_base.py

22:test_geometric.py

23:test_geometric_compoundstate.py

24:test_control.py

I've attached the LastTest.log
All the tests failed at

Traceback (most recent call last):
File "/Users/Adam/Documents/UofT/Thesis/code/omplapp/ompl/tests/control/test_control.py", line 48, in
import ompl.base as ob
File "/Users/Adam/Documents/UofT/Thesis/code/omplapp/ompl/py-bindings/ompl/base/init.py", line 2, in
from ompl.base._base import *
ImportError: dynamic module does not define module export function (PyInit__base)

Any thoughts?

I'm installing on MacOSX Mojave (10.14.2).

@mamoll
Copy link
Member Author

mamoll commented Jun 14, 2019

Original comment by Mark Moll (Bitbucket: mamoll, GitHub: mamoll).


Which version of Boost are you using? It’s working fine for me on OS X 10.14.2 with Boost 1.66.

@mamoll
Copy link
Member Author

mamoll commented Jun 14, 2019

Original comment by Adam Hall (Bitbucket: [Adam Hall](https://bitbucket.org/Adam Hall), ).


It looks like version 1.70. Should I revert back to 1.66?

brew info boost

boost: stable 1.70.0 (bottled), HEAD

Collection of portable C++ source libraries

https://www.boost.org/

/usr/local/Cellar/boost/1.68.0 (13,712 files, 460.2MB)

Poured from bottle on 2018-12-18 at 14:32:00

/usr/local/Cellar/boost/1.70.0 (13,983 files, 521.8MB) *

Poured from bottle on 2019-06-13 at 16:18:56

From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/boost.rb

==> Dependencies

Required: icu4c ✔

==> Options

--HEAD

Install HEAD version

==> Analytics

install: 53,542 (30 days), 190,823 (90 days), 635,367 (365 days)

install_on_request: 18,137 (30 days), 63,790 (90 days), 197,333 (365 days)

build_error: 0 (30 days)

@mamoll
Copy link
Member Author

mamoll commented Jun 14, 2019

Original comment by Mark Moll (Bitbucket: mamoll, GitHub: mamoll).


If you have an easy to revert to an older version of Boost, then it’d be nice if you can confirm that the problem is indeed with Boost 1.70. I installed Boost and other dependencies of OMPL via MacPorts, but I think it’s most likely a change in Boost that’s to blame. I don’t know when I will have time to track this down.

@mamoll
Copy link
Member Author

mamoll commented Jun 14, 2019

Original comment by Adam Hall (Bitbucket: [Adam Hall](https://bitbucket.org/Adam Hall), ).


Okay I’ll try a reinstall using Boost version 1.66. I’ll let you know how it goes. Thanks!

@mamoll
Copy link
Member Author

mamoll commented Jun 15, 2019

Original comment by Adam Hall (Bitbucket: [Adam Hall](https://bitbucket.org/Adam Hall), ).


Hi Mark,

I tried installing with 1.68 (brew doesn’t let you get 1.66 easily) and had the same problem. Is it possibly a problem with libspot or py++? Upon closer inspection I found this output after running make -j 8 update_bindings.

I’m currently trying to install with boost 1.59. I will let you know how it goes.

file "vectorPlannerSolution.pypp.cpp" - updated( 0.000558 seconds )

Traceback (most recent call last):

File "/Users/Adam/Documents/UofT/Thesis/code/omplapp/ompl/py-bindings/generate_bindings.py", line 930, in

globals()['ompl_'+module+'_generator_t']()

File "/Users/Adam/Documents/UofT/Thesis/code/omplapp/ompl/py-bindings/generate_bindings.py", line 154, in __init__

code_generator_t.__init__(self, 'base', ['bindings/util'], replacement)

File "/Users/Adam/Documents/UofT/Thesis/code/omplapp/ompl/py-bindings/ompl/bindings_generator.py", line 151, in __init__

self.mb.split_module('bindings/' + name, use_files_sum_repository=True)

File "/usr/local/lib/python3.7/site-packages/pyplusplus/module_builder/boost_python_builder.py", line 384, in split_module

, encoding=self.encoding)

File "/usr/local/lib/python3.7/site-packages/pyplusplus/file_writers/__init__.py", line 37, in write_multiple_files

mfs.write()

File "/usr/local/lib/python3.7/site-packages/pyplusplus/file_writers/multiple_files.py", line 396, in write

self.split_classes()

File "/usr/local/lib/python3.7/site-packages/pyplusplus/file_writers/multiple_files.py", line 300, in split_classes

for cls in class_creators: self.split_class(cls)

File "/usr/local/lib/python3.7/site-packages/pyplusplus/file_writers/multiple_files.py", line 288, in split_class

self.split_class_impl( class_creator )

File "/usr/local/lib/python3.7/site-packages/pyplusplus/file_writers/multiple_files.py", line 262, in split_class_impl

, self.create_function_code( function_name ) ) )

File "/usr/local/lib/python3.7/site-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/base/__self.pypp.hpp).

The following is a short list of possible explanations for this behaviour:

* `Py++` bug, in this case, please report it

* module_builder_t contains two or more classes with the same alias

* module_builder_t contains two or more classes with the same wrapper alias

Please carefully review `Py++` warning messages. It should contain an additional information.

-- Build type: Release

-- Checking for module 'libspot'

-- No package 'libspot' found

-- Could NOT find SPOT (missing: SPOT_LIBRARIES SPOT_INCLUDE_DIRS)

-- Code for module control not found; type "make update_bindings"

-- Code for module geometric not found; type "make update_bindings"

-- Code for module tools not found; type "make update_bindings"

-- Code for module app not found; type "make update_bindings"

-- The following features have been enabled:

@mamoll
Copy link
Member Author

mamoll commented Jun 15, 2019

Original comment by Adam Hall (Bitbucket: [Adam Hall](https://bitbucket.org/Adam Hall), ).


boost 1.59 had the same issue with the failed tests.

@mamoll
Copy link
Member Author

mamoll commented Jun 15, 2019

Original comment by Mark Moll (Bitbucket: mamoll, GitHub: mamoll).


I committed a temporary workaround: https://bitbucket.org/ompl/ompl/commits/eece2cddbb3a43292c499bcaf711aa4ac1339b75

@mamoll
Copy link
Member Author

mamoll commented Jun 15, 2019

Original comment by Adam Hall (Bitbucket: [Adam Hall](https://bitbucket.org/Adam Hall), ).


Work around seemed to work! Thanks! I used boost 1.59 and boost 1.70. Both worked.

Does this workaround cause limited functionality?

@mamoll
Copy link
Member Author

mamoll commented Jun 15, 2019

Original comment by Mark Moll (Bitbucket: mamoll, GitHub: mamoll).


Yes, in the sense that there won’t be any Python bindings for the ConstraintIntersection class, but that’s a rather specialized class used by few people at this point, I suspect.

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