./features/build on Linux in CLion
Download Features Source code Forum Ask for support

Build on Linux in CLion

Getting started

In what follows, we assume that you already have the CLion IDE installed. If that is not the case, head over to the web-site of JetBrains and download the IDE from there. You may also want to read about our experience with CLion covering its pros and cons on the Manifold Geometry blog: "Getting started with CLion".

If you do not have the working copy of Analysis Situs yet, proceed to the "Source code" link and clone our git repository locally to your filesystem into any preferred destination.

Run IDE and open your working directory of Analysis Situs. CLion will propose to create build configurations. Go ahead and create both "Debug" and "Release" configurations using the "Profiles" list on the left. These profiles correspond to the different values of CMAKE_BUILD_TYPE variable, i.e., they would control CMake generator in the same way as you would normally do from native CMake. You do not have to specify anything else in the "Open Project Wizard" dialog, so click "OK" and proceed.

CLion should recognize your app as a "CMake Application". If that does not happen, try configuring CMake for the first time: upon successful configuration, the IDE will identify your app correctly.

CLion shows the entire contents of your working directory in the project browser to the left. The IDE also attempts to configure the project for the first time and fails because of undefined CMake variables.

CMake variables in CLion are configured rigth in the CMakeCache.txt file. To jump into the contents of this file, use a little icon in the bottom panel:

Now you are supposed to set the variables, save the CMakeCache.txt file and reconfigure the project. We recommend you to follow our "Build on Linux" tutorial or read the contents of the Dockerfile shipped with Analysis Situs for defining those variables. Whether a certain configuration is ready or not is depicted with a small icon in the "CMake" bottom panel:

To run Analysis Situs from IDE, make sure to configure runtime environment variables in the "Run/Debug Configurations" dialog. You will have to specify the LD_LIBRARY_PATH variable and also the working directory of the application, so that it will be able to dynamically load its plugins.

If everything is configured correctly, you should be able to run Analysis Situs from IDE (by pressing the green "play" tool button). Make sure that the app loads all plugins successfully by looking at the "Logger" window:

Find out more debugging tips and tricks on our Manifold Geometry blog here: