From 64fdcbdfb24c88e05a48575d653959b35a409bec Mon Sep 17 00:00:00 2001 From: Simon Detheridge Date: Thu, 28 May 2015 14:21:45 +0100 Subject: [PATCH] Add travis config This adds a travis config to build everyting on 12.04. Because 12.04 is quite old, there are a certain number of hoops that need to be jumped through in order to get things working. As a result, the build script is more complex than I'd like. --- .travis.yml | 31 +++++++++++++++++++++++++++++++ Builds/QtCreator/build_all.sh | 8 ++++++-- 2 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..4943402 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,31 @@ +language: cpp +sudo: true +script: +# install standard deps (currently only libtbb is fine in 12.04) +- sudo apt-get update +- sudo apt-get install libtbb-dev +# gcc from ppa, because 12.04's is too old +- sudo apt-get install python-software-properties +- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test +- sudo apt-get update +- sudo apt-get install gcc-4.8 g++-4.8 +# qt 5.4 from ppa, because 12.04 only has 4.8 +# yeah, really rather unofficial ppa but it's all that exists +- sudo apt-add-repository -y ppa:beineri/opt-qt541 +- sudo apt-get update +- sudo apt-get install qt54-meta-full +# glm from source, because 12.04's is too old +- git clone https://github.com/g-truc/glm.git +- cd glm && cmake . && make && sudo make install && cd .. +- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 50 +- sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 50 +# opencl from Intel's site, because 12.04's is nonexistant +- wget http://registrationcenter.intel.com/irc_nas/2563/intel_sdk_for_ocl_applications_2012_x64.tgz +- tar -xzvf intel_sdk_for_ocl_applications_2012_x64.tgz +- sudo apt-get install alien +- sudo alien -i intel_ocl_sdk_2012_x64.rpm +- sudo ln -s /usr/lib64/libOpenCL.so /usr/lib/libOpenCL.so +# finally, run the build +- source /opt/qt54/bin/qt54-env.sh +- g++ --version +- Builds/QtCreator/build_all.sh --travis diff --git a/Builds/QtCreator/build_all.sh b/Builds/QtCreator/build_all.sh index 600a1e8..25b44b2 100755 --- a/Builds/QtCreator/build_all.sh +++ b/Builds/QtCreator/build_all.sh @@ -3,6 +3,8 @@ REBUILD='' NVIDIA='' NATIVE='' +CONCURRENCY='-j9' +QMAKE=${QMAKE:-qmake} while test $# -gt 0 do @@ -13,6 +15,8 @@ do ;; --native) NATIVE="CONFIG += native" ;; + --travis) CONCURRENCY="-j1" + ;; --*) echo "bad option $1"; exit 1 ;; *) echo "unrecognised argument $1"; exit 1 @@ -29,8 +33,8 @@ do if [ "x1" = "x$REBUILD" ]; then make clean fi - qmake "$NVIDIA" "$NATIVE" - make -j9 + $QMAKE "$NVIDIA" "$NATIVE" + make $CONCURRENCY if [ "x$?" != "x0" ]; then echo "Build failed! Check output for errors." exit 1