8000 Eclipse setup · SGpp/SGpp Wiki · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Eclipse setup

Julian Valentin edited this page Mar 15, 2019 · 8 revisions

Basic eclipse installation

Setup SG⁺⁺ Project

  • File->Import... Git->Projects from Git import

  • Select "Clone URI"

  • Enter URI (SSH or HTPPS) and authetication details from this projects main page

  • Select branches to clone locally

  • Choose destination folder (preferably inside current workspace)

  • Wait for clone operation to finish, select "Import as general project" and finish

  • Rightclick newly created Project->New->Convert to a C/C++ Project (Adds C/C++ nature)

  • Select "Makefile project" and "Linux GCC" as toolchain

convert

Fix C++11 header indexing

  • Rightclick Project->Properties ->C/C++ General->Preprocessor Include Paths, Macros etc.->Providers (Tab)
  • Select only CDT User Settings and CDT GCC Built-in Compiler Settings
  • Move the latter to the top of the list
  • Add "-std=c++11" to the "Command to get compiler specs" field

c++11

  • Rightclick Project->Index->Rebuild

Hide files

  • Open the C/C++ Projects View
  • Click on the small triangle ("View Menu") next to the minimize button of this view.
  • Click "Filters..."
  • Add filters

Configure SCons build

Either overwrite Eclipse build or install SConsolidator plugin

Overwrite Eclipse Build

  • Rightclick Project->C/C++ Build
  • Deselect "Use default build command" and enter "scons"
  • Switch to "Behaviour" tab
  • Enter scons parameters (e.g: "-j4 SG_ALL=0 SG_BASE=1") in "Build (Incremental build)"
  • Enter "-c" in Clean

build

  • Optionally add different build configurations

Install SConsolidator

  • SConsolidator is an Eclipse plugin that Introduces native support for SCons scripts in Eclipse and provides nice features like dependency visualization
  • Install SConsolidator from update page as proposed in Sconsolidator Wiki
  • Restart Eclipse
  • Right click on your Project > SCons > Use self-provided SCons build
  • Add your desired SCons options e.g. ("SG_ALL=0 SG_BASE=1"). DO NOT specify parallel building. (e.g. "-j 4"). This is done automatically by SConsolidator.
  • SConsolidator rebuilds the project
  • Build will from now on automatically use Sconsolidator.

NOTE: Sometimes "Converting projects to SCons projects" hangs. I don't know why. Then use the above method overriding Eclipse build.

Configure Code Styling

  • CppStyle Eclipse Plugin: fixes the style of your C++ code and prevents style warnings/errors on jenkins
    • Install CppStyle from Eclipse Marketplace
    • Restart eclipse
    • Rightclick Project->Preferences -> C/C++ -> CppStyle and set the corresponding
      • clang format path to '' (/usr/bin/clang-format by default)
      • cpplint path to "/tools/cpplint.py"
    • Check "enable cpplint" and "run clang-format on file save"