Skip to content

Commit

Permalink
Fix arrow libraries from download & build not being found in some cas…
Browse files Browse the repository at this point in the history
…es (#5366)

### What

Apparently they don't always end up in `/lib` depending on how cmake was
configured. This should fix this!

### Checklist
* [x] I have read and agree to [Contributor
Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and
the [Code of
Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md)
* [x] I've included a screenshot or gif (if applicable)
* [x] I have tested the web demo (if applicable):
* Using newly built examples:
[app.rerun.io](https://app.rerun.io/pr/5366/index.html)
* Using examples from latest `main` build:
[app.rerun.io](https://app.rerun.io/pr/5366/index.html?manifest_url=https://app.rerun.io/version/main/examples_manifest.json)
* Using full set of examples from `nightly` build:
[app.rerun.io](https://app.rerun.io/pr/5366/index.html?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json)
* [x] The PR title and labels are set such as to maximize their
usefulness for the next release's CHANGELOG
* [x] If applicable, add a new check to the [release
checklist](https://github.com/rerun-io/rerun/blob/main/tests/python/release_checklist)!

- [PR Build Summary](https://build.rerun.io/pr/5366)
- [Docs
preview](https://rerun.io/preview/81bd42b2125820499614687246906beac4ef8e91/docs)
<!--DOCS-PREVIEW-->
- [Examples
preview](https://rerun.io/preview/81bd42b2125820499614687246906beac4ef8e91/examples)
<!--EXAMPLES-PREVIEW-->
- [Recent benchmark results](https://build.rerun.io/graphs/crates.html)
- [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)
  • Loading branch information
Wumpf authored Mar 1, 2024
1 parent 52d779a commit bf27199
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
1 change: 1 addition & 0 deletions .github/workflows/on_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ jobs:
- '**/*.hpp'
- '**/*.cpp'
- '**/CMakeLists.txt'
- '**/*cmake'
rust-checks:
name: "Rust Checks"
Expand Down
21 changes: 13 additions & 8 deletions rerun_cpp/download_and_build_arrow.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,19 @@ function(download_and_build_arrow)

set(ARROW_DOWNLOAD_PATH ${CMAKE_BINARY_DIR}/arrow)

set(ARROW_LIB_PATH ${ARROW_DOWNLOAD_PATH}/lib)
set(ARROW_BIN_PATH ${ARROW_DOWNLOAD_PATH}/bin)

if(RERUN_ARROW_LINK_SHARED)
set(ARROW_BUILD_SHARED ON)
set(ARROW_BUILD_STATIC OFF)

if(APPLE)
set(ARROW_LIBRARY_FILE ${ARROW_DOWNLOAD_PATH}/lib/libarrow.dylib)
set(ARROW_LIBRARY_FILE ${ARROW_LIB_PATH}/libarrow.dylib)
elseif(UNIX) # if(LINUX) # CMake 3.25
set(ARROW_LIBRARY_FILE ${ARROW_DOWNLOAD_PATH}/lib/libarrow.so)
set(ARROW_LIBRARY_FILE ${ARROW_LIB_PATH}/libarrow.so)
elseif(WIN32)
set(ARROW_LIBRARY_FILE ${ARROW_DOWNLOAD_PATH}/bin/arrow.dll)
set(ARROW_LIBRARY_FILE ${ARROW_BIN_PATH}/arrow.dll)
else()
message(FATAL_ERROR "Unsupported platform.")
endif()
Expand All @@ -25,14 +28,14 @@ function(download_and_build_arrow)
set(ARROW_BUILD_STATIC ON)

if(APPLE)
set(ARROW_LIBRARY_FILE ${ARROW_DOWNLOAD_PATH}/lib/libarrow.a)
set(ARROW_LIBRARY_FILE ${ARROW_LIB_PATH}/libarrow.a)
set(ARROW_BUNDLED_DEPENDENCIES_FILE ${ARROW_DOWNLOAD_PATH}/lib/libarrow_bundled_dependencies.a)
elseif(UNIX) # if(LINUX) # CMake 3.25
set(ARROW_LIBRARY_FILE ${ARROW_DOWNLOAD_PATH}/lib/libarrow.a)
set(ARROW_BUNDLED_DEPENDENCIES_FILE ${ARROW_DOWNLOAD_PATH}/lib/libarrow_bundled_dependencies.a)
set(ARROW_LIBRARY_FILE ${ARROW_LIB_PATH}/libarrow.a)
set(ARROW_BUNDLED_DEPENDENCIES_FILE ${ARROW_LIB_PATH}/libarrow_bundled_dependencies.a)
elseif(WIN32)
set(ARROW_LIBRARY_FILE ${ARROW_DOWNLOAD_PATH}/lib/arrow_static.lib)
set(ARROW_BUNDLED_DEPENDENCIES_FILE ${ARROW_DOWNLOAD_PATH}/lib/arrow_bundled_dependencies.lib)
set(ARROW_LIBRARY_FILE ${ARROW_LIB_PATH}/arrow_static.lib)
set(ARROW_BUNDLED_DEPENDENCIES_FILE ${ARROW_LIB_PATH}/arrow_bundled_dependencies.lib)
else()
message(FATAL_ERROR "Unsupported platform.")
endif()
Expand Down Expand Up @@ -92,6 +95,8 @@ function(download_and_build_arrow)
-DARROW_USE_UBSAN=OFF
-DBOOST_SOURCE=BUNDLED
-DCMAKE_INSTALL_PREFIX=${ARROW_DOWNLOAD_PATH}
-DCMAKE_INSTALL_LIBDIR=lib
-DCMAKE_INSTALL_BINDIR=bin
-Dxsimd_SOURCE=BUNDLED
-DBOOST_SOURCE=BUNDLED
-DARROW_BOOST_USE_SHARED=OFF
Expand Down

0 comments on commit bf27199

Please sign in to comment.