Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,8 @@ add_subdirectory( plotjuggler_plugins/DataLoadParquet )
add_subdirectory( plotjuggler_plugins/DataLoadULog )

add_subdirectory( plotjuggler_plugins/DataStreamSample )
add_subdirectory( plotjuggler_plugins/DataStreamWebsocket )
add_subdirectory( plotjuggler_plugins/DataStreamWebsocketServer )
add_subdirectory( plotjuggler_plugins/DataStreamWebsocketClient )
add_subdirectory( plotjuggler_plugins/DataStreamUDP )
add_subdirectory( plotjuggler_plugins/DataStreamMQTT )
add_subdirectory( plotjuggler_plugins/DataStreamZMQ )
Expand Down Expand Up @@ -319,4 +320,4 @@ if(NOT COMPILING_WITH_AMENT AND NOT COMPILING_WITH_CATKIN)
DESTINATION ${PJ_CMAKECONFIG_INSTALL_DIR}
)

endif()
endif()
176 changes: 52 additions & 124 deletions COMPILE.md
Original file line number Diff line number Diff line change
@@ -1,47 +1,69 @@
# Compile in Linux
# Compilation
These instructions are adjusted to fit our usage of PlotJuggler. For the original compilation instructions, see [here](https://github.com/facontidavide/PlotJuggler/blob/main/COMPILE.md).
## Compile on Ubuntu (tested in 18.04)
### Dependencies

On Ubuntu, the dependencies can be installed with the command:
The dependencies can be installed with the command:

sudo apt -y install qtbase5-dev libqt5svg5-dev libqt5websockets5-dev \
libqt5opengl5-dev libqt5x11extras5-dev libprotoc-dev libzmq-dev
On Fedora:
libqt5opengl5-dev libqt5x11extras5-dev libprotoc-dev libzmq-dev

Install the latest version (tested till 10.0.1) of Arrow for C++ and Apache Parquet for C++ according to the install instructions [here](https://arrow.apache.org/install/).

sudo dnf install qt5-qtbase-devel qt5-qtsvg-devel qt5-websockets-devel \
qt5-qtopendl-devel qt5-qtx11extras-devel
### Build the repository

Clone the repository into **~/plotjuggler_ws**:
Clone the repository:

```
git clone https://github.com/facontidavide/PlotJuggler.git ~/plotjuggler_ws/src/PlotJuggler
cd ~/plotjuggler_ws
git clone https://github.com/mtan1503/PlotJuggler.git
cd PlotJuggler
```

Then compile using cmake (qmake is NOT supported):
Then compile using cmake and install to your computer:

```
cmake -S src/PlotJuggler -B build/PlotJuggler -DCMAKE_INSTALL_PREFIX=install
cmake --build build/PlotJuggler --config RelWithDebInfo --parallel --target install
mkdir build && cd build
cmake ..
make -j8
sudo make install
```

## Optional: build with Conan

If you want to use [conan](https://conan.io/) to manage the dependencies,
follow this instructions instead.
If you run into issues during compilation, check the *Troubleshooting* chapter below.
## Run PlotJuggler
If you installed PlotJuggler, then you can open the app

If you want to run your build, the from your `build/` folder run:
```
./bin/plotjuggler
```
## Troubleshooting
### Compilation issues
#### CMake Error: cannot create imported target
If you get an error similar to the error below, this happens because in an older version of PlotJuggler the CMakeLists used `find_package(Arrow CONFIG)` and `find_package(Parquet CONFIG)`.
```
CMake Error at /usr/lib/x86_64-linux-gnu/cmake/Arrow/FindBrotli.cmake:122 (add_library):
add_library cannot create imported target "Brotli::brotlicommon" because another target with the same name already exists.
Call Stack (most recent call first):
/usr/share/cmake-3.22/Modules/CMakeFindDependencyMacro.cmake:47 (find_package)
/usr/lib/x86_64-linux-gnu/cmake/Arrow/ArrowConfig.cmake:115 (find_dependency)
plotjuggler_plugins/DataLoadParquet/cmake/FindArrow.cmake:424 (find_package)
plotjuggler_plugins/DataLoadParquet/CMakeLists.txt:17 (find_package)
```
To get rid of this issue, delete the Arrow and Parquet folder in the path that specifies where ArrowConfig.cmake is located within this repository. For example, from the main folder of this repository:
```
conan install src/PlotJuggler --install-folder build/PlotJuggler \
--build missing -pr:b=default
cd plotjuggler_plugins/DataLoadParquet/
rm -r cmake/
```
### Run time issues

export CMAKE_TOOLCHAIN=$(pwd)/build/PlotJuggler/conan_toolchain.cmake
#### Problem: PlotJuggler closes when I open a Parquet file
It is likely that your Parquet/Arrow version and the version of this branch do not align.

cmake -S src/PlotJuggler -B build/PlotJuggler \
-DCMAKE_TOOLCHAIN_FILE=$CMAKE_TOOLCHAIN \
-DCMAKE_INSTALL_PREFIX=install \
-DCMAKE_POLICY_DEFAULT_CMP0091=NEW
Make sure that you have the latest Arrow version installed (10.0.1).
* Check your current Arrow and Parquet version with `dpkg --list | grep arrow` and `dpkg --list | grep parquet`.
* See instructions above for how to instal the newest version.

cmake --build build/PlotJuggler --config RelWithDebInfo --parallel --target install
```
Make sure that you have built this repo with the latest version of Arrow and Parquet.
* See build instructions above.

## Deploy as an AppImage

Expand All @@ -61,106 +83,12 @@ mkdir -p AppDir/usr/bin
Then:

```
cd src/PlotJuggler;export VERSION=$(git describe --abbrev=0 --tags);cd -
cd PlotJuggler;export VERSION=$(git describe --abbrev=0 --tags);cd -
echo $VERSION
cp -v install/bin/* AppDir/usr/bin

./linuxdeploy-x86_64.AppImage --appdir=AppDir \
-d ./src/PlotJuggler/PlotJuggler.desktop \
-i ./src/PlotJuggler/plotjuggler.png \
-d ./PlotJuggler/PlotJuggler.desktop \
-i ./PlotJuggler/plotjuggler.png \
--plugin qt --output appimage
```

# Compile in Mac

On Mac, the dependencies can be installed using [brew](https://brew.sh/) with the following command:

brew install qt@5 protobuf mosquitto zeromq zstd

Clone the repository into **~/plotjuggler_ws**:

```
git clone https://github.com/facontidavide/PlotJuggler.git ~/plotjuggler_ws/src/PlotJuggler
cd ~/plotjuggler_ws
```

Then compile using cmake:

```
cmake -S src/PlotJuggler -B build/PlotJuggler -DCMAKE_INSTALL_PREFIX=install
cmake --build build/PlotJuggler --config RelWithDebInfo --parallel --target install
```

# Compile in Windows

Dependencies in Windows are managed either using
[conan](https://conan.io/) or [vcpkg](https://vcpkg.io/en/index.html)

The rest of this section assumes that you installed
You need to install first [Qt](https://www.qt.io/download-open-source) and
[git](https://desktop.github.com/).

**Visual studio 2019 (16)**, that is part of the Qt 5.15.x installation,
will be used to compile PlotJuggler.

Start creating a folder called **plotjuggler_ws** and cloning the repo:

```
cd \
mkdir plotjuggler_ws
cd plotjuggler_ws
git clone https://github.com/facontidavide/PlotJuggler.git src/PlotJuggler
```

## Build with Conan

Note: the Arrow/Parque plugin is not supported in Conan. Use vcpkg instead, if you need
that specific plugin.

```
conan install src/PlotJuggler --install-folder build/PlotJuggler ^
--build=missing -pr:b=default

set CMAKE_TOOLCHAIN=%cd%/build/PlotJuggler/conan_toolchain.cmake

cmake -G "Visual Studio 16" ^
-S src/PlotJuggler -B build/PlotJuggler ^
-DCMAKE_TOOLCHAIN_FILE=%CMAKE_TOOLCHAIN% ^
-DCMAKE_INSTALL_PREFIX=%cd%/install ^
-DCMAKE_POLICY_DEFAULT_CMP0091=NEW


cmake --build build/PlotJuggler --config Release --parallel --target install
```

## Build with vcpkg

Change the path where **vcpkg.cmake** can be found as needed.

```
set CMAKE_TOOLCHAIN=/path/vcpkg/scripts/buildsystems/vcpkg.cmake

cmake -G "Visual Studio 16" ^
-S src/PlotJuggler -B build/PlotJuggler ^
-DCMAKE_TOOLCHAIN_FILE=%CMAKE_TOOLCHAIN% ^
-DCMAKE_INSTALL_PREFIX=%cd%/install

cmake --build build/PlotJuggler --config Release --parallel --target install
```

## Create a Windows installer

Change the **Qt** and **QtInstallerFramework** version as needed.

```
xcopy src\PlotJuggler\installer installer\ /Y /S /f /z
xcopy install\bin\*.* installer\io.plotjuggler.application\data /Y /S /f /z

C:\Qt\5.15.2\msvc2019_64\bin\windeployqt.exe --release ^
installer\io.plotjuggler.application\data\plotjuggler.exe

C:\Qt\Tools\QtInstallerFramework\4.1\bin\binarycreator.exe ^
--offline-only -c installer\config.xml -p installer ^
PlotJuggler-Windows-installer.exe

```
29 changes: 17 additions & 12 deletions plotjuggler_plugins/DataLoadParquet/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,22 @@ else()
message(STATUS "Finding Parquet without package managers")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/")

find_package(Arrow CONFIG QUIET)
find_package(Parquet CONFIG QUIET)
find_package(Arrow QUIET)
if(NOT ${Arrow_FOUND})
message(FATAL_ERROR "Apache Arrow not found.")
endif()

find_package(Parquet QUIET)
if(NOT ${Parquet_FOUND})
message(FATAL_ERROR "Parquet not found.")
endif()

endif()


if(Arrow_FOUND)
message(STATUS "[Parquet] found")
include_directories( ../
${ARROW_INCLUDE_DIR}
${PARQUET_INCLUDE_DIR} )
if(${Arrow_FOUND} AND ${Parquet_FOUND})
message(STATUS "Arrow version: ${ARROW_VERSION}")
message(STATUS "Parquet version: ${PARQUET_VERSION}")

add_definitions(${QT_DEFINITIONS})
add_definitions(-DQT_PLUGIN)
Expand All @@ -32,17 +38,16 @@ if(Arrow_FOUND)

add_library(DataLoadParquet SHARED ${SRC} ${UI_SRC} )

target_link_libraries(DataLoadParquet
target_link_libraries(DataLoadParquet
Arrow::arrow_shared
Parquet::parquet_shared
${Qt5Widgets_LIBRARIES}
${Qt5Xml_LIBRARIES}
${PARQUET_LIBRARIES}
plotjuggler_base)


install(TARGETS DataLoadParquet DESTINATION ${PJ_PLUGIN_INSTALL_DIRECTORY} )

else()
message("[Parquet] not found. Skipping plugin DataLoadParquet.")
message("Arrow/Parquet not found. Skipping plugin DataLoadParquet.")
endif()


Loading