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

Jupyter kernel handles library loads differently in a single cell vs separate cells #160

Open
chrahunt opened this issue Sep 2, 2017 · 0 comments

Comments

@chrahunt
Copy link

chrahunt commented Sep 2, 2017

  • Expected behavior: Libraries may be loaded in a single cell and used later.
  • Observed behavior: Dependent libraries need to be loaded in separate cells.
  • Cling version: 0.5~dev (nightly) ubuntu16 from 2017-08-30
  • OS: Ubuntu 16.04.3

Here is a markdown-formatted reproduction of the Jupyter notebook available here.

First attempt (failure)

Libraries are in correct load order, but seem not to resolve correctly when there are inter-dependencies (boost_filesystem depends on boost_system).

.I /usr/include
.L /usr/lib/x86_64-linux-gnu/libboost_system.so.1.58.0
.L /usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.58.0

Separated into 2 cells per #148.

#include <boost/filesystem.hpp>
#include <iostream>
IncrementalExecutor::executeFunction: symbol '_ZN5boost6system16generic_categoryEv' unresolved while linking function '_GLOBAL__sub_I_cling_module_1'!
You are probably missing the definition of boost::system::generic_category()
Maybe you need to load the corresponding shared library?
IncrementalExecutor::executeFunction: symbol '_ZN5boost6system15system_categoryEv' unresolved while linking function '_GLOBAL__sub_I_cling_module_1'!
You are probably missing the definition of boost::system::system_category()
Maybe you need to load the corresponding shared library?
std::cout << static_cast<unsigned long>(boost::filesystem::file_size("/bin/sh")) << "\n";
IncrementalExecutor::executeFunction: symbol '_ZN5boost10filesystem6detail9file_sizeERKNS0_4pathEPNS_6system10error_codeE' unresolved while linking [cling interface function]!
You are probably missing the definition of boost::filesystem::detail::file_size(boost::filesystem::path const&, boost::system::error_code*)
Maybe you need to load the corresponding shared library?

Second attempt (success)

Restarted kernel then evaluated the cells below, which succeeds

.I /usr/include
.L /usr/lib/x86_64-linux-gnu/libboost_system.so.1.58.0
.L /usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.58.0
#include <boost/filesystem.hpp>
#include <iostream>
std::cout << static_cast<unsigned long>(boost::filesystem::file_size("/bin/sh")) << "\n";
154072





(std::basic_ostream<char, std::char_traits<char> > &) @0x7fa9b1eb3f40
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

1 participant