You can clone OCTproZ with or without plugin submodules.
git clone --recurse-submodules https://github.com/spectralcode/OCTproZ.gitgit clone https://github.com/spectralcode/OCTproZ.gitTo 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-extensionIf 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>git pull --recurse-submodules
git submodule update --init --recursiveIf you want the latest plugin commits (not just the versions pinned by the main repo):
git submodule update --remote --mergeBuilding 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:
- Clone/Download the OCTproZ project. The destination path should not contain any spaces!
- Start Qt Creator and open octproz_project.pro
- Configure project by selecting appropriate kit in Qt Creator (on Windows you need the MSVC compiler)
- Change the CUDA architecture flags in cuda.pri if necessary for your hardware (more info)
- Build octproz_project (right click on octproz_project -> Build)
- 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.
OCTproZ can be compiled with different versions of Qt, CUDA and MSVC. One of the easiest setups is possible with:
- Download Visual Studio 2017 installer
- Start Visual Studio 2017 installer
- Select Desktop development with C++. (This will install MSVC v141 and Windows 10 SDK) and start installation process
- When installation is done, restart Windows
- Open "Add or remove programs" in Windows system settings
- Search for „Windows Software Development Kit“
- Click on Modify → Change → Next and select Debugging Tools for Windows. Click on Change. This will install the debugger that can be used later within Qt Creator.
- Download CUDA 11.5.2
- Start CUDA installer and follow instructions on screen
- Download Qt 15.12.12 offline installer
- Disconnect from internet to skip Qt login screen
- Start Qt installer and follow instructions on screen
- In the Select Components screen you only need Qt 5.12.12 → MSVC 2017 64-bit and Developer and Designer Tools → Qt Creator 5.02 CDB Debugger Support. Everything else can be unchecked.
- Finish installation procedure and you are done!
The following instructions have been tested with Ubuntu 18.04.
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
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.
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:
Open a terminal (ctrl + alt + t) and type the following commands:
sudo apt-get install build-essential
sudo apt-get install qtcreator
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-defaultpackage is no longer available in the repositories. In this case, useqtbase5-devinstead:
sudo apt-get build-dep qtbase5-dev
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.15It 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
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-xcboption 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:
- wiki.qt.io Building Qt 5 from Git
- stackoverflow.com Qt-default version issue on migration from RPi4 to NVIDIA Jetson Nano
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.
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)