Setup C++ IDE CLion on Raspberry Pi with Ubuntu Mate

Try CLion

Start CLIon with its script

/opt/clion/bin/clion.sh

Ignore for now the dialog about not found “VM options file”

Raspberry-Pi-CLion031

Do not import for now settings is no other version was installed yet

Raspberry-Pi-CLion032

On the dialog the “CLIon Privacy Policy Agreement” click on the button “Accept”  (if agree). On the dialog “CLion License Activation” enter the license information or click on the button “Evaluate for free for 30 days”. Select the UI theme and click the button “Next: Toolchain”.

Specify the location of the CMake

Raspberry-Pi-CLion034

Specify the location of the GDB

Raspberry-Pi-CLion036

The dialog reports OK on CMake bu for not it reports warning on the version of GDB – most likely debugging would not work. Ubuntu 14.04 for Raspberry Pi has version 7.7 which does not allow to debug with CLion as well.

Raspberry-Pi-CLion037

When complete with setup dialog and sturt-up splash-screen – select the option “New Project” in the “Welcome to CLIon” dialog

Raspberry-Pi-CLion039

Specify the project name and the folder where it will be located

Raspberry-Pi-CLion040

Wait while initial operations completed (notice the progress-indicators on the status bar), open panels with left bottom menu, turn on “Power Save Mode” – useful option for such processor as in Raspberry Pi

Raspberry-Pi-CLion045     Raspberry-Pi-CLion046

Hit the Run button to build and start the existing example project created automatically

Raspberry-Pi-CLion048

Select the executable file in the “Edit configuration” dialog

Raspberry-Pi-CLion047

If during first start result is not shown in the Terminal window – there are some issue with terminal during running

Raspberry-Pi-CLion049

Run it again – it works

Raspberry-Pi-CLion050

However following code example works fine and stable

#include <iostream>
#include <chrono>
#include <thread>

int main() {
    for (int i = 0; i < 100; ++i) {
        std::this_thread::sleep_for(std::chrono::milliseconds(500));
        std::cout << "Count: " << i << std::endl;
    }
    return 0;
}

Path to the built executable can be changed

Raspberry-Pi-CLion055

Close the CLion IDE and try to start it with shortcut “Application\Programming\CLion”. If the error dialog reports about missed path to JDK – this need to be fixed with workaround

sudo nano /opt/clion/bin/clion.sh

Add following line to the script

JAVA_HOME=/opt/java

Raspberry-Pi-CLion054

Hit Ctrl+X, then “Y” and Enter to save the file. Try to start CLion with application shortcut or under sudo permissions

sudo /opt/clion/bin/clion.sh

The reason for running CLion  with sudo permissions – some of Raspberry Pi resources require such permits when they are operated with applications.

 

 

 

 

 

Facebooktwittergoogle_plusredditpinterestlinkedintumblrmail

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.