Skip to content

Commit

Permalink
Working towards depending on apt packages
Browse files Browse the repository at this point in the history
  • Loading branch information
amessing-bdai committed Oct 10, 2024
1 parent c8649f4 commit 9a66160
Show file tree
Hide file tree
Showing 7 changed files with 395 additions and 25 deletions.
48 changes: 26 additions & 22 deletions .devcontainer/Dockerfile.amd64
Original file line number Diff line number Diff line change
@@ -1,27 +1,31 @@
FROM ubuntu:22.04

RUN apt-get update --fix-missing &&\
apt-get install -y --no-install-recommends build-essential ca-certificates git g++ pkg-config python3 curl ninja-build tar zip unzip zlib1g-dev libssl-dev wget &&\
apt-get autoclean &&\
apt-get autoremove &&\
apt-get clean &&\
rm -rf /var/lib/apt/lists/*
RUN apt-get update --fix-missing \
&& apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
cmake \
git \
libeigen3-dev \
libgrpc++-dev \
libprotobuf-dev \
g++ \
pkg-config \
protobuf-compiler \
python3 \
curl \
ninja-build \
tar \
zip \
unzip \
zlib1g-dev \
libssl-dev \
wget \
&& apt-get autoclean \
&& apt-get autoremove \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

RUN update-ca-certificates

RUN wget https://github.com/Kitware/CMake/releases/download/v3.28.3/cmake-3.28.3.tar.gz &&\
tar -xzf cmake-3.28.3.tar.gz &&\
cd cmake-3.28.3 &&\
./configure &&\
make install &&\
cd .. &&\
rm cmake-3.28.3.tar.gz &&\
rm -r cmake-3.28.3

RUN git clone https://github.com/microsoft/vcpkg &&\
cd vcpkg &&\
git checkout 3b213864579b6fa686e38715508f7cd41a50900f &&\
./bootstrap-vcpkg.sh -disableMetrics &&\
./vcpkg install grpc:x64-linux &&\
./vcpkg install eigen3:x64-linux &&\
./vcpkg install cli11:x64-linux
COPY entrypoint.sh .
27 changes: 27 additions & 0 deletions .devcontainer/Dockerfile.amd64_vcpkg
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM ubuntu:22.04

RUN apt-get update --fix-missing &&\
apt-get install -y --no-install-recommends build-essential ca-certificates git g++ pkg-config python3 curl ninja-build tar zip unzip zlib1g-dev libssl-dev wget &&\
apt-get autoclean &&\
apt-get autoremove &&\
apt-get clean &&\
rm -rf /var/lib/apt/lists/*

RUN update-ca-certificates

RUN wget https://github.com/Kitware/CMake/releases/download/v3.28.3/cmake-3.28.3.tar.gz &&\
tar -xzf cmake-3.28.3.tar.gz &&\
cd cmake-3.28.3 &&\
./configure &&\
make install &&\
cd .. &&\
rm cmake-3.28.3.tar.gz &&\
rm -r cmake-3.28.3

RUN git clone https://github.com/microsoft/vcpkg &&\
cd vcpkg &&\
git checkout 3b213864579b6fa686e38715508f7cd41a50900f &&\
./bootstrap-vcpkg.sh -disableMetrics &&\
./vcpkg install grpc:x64-linux &&\
./vcpkg install eigen3:x64-linux &&\
./vcpkg install cli11:x64-linux
2 changes: 2 additions & 0 deletions .devcontainer/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env bash
docker run -v ~/spot-cpp-sdk:/spot-cpp-sdk spot_builder /entrypoint.sh
9 changes: 9 additions & 0 deletions .devcontainer/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash
cd /spot-cpp-sdk/cpp
if [ -d build ]; then
rm -r build
fi
mkdir build
cd build
cmake .. -DCMAKE_FIND_PACKAGE_PREFER_CONFIG=TRUE -DBUILD_CHOREOGRAPHY_LIBS=ON
make -j8 install package
1 change: 1 addition & 0 deletions cpp/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build
13 changes: 10 additions & 3 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@
# This file is autogenerated.

cmake_minimum_required (VERSION 3.10.2)
project (bosdyn VERSION 4.0.3)
project (bosdyn VERSION 4.1.0)

# Add cmake modules
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")

# Dependencies:
find_package(protobuf REQUIRED)
find_package(Protobuf REQUIRED)
find_package(Eigen3 REQUIRED)
find_package(gRPC REQUIRED)
find_package(CLI11 REQUIRED)
find_package(Threads REQUIRED)
get_target_property(grpc_cpp_plugin_location gRPC::grpc_cpp_plugin LOCATION)
include_directories(SYSTEM $<TARGET_PROPERTY:CLI11::CLI11,INTERFACE_INCLUDE_DIRECTORIES>)
Expand All @@ -24,6 +26,7 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS true)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build." FORCE)
option(BUILD_SHARED_LIBS "Build using shared libraries" ON)
option(BUILD_CHOREOGRAPHY_LIBS "Boolean to control whether choreography proto libraries are built" ON)
option(BUILD_EXAMPLES "Boolean to control whether examples are built" OFF)

IF (NOT UNIX)
SET(BUILD_SHARED_LIBS OFF CACHE BOOL "Build using shared libraries" FORCE)
Expand Down Expand Up @@ -194,6 +197,9 @@ install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bosdyn


### EXAMPLE EXECUTABLES ###
if(BUILD_EXAMPLES)
find_package(CLI11 REQUIRED)

link_directories(
${PROTOBUF_LIB_DIR}
)
Expand Down Expand Up @@ -260,6 +266,7 @@ write_basic_package_version_file("${VERSION_FILE}"
VERSION ${PACKAGE_VERSION}
COMPATIBILITY AnyNewerVersion
)
endif()

# This defines the instructions to generate a relocatable targets file at install time
set(PROJECT_CONFIG_PATH "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}")
Expand Down
Loading

0 comments on commit 9a66160

Please sign in to comment.