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

Add HDF5 dependency to beluga core #335

Merged
merged 3 commits into from
Mar 12, 2024
Merged
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
8 changes: 7 additions & 1 deletion beluga/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
endif()

find_package(Eigen3 REQUIRED NO_MODULE)
find_package(
HDF5
COMPONENTS CXX
REQUIRED)
find_package(range-v3 REQUIRED)
find_package(Sophus REQUIRED)
find_package(TBB REQUIRED)
Expand All @@ -46,10 +50,12 @@ add_library(${PROJECT_NAME} INTERFACE)
target_include_directories(
${PROJECT_NAME}
INTERFACE "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:include/${PROJECT_NAME}>")
"$<INSTALL_INTERFACE:include/${PROJECT_NAME}>"
"${HDF5_INCLUDE_DIRS}")
target_link_libraries(
${PROJECT_NAME}
INTERFACE Eigen3::Eigen
${HDF5_CXX_LIBRARIES}
Sophus::Sophus
TBB::tbb
range-v3::range-v3)
Expand Down
1 change: 1 addition & 0 deletions beluga/cmake/Config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
include(CMakeFindDependencyMacro)
find_dependency(Eigen3 REQUIRED NO_MODULE)
find_dependency(range-v3 REQUIRED)
find_dependency(HDF5 COMPONENTS CXX REQUIRED)
find_dependency(Sophus REQUIRED)
find_dependency(TBB REQUIRED)

Expand Down
1 change: 1 addition & 0 deletions beluga/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<buildtool_depend>cmake</buildtool_depend>

<depend>eigen</depend>
<depend>libhdf5-dev</depend>
<depend>range-v3</depend>
<depend>sophus</depend>
<depend>tbb</depend>
Expand Down
20 changes: 14 additions & 6 deletions docker/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,18 @@ while [[ "$1" != "" ]]; do
esac
done

# Note: The `--build` flag was added to docker compose run after
# https://github.com/docker/compose/releases/tag/v2.13.0.
# We have this for convenience and compatibility with previous versions.
# Otherwise, we could just forward the script arguments to the run verb.
[[ "$BUILD" = true ]] && docker compose build dev
DEV_CONTAINER_NAME=beluga_dev

PRIVILEGED_CONTAINER=$PRIVILEGED_CONTAINER USERID=$(id -u) GROUPID=$(id -g) docker compose run --rm dev
# Kill the container JIC it already exists, if building, to ensure we don't attach to an old container.
[[ "$BUILD" = true ]] && docker compose build dev && docker rm -f $DEV_CONTAINER_NAME 2>/dev/null

# Check if the container exists
if docker ps -a --format '{{.Names}}' | grep -q $DEV_CONTAINER_NAME; then
# Attach to the container if it is running
echo "Found dev container running, attaching to it..."
else
echo "Container '$DEV_CONTAINER_NAME' does not exist or is not running, proceeding to run it."
PRIVILEGED_CONTAINER=$PRIVILEGED_CONTAINER USERID=$(id -u) GROUPID=$(id -g) docker compose run --rm --detach --name $DEV_CONTAINER_NAME dev
fi

docker exec -it $DEV_CONTAINER_NAME /ros_entrypoint.sh /bin/bash
Loading