Skip to content

Commit

Permalink
ccache
Browse files Browse the repository at this point in the history
  • Loading branch information
Hauke Strasdat authored and strasdat committed Aug 8, 2017
1 parent 2a50525 commit a97c960
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 5 deletions.
5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
sudo: required
dist: trusty


addons:
apt:
sources:
Expand All @@ -21,6 +22,8 @@ install:

language: cpp

cache: ccache

matrix:
include:
- compiler: gcc
Expand All @@ -42,7 +45,7 @@ matrix:
script:
- mkdir build
- cd build
- cmake -D CMAKE_BUILD_TYPE=$BUILD_TYPE ..
- cmake -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE=$BUILD_TYPE ..
- make -j
- make test

Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
SET(PROJECT_NAME Sophus)

PROJECT(${PROJECT_NAME})
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
CMAKE_MINIMUM_REQUIRED(VERSION 3.4)

SET( CMAKE_VERBOSE_MAKEFILE ON)

Expand All @@ -16,7 +16,7 @@ set(CMAKE_CXX_STANDARD 11)
IF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g")
SET(CMAKE_CXX_FLAGS_RELEASE "-O3")
SET(CMAKE_CXX_FLAGS "-Wall -Werror -Wextra -Wno-deprecated-register -Wno-deprecated-register")
SET(CMAKE_CXX_FLAGS "-Wall -Werror -Wextra -Wno-deprecated-register -Wno-deprecated-register -Qunused-arguments -fcolor-diagnostics")
ELSEIF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g")
SET(CMAKE_CXX_FLAGS_RELEASE "-O3")
Expand Down
12 changes: 11 additions & 1 deletion scripts/install_linux_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
set -x # echo on
set -e # exit on error

wget https://cmake.org/files/v3.9/cmake-3.9.0-Linux-x86_64.sh
chmod +x cmake-3.9.0-Linux-x86_64.sh
set +x # echo off
sudo ./cmake-3.9.0-Linux-x86_64.sh --skip-license --prefix=/usr/local
set -x # echo on
sudo update-alternatives --install /usr/bin/cmake cmake /usr/local/bin/cmake 1 --force
cmake --version

sudo apt-get -qq update
sudo apt-get install libeigen3-dev libc++-dev libgoogle-glog-dev libatlas-base-dev libsuitesparse-dev
sudo unlink /usr/bin/gcc && sudo ln -s /usr/bin/gcc-5 /usr/bin/gcc
Expand All @@ -14,6 +22,8 @@ cd ceres-solver
git reset --hard afe93546b67cee0ad205fe8044325646ed5deea9
mkdir build
cd build
cmake -DCXX11=On ..
ccache -M 50G
ccache -s
cmake -DCXX11=On -DCMAKE_CXX_COMPILER_LAUNCHER=ccache ..
make -j3
sudo make install
7 changes: 6 additions & 1 deletion scripts/install_osx_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,16 @@ brew update
brew install eigen
brew install glog
brew install suite-sparse
brew install ccache
export PATH="/usr/local/opt/ccache/libexec:$PATH"
whereis ccache
git clone https://ceres-solver.googlesource.com/ceres-solver ceres-solver
cd ceres-solver
git reset --hard afe93546b67cee0ad205fe8044325646ed5deea9
mkdir build
cd build
cmake -DCXX11=On ..
ccache -M 50G
ccache -s
cmake -DCXX11=On -DCMAKE_CXX_COMPILER_LAUNCHER=ccache ..
make -j3
make install

0 comments on commit a97c960

Please sign in to comment.