-
Notifications
You must be signed in to change notification settings - Fork 619
Eclipse
We use Eclipse CDT for development. In particular, we recommend using eclipse-4.4 (Eclipse Luna). Here's a blog post on installing it on Ubuntu.
First, install the EGit plug-in that enables Eclipse to work with Git repositories.
- Create a new workspace for Eclipse (if necessary).
- Select
File -> Import -> Git -> Projectsfrom Git. - When the next panel comes up, click the
Clonebutton. In the next window, enter the path to the Github repository into the URI field at Location:[email protected]:cmu-db/peloton.git. Then, clickNext. - In the next panel you can select which branches you wish to clone from the remote repository. You most likely only need to clone the
masterbranch. Then, clickNext. - Select the location on your local machine where you wish to store your cloned repository. You can leave the other defaults. Then, click
Finish. - It will now begin to pull down the repository. Once it’s finished, select
peloton. Then, clickNext. - In the next panel, select the
Import Existing Projectsoption at the top. Then, clickNext. - In the next page, select the
pelotoncheckbox. ClickFinish.
GCC needs the compiler option "-std=c++0x" or "-std=gnu++0x" depending on your needs. (please note: check the GCC manual also, because different GCC version may support different switches. For example GCC 4.7 accepts -std=c++11 also.)
Open Project Properties->C/C++ Build->Settings->Tool Settings->GCC C++ Compiler->Miscellaneous->Other Flags. Put "-std=c++0x" at the end.
Since CDT 8.3 there is a new "Dialect" option in the compiler option settings, see: https://wiki.eclipse.org/CDT/User/NewIn83#Toolchains
In Eclipse Neon: Open Project->Properties->C/C++ General->Preprocessor Include Paths, Macros etc.->Providers->CDT GCC Built-in Compiler Settings. Put "-std=c++0x" at the end of Command to get compiler specs:.
You should add the option -std=c++0x to the scanner discovery in Project Properties->C/C++ Build ->discovery Options in the field "compiler invocation arguments" (note the warning at the bottom of the page).
Open Project Properties->C/C++ General->Index->Index source and header files opened in the editor. If you are not using project specific settings you need to follow the link to "Configure workspace settings". This needs to be checked. Give it a minute to reindex.
Since Eclipse Juno a new Scanner Discovery is integrated in CDT version 8.1. This new scanner has a "hidden" option to set the C++11 feature, see this message: http://www.eclipse.org/forums/index.php/mv/msg/373462/909018/#msg_909018
- Ensure that you have run
../configurewith-gand-ggdbflags. - Select
Project -> Properties -> Run/Debug Settings - Click
Newto add a configuration - Click on
Maintab, enter the project namePeloton, and type in the path to executable filepelotonintoC/C++ Application. - Click on
Argumentstab, enter the program arguments:-D $PATH_TO_DATA_DIRECTORY. Replace$PATH_TO_DATA_DIRECTORYwith the absolute path to the directory when you runinitdbin previous steps. - Then you can set breakpoints and debug with it.
- Install
clang-formatandcpplint.pyaccording to the Requirement - To configure CppStyle globally, go to
Preferences -> C/C++ -> CppStyledialog - Fill in the path for
Clang-formatandCpplint, and tickEnable cpplintandRun clang-format on file save.
Have fun hacking !