Development Setup - labp/na-online_ow-toolbox GitHub Wiki
Development Setup
For development it is recommended to build OpenWalnut from source and use this setup for the NA-Online toolbox. Furthermore, a developer should read:
After this boring duty, you have to download and install the 3rd party libraries (na-online_dependencies), see Download & Installation. To permanently point CMake to the correct library paths, you have to:
- setup the environment variables (recommended), or
- move them to
/opt/include
and/opt/lib
.
Environment Variables
-
Help on Ubuntu Documentation
-
Session-wide (single user) - edit one of these files:
~/.pam_environment
, syntaxVAR_NAME=VALUE
,~/.profile
, syntaxexport VAR_NAME=VALUE
, or~/.bashrc
, syntaxexport VAR_NAME=VALUE
-
System-wide (multi user) - edit one of these files:
/etc/environment
, syntaxVAR_NAME=VALUE
, or/etc/profile.d/*.sh
, syntaxexport VAR_NAME=VALUE
-
Point CMake to OpenWalnut:
OPENWALNUT_INCLUDEDIR=<path to OpenWalnut>/src OPENWALNUT_LIBDIR=<path to OpenWalnut>/build/lib
-
Point CMake to the 3rd party libraries
MNE_INCLUDE_DIR=~/na-online_dependencies/mne-cpp/MNE MNE_LIBRARY_DIR=~/na-online_dependencies/mne-cpp/lib FTB_BUFFER_INCLUDE_DIR=~/na-online_dependencies/fieldtrip/realtime/src/buffer/src FTB_BUFFER_LIBRARY=~/na-online_dependencies/fieldtrip/realtime/src/buffer/src/libFtbBuffer.a FTB_CLIENT_INCLUDE_DIR=~/na-online_dependencies/fieldtrip/realtime/src/buffer/cpp FTB_CLIENT_LIBRARY=~/na-online_dependencies/fieldtrip/realtime/src/buffer/cpp/libFtbClient.a
Setup Eclipse CDT
- Download latest Eclipse IDE for C/C++ Developers: eclipse.org/downloads
- It is recommended to increase memory for JVM
- modify
eclipse.ini
- change e.g.
-Xmx384m
to-Xmx1024m
or more
- modify
- Clone/Copy OpenWalnut and NA-Online to
~/workspace_nao
, e.g.:~/workspace_nao/OpenWalnut
~/workspace_nao/na-online_ow-toolbox
- Start Eclipse with the workspace
~/workspace_nao
- Create a project for OpenWalnut:
- File/New C++ Project
- Makefile project/: Empty Project; Toolchain: Linux GCC; Project Name: OpenWalnut
- Use the folder of your cloned OpenWalnut as project name. There should be a warning, ignore it.
- Create a project for NA-Online:
- File/New C++ Project
- Makefile project/: Empty Project; Toolchain: Linux GCC; Project Name: na-online_ow-toolbox
- Use the folder of your cloned NA-Online as project name. There should be a warning, ignore it.
- Setup includes and symbols for Auto Completion, Highlighting and more
- Right click on NA-Online project or OpenWalnut project
- Open Properties/C++ General/Path and Symbols
- Setup missing Includes (na-online_dependencies), Source Location, ...
- Setup Code Style for Auto Formatter
- Open Windows/Preferences
- C/C++/Code Style/Formatter
- Import
~/workspace_nao/na-online_ow-toolbox/tools/style/codeStyleDefinition_OpenWalnut_eclipse.xml
- Setup in specific projects: OpenWalnut and na-online_ow-toolbox
- Setup Code Templates for C++ source and header files
- Open Windows/Preferences
- C/C++/Code Templates
- Import
~/workspace_nao/na-online_ow-toolbox/tools/style/codeTemplate_cpp_NA-Online_eclipse.xml
to Files/C++ Source File - Import
~/workspace_nao/na-online_ow-toolbox/tools/style/codeTemplate_hpp_NA-Online_eclipse.xml
to Files/C++ Header File - You can now select the Code Template when creating a C++ source or header file
- For classes do:
- NOTE: Unfortunately this is not project specific!
- Backup the Default C++ source/header template
- Copy the patterns of NA-Online to Default C++ source/header template
Setup Mercurial (hg)
Set your name and e-mail for commits.
Use your global hg settings in ~/.hgrc
or repository settings in ~/workspace_nao/na-online_ow-toolbox/.hgrc
:
[ui]
username = forename surname <[email protected]>
# Optional: Set your favorite tools
editor = nano
merge = meld