Skip to content

Commit

Permalink
Merge pull request #1892 from SergioRAgostinho/ccache
Browse files Browse the repository at this point in the history
Enable ccache for speeding up build in CI
  • Loading branch information
jspricke authored Jun 26, 2017
2 parents 43601d6 + 92d3fd7 commit 08e9ebc
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 64 deletions.
59 changes: 32 additions & 27 deletions .travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,23 @@ ADVANCED_DIR=$BUILD_DIR/doc/advanced/html
CMAKE_C_FLAGS="-Wall -Wextra -Wabi -O2"
CMAKE_CXX_FLAGS="-Wall -Wextra -Wabi -O2"

if [ "$TRAVIS_OS_NAME" == "linux" ]; then
if [ "$CC" == "clang" ]; then
CMAKE_C_FLAGS="$CMAKE_C_FLAGS -Qunused-arguments"
CMAKE_CXX_FLAGS="$CMAKE_CXX_FLAGS -Qunused-arguments"
fi
fi

function before_install ()
{
if [ "$TRAVIS_OS_NAME" == "linux" ]; then
if [ "$CC" == "clang" ]; then
sudo ln -s ../../bin/ccache /usr/lib/ccache/clang
sudo ln -s ../../bin/ccache /usr/lib/ccache/clang++
fi
fi
}

function build ()
{
case $CC in
Expand All @@ -23,7 +40,7 @@ function build_lib ()
# A complete build
# Configure
mkdir $BUILD_DIR && cd $BUILD_DIR
cmake -DCMAKE_C_FLAGS=$CMAKE_C_FLAGS -DCMAKE_CXX_FLAGS=$CMAKE_CXX_FLAGS \
cmake -DCMAKE_C_FLAGS="$CMAKE_C_FLAGS" -DCMAKE_CXX_FLAGS="$CMAKE_CXX_FLAGS" \
-DPCL_ONLY_CORE_POINT_TYPES=ON \
-DPCL_QT_VERSION=4 \
-DBUILD_simulation=ON \
Expand All @@ -47,20 +64,14 @@ function build_examples ()
# A complete build
# Configure
mkdir $BUILD_DIR && cd $BUILD_DIR
cmake -DCMAKE_C_FLAGS=$CMAKE_C_FLAGS -DCMAKE_CXX_FLAGS=$CMAKE_CXX_FLAGS \
cmake -DCMAKE_C_FLAGS="$CMAKE_C_FLAGS" -DCMAKE_CXX_FLAGS="$CMAKE_CXX_FLAGS" \
-DPCL_ONLY_CORE_POINT_TYPES=ON \
-DPCL_QT_VERSION=4 \
-DBUILD_simulation=ON \
-DBUILD_global_tests=OFF \
-DBUILD_examples=ON \
-DBUILD_tools=OFF \
-DBUILD_apps=OFF \
-DBUILD_apps_3d_rec_framework=OFF \
-DBUILD_apps_cloud_composer=OFF \
-DBUILD_apps_in_hand_scanner=OFF \
-DBUILD_apps_modeler=OFF \
-DBUILD_apps_optronic_viewer=OFF \
-DBUILD_apps_point_cloud_editor=OFF \
$PCL_DIR
# Build
make -j2
Expand All @@ -71,20 +82,14 @@ function build_tools ()
# A complete build
# Configure
mkdir $BUILD_DIR && cd $BUILD_DIR
cmake -DCMAKE_C_FLAGS=$CMAKE_C_FLAGS -DCMAKE_CXX_FLAGS=$CMAKE_CXX_FLAGS \
cmake -DCMAKE_C_FLAGS="$CMAKE_C_FLAGS" -DCMAKE_CXX_FLAGS="$CMAKE_CXX_FLAGS" \
-DPCL_ONLY_CORE_POINT_TYPES=ON \
-DPCL_QT_VERSION=4 \
-DBUILD_simulation=ON \
-DBUILD_global_tests=OFF \
-DBUILD_examples=OFF \
-DBUILD_tools=ON \
-DBUILD_apps=OFF \
-DBUILD_apps_3d_rec_framework=OFF \
-DBUILD_apps_cloud_composer=OFF \
-DBUILD_apps_in_hand_scanner=OFF \
-DBUILD_apps_modeler=OFF \
-DBUILD_apps_optronic_viewer=OFF \
-DBUILD_apps_point_cloud_editor=OFF \
$PCL_DIR
# Build
make -j2
Expand All @@ -95,10 +100,12 @@ function build_apps ()
# A complete build
# Configure
mkdir $BUILD_DIR && cd $BUILD_DIR
cmake -DCMAKE_C_FLAGS=$CMAKE_C_FLAGS -DCMAKE_CXX_FLAGS=$CMAKE_CXX_FLAGS \
cmake -DCMAKE_C_FLAGS="$CMAKE_C_FLAGS" -DCMAKE_CXX_FLAGS="$CMAKE_CXX_FLAGS" \
-DPCL_ONLY_CORE_POINT_TYPES=ON \
-DPCL_QT_VERSION=4 \
-DBUILD_simulation=ON \
-DBUILD_simulation=OFF \
-DBUILD_outofcore=OFF \
-DBUILD_people=OFF \
-DBUILD_global_tests=OFF \
-DBUILD_examples=OFF \
-DBUILD_tools=OFF \
Expand All @@ -107,7 +114,7 @@ function build_apps ()
-DBUILD_apps_cloud_composer=ON \
-DBUILD_apps_in_hand_scanner=ON \
-DBUILD_apps_modeler=ON \
-DBUILD_apps_optronic_viewer=ON \
-DBUILD_apps_optronic_viewer=OFF \
-DBUILD_apps_point_cloud_editor=ON \
$PCL_DIR
# Build
Expand All @@ -119,7 +126,7 @@ function build_lib_core ()
# A reduced build, only pcl_common
# Configure
mkdir $BUILD_DIR && cd $BUILD_DIR
cmake -DCMAKE_C_FLAGS=$CMAKE_C_FLAGS -DCMAKE_CXX_FLAGS=$CMAKE_CXX_FLAGS \
cmake -DCMAKE_C_FLAGS="$CMAKE_C_FLAGS" -DCMAKE_CXX_FLAGS="$CMAKE_CXX_FLAGS" \
-DPCL_ONLY_CORE_POINT_TYPES=ON \
-DBUILD_2d=OFF \
-DBUILD_features=OFF \
Expand Down Expand Up @@ -152,8 +159,7 @@ function test_core ()
{
# Configure
mkdir $BUILD_DIR && cd $BUILD_DIR
cmake -DCMAKE_C_FLAGS=$CMAKE_C_FLAGS \
-DCMAKE_CXX_FLAGS=$CMAKE_CXX_FLAGS \
cmake -DCMAKE_C_FLAGS="$CMAKE_C_FLAGS" -DCMAKE_CXX_FLAGS="$CMAKE_CXX_FLAGS" \
-DPCL_ONLY_CORE_POINT_TYPES=ON \
-DPCL_NO_PRECOMPILE=ON \
-DBUILD_tools=OFF \
Expand Down Expand Up @@ -208,8 +214,7 @@ function test_ext_1 ()
{
# Configure
mkdir $BUILD_DIR && cd $BUILD_DIR
cmake -DCMAKE_C_FLAGS=$CMAKE_C_FLAGS \
-DCMAKE_CXX_FLAGS=$CMAKE_CXX_FLAGS \
cmake -DCMAKE_C_FLAGS="$CMAKE_C_FLAGS" -DCMAKE_CXX_FLAGS="$CMAKE_CXX_FLAGS" \
-DPCL_ONLY_CORE_POINT_TYPES=ON \
-DPCL_NO_PRECOMPILE=ON \
-DBUILD_tools=OFF \
Expand Down Expand Up @@ -257,15 +262,14 @@ function test_ext_1 ()
-DBUILD_tests_visualization=ON \
$PCL_DIR
# Build and run tests
make tests
make -j2 tests
}

function test_ext_2 ()
{
# Configure
mkdir $BUILD_DIR && cd $BUILD_DIR
cmake -DCMAKE_C_FLAGS=$CMAKE_C_FLAGS \
-DCMAKE_CXX_FLAGS=$CMAKE_CXX_FLAGS \
cmake -DCMAKE_C_FLAGS="$CMAKE_C_FLAGS" -DCMAKE_CXX_FLAGS="$CMAKE_CXX_FLAGS" \
-DPCL_ONLY_CORE_POINT_TYPES=ON \
-DPCL_NO_PRECOMPILE=ON \
-DBUILD_tools=OFF \
Expand Down Expand Up @@ -313,7 +317,7 @@ function test_ext_2 ()
-DBUILD_tests_visualization=OFF \
$PCL_DIR
# Build and run tests
make tests
make -j2 tests
}

function doc ()
Expand Down Expand Up @@ -365,6 +369,7 @@ function doc ()
}

case $1 in
before-install ) before_install;;
build ) build;;
build-examples ) build_examples;;
build-tools ) build_tools;;
Expand Down
89 changes: 53 additions & 36 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,36 @@
sudo: false
sudo: required
language: cpp
compiler:
- gcc
- clang
cache:
ccache: true
addons:
apt:
sources:
- kalakris-cmake
- boost-latest
- kubuntu-backports
- sourceline: 'ppa:kedazo/doxygen-updates-precise'
- sourceline: 'ppa:v-launchpad-jochen-sprickerhof-de/pcl'
packages:
- cmake
- libboost1.55-all-dev
- libeigen3-dev
- libgtest-dev
- doxygen-latex
- dvipng
- libusb-1.0-0-dev
- libqhull-dev
- libvtk5-dev
- libflann-dev
- doxygen
- libqt4-dev
- libqt4-opengl-dev
- libvtk5-qt4-dev
- libglew-dev
- libopenni-dev
before_install:
- bash .travis.sh before-install

env:
matrix:
- TASK="build"
global:
- secure: XQw5SBf/7b1SHFR+kKklBWhWVgNvm4vIi+wwyajFSbDLOPpsAqtnDKeA2DV9ciaQJ3CVAvBoyxYgzAvpbsb5k95jadbvu9aSlo/AQnAbz+8DhkJL25DwJAn8G4s4zD1MFi7P4fxJHZsv/l9UcdW4BzjEhh0VidWCO4hP6I9BAQc=
- secure: dRKTSeQI2Jad+/K9XCkNZxuu8exPi2wGzf6D0ogd1Nb2ZIUsOtnHSME4DO+xv7F5ZYrythHTrfezQl5hhcK+cr7A12okxlvmF/gVFuGCBPkUbyWPOrxx/Ic5pqdVnmrMFG1hFmr1KmOxCVx0F48JfGNd4ZgtUBAmnIomRp8sXRI=
Expand All @@ -30,43 +55,35 @@ env:
- secure: WTZ238yAEfXRyll1n8yau3FUW9HTvq6scKIl9AmNZrnzTr9dktupWrBVV6CtvaufT1mSmDigZ7VGC6T71HkyRIyb2qfVTrnjnxE96Wtcci6PfkuQc2L2puuZYo8dXaBRoOgJKGHFo/uKVKWnp7t55dp3lBJJmclHhon+K2hMSJw=
- secure: LNsNoBvqY/jYDoBjWCE5cM+f1H8xOwSBc/tbWZo6E/jPRjUOLzXSicMMUMrlVto+bFzSUT8OVajV3XmoRx+Qntzv6bDSAGjdycvHd2YZQPn8BYrsFtR4So7SsJkF9FlxzbiOXaiSRpwGn7TP/DO7Neubrr4IS2ef4nWowGrnCE8=
- secure: PZivWbaCWFA2BFFY8n3UMxdEWjz7rBh568u9LF5LH3HgWADnfiwWzNriACqX9fhe7tSmDru5Bk978s+xPPAY9v24cfiDEX5a5MQ/XVr2rP48n3vlUDWERDhIodJ73F9F9GGZXToGdNz0MBUAHgiv7Lb0GYUfmOYzUJjWghngLBw=
matrix:

jobs:
include:
- compiler: clang
- stage: Core Build
env: TASK="build"
compiler: gcc
script: bash .travis.sh $TASK
- env: TASK="build"
compiler: clang
script: bash .travis.sh $TASK
- stage: Extended Build and Tests
compiler: clang
env: TASK="build-examples"
script: bash .travis.sh $TASK
- compiler: clang
env: TASK="build-tools"
- compiler: clang
env: TASK="build-apps"
script: bash .travis.sh $TASK
# - compiler: clang
# env: TASK="build-apps"
# script: bash .travis.sh $TASK
- compiler: gcc
env: TASK="doc"
script: bash .travis.sh $TASK
- compiler: gcc
env: TASK="test-core"
script: bash .travis.sh $TASK
- compiler: gcc
env: TASK="test-ext-1"
script: bash .travis.sh $TASK
- compiler: gcc
env: TASK="test-ext-2"
- compiler: gcc
env: TASK="doc"
addons:
apt:
sources:
- kalakris-cmake
- boost-latest
- kubuntu-backports
- sourceline: 'ppa:kedazo/doxygen-updates-precise'
packages:
- cmake
- libboost1.55-all-dev
- libeigen3-dev
- libgtest-dev
- doxygen-latex
- dvipng
- libusb-1.0-0-dev
- libqhull-dev
- libvtk5-dev
- libflann-dev
- doxygen
- libqt4-dev
- libvtk5-qt4-dev
- libglew-dev
script:
- bash .travis.sh $TASK
script: bash .travis.sh $TASK
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -465,4 +465,3 @@ MAKE_DEP_GRAPH()
### ---[ Finish up
PCL_WRITE_STATUS_REPORT()
PCL_RESET_MAPS()

0 comments on commit 08e9ebc

Please sign in to comment.