Skip to content

Latest commit

 

History

History
193 lines (147 loc) · 8.76 KB

BUILD.md

File metadata and controls

193 lines (147 loc) · 8.76 KB

Building OCTproZ

OCTproZ can be build on Windows and Linux.

Compiling

Building OCTproZ from source requires:

  • Installation of Qt 5 (version 5.10.1 or newer)
  • Installation of CUDA Toolkit (version 8 or newer)
  • Windows: MSVC compiler that is compatible with your CUDA version (see CUDA installation guide for Windows) To get the MSVC compiler it is the easiest to search online where/how to get it as this changes from time to time. Pay attention that you get the right version of the MSVC compiler as described in the CUDA guide.
    Linux: Development environment that is compatible with your CUDA version (see CUDA installation guide for Linux) and the third-party libraries mentioned in the CUDA installation guide

How to compile:

  1. Clone/Download the OCTproZ project. The destination path should not contain any spaces!
  2. Start Qt Creator and open octproz_project.pro
  3. Configure project by selecting appropriate kit in Qt Creator (on Windows you need the MSVC compiler)
  4. Change the CUDA architecture flags in cuda.pri if necessary for your hardware (more info)
  5. Build octproz_project (right click on octproz_project -> Build)
  6. Run OCTproZ (right click on octproz_project or right click on octproz -> Run)

The project file octproz_project.pro ensures that the devkit is compiled first as it generates a folder with files that are used by OCTproZ and any plug-in at compile time.

Installing development tools to build OCTproZ on Windows

-->Video tutorial<--

OCTproZ can be compiled with different versions of Qt, CUDA and MSVC. One of the easiest setups is possible with:

1. Install Visual Studio 2017

  1. Download Visual Studio 2017 installer
  2. Start Visual Studio 2017 installer
  3. Select Desktop development with C++. (This will install MSVC v141 and Windows 10 SDK) and start installation process
  4. When installation is done, restart Windows
  5. Open "Add or remove programs" in Windows system settings
  6. Search for „Windows Software Development Kit“
  7. Click on ModifyChangeNext and select Debugging Tools for Windows. Click on Change. This will install the debugger that can be used later within Qt Creator.

2 Install CUDA:

  1. Download CUDA 11.5.2
  2. Start CUDA installer and follow instructions on screen

3. Install Qt 5.12.12:

  1. Download Qt 15.12.12 offline installer
  2. Disconnect from internet to skip Qt login screen
  3. Start Qt installer and follow instructions on screen
  4. In the Select Components screen you only need Qt 5.12.12MSVC 2017 64-bit and Developer and Designer ToolsQt Creator 5.02 CDB Debugger Support. Everything else can be unchecked.
  5. Finish installation procedure and you are done!

Installing development tools to build OCTproZ on Linux

Debian based systems

The following instructions have been tested with Ubuntu 18.04.

1. Install Qt 5:

Open a terminal (ctrl + alt + t) and type the following commands:

sudo apt-get install build-essential
sudo apt-get install qtcreator
sudo apt-get install qt5-default

Qt documentation and examples which are not not required, but recommended can be installed with these commands:

sudo apt-get install qt5-doc
sudo apt-get install qt5-doc-html qtbase5-doc-html
sudo apt-get install qtbase5-examples

2. Install CUDA

Follow the CUDA installation guide for Linux carefully.

When you get to the post-installation actions, you need to know that adding paths to the PATH variable can be done with the terminal-based text editor Nano by modifying the file ".bashrc".

Open .bashrc with Nano:

nano /home/$USER/.bashrc

Now insert the cuda relevant paths as stated in the cuda installation guide at the end of the file.

To save the file press on your keyboard

ctrl + o

And to close the file press

ctrl + x

After this you should verify that the CUDA toolkit can find and communicate correctly with the CUDA-capable hardware.

Finally you need to install some third-party libraries:

sudo apt-get install g++ freeglut3-dev build-essential libx11-dev \
    libxmu-dev libxi-dev libglu1-mesa libglu1-mesa-dev

That is all! Now you are able to compile OCTproZ by opening the OCTproZ project files with Qt Creator.

OCTproZ on the NVIDIA Jetson Nano with JetPack

To compile and run OCTproZ on the Jetson Nano you need Qt with enabled OpenGL desktop option.

For this Qt can be built from source on the Jetson Nano:

1. Install build-essential package and Qt Creator:

Open a terminal (ctrl + alt + t) and type the following commands:

sudo apt-get install build-essential
sudo apt-get install qtcreator

2. Install build dependencies

Enable the "Source code" option in Software and Updates > Ubuntu Software under the "Downloadable from the Internet" section. Then install the build dependencies like this

sudo apt-get build-dep qt5-default

3. Get the Qt source

git clone https://code.qt.io/qt/qt5.git
cd qt5
git checkout 5.12.10

then

git submodule update --init --recursive
cd ~
mkdir qt5-build
cd qt5-build

4. Configure and build

In this step you configure Qt for OpenGL desktop (this is necessary!) and remove some packages with -skip (this is optional. Removing those packages slightly reduces the build time)

../qt5/configure -qt-xcb -opengl desktop -nomake examples -nomake tests -skip qtwebengine -skip qtandroidextras -skip qtcanvas3d -skip qtcharts -skip qtconnectivity -skip qtdatavis3d -skip qtdeclarative -skip qtpurchasing -skip qtquickcontrols -skip qtquickcontrols2 -skip qtwinextras

After the configuration was done a Configure summary will be displayed. Please verify that there is a yes in the line with Desktop OpenGL. Now you can start the build process:

make
sudo make install

Be aware that make will take about 5 hours on the Jetson Nano.

When everything has been successfully completed you can start Qt Creator and build OCTproZ!

References:

Troubleshooting

Windows

After installing Qt 5.12.11 with the offline installer, you may get the error message:

NMAKE : fatal error U1077: "C:\Program": Rückgabe-Code "0x1""

One way to solve this issue is to close Qt Creator and (re-)install Qt Creator 4.14.2 with the offline installer form here: https://download.qt.io/official_releases/qtcreator/4.14/4.14.2/

Then delete the file toolchains.xml. You can find the file here:

C:\Users\%USERNAME%\AppData\Roaming\QtProject\qtcreator\toolchains.xml

After these steps reopen Qt Creator and everything should work fine.

Jetson Nano

If you encounter the following error message after the configure step:

ERROR: Feature 'xcb' was enabled, but the pre-condition 'features.thread && features.xkbcommon && libs.xcb' failed.

it may help to install the following packages:

sudo apt-get install libx11*
sudo apt-get install libxcb-*
sudo apt-get install libxcb*
sudo apt-get install libxkbcommon-dev
sudo apt-get install libxkbcommon-x11-dev

After installing these packages you need to delete the content of the qt5-build folder and run the configure step again. (see this discussion)