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

Add header only library #518

Open
SuperKlever opened this issue Feb 21, 2024 · 1 comment
Open

Add header only library #518

SuperKlever opened this issue Feb 21, 2024 · 1 comment

Comments

@SuperKlever
Copy link

I downloaded the header only library (NumCpp) and now I have the /include directory. The library folder is located in the same directory as my .ipynb file.
I'm trying to add add library to include path, however it doesn't seem to work.

#pragma cling add_include_path("/NumCpplib/include")
#include "NumCpplib/include/NumCpp.hpp"

After running this code, I get the classic error that the path to the library was not found.

./NumCpplib/include/NumCpp/Coordinates.hpp:30:10: fatal error: 'NumCpp/Coordinates/Cartesian.hpp' file not found

What am I doing wrong?

@Juno070
Copy link

Juno070 commented Jan 27, 2025

I am also experiencing some issues when specifying paths to library files. It has worked well up until the point where I attempt to use nonstandard libraries.

Platform: Linux Ubuntu 22.04.5 LTS x86_64
Environment: Miniconda created conda environment (using conda create --prefix ./cling_env -y) with xeus-cling and jupyter lab installed from the conda-forge channel

Example One:
#pragma cling add_include_path("/usr/include/wolfssl")
#pragma cling add_include_path("/usr/include/wolfssl/wolfcrypt")
#pragma cling add_library_path("/usr/lib/x86_64-linux-gnu")
#pragma cling load("libwolfssl.so")
#pragma cling load("libwolfssl.so.32")
#pragma cling load("libwolfssl.so.32.0.0")

#include <options.h>
#include <sha.h>
#include

Error One:
In file included from input_line_8:2:
/usr/include/wolfssl/wolfcrypt/sha.h:30:10: fatal error: 'wolfssl/wolfcrypt/types.h' file not found
#include <wolfssl/wolfcrypt/types.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~
Interpreter Error:

Example Two:
#pragma cling add_include_path("/usr/include/botan-2/botan")
#pragma cling add_library_path("/usr/lib/x86_64-linux-gnu")
#pragma cling load("libbotan-2.so")
#pragma cling load("libbotan-2.so.19")
#pragma cling load("libbotan-2.so.19.19.1")

#include <auto_rng.h>
#include <hash.h>
#include
#include

Error Two:
In file included from input_line_12:1:
/usr/include/botan-2/botan/auto_rng.h:11:10: fatal error: 'botan/rng.h' file not found
#include <botan/rng.h>
^~~~~~~~~~~~~

Note: Notice how it is not asking for any of the includes that I have explicitly declared, it is asking for other (types.h and rng.h) related include that is in the same location and exists. And even if I explicitly declare this include, it still fails.

Troubleshooting Attempts:
*Using echo | gcc -v -E -x c++ - to see where the compiler looks for files. I noticed that none of the include and lib paths of the created conda environment were listed, instead it seems to be using the system's files. I ran this with the conda environment activated, so it should be reflecting the behavior of the environments gcc, right?
*Moving the files didn't help. It just seems to be ignoring or unable to recognize the files.
*Using export CPLUS_INCLUDE_PATH, LIBRARY_PATH, and LD_LIBRARY_PATH in the ~/.bashrc or in the conda activate.d (this caused any code executed within jupyter to fail, so I removed them).

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