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

Unable to import POMDP in python #21

Closed
omangin opened this issue Nov 21, 2016 · 4 comments
Closed

Unable to import POMDP in python #21

omangin opened this issue Nov 21, 2016 · 4 comments

Comments

@omangin
Copy link

omangin commented Nov 21, 2016

Importing POMDP in python raises the following error:

import POMDP
>>> ImportError: ./POMDP.so: undefined symbol: _ZNK9AIToolbox5POMDP18IncrementalPruning10getEpsilonEv

The error does not occur on import MDP, if I try again the import POMDP, python segfaults. The import was working on dcbe953.

(Compiled from 722826b, with python 1.7.12, boost 1.62.0 and eigen 3.2.95.)

@Svalorzen
Copy link
Owner

It seems I forgot to link the Python libraries against the .cpp implementations. I'll fix this ASAP and add a couple of easy tests just to check that everything is working. I only had MDP tests so I unfortunately missed this. Thanks for the report!

@Svalorzen
Copy link
Owner

I seem to have fixed this, however fixing it revealed a worse problem: CMake does not seem to be able to discriminate between static and shared libraries.

This is a problem since lpsolve can be found in both static and shared forms. I can't seem to be able to make linking work with the static version since the Python library is shared.

This means that we'd need to automatically understand whether CMake could find a shared version, and depending if Python was requested or not stop the configuring process. I'm looking around but there does not seem to be a portable way to do this, so I'm still trying to understand what the best way of doing this is.

@Svalorzen
Copy link
Owner

I've resolved this by simply emitting a warning if lpsolve libraries may be static, since we may not be able to link Python in this way (the default static Ubuntu ones in liblpsolve55-dev are not compiled with -fpic). However, we cannot know for certain since the user may have compiled his/her own, and there is no real cross platform way to be sure.

So we just emit the CMake warning and hope for the best.

Let me know if it works again!

@omangin
Copy link
Author

omangin commented Nov 24, 2016

It seems that the problem is solved now! Thanks a lot.

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