How to use anaconda (miniconda3) c++ development environments with CLion ?

Answered

Hello,

To address multiplatform development, and to take advantage of community build packages, I'm currently using anaconda (miniconda3) environments, for C++ development, that includes cmake, make, gcc and other development tools.

I'd like to know how can I use, anaconda environments with CLion on the build process.

Currently I've defined a toolchain, to point to the cmake executable under my anaconda development environment, also added the python interpreter as an anaconda environment (same as PyCharm).

Still after those settings, the cmake fails to find libraries that are defined in the conda environment.

The same does not occur when developing under console with the conda environment activate, cmake successfully configures and code successfully compiles.

Is there a way to use the anaconda environment in the cmake configure and build process?

6 comments
Comment actions Permalink

Hi Mario!

May be the same methods as for ROS development in CLion will help - https://www.jetbrains.com/help/clion/ros-setup-tutorial.html#launch-in-sourced?

0
Comment actions Permalink

Hello! Have there been any updates concerning this issue? Or is there a relevant CLion YouTrack issue to refer to? Launching CLion from within an activated Conda environment works as a workaround. However, it's inconvenient to keep track of and launch each project with its corresponding environment outside of the project, rather than having it be part of the project configuration.

0
Comment actions Permalink

Hi Greg Olmschenk!

In CLion 2021.3 EAP we added the ability to initialize toolchain environment via script - https://blog.jetbrains.com/clion/2021/09/clion-starts-2021-3-eap/#toolchains_and_environments. Maybe this feature will help in your scenario?

1
Comment actions Permalink

Hi Anna Falevskaya. Yes, this works. I look forward to seeing it in the stable version. Thank you!

0
Comment actions Permalink

Hi Anna Falevskaya

I still can't add conda env before compiling in CLion 2021.3 EAP. Could you have a detailed blog for this?

 

Thx

0
Comment actions Permalink

Hi Wbo4958!

We have a blog post and a web help article about the new feature mentioned in previous comments.

0

Please sign in to leave a comment.