mirror of
https://github.com/ceres-solver/ceres-solver.git
synced 2026-08-29 08:34:37 +08:00
Add Github workflows
Change-Id: I74fc45784b1b1d20c22b9e983902aa69fbfa764f
This commit is contained in:
@@ -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}}
|
||||
@@ -0,0 +1,90 @@
|
||||
name: Linux
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: ${{matrix.os}}-${{matrix.build_type}}-${{matrix.lib}}-${{matrix.threading_model}}
|
||||
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-18.04
|
||||
- ubuntu-20.04
|
||||
build_type:
|
||||
- Release
|
||||
lib:
|
||||
- shared
|
||||
- static
|
||||
threading_model:
|
||||
- CXX_THREADS
|
||||
- NO_THREADS
|
||||
- OPENMP
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Setup Dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo 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
|
||||
@@ -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
|
||||
@@ -0,0 +1,167 @@
|
||||
name: Windows
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
build-msvc:
|
||||
name: ${{matrix.msvc}}-${{matrix.arch}}-${{matrix.build_type}}-${{matrix.lib}}
|
||||
runs-on: ${{matrix.os}}
|
||||
defaults:
|
||||
run:
|
||||
shell: powershell
|
||||
env:
|
||||
CL: /MP
|
||||
CMAKE_GENERATOR: ${{matrix.generator}}
|
||||
CMAKE_GENERATOR_PLATFORM: ${{matrix.arch}}
|
||||
strategy:
|
||||
fail-fast: true
|
||||
matrix:
|
||||
arch:
|
||||
- x64
|
||||
build_type:
|
||||
- Release
|
||||
msvc:
|
||||
- VS-16-2019
|
||||
- VS-17-2022
|
||||
lib:
|
||||
- shared
|
||||
include:
|
||||
- msvc: VS-16-2019
|
||||
os: windows-2019
|
||||
generator: 'Visual Studio 16 2019'
|
||||
marker: vc16
|
||||
- msvc: VS-17-2022
|
||||
os: windows-2022
|
||||
generator: 'Visual Studio 17 2022'
|
||||
marker: vc17
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Cache gflags
|
||||
id: cache-gflags
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: gflags/
|
||||
key: ${{matrix.msvc}}-gflags-2.2.2-${{matrix.arch}}-${{matrix.build_type}}-${{matrix.lib}}
|
||||
|
||||
- name: Download gflags
|
||||
if: steps.cache-gflags.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
(New-Object System.Net.WebClient).DownloadFile("https://github.com/gflags/gflags/archive/refs/tags/v2.2.2.zip", "v2.2.2.zip");
|
||||
Expand-Archive -Path v2.2.2.zip -DestinationPath .;
|
||||
|
||||
- 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_INSTALL_PREFIX=${{github.workspace}}/gflags
|
||||
cmake --build build-gflags `
|
||||
--config ${{matrix.build_type}} `
|
||||
--target install
|
||||
|
||||
- name: Cache glog
|
||||
id: cache-glog
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: glog/
|
||||
key: ${{matrix.msvc}}-glog-0.6.0rc1-${{matrix.arch}}-${{matrix.build_type}}-${{matrix.lib}}
|
||||
|
||||
- name: Download glog
|
||||
if: steps.cache-glog.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
(New-Object System.Net.WebClient).DownloadFile("https://github.com/google/glog/archive/refs/tags/v0.6.0-rc1.zip", "v0.6.0-rc1.zip");
|
||||
Expand-Archive -Path v0.6.0-rc1.zip -DestinationPath .;
|
||||
|
||||
- name: Setup glog
|
||||
if: steps.cache-glog.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
cmake -S glog-0.6.0-rc1 -B build-glog `
|
||||
-DBUILD_SHARED_LIBS=${{matrix.lib == 'shared'}} `
|
||||
-DBUILD_TESTING=OFF `
|
||||
-DCMAKE_INSTALL_PREFIX=${{github.workspace}}/glog `
|
||||
-DCMAKE_PREFIX_PATH=${{github.workspace}}/gflags
|
||||
cmake --build build-glog `
|
||||
--config ${{matrix.build_type}} `
|
||||
--target install
|
||||
|
||||
- name: Cache SuiteSparse
|
||||
id: cache-suitesparse
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: suitesparse/
|
||||
key: ${{matrix.msvc}}-suitesparse-5.10.1-cmake.1-${{matrix.arch}}-${{matrix.build_type}}-${{matrix.lib}}
|
||||
|
||||
- name: Download SuiteSparse
|
||||
if: steps.cache-suitesparse.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
(New-Object System.Net.WebClient).DownloadFile("https://github.com/sergiud/SuiteSparse/releases/download/5.10.1-cmake.1/SuiteSparse-5.10.1-cmake.1-${{matrix.marker}}-Win64-${{matrix.build_type}}-${{matrix.lib}}-gpl.zip", "suitesparse.zip");
|
||||
Expand-Archive -Path suitesparse.zip -DestinationPath ${{github.workspace}}/suitesparse;
|
||||
|
||||
- name: Cache Eigen
|
||||
id: cache-eigen
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: eigen/
|
||||
key: ${{runner.os}}-eigen-3.4.0
|
||||
|
||||
- name: Download Eigen
|
||||
if: steps.cache-eigen.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
(New-Object System.Net.WebClient).DownloadFile("https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.zip", "eigen-3.4.0.zip");
|
||||
Expand-Archive -Path eigen-3.4.0.zip -DestinationPath .;
|
||||
|
||||
- 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_Fortran_COMPILER= `
|
||||
-DCMAKE_INSTALL_PREFIX=${{github.workspace}}/eigen `
|
||||
-DEIGEN_BUILD_DOC=OFF
|
||||
cmake --build build-eigen `
|
||||
--config ${{matrix.build_type}} `
|
||||
--target install
|
||||
|
||||
- name: Setup Build Environment
|
||||
run: |
|
||||
echo "Eigen3_ROOT=${{github.workspace}}/eigen" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||
echo "gflags_ROOT=${{github.workspace}}/gflags" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||
echo "glog_ROOT=${{github.workspace}}/glog" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||
echo "CMAKE_PREFIX_PATH=${{github.workspace}}/suitesparse" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||
|
||||
- name: Setup Runtime Environment
|
||||
run: |
|
||||
echo '${{github.workspace}}\gflags\bin' | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
||||
echo '${{github.workspace}}\glog\bin' | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
||||
echo '${{github.workspace}}\suitesparse\bin' | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
||||
|
||||
- name: Configure
|
||||
run: |
|
||||
cmake -S . -B build_${{matrix.build_type}}/ `
|
||||
-DBLAS_blas_LIBRARY=${{github.workspace}}/suitesparse/lib/libblas.lib `
|
||||
-DBUILD_SHARED_LIBS=${{matrix.lib == 'shared'}} `
|
||||
-DCMAKE_CONFIGURATION_TYPES=${{matrix.build_type}} `
|
||||
-DCMAKE_INSTALL_PREFIX:PATH=${{github.workspace}}/install `
|
||||
-DLAPACK_lapack_LIBRARY=${{github.workspace}}/suitesparse/lib/liblapack.lib
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
cmake --build build_${{matrix.build_type}}/ `
|
||||
--config ${{matrix.build_type}}
|
||||
|
||||
- name: Test
|
||||
env:
|
||||
CTEST_OUTPUT_ON_FAILURE: 1
|
||||
run: |
|
||||
cmake --build build_${{matrix.build_type}}/ `
|
||||
--config ${{matrix.build_type}} `
|
||||
--target RUN_TESTS
|
||||
|
||||
- name: Install
|
||||
run: |
|
||||
cmake --build build_${{matrix.build_type}}/ `
|
||||
--config ${{matrix.build_type}} `
|
||||
--target INSTALL
|
||||
-70
@@ -1,70 +0,0 @@
|
||||
language: cpp
|
||||
|
||||
matrix:
|
||||
fast_finish: true
|
||||
include:
|
||||
- os: linux
|
||||
dist: bionic
|
||||
sudo: required
|
||||
compiler: gcc
|
||||
env: CERES_BUILD_TARGET=LINUX
|
||||
- os: linux
|
||||
dist: bionic
|
||||
sudo: required
|
||||
compiler: gcc
|
||||
env: CERES_BUILD_TARGET=ANDROID
|
||||
- os: osx
|
||||
osx_image: xcode11.2
|
||||
env: CERES_BUILD_TARGET=OSX
|
||||
- os: osx
|
||||
osx_image: xcode11.2
|
||||
env: CERES_BUILD_TARGET=IOS
|
||||
|
||||
env:
|
||||
# As per http://docs.travis-ci.com/user/languages/cpp/#OpenMP-projects don't be greedy with OpenMP.
|
||||
- OMP_NUM_THREADS=4
|
||||
|
||||
before_install:
|
||||
- if [ $TRAVIS_OS_NAME = linux ]; then sudo apt-get update -qq; fi
|
||||
- |
|
||||
if [[ "$CERES_BUILD_TARGET" == "ANDROID" ]]; then
|
||||
cd /tmp
|
||||
wget https://dl.google.com/android/repository/android-ndk-r20b-linux-x86_64.zip
|
||||
unzip -qq android-ndk-r20b-linux-x86_64.zip
|
||||
fi
|
||||
|
||||
install:
|
||||
- if [ $TRAVIS_OS_NAME = linux ]; then $TRAVIS_BUILD_DIR/travis/install_travis_linux_deps.sh; fi
|
||||
- if [ $TRAVIS_OS_NAME = osx ]; then $TRAVIS_BUILD_DIR/travis/install_travis_osx_deps.sh; fi
|
||||
|
||||
before_script:
|
||||
- mkdir /tmp/ceres-build
|
||||
- cd /tmp/ceres-build
|
||||
|
||||
script:
|
||||
# NOTE: TRAVIS_BUILD_DIR is actually the source directory for Ceres.
|
||||
- |
|
||||
if [[ "$CERES_BUILD_TARGET" == "LINUX" || "$CERES_BUILD_TARGET" == "OSX" ]]; then
|
||||
cmake $TRAVIS_BUILD_DIR
|
||||
fi
|
||||
- |
|
||||
if [[ "$CERES_BUILD_TARGET" == "ANDROID" ]]; then
|
||||
cmake -DCMAKE_TOOLCHAIN_FILE=/tmp/android-ndk-r20b/build/cmake/android.toolchain.cmake -DEigen3_DIR=/usr/lib/cmake/eigen3 -DANDROID_ABI=arm64-v8a -DANDROID_STL=c++_shared -DANDROID_NATIVE_API_LEVEL=android-29 -DMINIGLOG=ON -DBUILD_EXAMPLES=OFF $TRAVIS_BUILD_DIR
|
||||
fi
|
||||
- |
|
||||
if [[ "$CERES_BUILD_TARGET" == "IOS" ]]; then
|
||||
cmake -DCMAKE_TOOLCHAIN_FILE=$TRAVIS_BUILD_DIR/cmake/iOS.cmake -DEigen3_DIR=/usr/local/share/eigen3/cmake -DIOS_PLATFORM=OS $TRAVIS_BUILD_DIR
|
||||
fi
|
||||
- make -j 4
|
||||
- |
|
||||
if [[ "$CERES_BUILD_TARGET" == "LINUX" || "$CERES_BUILD_TARGET" == "OSX" ]]; then
|
||||
sudo make install
|
||||
ctest --output-on-failure -j 4
|
||||
fi
|
||||
|
||||
notifications:
|
||||
email:
|
||||
- alexs.mac@gmail.com
|
||||
- sandwichmaker@gmail.com
|
||||
- keir@google.com
|
||||
- wjr@google.com
|
||||
@@ -1,4 +1,7 @@
|
||||
[](https://app.travis-ci.com/ceres-solver/ceres-solver)
|
||||
[](https://github.com/ceres-solver/ceres-solver/actions/workflows/android.yml)
|
||||
[](https://github.com/ceres-solver/ceres-solver/actions/workflows/linux.yml)
|
||||
[](https://github.com/ceres-solver/ceres-solver/actions/workflows/macOS.yml)
|
||||
[](https://github.com/ceres-solver/ceres-solver/actions/workflows/windows.yml)
|
||||
|
||||
Ceres Solver
|
||||
============
|
||||
|
||||
+1
-3
@@ -309,7 +309,7 @@ set(CMAKE_SYSTEM_FRAMEWORK_PATH
|
||||
${CMAKE_OSX_SYSROOT}/Developer/Library/Frameworks)
|
||||
|
||||
# Only search the specified iOS SDK, not the remainder of the host filesystem.
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
|
||||
@@ -322,7 +322,6 @@ endmacro(set_xcode_property)
|
||||
|
||||
# This macro lets you find executable programs on the host system.
|
||||
macro(find_host_package)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY NEVER)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER)
|
||||
set(IOS FALSE)
|
||||
@@ -330,7 +329,6 @@ macro(find_host_package)
|
||||
find_package(${ARGN})
|
||||
|
||||
set(IOS TRUE)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
||||
endmacro(find_host_package)
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Stop processing on any error.
|
||||
set -e
|
||||
|
||||
# Install default versions of standard dependencies that are new enough in 18.04
|
||||
sudo apt-get install -y cmake
|
||||
sudo apt-get install -y libatlas-base-dev libsuitesparse-dev
|
||||
sudo apt-get install -y libgoogle-glog-dev libgflags-dev
|
||||
sudo apt-get install -y libeigen3-dev
|
||||
@@ -1,25 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Stop processing on any error.
|
||||
set -e
|
||||
|
||||
function install_if_not_installed() {
|
||||
declare -r formula="$1"
|
||||
if [[ $(brew list ${formula} &>/dev/null; echo $?) -ne 0 ]]; then
|
||||
brew install ${formula}
|
||||
else
|
||||
echo "$0 - ${formula} is already installed."
|
||||
fi
|
||||
}
|
||||
|
||||
# Manually trigger an update prior to installing packages to avoid Ruby
|
||||
# version related errors as per [1].
|
||||
#
|
||||
# [1]: https://github.com/travis-ci/travis-ci/issues/8552
|
||||
brew update
|
||||
|
||||
install_if_not_installed cmake
|
||||
install_if_not_installed glog
|
||||
install_if_not_installed gflags
|
||||
install_if_not_installed eigen
|
||||
install_if_not_installed suite-sparse
|
||||
Reference in New Issue
Block a user