Home        Store        Learn        Blog

Build Ping Viewer from source Jetson Xavier

Been trying to build Ping Viewer from source for almost a week and making no progress. I am on a jetson xavier and even gettting Qmake to work has been a process! I have a version QT creator installed but also tried to install older versions and building them from source so I should have 5.15.2 as well. Problem is when I try to build, QT tries to use the newest version and not the 5.15.2 version.
When I try
cmake -B build -DCMAKE_BUILD_TYPE=Debug
in terminal I get the error-
the following configuration files were considered but not accepted:
/usr/lib/aarch64-linux-gnu/cmake/QT5/Qt5Config.cmake, version 5.9.5

How can I get QT to use the right configuration file?

Hi @cperos, welcome to the forum :slight_smile:

I don’t have much experience with Qt, so I’ve passed this on to our software team and will get back to you.

Our build instructions say to use Qt 5.15, so if it’s trying to use that then that’s the expected behaviour. Do you know where you got the idea that Qt 5.12 should be used? If that’s on the forum or in our documentation please let me know so I can correct it :slight_smile:

It’s likely irrelevant, but I’m aware that we have an open issue regarding adding Arm support. I believe that’s more about us making pre-built binaries and perhaps adding some board-specific build instructions - I don’t believe any code changes should be required to build from source on an Arm device.

Hi @cperos, it appears from your error message that you are building Ping-Viewer with Qt 5.9.5.

I would recommend to install Qt with the official tool if possible, if you hardware/OS is not fully supported you could try to use non-official installation tools such as aqtinstall.

If you have any other Qt version installed, make sure to configure cmake property to look for the correct Qt installation version path.

As @EliotBR pointed, we do have an open issue to create ARM based releases, there are some people that are building and running Ping-Viewer on the raspberry, so we know that it works: Building PingViewer from source - #4 by hc-robotics

1 Like

Yes I know that is the problem, I just cant get QT to use another version instead of 5.9.5, I keep trying to add another version but it never seems to detect or try to use the alternate config file. How can I get QT to try in 5.15

I tried installing 5.15.2 because that’s the only source I can find to build it from that is 5.15, Im not using 5.12, I assumed 5.15.2 was just the second release of 5.15, Still the issue is I cant get QT to even try to use other versions to build from source and would like to know how to get qt to at least consider using an alternate config file. Hopefully one day they release builds for different architectures, I cant be the only one trying to run this on a Jetson…

Thanks I think this is what I need to figure out how to to, do you have any advice on how to accomplish this?

Unfortunately time is a finite resource, and the vast majority of our users run Ping Viewer on more standard computers, along with QGroundControl. No doubt we’ll get Arm builds out at some point, but at the moment we’ve got a few major projects ongoing that are taking most of our available programming time, which is unlikely to change for at least the next couple of months.

I searched online for “cmake specify qt installation version path”, and found this, which suggests using the CMAKE_PREFIX_PATH variable. Hope that helps :slight_smile:

Hi @cperos,

@EliotBR suggestion is correct, it’s only necessary to use CMAKE_PREFIX_PATH argument.
As example, in my machine, to build Ping-Viewer with Qt6, I only need to call cmake with
-DCMAKE_PREFIX_PATH=/usr/lib/qt515/ argument. But be aware, the value of the CMAKE_PREFIX_PATH needs to be defined correctly for you setup.

1 Like

I think I am close to being able to get this to work, I now have QT 5.15.0 installed as well as cmake version 3.12.1, I am unable to build the pingviewer software and am getting a similar error to the one descibed, I think QT installed to /usr/local/Qt-5.15.0/ but when I build with
-DCMAKE_PREFIX_PATH=~/usr/local/Qt-5.15.0/ I get no such file or directory. its weird when I typ cd ~ I dont get all the way to my root directory, but need to go cd ../../ before I see the usr folder. I have tried this as well and got this error, any ideas?

urop@urop-Jetson-Xavier-desktop:~/Downloads/pingviewer-source/ping-viewer-stable$ -DCMAKE_PREFIX_PATH=../../../../../usr/local/Qt-5.15.0/lib/cmake/
bash: -DCMAKE_PREFIX_PATH=../../../../../usr/local/Qt-5.15.0/lib/cmake/: No such file or directory

urop@urop-Jetson-Xavier-desktop:~/Downloads/pingviewer source/ping-viewer-stable$ -DCMAKE_PREFIX_PATH=~/../../usr/local/Qt-5.15.0/lib/cmake/
bash: -DCMAKE_PREFIX_PATH=~/../../usr/local/Qt-5.15.0/lib/cmake/: No such file or directory

urop@urop-Jetson-Xavier-desktop:~/Downloads/pingviewer source/ping-viewer-stable$ -DCMAKE_PREFIX_PATH=~/../../usr/local/Qt-5.15.0/
bash: -DCMAKE_PREFIX_PATH=~/../../usr/local/Qt-5.15.0/: No such file or directory

None of these seem to find the right path… I have been at this for a couple weeks now to no avail…

In unix, paths that start with / are absolute, and go from the root directory of the file system, whereas paths that start with ~ start at your home directory, and any other path is relative to where you’re running the code from. If you installed Qt to /usr/local/Qt-5.15.0/ then that’s what you need to specify the path as - specifying it as ~/usr/... is very different - there is probably no usr directory in your home directory, and even if there is it wouldn’t be the one you’re after.

Accordingly, you should be doing something like

cmake -B build -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH=/usr/local/Qt-5.15.0/

By the way, I’ve edited your last comment with code blocks. To do that yourself in future I’d recommend you check the Formatting a Post/Comment section of the Using the Blue Robotics Forum post :slight_smile:

Almost works, but still getting this error?
First it wants a directory called build,

CMake Error: The source directory "/home/urop/Downloads/pingviewer-source/ping-viewer-stable/build" does not exist.
Specify --help for usage, or press the help button on the CMake GUI.

I make that, then it wants the CMakeLists.txt file in there

CMake Error: The source directory "/home/urop/Downloads/pingviewer-source/ping-viewer-stable/build" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.

I put CMakeLists.Txt in the build folder and get more errors

$ cmake -B build -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH=/usr/local/Qt-5.15.0/
-- The CXX compiler identification is GNU 7.5.0
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:18 (include):
  include could not find load file:

    cmake/default.cmake


CMake Error at CMakeLists.txt:20 (include):
  include could not find load file:

    cmake/compiler.cmake


CMake Error at CMakeLists.txt:22 (include):
  include could not find load file:

    cmake/git.cmake


CMake Error at CMakeLists.txt:24 (include):
  include could not find load file:

    cmake/helper.cmake


CMake Error at CMakeLists.txt:58 (add_subdirectory):
  add_subdirectory given source "lib/fmt/fmt" which is not an existing
  directory.


CMake Error at CMakeLists.txt:60 (add_subdirectory):
  add_subdirectory given source "src" which is not an existing directory.


-- Configuring incomplete, errors occurred!
See also "/home/urop/Downloads/pingviewer-source/ping-viewer-stable/CMakeFiles/CMakeOutput.log".

So then I try with the files it specifies in the build folder, then I try moving all the files into the build folder, still getting an error

$ cmake -B build -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH=/usr/local/Qt-5.15.0/
-- The CXX compiler identification is GNU 7.5.0
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Compiler information:
--  Compiler ID: GNU
--  Compiler Version: 7.5.0
-- Found Git: /usr/bin/git (found version "2.17.1") 
CMake Error at CMakeLists.txt:58 (add_subdirectory):
  The source directory

    /home/urop/Downloads/pingviewer-source/ping-viewer-stable/build/lib/fmt/fmt

  does not contain a CMakeLists.txt file.


-- Configuring incomplete, errors occurred!
See also "/home/urop/Downloads/pingviewer-source/ping-viewer-stable/CMakeFiles/CMakeOutput.log".

CMakeOutput.log

Am I getting closer?

I’m intrigued that your sources seem to be in your Downloads directory - did you happen to get the source code as a .zip from github instead of using git? The build instructions state

I’d recommend you follow the source installation instructions (making sure to also update the submodules, as specified), and then try building again. You shouldn’t need to make the build directory - that should happen automatically as part of the build process :slight_smile:

oh ok, I will try with git again thanks

Getting further, every step has an obstacle to overcome
Hopefully almost there, been at this for weeks!

urop@urop-Jetson-Xavier-desktop:~/ping-viewer$ cmake -B build -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH=/usr/local/Qt-5.15.0/
-- Compiler information:
--  Compiler ID: GNU
--  Compiler Version: 7.5.0
-- Version: 6.1.1
-- Build type: Debug
-- CXX_STANDARD: 17
-- Configuring done
-- Generating done
-- Build files have been written to: /home/urop/ping-viewer
urop@urop-Jetson-Xavier-desktop:~/ping-viewer$ cmake --build build --parallel --config Debug
Error: could not load cache

It seems to have built but cant do the next step or run it yet

tried again with git, tried to follow the posted instructions but still required me to make the build folder and drop everything in it. How do I do the second build that makes it so I can run Ping Viewer?

well tried again in qt creator, got really close, even have a program I can open that looks like pingviewer, but there is no text anywhere.

I believe that’s unexpected. When I run the first build command I get the following output:

-- Compiler information:
--  Compiler ID: AppleClang
--  Compiler Version: 13.0.0.13000029
-- Submodule update
-- Git information:
--  Tag: v2.2.1
--  Version: c003725
--  Version Date: 2021-09-16T12:58:09-03:00
--  URL: https://github.com/bluerobotics/ping-viewer
-- Version: 6.1.1
-- Build type: Debug
-- CXX_STANDARD: 17
-- Performing Test has_std_17_flag
-- Performing Test has_std_17_flag - Success
-- Performing Test has_std_1z_flag
-- Performing Test has_std_1z_flag - Success
-- Performing Test SUPPORTS_VARIADIC_TEMPLATES
-- Performing Test SUPPORTS_VARIADIC_TEMPLATES - Success
-- Performing Test SUPPORTS_USER_DEFINED_LITERALS
-- Performing Test SUPPORTS_USER_DEFINED_LITERALS - Success
-- Performing Test FMT_HAS_VARIANT
-- Performing Test FMT_HAS_VARIANT - Success
-- Performing Test HAS_NULLPTR_WARNING
-- Performing Test HAS_NULLPTR_WARNING - Success
-- Looking for strtod_l
-- Looking for strtod_l - found
-- Configuring done
-- Generating done
-- Build files have been written to: /My/Computer/Path/ping-viewer/build

Yours won’t have the same compiler information, but the git information should be the same, and I believe the build result should automatically be to the build directory within ping-viewer.

Yours does seem to be writing them directly to the ping-viewer directory instead, which is odd, and likely makes it hard to separate build files from the source files.

If you managed to build there should hopefully be a PingViewer/Gui_Log/ directory in your Documents, with a log file saying what the program was trying and failing to do. It would likely be helpful if you can post that file so we can take a look :slight_smile: