Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
Change-Id: Ia9752e1e9c021ef6becc518c4361e3ec00b25458
  • Loading branch information
birkler committed May 19, 2022
2 parents 3288ecc + 9b34ece commit 170573f
Show file tree
Hide file tree
Showing 666 changed files with 64,198 additions and 53,066 deletions.
7 changes: 7 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
BasedOnStyle: Google
Standard: Cpp11
BinPackArguments: false
BinPackParameters: false
PointerAlignment: Left
DerivePointerAlignment: false
CommentPragmas: NOLINT.*
166 changes: 166 additions & 0 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
name: Android

on: [push, pull_request]

jobs:
build-android:
name: NDK-${{matrix.abi}}-${{matrix.build_type}}-${{matrix.lib}}
runs-on: ${{matrix.os}}
defaults:
run:
shell: bash -e -o pipefail {0}
env:
CCACHE_DIR: ${{github.workspace}}/ccache
CMAKE_GENERATOR: Ninja
DEBIAN_FRONTEND: noninteractive
strategy:
fail-fast: true
matrix:
os:
- ubuntu-20.04
abi:
- arm64-v8a
- armeabi-v7a
- x86
- x86_64
build_type:
- Release
lib:
- shared
- static
android_api_level:
- '28'

steps:
- uses: actions/checkout@v2

- name: Setup Ninja
uses: ashutoshvarma/setup-ninja@master
with:
version: 1.10.0

- name: Setup Dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
ccache \
ninja-build
- name: Cache Eigen
id: cache-eigen
uses: actions/cache@v2
with:
path: eigen/
key: NDK-${{matrix.os}}-eigen-3.4.0-${{matrix.abi}}

- name: Download Eigen
if: steps.cache-eigen.outputs.cache-hit != 'true'
run: |
wget https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.zip
unzip eigen-3.4.0.zip
- name: Setup Eigen
if: steps.cache-eigen.outputs.cache-hit != 'true'
run: |
cmake -S eigen-3.4.0 -B build-eigen \
-DBUILD_TESTING=OFF \
-DCMAKE_ANDROID_API=${{matrix.android_api_level}} \
-DCMAKE_ANDROID_ARCH_ABI=${{matrix.abi}} \
-DCMAKE_ANDROID_STL_TYPE=c++_shared \
-DCMAKE_Fortran_COMPILER= \
-DCMAKE_INSTALL_PREFIX=${{github.workspace}}/eigen \
-DCMAKE_SYSTEM_NAME=Android \
-DEIGEN_BUILD_DOC=OFF
cmake --build build-eigen \
--config ${{matrix.build_type}} \
--target install
- name: Cache gflags
id: cache-gflags
uses: actions/cache@v2
with:
path: gflags/
key: NDK-${{matrix.os}}-gflags-2.2.2-${{matrix.abi}}-${{matrix.build_type}}-${{matrix.lib}}

- name: Download gflags
if: steps.cache-gflags.outputs.cache-hit != 'true'
run: |
wget https://github.com/gflags/gflags/archive/refs/tags/v2.2.2.zip
unzip v2.2.2.zip
- name: Setup gflags
if: steps.cache-gflags.outputs.cache-hit != 'true'
run: |
cmake -S gflags-2.2.2 -B build-gflags \
-DBUILD_SHARED_LIBS=${{matrix.lib == 'shared'}} \
-DBUILD_TESTING=OFF \
-DCMAKE_ANDROID_API=${{matrix.android_api_level}} \
-DCMAKE_ANDROID_ARCH_ABI=${{matrix.abi}} \
-DCMAKE_ANDROID_STL_TYPE=c++_shared \
-DCMAKE_BUILD_TYPE=${{matrix.build_type}} \
-DCMAKE_INSTALL_PREFIX=${{github.workspace}}/gflags \
-DCMAKE_SYSTEM_NAME=Android
cmake --build build-gflags \
--config ${{matrix.build_type}} \
--target install
- name: Cache glog
id: cache-glog
uses: actions/cache@v2
with:
path: glog/
key: NDK-${{matrix.os}}-glog-0.5-${{matrix.abi}}-${{matrix.build_type}}-${{matrix.lib}}

- name: Download glog
if: steps.cache-glog.outputs.cache-hit != 'true'
run: |
wget https://github.com/google/glog/archive/refs/tags/v0.5.0.zip
unzip v0.5.0.zip
- name: Setup glog
if: steps.cache-glog.outputs.cache-hit != 'true'
run: |
cmake -S glog-0.5.0 -B build-glog \
-DBUILD_SHARED_LIBS=${{matrix.lib == 'shared'}} \
-DBUILD_TESTING=OFF \
-DCMAKE_ANDROID_API=${{matrix.android_api_level}} \
-DCMAKE_ANDROID_ARCH_ABI=${{matrix.abi}} \
-DCMAKE_ANDROID_STL_TYPE=c++_shared \
-DCMAKE_BUILD_TYPE=${{matrix.build_type}} \
-DCMAKE_FIND_ROOT_PATH=${{github.workspace}}/gflags \
-DCMAKE_INSTALL_PREFIX=${{github.workspace}}/glog \
-DCMAKE_SYSTEM_NAME=Android
cmake --build build-glog \
--config ${{matrix.build_type}} \
--target install
- name: Cache Build
id: cache-build
uses: actions/cache@v2
with:
path: ${{env.CCACHE_DIR}}
key: NDK-${{matrix.os}}-ccache-${{matrix.abi}}-${{matrix.build_type}}-${{matrix.lib}}-${{github.run_id}}
restore-keys: NDK-${{matrix.os}}-ccache-${{matrix.abi}}-${{matrix.build_type}}-${{matrix.lib}}-

- name: Setup Environment
if: matrix.build_type == 'Release'
run: |
echo 'CXXFLAGS=-flto' >> $GITHUB_ENV
- name: Configure
run: |
cmake -S . -B build_${{matrix.abi}} \
-DBUILD_SHARED_LIBS=${{matrix.lib == 'shared'}} \
-DCMAKE_ANDROID_API=${{matrix.android_api_level}} \
-DCMAKE_ANDROID_ARCH_ABI=${{matrix.abi}} \
-DCMAKE_ANDROID_STL_TYPE=c++_shared \
-DCMAKE_BUILD_TYPE=${{matrix.build_type}} \
-DCMAKE_C_COMPILER_LAUNCHER=$(which ccache) \
-DCMAKE_CXX_COMPILER_LAUNCHER=$(which ccache) \
-DCMAKE_FIND_ROOT_PATH="${{github.workspace}}/eigen;${{github.workspace}}/gflags;${{github.workspace}}/glog" \
-DCMAKE_SYSTEM_NAME=Android
- name: Build
run: |
cmake --build build_${{matrix.abi}} \
--config ${{matrix.build_type}}
91 changes: 91 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Linux

on: [push, pull_request]

jobs:
build:
name: ${{matrix.os}}-${{matrix.build_type}}-${{matrix.lib}}-${{matrix.threading_model}}
runs-on: ubuntu-latest
container: ${{matrix.os}}
defaults:
run:
shell: bash -e -o pipefail {0}
env:
CCACHE_DIR: ${{github.workspace}}/ccache
CMAKE_GENERATOR: Ninja
DEBIAN_FRONTEND: noninteractive
strategy:
fail-fast: true
matrix:
os:
- ubuntu:20.04
- ubuntu:22.04
build_type:
- Release
lib:
- shared
- static
threading_model:
- CXX_THREADS
- NO_THREADS
- OPENMP

steps:
- uses: actions/checkout@v2

- name: Setup Dependencies
run: |
apt-get update
apt-get install -y \
build-essential \
ccache \
cmake \
libbenchmark-dev \
libblas-dev \
libeigen3-dev \
libgflags-dev \
libgoogle-glog-dev \
liblapack-dev \
libsuitesparse-dev \
ninja-build
- name: Cache Build
id: cache-build
uses: actions/cache@v2
with:
path: ${{env.CCACHE_DIR}}
key: ${{matrix.os}}-ccache-${{matrix.build_type}}-${{matrix.lib}}-${{matrix.threading_model}}-${{github.run_id}}
restore-keys: ${{matrix.os}}-ccache-${{matrix.build_type}}-${{matrix.lib}}-${{matrix.threading_model}}-

- name: Setup Environment
if: matrix.build_type == 'Release'
run: |
echo 'CXXFLAGS=-flto' >> $GITHUB_ENV
- name: Configure
run: |
cmake -S . -B build_${{matrix.build_type}} \
-DBUILD_SHARED_LIBS=${{matrix.lib == 'shared'}} \
-DCERES_THREADING_MODEL=${{matrix.threading_model}} \
-DCMAKE_BUILD_TYPE=${{matrix.build_type}} \
-DCMAKE_C_COMPILER_LAUNCHER=$(which ccache) \
-DCMAKE_CXX_COMPILER_LAUNCHER=$(which ccache) \
-DCMAKE_INSTALL_PREFIX=${{github.workspace}}/install
- name: Build
run: |
cmake --build build_${{matrix.build_type}} \
--config ${{matrix.build_type}}
- name: Test
run: |
ctest --test-dir build_${{matrix.build_type}} \
--config ${{matrix.build_type}} \
--output-on-failure \
-j$(nproc)
- name: Install
run: |
cmake --build build_${{matrix.build_type}}/ \
--config ${{matrix.build_type}} \
--target install
107 changes: 107 additions & 0 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
name: macOS

on: [push, pull_request]

jobs:
build:
name: ${{matrix.os}}-${{matrix.build_type}}-${{matrix.lib}}-${{matrix.target}}
runs-on: ${{matrix.os}}
defaults:
run:
shell: bash -e -o pipefail {0}
env:
CCACHE_DIR: ${{github.workspace}}/ccache
CMAKE_GENERATOR: Ninja
strategy:
fail-fast: true
matrix:
os:
- macos-11
build_type:
- Release
lib:
- shared
- static
target:
- host
- ios

steps:
- uses: actions/checkout@v2

- name: Setup Dependencies (iOS)
if: matrix.target == 'ios'
run: |
brew update
brew install \
ccache \
eigen \
ninja
- name: Setup Dependencies (Host)
if: matrix.target == 'host'
run: |
brew update
brew install \
ccache \
eigen \
gflags \
glog \
google-benchmark \
ninja \
suite-sparse
- name: Cache Build
id: cache-build
uses: actions/cache@v2
with:
path: ${{env.CCACHE_DIR}}
key: ${{matrix.os}}-ccache-${{matrix.build_type}}-${{matrix.lib}}-${{matrix.target}}-${{github.run_id}}
restore-keys: ${{matrix.os}}-ccache-${{matrix.build_type}}-${{matrix.lib}}-${{matrix.target}}-

- name: Setup Environment
if: matrix.build_type == 'Release'
run: |
echo 'CXXFLAGS=-flto' >> $GITHUB_ENV
- name: Configure (iOS)
if: matrix.target == 'ios'
run: |
cmake -S . -B build_${{matrix.build_type}} \
-DBUILD_SHARED_LIBS=${{matrix.lib == 'shared'}} \
-DCMAKE_BUILD_TYPE=${{matrix.build_type}} \
-DCMAKE_C_COMPILER_LAUNCHER=$(which ccache) \
-DCMAKE_CXX_COMPILER_LAUNCHER=$(which ccache) \
-DCMAKE_TOOLCHAIN_FILE=${{github.workspace}}/cmake/iOS.cmake \
-DEigen3_DIR=/usr/local/share/eigen3/cmake \
-DIOS_PLATFORM=OS \
-DCMAKE_INSTALL_PREFIX=${{github.workspace}}/install
- name: Configure (Host)
if: matrix.target == 'host'
run: |
cmake -S . -B build_${{matrix.build_type}} \
-DBUILD_SHARED_LIBS=${{matrix.lib == 'shared'}} \
-DCMAKE_BUILD_TYPE=${{matrix.build_type}} \
-DCMAKE_C_COMPILER_LAUNCHER=$(which ccache) \
-DCMAKE_CXX_COMPILER_LAUNCHER=$(which ccache) \
-DCMAKE_INSTALL_PREFIX=${{github.workspace}}/install
- name: Build
run: |
cmake --build build_${{matrix.build_type}} \
--config ${{matrix.build_type}}
- name: Test
if: matrix.target == 'host'
run: |
ctest --test-dir build_${{matrix.build_type}} \
--config ${{matrix.build_type}} \
--output-on-failure \
-j$(sysctl -n hw.ncpu)
- name: Install
run: |
cmake --build build_${{matrix.build_type}}/ \
--config ${{matrix.build_type}} \
--target install
Loading

0 comments on commit 170573f

Please sign in to comment.