Skip to content

Commit

Permalink
maintenance
Browse files Browse the repository at this point in the history
  • Loading branch information
strasdat committed Jun 9, 2024
1 parent 49c07cc commit a135781
Show file tree
Hide file tree
Showing 52 changed files with 341 additions and 985 deletions.
50 changes: 16 additions & 34 deletions .github/workflows/build-and-test-sophus-pybind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ on:

jobs:
build:
name: Build sophus_pybind on ${{ matrix.os }} / ${{ matrix.cmakeOptions }}
name: Build sophus_pybind on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, macos-10.15]
os: [ubuntu-20.04]
steps:
- name : Checkout
uses: actions/checkout@v2
Expand All @@ -22,44 +22,26 @@ jobs:
- name: Install dependencies
shell: bash
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
# Update & upgrade package lists
sudo apt-get update -y
sudo apt-get upgrade
# Deal with Github CI limitation
# https://github.com/actions/runner-images/issues/6399#issuecomment-1285011525
sudo apt install -y libunwind-dev
# Update & upgrade package lists
sudo apt-get update -y
sudo apt-get upgrade
# Deal with Github CI limitation
# https://github.com/actions/runner-images/issues/6399#issuecomment-1285011525
sudo apt install -y libunwind-dev
# Generic dependencies
sudo apt-get install cmake
# Generic dependencies
sudo apt-get install cmake
# Clean APT cache
sudo apt-get clean
elif [ "$RUNNER_OS" == "macOS" ]; then
# Install system deps with Homebrew
brew install cmake
# VRS dependencies
brew install fmt lz4 zstd xxhash
else
echo "$RUNNER_OS not supported"
exit 1
fi
# Clean APT cache
sudo apt-get clean
- name: Install sophus_pybind
shell: bash
run: |
# Installing Python and dependencies
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt-get install libpython3-dev python3-pip
sudo pip3 install numpy pytest
elif [ "$RUNNER_OS" == "macOS" ]; then
pip3 install numpy pytest
else
echo "$RUNNER_OS not supported"
exit 1
fi
sudo apt-get install libpython3-dev python3-pip
sudo pip3 install numpy pytest

# Build and install Python bindings
pip3 install .

Expand Down
59 changes: 0 additions & 59 deletions .github/workflows/coverage.yml

This file was deleted.

34 changes: 0 additions & 34 deletions .github/workflows/gh_pages.yml

This file was deleted.

54 changes: 21 additions & 33 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,51 +12,39 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04]
build_type: [Debug, Release]
row_major: [ON, OFF]
basic_logging: [ON, OFF]
exclude:
- build_type: Release
include:
- os: ubuntu-22.04
build_type: Release
row_major: ON
- build_type: Release
basic_logging: ON
- build_type: Debug
row_major: ON
basic_logging: ON
- os: ubuntu-22.04
build_type: RelWithDebInfo
row_major: OFF
- os: ubuntu-24.04
build_type: RelWithDebInfo
row_major: OFF
- os: macos-13
build_type: RelWithDebInfo
row_major: OFF
- os: macos-14
build_type: RelWithDebInfo
row_major: OFF
fail-fast: false
env:
BUILD_TYPE: ${{ matrix.build_type }}
ROW_MAJOR_DEFAULT: ${{ matrix.row_major }}
USE_BASIC_LOGGING: ${{ matrix.basic_logging }}


steps:
- uses: actions/checkout@v2

- name: Format
uses: DoozyX/[email protected]
with:
source: '.'
extensions: 'hpp,cpp'
exclude: './sympy ./doxyrest_b'
clangFormatVersion: 9
if: matrix.os == 'ubuntu-20.04'

- name: ccache
uses: hendrikmuhs/ccache-action@v1

- name: Install dependencies (Linux)
run: ./scripts/install_linux_deps.sh
if: matrix.os == 'ubuntu-20.04'

- name: Install fmt dependency (Linux)
run: ./scripts/install_linux_fmt_deps.sh
if: matrix.os == 'ubuntu-20.04' && matrix.basic_logging == 'OFF'
- name: Install dependencies (Linux incl. Ceres)
run: ./scripts/install_ubuntu_deps_incl_ceres.sh
if: matrix.os == 'ubuntu-22.04' || matrix.os == 'ubuntu-24.04'

- name: Install dependencies (Mac OS)
run: ./scripts/install_osx_deps.sh
if: matrix.os == 'macos-10.15'
- name: Install dependencies (Mac OS incl. Ceres)
run: ./scripts/install_osx_deps_incl_ceres.sh
if: matrix.os == 'macos-14' || matrix.os == 'macos-13'

- name: Run tests
run: ./scripts/run_cpp_tests.sh
36 changes: 9 additions & 27 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.4)
project(Sophus VERSION 1.22.10)
cmake_minimum_required(VERSION 3.16)
project(Sophus VERSION 1.24.06)

include(CMakePackageConfigHelpers)
include(GNUInstallDirs)
Expand All @@ -15,16 +15,15 @@ if (NOT DEFINED SOPHUS_MASTER_PROJECT)
endif ()

option(SOPHUS_INSTALL "Generate the install target." ${SOPHUS_MASTER_PROJECT})
option(SOPHUS_USE_BASIC_LOGGING "Use basic logging (in ensure and test macros)" OFF)

if(SOPHUS_MASTER_PROJECT)
# Release by default
# Turn on Debug with "-DCMAKE_BUILD_TYPE=Debug"
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
set(CMAKE_BUILD_TYPE RelWithDebInfo)
endif()

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 17)

# Set compiler specific settings (FixMe: Should not cmake do this for us automatically?)
IF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
Expand All @@ -34,22 +33,13 @@ if(SOPHUS_MASTER_PROJECT)
ELSEIF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g")
SET(CMAKE_CXX_FLAGS_RELEASE "-O3")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror -Wextra -std=c++14 -Wno-deprecated-declarations -ftemplate-backtrace-limit=0")
SET(CMAKE_CXX_FLAGS_COVERAGE "${CMAKE_CXX_FLAGS_DEBUG} --coverage -fno-inline -fno-inline-small-functions -fno-default-inline")
SET(CMAKE_EXE_LINKER_FLAGS_COVERAGE "${CMAKE_EXE_LINKER_FLAGS_DEBUG} --coverage")
SET(CMAKE_SHARED_LINKER_FLAGS_COVERAGE "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} --coverage")
ELSEIF(CMAKE_CXX_COMPILER_ID MATCHES "^MSVC$")
ADD_DEFINITIONS("-D _USE_MATH_DEFINES /bigobj /wd4305 /wd4244 /MP")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror -Wextra -std=c++14 -Wno-deprecated-declarations -ftemplate-backtrace-limit=0 -Wno-array-bounds")
ENDIF()

# Add local path for finding packages, set the local version first
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules")
endif()

if(SOPHUS_USE_BASIC_LOGGING)
set (CMAKE_DISABLE_FIND_PACKAGE_fmt ON)
endif()

# Find public dependencies if targets are not yet defined. (Targets might be for example
# defined by a parent project including Sophus via `add_subdirectory`.)

Expand All @@ -69,7 +59,6 @@ add_library (Sophus::Sophus ALIAS sophus)
set(SOPHUS_HEADER_FILES
sophus/average.hpp
sophus/cartesian.hpp
sophus/ceres_local_parameterization.hpp
sophus/ceres_manifold.hpp
sophus/ceres_typetraits.hpp
sophus/common.hpp
Expand All @@ -89,7 +78,6 @@ set(SOPHUS_HEADER_FILES
sophus/so3.hpp
sophus/spline.hpp
sophus/types.hpp
sophus/velocities.hpp
)

set(SOPHUS_OTHER_FILES
Expand All @@ -110,16 +98,10 @@ else()
target_include_directories (sophus SYSTEM INTERFACE ${EIGEN3_INCLUDE_DIR})
endif()

if(SOPHUS_USE_BASIC_LOGGING OR NOT TARGET fmt::fmt)
# NOTE fmt_FOUND does not seem to be defined even though the package config
# was found.
target_compile_definitions(sophus INTERFACE SOPHUS_USE_BASIC_LOGGING=1)
message(STATUS "Turning basic logging ON")
else()
target_link_libraries(sophus INTERFACE fmt::fmt)
set(fmt_DEPENDENCY "find_dependency (fmt ${fmt_VERSION})")
message(STATUS "Turning basic logging OFF")
endif()

target_link_libraries(sophus INTERFACE fmt::fmt)
set(fmt_DEPENDENCY "find_dependency (fmt ${fmt_VERSION})")
message(STATUS "Turning basic logging OFF")

# Associate target with include directory
target_include_directories(sophus INTERFACE
Expand Down
Loading

0 comments on commit a135781

Please sign in to comment.