eclipse manual - noma/dm-heom GitHub Wiki

Eclipse Manual

Note: the preferred, but commercial, IDE for HEOM is CLion

This is a short description of how to work with the HEOM code using the Eclipse IDE. Remember: using some powerful tool for navigating and editing the code in a larger, structured (i.e. the opposite of single file spaghetti-code) project is key to productivity.

Note: Eclipse and CMake aren't an ideal match as their philosophies aren't either. For instance, you have to create multiple Eclipse projects, one for each build directory instead of having one eclipse project with multiple build-configurations. Version control (git) integration is complicated, too.

However, it is a solid (and free) IDE with a good editor and good code navigation/analysis features. Personally, I use it for editing only. For running and debugging, I use the command line. For version control, I use the command line and a Git web-interface.

Howto

  • Download Eclipse

    • "Eclipse IDE for C/C++ Developers", Linux, 64 bit
  • Unpack it to your home, e.g. ~/Software

  • Create a link to the executable in your ~/bin folder

cd ~/bin # create if missing
ln -s  ../Software/eclipse-cpp-mars-1-linux-gtk-x86_64/eclipse eclipse
  • If you don't have ~/bin in your PATH environment variable, test with
env | grep ^PATH | grep home
  • ... add it to your ~/.bashrc
export PATH=$HOME/bin:"${PATH}
  • You can now start it as "eclipse" from a terminal or via the execute short-cut of your desktop (try Alt+F2)

  • Generate an Eclipse project using cmake

  • call cmake as usual with an additional -G option, e.g.:

cmake -G"Eclipse CDT4 - Unix Makefiles" ..
  • Import the project:
    • File->Import->Existing Project into Workspace
    • click "Next"
    • browse to build dir
    • click "Finish"

Bonus:

  • Show all shortcuts in Eclipse: Strg+Shift+L my favourites:
  • Ctrl + Tab => switch between cpp and hpp
  • Alt + Left/Right => navigate forward backward in your code navigation history
  • Ctrl + Space => auto completion
  • F3 => jump to declaration/open header