It is for a while that I am working on a project and I want to build it on travis ci. My project has a dependency to boost-geometry
, so I tried the following travis.yml
language: cpp
dist: Xenial
sudo: true
matrix:
include:
- os: linux
env:
- PYTHON=3.6
- CXX=g++-5
- CC=gcc-5
- CXXFLAGS = "$CXXFLAGS -std=c++14"
# - os: linux
# env: CONDA=3.6 CXX=g++ CC=gcc CXXFLAGS = "$CXXFLAGS -std=c++14"
# Boost
addons:
apt:
update: true
packages:
- libboost-all-dev
- g++-5
before_install:
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- sudo apt-get update -qq
- sudo apt-get install gcc-5 -y
- sudo apt-get install g++-5 -y
- sudo apt-get install libboost-all-dev -y
- sudo apt-get install python-pip python-dev build-essential
- sudo apt-get install python3-setuptools
- sudo apt-get install python3-pip
- sudo pip install --user --upgrade pip virtualenv
- sudo pip install --user setuptools
- sudo virtualenv -p python3 venv
- source venv/bin/activate
- sudo pip install pybind11
- sudo python3 -m pip install pybind11
- sudo python3 -m pip install --upgrade pip
- cd src
- ls
- cd ../
install:
- ls $TRAVIS_BUILD_DIR
- sudo python3 setup.py install
- sudo python3 setup.py sdist
- sudo pip install --verbose dist/*.tar.gz
script:
- python tests/test.py
In this file it gives me a error. which indicates that this file is not installed as part of boost
geometry library.
could not find boost/geometry/core/assert.hpp
So I decided to build boost from source. I used the following file
language: cpp
dist: Xenial
sudo: true
matrix:
include:
- os: linux
env:
- PYTHON=3.6
- CXX=g++-5
- CC=gcc-5
- CXXFLAGS = "$CXXFLAGS -std=c++14"
# - os: linux
# env: CONDA=3.6 CXX=g++ CC=gcc CXXFLAGS = "$CXXFLAGS -std=c++14"
# Boost
addons:
apt:
update: true
sources:
-boost-latest
packages:
- libboost-all-dev
- g++-5
before_install:
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- sudo apt-get update -qq
- sudo apt-get install gcc-5 -y
- sudo apt-get install g++-5 -y
- sudo apt-get install libboost-all-dev -y
- sudo apt-get install python-pip python-dev build-essential
- sudo apt-get install python3-setuptools
- sudo apt-get install python3-pip
- wget https://sourceforge.net/projects/boost/files/boost/1.70.0/boost_1_70_0.tar.gz
- tar -xzvf boost_1_70_0.tar.gz
- cd boost_1_70_0
- sudo ./bootstrap.sh --prefix=/usr/local --with-libraries=all
- sudo ./b2 install
- sudo /bin/bash -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/boost.conf'
- sudo ldconfig
- cd ../../
- sudo pip install --user --upgrade pip virtualenv
- sudo pip install --user setuptools
- sudo virtualenv -p python3 venv
- source venv/bin/activate
- sudo pip install pybind11
- sudo python3 -m pip install pybind11
- sudo python3 -m pip install --upgrade pip
- cd src
- ls
- cd ../
# Inform user that Boost 1.55 was successfully installed
# echo "Boost 1.55 was successfully installed."
install:
#- |
# if [ -n "$PYTHON" ]; then
# sudo apt-get install -qq g++-6
# sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-6 90
- ls $TRAVIS_BUILD_DIR
- sudo python3 setup.py install
- sudo python3 setup.py sdist
- sudo pip install --verbose dist/*.tar.gz
# elif [ -n "$CONDA" ]; then
# conda build conda.recipe
# conda install --use-local pydggrid
# fi
script:
- python tests/test.py
It starts to run but as boost writes logs travis raises the following error
The job exceeded the maximum log length, and has been terminated.
Well, what can I do to fix this issue? I looked for a flag to avoid boost generating that amount of logs but could not find any. I also tried to find a why to use apt-get
to install boost-geometry but did not get any chance to find proper package. Can some one help me with this issue? thanks
well I ended up with this method
- wget https://sourceforge.net/projects/boost/files/boost/1.70.0/boost_1_70_0.tar.gz -P $HOME
- cd $HOME
- tar -xzvf boost_1_70_0.tar.gz >/dev/null
and as boost is header only library I did not compile it, I just added its directory in include section of my make script
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.