When CLion met biicode

C and C++ have a long history going back to the early days of programming. Over three decades, many interesting tools have appeared in the field: debuggers, compilers, memory analyzers and code analyzers for these languages are evolving swiftly. But how about a dependency manager? Can C/C++ developers save their time by configuring and installing various libraries used in their projects?

Luckily there is a very interesting cross-platform tool called biicode. With biicode, you can reuse any single source file from any given project in any other project you are developing. It tracks and manages versions of published code and retrieves the missing files from the repository (GitHub and Bitbucket are supported for now). In its latest versions, it supports boost libraries, Eigen and many others, and can even work with Arduino boards.

Interestingly, biicode uses CMake to configure and build projects. Having that in common, we knew CLion and biicode had to start a relationship.

CLion is a cross-platform C/C++ IDE, which uses CMake build system as the project model. Now, there’s one more benefit you can get from it: a very simple and straightforward way to use biicode features together with the IDE. (You’ll need biicode 2.4.1 or higher and the latest CLion EAP.)

CMake layout for the project is generated by biicode commands, after which you can open the project directly in CLion. You can resolve dependencies and install the missing libraries easily by using bii commands from the CLion built-in terminal (Alt+F12). Let’s take a short overview of the overall process and some available features.

Download the latest version of biicode from the biicode website. To create a new project, run the command bii init -l clion prj_name, which will generate the proper layout to be used in CLion:
bii_init copy
To configure your project, run bii cpp:configure:
bii_configure copy

As you can see, these commands produced CMake-based output which can be simply opened in CLion via File | Open… Now you can use CLion for working on your project.

One extra benefit is that bii commands can be called directly from the IDE’s terminal (open it with Alt+F12).

Let’s talk about resolving dependencies in your projects. Assume you are going to use boost libraries, for example, in very simple and demo-like code below:
Because the project doesn’t have any boost dependency, CLion highlights boost-related code with red; no code completion or navigation features are available at this point. We’ll update the CMakeLists.txt file following instructions from the biicode website as follows:
bii_boost_cmake copy
Then we run the commands bii find and bii cpp:configure. After biicode downloads and installs all the missing dependencies and the CMake project in CLion is reloaded, the code is highlighted with green. Smart actions now work fine, as does code completion:
boost_completion copy

That’s it! Get CLion EAP build and install biicode to try them together now.

Develop with pleasure,
The CLion Team

This entry was posted in Announcement and tagged . Bookmark the permalink.

17 Responses to When CLion met biicode

  1. Daniel Clausen says:

    Looking forward to use the new version this evening!

    I’m wondering whether support for Google Test is still planned for release CLion 1.0? Since this sounds like a major feature and you’re planning to release 1.0 “soon”, I’m starting to worry a bit. :)


  2. Rob Irving says:

    Looks great, I really need to try CLion for myself.

    Anastasia would you be interested in being a guest on CppCast (www.cppcast.com) to talk about CLion?

  3. Jon Reyna says:

    Will CLion eventually give the option to use libclang for a semantic model? Or will it only use CLion’s own AST?

  4. Ed Johnson says:

    Instructions for this tutorial do not work with biicode 3.3 on ubuntu 14.04 64bit.
    There are huge gaps in this blog post, and even more errors on the biicode docs that it refers to.
    End result is that neither biicode nor Idea have produced a working tutorial for using Clion with biicode. Very frustrating.

    If you’re going to make an example tutorial for new technology, then please add all the steps required and don’t ‘wave your hands’ over critical parts.

    • Anastasia Kazakova says:

      Sorry for the inconvenience. We’ll check the content. What exactly are you missing in the blog post (please, take into consideration that the aim of the post was to share the initial experience and not to provide a full-fledged tutorial on the topic)? The biicode docs fits this goal better. However, I believe the problems with the biicode docs are caused by the tough situation biicode team has right now and not sure they are going to evolve it further. But hope for the best, because the tool is really nice.

  5. al3abnat says:

    Looks great, I really like CLion for myself.

  6. Tim says:


    bii init unit_test -l=clion
    cd unit_test
    bii configure

    Open the biicode project with CLion (File -> Open).

    Created main.cpp with:

    #include “google/gtest/include/gtest/gtest.h”

    int sum(int a, int b) {return a+b;}

    bii find from CLion’s Terminal

    INFO: Processing changes…
    INFO: No deps to find on server

    CLion CL-143.1183.3
    Build #CL-143.1183, built on December 1, 2015
    JRE: 1.8.0_66-b17 amd64
    JVM: Java HotSpot(TM) 64-Bit Server VM by Oracle Corporation

    What’s wrong? Without -l=clion works well.

    • Anastasia Kazakova says:

      Not sure what’s going on here. It worked for CLion in the way described in the post, at least with the biicode version available at that moment. There is nothing special in CLion to work with biicode. So it’s probably smth related to biicode itself.

Leave a Reply

Your email address will not be published. Required fields are marked *