jupyter-xeus / xeus-cling

Jupyter kernel for the C++ programming language
BSD 3-Clause "New" or "Revised" License
3.08k stars 299 forks source link

Failing to load a dynamic library that loads in plain cling #71

Closed nthiery closed 6 years ago

nthiery commented 6 years ago

I am trying to load a dynamic library, and am getting a failure: image

The same commands work with plain cling from the same conda environment, in the same directory. MLV is from debian package libmlv0-dev. One thing that may have an influence is that MLV.h is not in the system dir but in the same directory as the notebook. In any cases, the error message looks dubious.

I could try with other libraries if useful.

SylvainCorlay commented 6 years ago

The dot versiobs of the cling commands don't work with the kernel.

Instead, you can use the cling pragmas

For loading a library, use

#pragma cling load("MLV")

Which is also more c++ compliant. Examples available in xtensor-blas.

nthiery commented 6 years ago

That worked! Perfect. Thanks a lot Sylvain. Micro suggestion: could the dot version of the cling commands raise an explicit error in the kernel, suggesting to use the pragma as you just did?

SylvainCorlay commented 6 years ago

OK, closing and opening a separate issue for the warning.