CLion
IntelliJ CLion is a heavy IDE for cross-platform C++. Good for Intellisense-like assistance.
Intallation
I have a full license for the Ultimate Edition because of my open-source work. It's granted a year at a time. Download the tar, untar it here, and set up a symlink:
~m/development/intellij/clion-### ln -s clion-#### clion
During installation, it will ask where to put startup script, make it machine-specific for now to handle diff version, eg:
/home/m/development/scripts/ubuntu/viper/clion
Clion has a couple configuration challenges:
- All Jetbrains editors are Java based which means they can perform very poorly and can be difficult to tune. I've tried a lot of VM options from Help > Edit Custom VM options, but no magic bullet. In fact, right now I use no options there (defaults).
- Jetbrains is heavy and has a HUGE system cache of libraries. That meant that on viper, I had to symlink it to a larger drive. Config is here:
🐍 m@viper [~] ls .C* -lad lrwxrwxrwx 1 m m 45 Aug 11 2017 .CLion2017.2 -> development/config/common/home/m/.CLion2017.2 lrwxrwxrwx 1 m m 45 Dec 4 19:17 .CLion2017.3 -> development/config/common/home/m/.CLion2017.3 drwxr-xr-x 4 m m 4.0K Apr 1 11:33 .CLion2018.1
But then the system folder is symlinked to bigdata:
🐍 m@viper [~] ls .CLion2017.3/system lrwxrwxrwx 1 m m 35 Dec 21 20:07 .CLion2017.3/system -> /home/m/bigdata/.CLion2017.3-system
See maintenance for quick setup instructions.
Maintenance
3-4 times a year we get an update, whoohoo. If you get a new config dot file folder, make these changes:
# exit Clion after the update cd mv .CLion2018.1 development/config/common/home/m/ mv development/config/common/home/m/.CLion2018.1/system /home/m/bigdata/.CLion2018.1-system setup_stow.sh cd .CLion2018.1 ln -s /home/m/bigdata/.CLion2018.1-system system git add config # hold on now, all of it?
Project Settings
- You typically have a CMakeLists.txt file that defines your CMake project. Clion can open this!
- Next you should set up build/run/debug settings.
- BUILD: Go to File > Settings > Build > CMake
- Debug is typically there as a default. Hit the copy button and you'll get a Release too (silly).
- I set them up under cmake-debug and cmake-release (I remove the middle -build- part).
- Update the build options from the default of [-j 4] to [-j 8] if you have an i7 chip with hyperthreading for FAAAAAST COMPILES
- RUN/DEBUG: Go to Run > Edit Configurations...
- Application > at_server (or other project name) - this is a debug setup
- Copy it to create a release setup, call it [at_server ** LIVE **] (or whatever is best)
- Set both of them to run in [..] (the parent dir of the cmake build dir)
First time clean+build
First time building should be done with scripts:
- cda && cd cmake-debug && ./clean.sh && ./build.sh && cd ..
- cd cmake-release && ./clean.sh && ./build.sh && cd ..
boost
- Boost should be built as usual:
- unzip a release to development/boost_##_# and set up a development/boost symlink
- cd to boost and use build_boost_release_and_debug
- make sure .bashrc sets its variable to the currently-installed version