Skip to content

Commit

Permalink
Zenohc fix cargo version (#38)
Browse files Browse the repository at this point in the history
# Description
See
[discord](https://discord.com/channels/914168414178779197/940584045287460885/1220421516219388025)
conversation.
zenoh doesn't support cargo 1.77 so we need to fix the zenoh version

## Type of change
Please delete options that are not relevant.
- Bug fix (non-breaking change which fixes an issue)
  • Loading branch information
filippobrizzi authored Mar 26, 2024
1 parent 28bee7f commit 85be4b5
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 20 deletions.
4 changes: 2 additions & 2 deletions cmake/03_compiler_config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ if(LIST_OF_SANITIZERS)
endif()
endif()

# Set whether to enable inter-procedural optimisation
option(ENABLE_IPO "Enable interprocedural optimization" ON)
# Set whether to enable inter-procedural optimisation TODO: This is working with latest release of Clang.
option(ENABLE_IPO "Enable interprocedural optimization" OFF)
if(ENABLE_IPO)
include(CheckIPOSupported)
check_ipo_supported(RESULT ipo_result OUTPUT output)
Expand Down
12 changes: 7 additions & 5 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ ENV DEBIAN_FRONTEND=noninteractive

RUN apt update && \
apt install -y --no-install-recommends x11-apps g++ mesa-utils make cmake-curses-gui ninja-build git gdb vim htop \
curl zlib1g-dev libffi-dev libssl-dev libbz2-dev libsqlite3-dev iproute2 tk-dev texlive-latex-extra texlive-fonts-recommended dvipng cm-super libnotify-bin \
pkg-config gpg wget ca-certificates git-lfs curl ccache ninja-build doxygen graphviz linux-generic python3-dev python3-pip iproute2 python-is-python3 \
net-tools iftop htop lsb-release software-properties-common gnupg bash-completion psmisc less tree && \
rm -rf /var/lib/apt/lists/*
curl zlib1g-dev libffi-dev libssl-dev libbz2-dev libsqlite3-dev iproute2 tk-dev texlive-latex-extra texlive-fonts-recommended dvipng cm-super libnotify-bin \
pkg-config gpg wget ca-certificates git-lfs curl ccache ninja-build doxygen graphviz linux-generic python3-dev python3-pip iproute2 python-is-python3 \
net-tools iftop htop lsb-release software-properties-common gnupg bash-completion psmisc less tree && \
rm -rf /var/lib/apt/lists/*
RUN python3 -m pip install cmakelang

RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null && \
Expand Down Expand Up @@ -39,7 +39,9 @@ RUN echo "deb [trusted=yes] https://download.eclipse.org/zenoh/debian-repo/ /" |
apt-get update && apt-get install -y systemctl zenoh && \
rm -rf /var/lib/apt/lists/*

RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rust_installer.sh && chmod +x rust_installer.sh && ./rust_installer.sh -y
ENV RUST_VERSION=1.76.0
RUN wget -q -O rust_installer.sh https://sh.rustup.rs && chmod +x rust_installer.sh && ./rust_installer.sh -y && \
. "$HOME/.cargo/env" && rustup install "$RUST_VERSION" && rustup default "$RUST_VERSION"
RUN . "$HOME/.cargo/env" && cargo install sccache --locked
RUN echo "export RUSTC_WRAPPER=sccache" >> $HOME/.bashrc

Expand Down
4 changes: 2 additions & 2 deletions docker/version.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
HOST=ghcr.io/olympus-robotics
VERSION=1.0.5
VERSION=1.0.7
IMAGE=hephaestus-dev

# This is the version of the dep image. Increase this number everytime you change `external/CMakeLists.txt`
DEPS_VERSION=1.0.9
DEPS_VERSION=1.0.10
9 changes: 6 additions & 3 deletions external/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,13 @@ endif()
# --------------------------------------------------------------------------------------------------
# zenoh

set(GIT_TAG "10176b911096cb92b8ee46bc491b78079ee26c20")
add_cmake_dependency(NAME zenohc URL "https://github.com/eclipse-zenoh/zenoh-c/archive/${GIT_TAG}.zip")
set(GIT_TAG "0d0a6d8d1488a71224c3bf6929714036945e7947")
add_cmake_dependency(
NAME zenohc URL "https://github.com/eclipse-zenoh/zenoh-c/archive/${GIT_TAG}.zip"
CMAKE_ARGS -DZENOHC_CARGO_CHANNEL=1.76.0
)

set(GIT_TAG "c0b7adb077cbf0b7b0cd04addb6de741b338fc49")
set(GIT_TAG "2013df93ee771ed691e0bf85f55c61d9cb85119d")
add_cmake_dependency(
NAME zenohcxx
DEPENDS zenohc URL "https://github.com/eclipse-zenoh/zenoh-cpp/archive/${GIT_TAG}.zip"
Expand Down
2 changes: 1 addition & 1 deletion modules/bag/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ set(SOURCES
# library target
define_module_library(
NAME bag
PUBLIC_LINK_LIBS absl::base hephaestus::containers hephaestus::ipc mcap
PUBLIC_LINK_LIBS absl::base absl::log hephaestus::containers hephaestus::ipc mcap
PRIVATE_LINK_LIBS ""
SOURCES ${SOURCES}
PUBLIC_INCLUDE_PATHS $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include>
Expand Down
2 changes: 1 addition & 1 deletion modules/examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ set(TYPES_SOURCES src/types/pose.cpp README.md include/hephaestus/examples/types
# library target
define_module_library(
NAME examples_types
PUBLIC_LINK_LIBS absl::base Eigen3::Eigen hephaestus::bag fmt::fmt mcap
PUBLIC_LINK_LIBS absl::base absl::status Eigen3::Eigen hephaestus::bag fmt::fmt mcap
PRIVATE_LINK_LIBS ""
SOURCES ${TYPES_SOURCES}
PUBLIC_INCLUDE_PATHS $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include>
Expand Down
5 changes: 3 additions & 2 deletions modules/serdes/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
declare_module(
NAME serdes
DEPENDS_ON_MODULES base
DEPENDS_ON_EXTERNAL_PROJECTS magic_enum Protobuf
DEPENDS_ON_EXTERNAL_PROJECTS absl magic_enum Protobuf
)

find_package(absl REQUIRED)
find_package(magic_enum REQUIRED)
find_package(Protobuf REQUIRED)

Expand All @@ -34,7 +35,7 @@ set(SOURCES
# library target
define_module_library(
NAME serdes
PUBLIC_LINK_LIBS hephaestus::base magic_enum::magic_enum protobuf::libprotobuf
PUBLIC_LINK_LIBS absl::status hephaestus::base magic_enum::magic_enum protobuf::libprotobuf
PRIVATE_LINK_LIBS ""
SOURCES ${SOURCES}
PUBLIC_INCLUDE_PATHS $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include>
Expand Down
6 changes: 3 additions & 3 deletions modules/utils/src/version_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ static constexpr std::uint8_t VERSION_MAJOR = 0;
static constexpr std::uint8_t VERSION_MINOR = 0;
static constexpr std::uint16_t VERSION_PATCH = 1;

static constexpr std::string_view REPO_BRANCH = "devel/ament";
static constexpr std::string_view BUILD_PROFILE = "RelWithDebInfo";
static constexpr std::string_view REPO_HASH = "65db096";
static constexpr std::string_view REPO_BRANCH = "zenohc_fix_carg_version";
static constexpr std::string_view BUILD_PROFILE = "Release";
static constexpr std::string_view REPO_HASH = "5f5c307";

} // namespace heph::utils
3 changes: 2 additions & 1 deletion toolchains/toolchain_clang.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ else()
set(CMAKE_CXX_COMPILER clang++)
endif()
set(CMAKE_CXX_FLAGS "-stdlib=libc++")
set(CMAKE_EXE_LINKER_FLAGS "-stdlib=libc++ -lc++abi")
set(CMAKE_EXE_LINKER_FLAGS "-stdlib=libc++ -lc++abi -fuse-ld=lld")
set(CMAKE_EXE_LINKER_FLAGS "-stdlib=libc++ -lc++abi -fuse-ld=lld")
set(CMAKE_CROSSCOMPILING FALSE)

0 comments on commit 85be4b5

Please sign in to comment.