Skip to content

Commit

Permalink
preparing for merge
Browse files Browse the repository at this point in the history
  • Loading branch information
xanthospap committed Sep 19, 2024
2 parents b41ff7a + 9d84bc5 commit 44d2ca9
Show file tree
Hide file tree
Showing 80 changed files with 1,848 additions and 7,122 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/clang-format-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: clang-format Check
on:
push:
branches: [ "master", "cleanup" ]
pull_request:
branches: [ "master" ]

jobs:
formatting-check:
name: Formatting Check
runs-on: ubuntu-latest
strategy:
matrix:
path:
- 'src'
- 'test/unit_tests'
- 'include/core'
- 'include'
steps:
- uses: actions/checkout@v3
- name: Run clang-format style check for C/C++/Protobuf programs.
uses: jidicula/[email protected]
with:
clang-format-version: '16'
check-path: ${{ matrix.path }}
fallback-style: 'LLVM' # optional
32 changes: 32 additions & 0 deletions .github/workflows/cpp-linux-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Linux CI build

on:
push:
branches: [ "master", "cleanup" ]
pull_request:
branches: [ "master" ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: install (latest) eigen
run: sudo apt install libeigen3-dev

- name: "prepare build (production/standard), gcc"
run: cmake -S . -B build -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release
- name: "build"
run: cmake --build build --target all --config Release -- -j4
- name: "Test"
run: ctest --test-dir build

- name: "prepare build (production/standard), clang++"
run: cmake -S . -B build -G "Unix Makefiles" -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Release
- name: "build"
run: cmake --build build --target all --config Release -- -j4
- name: "Test"
run: ctest --test-dir build
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ geodpy/
# Folders
doc/doxydoc/
doc/html/
build/

# Files & Folders generated by automake
Makefile.in
Expand Down
28 changes: 28 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
cmake_minimum_required(VERSION 3.1)

project(
Geodesy
VERSION 1.1.0
DESCRIPTION "DSO Geodetic Library"
LANGUAGES CXX)

# We need Eigen
find_package(Eigen3 3.3 REQUIRED)

# The library
add_subdirectory(src)

# The tests
include(CTest)
add_subdirectory(test//unit_tests)
enable_testing()

add_compile_options(
-Wall -Wextra -Werror -pedantic -W -Wshadow -march=native -DEIGEN_NO_AUTOMATIC_RESIZING
$<$<CONFIG:RELEASE>:-O2 -march=native -DEIGEN_NO_AUTOMATIC_RESIZING>
$<$<CONFIG:DEBUG>:-g -pg -Wdisabled-optimization -DDEBUG>
)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED On)
set(CMAKE_CXX_EXTENSIONS Off)
50 changes: 32 additions & 18 deletions SConstruct
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import print_function
import os, sys, glob

## Prefic for install(ed) files
## Prefix for install(ed) files
prefix="/usr/local"
if not os.path.isdir(prefix):
print('[ERROR] Cannot find \'prefix\' directory, aka {:}; aborting'.format(prefix), file=sys.stderr)
Expand All @@ -21,25 +21,48 @@ num_cpu = int(os.environ.get('NUM_CPU', 2))
SetOption('num_jobs', num_cpu)
print("running with -j %s" % GetOption('num_jobs'))

AddOption('--cxx',
dest='cxx',
type='string',
nargs=1,
action='store',
metavar='CXX',
help='C++ Compiler',
default=None)
AddOption('--std',
dest='std',
type='string',
nargs=1,
action='store',
metavar='STD',
help='C++ Standard [11/14/17/20]',
default='17')

## Source files (for lib)
lib_src_files = glob.glob(r"src/*.cpp")

## Headers (for lib)
hdr_src_files = glob.glob(r"src/*.hpp")

## Environments ...
denv = Environment(CXXFLAGS='-std=c++17 -g -pg -Wall -Wextra -Werror -pedantic -W -Wshadow -Winline -Wdisabled-optimization -DDEBUG')
denv = Environment(CXXFLAGS='-g -pg -Wall -Wextra -Werror -pedantic -W -Wshadow -Winline -Wdisabled-optimization -DDEBUG -DEIGEN_NO_AUTOMATIC_RESIZING')
## g++ complains about failing to inline functions if we use the '-Winline' here ...
penv = Environment(CXXFLAGS='-std=c++17 -Wall -Wextra -Werror -pedantic -W -Wshadow -O2 -march=native')
penv = Environment(CXXFLAGS='-Wall -Wextra -Werror -pedantic -W -Wshadow -O2 -march=native -DEIGEN_NO_AUTOMATIC_RESIZING')

## Command line arguments ...
debug = ARGUMENTS.get('debug', 0)
boostg = ARGUMENTS.get('boost', 0)
make_test = ARGUMENTS.get('make-test', 0)
test = ARGUMENTS.get('test', 0)

## Construct the build enviroment
env = denv.Clone() if int(debug) else penv.Clone()

## What compiler should we be using ?
if GetOption('cxx') is not None: env['CXX'] = GetOption('cxx')

## Set the C++ standard
cxxstd = GetOption('std')
env.Append(CXXFLAGS=' --std=c++{}'.format(cxxstd))

## (shared) library ...
vlib = env.SharedLibrary(source=lib_src_files, target=lib_name, CPPPATH=['.'], SHLIBVERSION=lib_version)

Expand All @@ -49,18 +72,9 @@ env.Alias(target='install', source=env.Install(dir=os.path.join(prefix, 'include
env.Alias(target='install', source=env.InstallVersionedLib(dir=os.path.join(prefix, 'lib'), source=vlib))

## Tests ...
if make_test:
tests_sources = glob.glob(r"test/unit/*.cpp")
if test:
tests_sources = glob.glob(r"test/unit_tests/*.cpp")
env.Append(RPATH=root_dir)
for tsource in tests_sources:
ttarget = tsource.replace('_', '-').replace('.cpp', '.out')
env.Program(target=ttarget, source=tsource, CPPPATH='src/', LIBS=vlib+['datetime'], LIBPATH='.')

## Boost test executables
if boostg:
print('>> note that we\'ll be building boost executables ...')
boost_sources = ['boost/test_geodtest.cpp', 'boost/test_geodtime.cpp']
for bsource in boost_sources:
btarget = bsource.replace('_', '-').replace('.cpp', '.out')
env.Program(target=btarget, source=bsource, CPPPATH='src/',
LIBS=vlib+['datetime'], LIBPATH='.')
ttarget = os.path.join(os.path.dirname(tsource), os.path.basename(tsource).replace('_', '-').replace('.cpp', '.out'))
env.Program(target=ttarget, source=tsource, CPPPATH='src/', LIBS=vlib, LIBPATH='.')
108 changes: 0 additions & 108 deletions add/utm.hpp

This file was deleted.

11 changes: 0 additions & 11 deletions angle_normalization/build_angle_normalization_tests.sh

This file was deleted.

46 changes: 0 additions & 46 deletions angle_normalization/readme.md

This file was deleted.

Loading

0 comments on commit 44d2ca9

Please sign in to comment.