Skip to content

Latest commit

 

History

History
284 lines (206 loc) · 11 KB

File metadata and controls

284 lines (206 loc) · 11 KB

Building OCTproZ

Clone Repository

You can clone OCTproZ with or without plugin submodules.

Clone with all plugins

git clone --recurse-submodules https://github.com/spectralcode/OCTproZ.git

Clone without plugins

git clone https://github.com/spectralcode/OCTproZ.git

To initialize a specific existing plugin (already part of OCTproZ and tracked in .gitmodules):

git submodule update --init octproz_project/octproz_plugins/<plugin-folder>

Example for the Phase Extraction Extension:

git submodule update --init octproz_project/octproz_plugins/octproz-phase-extraction-extension

Add a new plugin manually (if not yet tracked)

If the plugin is not yet listed in .gitmodules, you can add it manually:

git submodule add <plugin-repo-url> octproz_project/octproz_plugins/<plugin-folder>

Pull updates (main repo + plugins)

git pull --recurse-submodules
git submodule update --init --recursive

(Optional) Update plugins to latest versions

If you want the latest plugin commits (not just the versions pinned by the main repo):

git submodule update --remote --merge

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 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

Note: In newer JetPack versions (JetPack 6 and newer, based on Ubuntu 22.04), the qt5-default package is no longer available in the repositories. In this case, use qtbase5-dev instead:

sudo apt-get build-dep qtbase5-dev

3. Get the Qt source

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

Note:
You can also use the latest Qt 5 version: git checkout 5.15 It works, but it has not been thoroughly tested with OCTproZ on the Jetson Nano. Use at your own risk.

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

Note for Qt 5.15 and later:
The -qt-xcb option was removed. Omit it from the configure command.

After the configuration is complete 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

Be aware that make will take about 5 hours on the Jetson Nano. Once make has finished, you can install Qt with:

sudo make install

Qt is now installed and ready to use. However, to successfully compile the Phase Extraction Extension, one additional packages is required:

sudo apt-get install libfftw3-dev 

Now you can start Qt Creator and check if your Qt installation was autodetected.
If not, you can add it manually via:

Tools → Options… → Kits → Qt Versions → Add…

The path to qmake depends on your Qt version, but it should be something like:

/usr/local/Qt-5.15.17/bin/qmake

Now you can open octproz_project.pro with Qt Creator and you are ready to 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 from 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)