Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update & improve build instructions for auto-bundled arrow-cpp, and get windows to work out of the box #8

Merged
merged 6 commits into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from 4 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
40 changes: 20 additions & 20 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
cmake_minimum_required(VERSION 3.16...3.27)

project(rerun_external_cpp_proj LANGUAGES CXX)

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

if(NOT DEFINED CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
endif()

include(FetchContent)
FetchContent_Declare(rerun_sdk URL https://build.rerun.io/commit/bc05d11/rerun_cpp_sdk.zip) # 2023-10-26
FetchContent_MakeAvailable(rerun_sdk)

find_package(Eigen3 REQUIRED)
find_package(OpenCV REQUIRED)

add_executable(rerun_ext_example src/main.cpp)

target_link_libraries(rerun_ext_example Eigen3::Eigen ${OpenCV_LIBS} rerun_sdk)
cmake_minimum_required(VERSION 3.16...3.27)
project(rerun_external_cpp_proj LANGUAGES CXX)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
if(NOT DEFINED CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
endif()
include(FetchContent)
FetchContent_Declare(rerun_sdk URL https://build.rerun.io/commit/b7f404a/rerun_cpp_sdk.zip) # 2023-10-29
FetchContent_MakeAvailable(rerun_sdk)
find_package(Eigen3 REQUIRED)
find_package(OpenCV REQUIRED)
add_executable(rerun_ext_example src/main.cpp)
target_link_libraries(rerun_ext_example Eigen3::Eigen ${OpenCV_LIBS} rerun_sdk)
33 changes: 25 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# C++ Example with OpenCV and Eigen

Check warning on line 1 in README.md

View workflow job for this annotation

GitHub Actions / Spellcheck

Unknown word (Eigen)

This is a minimal CMake project that shows how to use [Rerun](https://github.com/rerun-io/rerun) in your code in conjunction with [Eigen](https://eigen.tuxfamily.org/) and [OpenCV](https://opencv.org/).

Check warning on line 3 in README.md

View workflow job for this annotation

GitHub Actions / Spellcheck

Unknown word (Eigen)

<center>
<picture>
<img src="https://static.rerun.io/cpp-example-opencv-eigen/80ec7c698224eccb5ba1928136ba0a522d79b60a/full.png" alt="">
<source media="(max-width: 480px)" srcset="https://static.rerun.io/cpp-example-opencv-eigen/80ec7c698224eccb5ba1928136ba0a522d79b60a/480w.png">

Check warning on line 8 in README.md

View workflow job for this annotation

GitHub Actions / Spellcheck

Unknown word (srcset)
<source media="(max-width: 768px)" srcset="https://static.rerun.io/cpp-example-opencv-eigen/80ec7c698224eccb5ba1928136ba0a522d79b60a/768w.png">

Check warning on line 9 in README.md

View workflow job for this annotation

GitHub Actions / Spellcheck

Unknown word (srcset)
<source media="(max-width: 1024px)" srcset="https://static.rerun.io/cpp-example-opencv-eigen/80ec7c698224eccb5ba1928136ba0a522d79b60a/1024w.png">

Check warning on line 10 in README.md

View workflow job for this annotation

GitHub Actions / Spellcheck

Unknown word (srcset)
<source media="(max-width: 1200px)" srcset="https://static.rerun.io/cpp-example-opencv-eigen/80ec7c698224eccb5ba1928136ba0a522d79b60a/1200w.png">

Check warning on line 11 in README.md

View workflow job for this annotation

GitHub Actions / Spellcheck

Unknown word (srcset)
</picture>
</center>

Expand All @@ -28,28 +28,45 @@

## Run this example

### Using `pixi`

Check warning on line 31 in README.md

View workflow job for this annotation

GitHub Actions / Spellcheck

Unknown word (pixi)
The easiest way to get started is to install [pixi](https://prefix.dev/docs/pixi/overview).

Check warning on line 32 in README.md

View workflow job for this annotation

GitHub Actions / Spellcheck

Unknown word (pixi)

* Start the rerun viewer with `rerun` (see above)
* Run the example with `pixi run run`

Check warning on line 35 in README.md

View workflow job for this annotation

GitHub Actions / Spellcheck

Unknown word (pixi)


### Manually
First install the required dependencies:
* `arrow-cpp` (required by Rerun)
* `eigen` and `opencv` (required by this example)

Check warning on line 40 in README.md

View workflow job for this annotation

GitHub Actions / Spellcheck

Unknown word (eigen)
* `cmake` and `ninja` (build tools)
* `cmake` (for building)

Build using:

### Linux & Mac

Build:
```bash
mkdir build
cd build
cmake ..
cmake --build . -- -j8
cmake -B build
cmake --build build -j
```

Then run the binary with:

`build/rerun_ext_example`


### Windows using Visual Studio 2022


Build
```cmd
cmake -B build -G 'Visual Studio 17 2022'
cmake --build build
```
Instead of building via CMake you can also open `build/rerun_external_cpp_proj.sln` in Visual Studio and build & run from there.

Then run the binary with
```cmd
build\RelWithDebInfo\rerun_ext_example.exe
```
Make sure that all dependent dlls (OpenCV & Eigen) are in PATH or next to the executable.


Loading
Loading