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

xcpp::xdisplay fails with linking error #526

Open
hoorayphyer opened this issue Jun 16, 2024 · 1 comment
Open

xcpp::xdisplay fails with linking error #526

hoorayphyer opened this issue Jun 16, 2024 · 1 comment

Comments

@hoorayphyer
Copy link

I have the following code

#pragma cling add_library_path("/myhome/mambaforge/envs/cling/lib")
#pragma cling load("libxeus")
#pragma cling load("libxeus-cling")

#include <xcpp/xdisplay.hpp>

int a = 1;

xcpp::display(a)

which throws the following error (basically linker can't find xeus::xinterpreter::display_data.)

IncrementalExecutor::executeFunction: symbol 'ZN4xeus12xinterpreter12display_dataEN8nlohmann16json_abi_v3_11_310basic_jsonISt3mapSt6vectorNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEblmdSaNS2_14adl_serializerES5_IhSaIhEEvEESF_SF' unresolved while linking [cling interface function]!
You are probably missing the definition of xeus::xinterpreter::display_data(nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator >, void>, nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator >, void>, nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator >, void>)
Maybe you need to load the corresponding shared library?
Interpreter Error:

I've created a virtual env cling and installed xeus-cling via mamba install xeus-cling -c conda-forge as instructed and verified that xeus is also installed. I also verified that libxeus.so existed under the lib.

I first tried without the three pragmas, then with, but either way I got the same error. In case it's relevant, I ran jupyter notebook without browser on a remote server, and did an ssh tunnel so as to open it locally where I encountered the above error.

Any help in this is much appreciated!

@daviddwlee84
Copy link

I found that we should make sure the nlohmann json is exactly nlohmann_json=3.11.2, the latest version (3.11.3) won't work.

mamba install -y -c conda-forge nlohmann_json=3.11.2

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