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

initialization of io raised unreported exception #174

Closed
ananevans opened this issue Jan 10, 2021 · 4 comments
Closed

initialization of io raised unreported exception #174

ananevans opened this issue Jan 10, 2021 · 4 comments

Comments

@ananevans
Copy link

I am trying to install the lanelet2 library using conan on an Ubuntu 20.04 distribution (python 3.8). Here is the output of:

conan install lanelet2/1.1.1@lanelet2/stable --build=missing -g virtualenv
The following tests FAILED:
	 26 - lanelet2_routing-gtest-test_relations (Failed)
	 27 - lanelet2_routing-gtest-test_route (Failed)
	 28 - lanelet2_routing-gtest-test_routing (Failed)
	 29 - lanelet2_routing-gtest-test_routing_graph_container (Failed)
	 30 - lanelet2_routing-gtest-test_routing_visualization (Failed)
/bin/bash: catkin_test_results: command not found


Errors while running CTest
make: *** [Makefile:130: test] Error 8
lanelet2/1.1.1@lanelet2/stable: 
lanelet2/1.1.1@lanelet2/stable: ERROR: Package '3b1a061d4322670975310ee5186a9939d8da6793' build failed
lanelet2/1.1.1@lanelet2/stable: WARN: Build folder /home/nora/.conan/data/lanelet2/1.1.1/lanelet2/stable/build/3b1a061d4322670975310ee5186a9939d8da6793
ERROR: lanelet2/1.1.1@lanelet2/stable: Error in build() method, line 116
	cmake.test()
	ConanException: Error 2 while executing cmake --build '/home/nora/.conan/data/lanelet2/1.1.1/lanelet2/stable/build/3b1a061d4322670975310ee5186a9939d8da6793' '--target' 'test' '--' '-j32'

If I comment cmake.test() in conanfile.py, then the installation completes, but I get the following error:

nora@nora-gpu:~/work/lanelet2$ source activate.sh
(conanenv) nora@nora-gpu:~/work/lanelet2$ python -c "import lanelet2"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/nora/.conan/data/lanelet2/1.1.1/lanelet2/stable/package/3b1a061d4322670975310ee5186a9939d8da6793/lib/python3.8/site-packages/lanelet2/__init__.py", line 11, in <module>
    module = import_module(__name__ + "." + module_name)
  File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
SystemError: initialization of io raised unreported exception

Any suggestions on how to get the library to work are greatly appreciated.

@poggenhans
Copy link
Contributor

Seems like you have to make conan build lanelet2 and boost as shared libraries. And you need virtualrunenv so that LD_LIBRARY_PATH is set. Basically like this:

conan install lanelet2/1.1.1@lanelet2/stable --build=missing --options shared=True --options boost:shared=True -g virtualenv -g virtualrunenv
source activate.sh && source activate_run.sh

Can you confirm this works? Then we'll update the docs to reflect this. This "double-sourcing" makes me a little sad, but it seems conan offers no better way to make it work. And it seems you cannot even properly deactivate this without breaking your shell...

@ananevans
Copy link
Author

I cleaned up any previous installation with:

pip uninstall conan
rm -rf ~/.conan
rm -rf lanelet2

I executed the updated commands:

pip install conan catkin_pkg
conan remote add bincrafters https://api.bintray.com/conan/bincrafters/public-conan
git clone https://github.com/fzi-forschungszentrum-informatik/lanelet2.git
cd lanelet2
conan source .
conan create . lanelet2/stable --build=missing --options shared=True
conan install lanelet2/1.1.1@lanelet2/stable --build=missing --options shared=True --options boost:shared=True -g virtualenv -g virtualrunenv
source activate.sh && source activate_run.sh

(conanrunenv) (conanenv) nora@nora-gpu:~/work/lanelet2$ echo $PYTHONPATH 
/home/nora/.conan/data/lanelet2/1.1.1/lanelet2/stable/package/abcbc5a4772b5361c96f5d7412ed223ead324210/lib/python3.8/site-packages

(conanrunenv) (conanenv) nora@nora-gpu:~/work/lanelet2$ echo $LD_LIBRARY_PATH 
/home/nora/.conan/data/lanelet2/1.1.1/lanelet2/stable/package/abcbc5a4772b5361c96f5d7412ed223ead324210/lib:/usr/lib/x86_64-linux-gnu:/home/nora/.conan/data/boost/1.69.0/conan/stable/package/30be8cb7c8f95490da5b0c3284d85b9373099bae/lib:/home/nora/.conan/data/geographiclib/1.49/bincrafters/stable/package/50a5030bbbb13ae56bc4be41915ecd48549cb895/lib:/home/nora/.conan/data/pugixml/1.9/bincrafters/stable/package/50a5030bbbb13ae56bc4be41915ecd48549cb895/lib:/home/nora/.conan/data/zlib/1.2.11/_/_/package/6af9cc7cb931c5ad942174fd7838eb655717c709/lib:/home/nora/.conan/data/bzip2/1.0.8/_/_/package/da606cf731e334010b0bf6e85a2a6f891b9f36b0/lib

(conanrunenv) (conanenv) nora@nora-gpu:~/work/lanelet2$ python -c "import lanelet2"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/nora/.conan/data/lanelet2/1.1.1/lanelet2/stable/package/abcbc5a4772b5361c96f5d7412ed223ead324210/lib/python3.8/site-packages/lanelet2/__init__.py", line 11, in <module>
    module = import_module(__name__ + "." + module_name)
  File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
SystemError: initialization of io raised unreported exception

@poggenhans
Copy link
Contributor

You also need --options boost:shared=True for the create step:

conan source .
conan create . lanelet2/stable --build=missing --options shared=True --options boost:shared=True
conan install lanelet2/1.1.1@lanelet2/stable --build=missing --options shared=True --options boost:shared=True -g virtualenv -g virtualrunenv
source activate.sh && source activate_run.sh

@ananevans
Copy link
Author

It works now. Thank you!

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