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

Question on usage #8

Open
qlibp opened this issue May 8, 2023 · 7 comments
Open

Question on usage #8

qlibp opened this issue May 8, 2023 · 7 comments

Comments

@qlibp
Copy link

qlibp commented May 8, 2023

If I just wanna bring in the necessary dependencies, but not building a target, is it possible to call the function without targets?

Saying that I make some find_package() calls, then invoke xeus_cling_setup() with the found libs and include directories without providing a target object.

@SoilRos
Copy link
Collaborator

SoilRos commented May 8, 2023

Yes. The TARGET argument in the xeus_cling_setup() signature allows to consume existing target dependencies if available, it does not create a new one. However, you can provide the dependencies by other means other than targets (see the documentation). The function will create a target named install_kernelspec which is up to you to call at build time (i.e., is not automatically included in the default build target all). What is not supported is to call xeus_cling_setup multiple times in the same project.

@dokempf
Copy link
Owner

dokempf commented May 8, 2023

@SoilRos is fully right. Here is a link to the full signature you are looking for. If you achieve something cool with this, let us know @qlibp , I wrote this a while back and still think it is nice, but I have only ever used it once.

@qlibp
Copy link
Author

qlibp commented May 9, 2023

Thank you all, and I'm trying to use it with the ROS eco-system, if I could make any progress on it, I will let you know.

For now, some guy from the community have provided a simple python script that extract information within .pc generated by the catkin build system, and then generate pragmas and inject into jupyter notebooks.

You could checkout the concrete usage from the following links:

The methods above is not quite fitting my ideal workflow as not every third party libs provide .pc file. And, what's bad about cmake is that it can't automatically generate .pc for us(at least for now)

So, the reason why xeus-cling-cmake-setup interest me is that I could create a dummy cmake project that call find_package() to find all my necessary dependencies(whether it provides a .pc or not) and call xeus_cling_setup () to generate a unify kernel file for me. With this, my development environment will settle down.

@qlibp
Copy link
Author

qlibp commented May 9, 2023

Just another question: is it possible to link a gcc-pre-built lib?

@qlibp
Copy link
Author

qlibp commented May 10, 2023

@dokempf Just play around the ROS env and try to generate the pcl related lib and directories.

Just curious about mechanism on how to generate include share lib name?
For me, I encounter such situation:

  • In the file system, I get the following name:
    • /usr/lib/x86_64-linux-gnu/libvtkChartsCore-7.1.so
    • /usr/lib/x86_64-linux-gnu/libvtkChartsCore-6.3.so.6.3.0
  • In CMakeLists.txt, when I find_package, I got the name vtkChartsCore
  • In generated xeus-cling.hh, I load vtkChartsCore, but it fails.

is there a better way to generate a precise name automatically? Or I need to manually write down?

@qlibp
Copy link
Author

qlibp commented May 11, 2023

Suggestion on readme:

It would be better to tell the user that they need to first activate the conda env before calling make install_kernelspec if their jupyter is installed with conda.

this kernel specification by building the CMake target `install_kernelspec` or you

@dokempf
Copy link
Owner

dokempf commented Jun 12, 2023

Thanks for the suggestion @qlibp, I added it to the README.

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

3 participants