These brief instructions will help you how to start develop OpenKAI apps with Eclipse CDT systems

Develop OpenKAI apps with Eclipse CDT

Prerequisites

Assume you put all the git repositories inside the “/home/ubuntu/src” directory as in above link,run

sudo apt-get install default-jre
sudo su -c "echo -e '/usr/local/cuda/lib64\n/home/ubuntu/src/jetson-inference/build/x86_64/lib' >> /etc/ld.so.conf"
sudo ldconfig

Eclipse install

Download, extract and launch the latest Eclipse IDE for C/C++ Developers (CDT),

tar xzvf eclipse-cpp-neon-2-linux-gtk-x86_64.tar.gz
cd eclipse
sudo ./eclipse

Following the instruction to setup the worksapce in the first launch of Eclipse. Here we suppose to make and set “/home/ubuntu/src/workspace” directory as the workspace.

Eclipse project

Make a new C++ Project in Eclipse

Eclipse
Eclipse new C++ Project

Here we assume to use the project name “OpenKAI”, check “Use default location” or set the Location as “/home/ubuntu/src/workspace”, choose “Empty Project”, Toolchains “Linux GCC”, and click Next>

Eclipse
Choose Empty Project

Make sure both “Debug” and “Release” are checked, and click “Finish”

Eclipse
Debug and Release are checked

Git clone into eclipse workspace

Open Terminal and run

cd ~/src/workspace/OpenKAI
git clone https://github.com/yankailab/OpenKAI.git

Eclipse project settings

Back to Eclipse CDT, in the left pane click “OpenKAI” and press F5 key, now you should see there is an “OpenKAI” directory in the project.

Eclipse OpenKAI
OpenKAI directory in the project

Right click project “OpenKAI” and click “Properties”, click “C/C++ Build”, and choose the Configuration to be “[All configurations]”. Setup each page as following:

Eclipse C++ Builder Settings
C/C++ Builder Settings
Eclipse C++ Build Behavior
Eclipse C++ Build Behavior
Eclipse C++ Build Behavior
Eclipse C++ Build Artifact
Eclipse C++ Dialect
Eclipse C++ Dialect
Eclipse C++ Includes
Eclipse C++ Includes
Eclipse C++ Libraries
Eclipse C++ Libraries

Note:

If you experienced non-reponding or freezing in Eclipse on Ubuntu 16.04 etc., try to force Eclipse using GTK2 instead of GTK3. Open “/home/ubuntu/src/eclipse/eclipse.ini” and add

--launcher.GTK_version
2

just above the “–launcher.appendVmargs” line, so the “eclipse.ini” should somehow look like this:

-startup
plugins/org.eclipse.equinox.launcher_1.3.201.v20161025-1711.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.401.v20161122-1740
-product
org.eclipse.epp.package.cpp.product
--launcher.defaultAction
openFile
-showsplash
org.eclipse.platform
--launcher.defaultAction
openFile
--launcher.GTK_version
2
--launcher.appendVmargs
-vmargs
-Dosgi.requiredJavaVersion=1.8
-XX:+UseG1GC
-XX:+UseStringDeduplication
-Dosgi.requiredJavaVersion=1.8
-Xms256m
-Xmx1024m

Launch OpenKAI from Eclipse

Open the run configuration setting by

Eclipse run configuration
Eclipse run configuration

Click “New launch configuration” icon in the left pane, put a new name and setting up like following:

Eclipse run configuration
Eclipse run configuration 2
Eclipse run configuration
Eclipse run configuration 3

Click “Apply”, “Run” and you are done.

Enjoy.

Tags: