Skip to content

Commit

Permalink
Squashed '.travis/' changes from 2a03b5b..679949e
Browse files Browse the repository at this point in the history
679949e Update Eigen 3.3 to 3.3.7 and add ps1 script
e3853d4 Setup catkin workspace in common script
083fa2c Do not build dependencies in source
dc8b946 Merge pull request #35 from bchretien/fix/osx-build
432f6b1 Fix OSX build (deprecated science repo)
bad6dbd Allow to specify pybindgen install prefix
3f214dd Update pybindgen archive url
f13ddca Use a common script for Eigen 3.2 and 3.3
0d26976 Add a script for Eigen 3.3
027bca4 Update Eigen 3.2 version to 3.2.10
629f539 ipopt: update to 3.12.6
87f7ee7 eigen: update to 3.2.9
a0c7e47 common.sh: fix OS X environment
811fbd6 Merge pull request #31 from francois-keith/dev4
4c8a74c Hard code the path to git.exe
8c1c5f5 Build in debug.
89d0b39 Add some intermediary checks.
c2f4554 [AppVeyor] Add a method to run the unit tests.
e59a441 Correct choco install.
af4c533 Merge pull request #30 from jcarpent/master
00d90b0 Fix bug in common.sh
9da636c Merge pull request #29 from jcarpent/master
dd15db5 Use CI_BRANCH instead of TRAVIS_BRANCH
448cc3f Set DO_*_ON_BRANCH to the current branch if they are not yet defined
c5ed776 [Cppcheck] Do ccpcheck only on specified branches
3c52bd1 [Coverage] Do coverage only on specified branches

git-subtree-dir: .travis
git-subtree-split: 679949e28a91c334edf3588753cf294aec2fc4c7
  • Loading branch information
gergondet committed Apr 4, 2019
1 parent ed38c7f commit a3c25a2
Show file tree
Hide file tree
Showing 11 changed files with 139 additions and 43 deletions.
5 changes: 4 additions & 1 deletion after_success
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,10 @@ elif [[ ${CI_OS_NAME} = linux ]]; then
exit 0
fi

generate_coverage_data
if [[ ";${DO_COVERAGE_ON_BRANCH};" == *";${CI_BRANCH};"* ]]; then
generate_coverage_data
fi

# If it's not a fork or a pull request
if `test x${CI_REPO_SLUG} = x${GH_REPO} -a ${CI_PULL_REQUEST} = false`; then
set_push_uri
Expand Down
6 changes: 3 additions & 3 deletions before_install
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ _linux_setup_package_source()

_osx_setup_package_source()
{
# Add science-related repos
brew tap homebrew/science
# Update homebrew
brew update
}
Expand Down Expand Up @@ -140,7 +138,9 @@ build_git_dependency()
mkdir -p "$git_dep"
$git_clone -b $git_dep_branch "$git_dep_uri" "$git_dep"
cd "$git_dep"
cmake . -DCMAKE_INSTALL_PREFIX:STRING="$install_dir" \
mkdir -p build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX:STRING="$install_dir" \
-DDISABLE_TESTS:BOOL=ON ${CMAKE_ADDITIONAL_OPTIONS}
make install || make
}
Expand Down
31 changes: 20 additions & 11 deletions build
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,32 @@ build_package()
echo "--> Building package..."

cd "$build_dir"
cmake "$root_dir" -DCMAKE_INSTALL_PREFIX="$install_dir" \
-DCMAKE_CXX_FLAGS="--coverage" \
-DCMAKE_EXE_LINKER_FLAGS="--coverage" \
-DCMAKE_MODULE_LINKER_FLAGS="--coverage" \
${CMAKE_ADDITIONAL_OPTIONS}

if [[ ";${DO_COVERAGE_ON_BRANCH};" == *";${CI_BRANCH};"* ]]; then
cmake "$root_dir" -DCMAKE_INSTALL_PREFIX="$install_dir" \
-DCMAKE_CXX_FLAGS="--coverage" \
-DCMAKE_EXE_LINKER_FLAGS="--coverage" \
-DCMAKE_MODULE_LINKER_FLAGS="--coverage" \
${CMAKE_ADDITIONAL_OPTIONS}
else
cmake "$root_dir" -DCMAKE_INSTALL_PREFIX="$install_dir" \
${CMAKE_ADDITIONAL_OPTIONS}
fi

${MAKE_PREFIX} make
make install

ALLOW_TESTSUITE_FAILURE=${ALLOW_TESTSUITE_FAILURE:-false}
make test || ${ALLOW_TESTSUITE_FAILURE}

cppcheck --quiet --enable=all \
-I $root_dir/src -I $root_dir/tests -I $root_dir/include \
-I $root_dir/tests/shared-tests \
-I $build_dir/include -I $install_dir/include \
-i $build_dir/CMakeFiles \
$root_dir || true
if [[ ";${DO_CPPCHECK_ON_BRANCH};" == *";${CI_BRANCH};"* ]]; then
cppcheck --quiet --enable=all \
-I $root_dir/src -I $root_dir/tests -I $root_dir/include \
-I $root_dir/tests/shared-tests \
-I $build_dir/include -I $install_dir/include \
-i $build_dir/CMakeFiles \
$root_dir || true
fi
}

# debian_build_package
Expand Down
17 changes: 17 additions & 0 deletions common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ _setup_ros()
if [ -f /opt/ros/${ROS_DISTRO}/setup.sh ]; then
. /opt/ros/${ROS_DISTRO}/setup.sh
fi
CATKIN_DEP_WORKSPACE=/tmp/_ci/catkin_dep_ws
if [ -e ${CATKIN_DEP_WORKSPACE}/devel/setup.sh ]; then
. ${CATKIN_DEP_WORKSPACE}/devel/setup.sh
fi
}

# _setup_env_vars
Expand Down Expand Up @@ -188,6 +192,10 @@ _setup_osx_env()
export CXX=g++-4.8
export CC=gcc-4.8
fi

export DYLD_LIBRARY_PATH="$install_dir/lib:$DYLD_LIBRARY_PATH"
export LTDL_LIBRARY_PATH="$install_dir/lib:$LTDL_LIBRARY_PATH"
export PKG_CONFIG_PATH="$install_dir/lib/pkgconfig:$PKG_CONFIG_PATH"
}

# setup_ci_env
Expand Down Expand Up @@ -227,6 +235,15 @@ setup_ci_env
export CMAKE_VERBOSE_MAKEFILE=1
export CTEST_OUTPUT_ON_FAILURE=1

# Add default DO_*_ON_BRANCH if needed
if [ -z ${DO_COVERAGE_ON_BRANCH+x} ]; then
export DO_COVERAGE_ON_BRANCH=${CI_BRANCH}
fi

if [ -z ${DO_CPPCHECK_ON_BRANCH+x} ]; then
export DO_CPPCHECK_ON_BRANCH=${CI_BRANCH}
fi

# Create layout.
mkdir -p "$build_dir"
mkdir -p "$install_dir"
23 changes: 3 additions & 20 deletions dependencies/eigen-3.2
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,7 @@
#
# Setup Eigen 3.2
#
. `dirname $0`/../common.sh
EIGEN_VERSION=3.2.10
EIGEN_HASH=b9cd8366d4e8

EIGEN_VERSION=3.2.8
EIGEN_HASH=07105f7124f9

# Checkout Eigen
cd "$build_dir"
wget --quiet "http://bitbucket.org/eigen/eigen/get/${EIGEN_VERSION}.tar.gz"
tar xzf ${EIGEN_VERSION}.tar.gz
cd "$build_dir/eigen-eigen-${EIGEN_HASH}/"
mkdir -p "$build_dir/eigen-eigen-${EIGEN_HASH}/_build"
cd "$build_dir/eigen-eigen-${EIGEN_HASH}/_build"

# Build, make and install Eigen
cmake .. -DCMAKE_INSTALL_PREFIX:STRING="$install_dir"
make
make install

# Check install
pkg-config --modversion "eigen3 >= ${EIGEN_VERSION}"
pkg-config --cflags "eigen3 >= ${EIGEN_VERSION}"
. `dirname $0`/eigen-common.sh $EIGEN_VERSION $EIGEN_HASH
8 changes: 8 additions & 0 deletions dependencies/eigen-3.3
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
#
# Setup Eigen 3.3
#
EIGEN_VERSION=3.3.7
EIGEN_HASH=323c052e1731

. `dirname $0`/eigen-common.sh $EIGEN_VERSION $EIGEN_HASH
26 changes: 26 additions & 0 deletions dependencies/eigen-3.3.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
$EIGEN_VERSION="3.3.7"
$EIGEN_HASH="323c052e1731"

cd $Env:SOURCE_FOLDER
appveyor DownloadFile "http://bitbucket.org/eigen/eigen/get/$EIGEN_VERSION.zip"
7z x "${EIGEN_VERSION}.zip" -o"${Env:SOURCE_FOLDER}\eigen" -r
cd "${Env:SOURCE_FOLDER}\eigen\eigen-eigen-$EIGEN_HASH"
md build
cd build

# Build, make and install Eigen
cmake -G "Visual Studio 14 2015 Win64" -DCMAKE_INSTALL_PREFIX="${Env:CMAKE_INSTALL_PREFIX}" ../
msbuild INSTALL.vcxproj

# Generate eigen3.pc
$EIGEN3_PC_FILE="${Env:PKG_CONFIG_PATH}/eigen3.pc"
echo "Name: Eigen3" | Out-File -Encoding ascii -FilePath $EIGEN3_PC_FILE
echo "Description: A C++ template library for linear algebra: vectors, matrices, and related algorithms" | Out-File -Append -Encoding ascii -FilePath $EIGEN3_PC_FILE
echo "Requires:" | Out-File -Append -Encoding ascii -FilePath $EIGEN3_PC_FILE
echo "Version: $EIGEN_VERSION" | Out-File -Append -Encoding ascii -FilePath $EIGEN3_PC_FILE
echo "Libs:" | Out-File -Append -Encoding ascii -FilePath $EIGEN3_PC_FILE
echo "Cflags: -I${Env:CMAKE_INSTALL_PREFIX}/include/eigen3" | Out-File -Append -Encoding ascii -FilePath $EIGEN3_PC_FILE

# Check install
pkg-config --modversion "eigen3 >= ${EIGEN_VERSION}"
pkg-config --cflags "eigen3 >= ${EIGEN_VERSION}"
25 changes: 25 additions & 0 deletions dependencies/eigen-common.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash
#
# Setup Eigen
#
. `dirname $0`/../common.sh

EIGEN_VERSION=$1
EIGEN_HASH=$2

# Checkout Eigen
cd "$build_dir"
wget --quiet "http://bitbucket.org/eigen/eigen/get/${EIGEN_VERSION}.tar.gz"
tar xzf ${EIGEN_VERSION}.tar.gz
cd "$build_dir/eigen-eigen-${EIGEN_HASH}/"
mkdir -p "$build_dir/eigen-eigen-${EIGEN_HASH}/_build"
cd "$build_dir/eigen-eigen-${EIGEN_HASH}/_build"

# Build, make and install Eigen
cmake .. -DCMAKE_INSTALL_PREFIX:STRING="$install_dir"
make
make install

# Check install
pkg-config --modversion "eigen3 >= ${EIGEN_VERSION}"
pkg-config --cflags "eigen3 >= ${EIGEN_VERSION}"
2 changes: 1 addition & 1 deletion dependencies/ipopt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
${SUDO_CMD} apt-get update -qq
${SUDO_CMD} apt-get install -qq libblas-dev liblapack-dev libmumps-seq-dev gfortran

IPOPT_VERSION=3.12.4
IPOPT_VERSION=3.12.6

build_dir=`mktemp -d`
trap "rm -rf -- '$build_dir'" EXIT
Expand Down
10 changes: 8 additions & 2 deletions dependencies/pybindgen-0.16
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,22 @@

. `dirname $0`/../common.sh

if [ $# -ge 1 ]; then
PYBINDGEN_INSTALL_PREFIX=$1
else
PYBINDGEN_INSTALL_PREFIX=/usr/local
fi

# Install dependencies
${SUDO_CMD} apt-get install -qq gccxml python-pygccxml

# Get pybindgen
cd "$build_dir"
wget --quiet https://pybindgen.googlecode.com/files/pybindgen-0.16.0.tar.bz2
wget --quiet https://launchpad.net/pybindgen/trunk/0.16/+download/pybindgen-0.16.0.tar.bz2
tar xjf pybindgen-0.16.0.tar.bz2
cd "$build_dir/pybindgen-0.16.0/"

# Configure build and install
./waf configure
./waf --prefix=$PYBINDGEN_INSTALL_PREFIX configure
./waf
${SUDO_CMD} ./waf install
29 changes: 24 additions & 5 deletions functions.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function install_choco_dependencies
{
ForEach($choco_dep in $Env:CHOCO_DEPENDENCIES.split(' '))
{
choco install $choco_dep
choco install $choco_dep -y
}
}

Expand All @@ -75,13 +75,17 @@ function install_git_dependencies
git clone -b "$git_dep_branch" "$git_dep_uri" "$git_dep"
cd $git_dep
git submodule update --init
if ($lastexitcode -ne 0){ exit $lastexitcode }
md build
cd build
# For projects that use cmake_add_subfortran directory this removes sh.exe
# from the path
$Env:Path = $Env:Path -replace "Git","dummy"
cmake ../ -G "Visual Studio 14 2015 Win64" -DCMAKE_INSTALL_PREFIX="${Env:CMAKE_INSTALL_PREFIX}" -DPYTHON_BINDING=OFF -DMINGW_GFORTRAN="$env:MINGW_GFORTRAN"
msbuild INSTALL.vcxproj
cmake ../ -G "Visual Studio 14 2015 Win64" -DCMAKE_INSTALL_PREFIX="${Env:CMAKE_INSTALL_PREFIX}" -DPYTHON_BINDING=OFF -DMINGW_GFORTRAN="$env:MINGW_GFORTRAN" -DGIT="C:/Program Files/Git/cmd/git.exe"

if ($lastexitcode -ne 0){ exit $lastexitcode }
msbuild INSTALL.vcxproj /p:Configuration=Debug
if ($lastexitcode -ne 0){ exit $lastexitcode }
# Reverse our dirty work
$Env:Path = $Env:Path -replace "dummy","Git"
}
Expand All @@ -97,11 +101,26 @@ function build_project
{
cd $Env:PROJECT_SOURCE_DIR
git submodule update --init
if ($lastexitcode -ne 0){ exit $lastexitcode }
md build
cd build
# See comment in dependencies regarding $Env:Path manipulation
$Env:Path = $Env:Path -replace "Git","dummy"
cmake ../ -G "Visual Studio 14 2015 Win64" -DCMAKE_INSTALL_PREFIX="${Env:CMAKE_INSTALL_PREFIX}" -DPYTHON_BINDING=OFF -DMINGW_GFORTRAN="$env:MINGW_GFORTRAN"
msbuild INSTALL.vcxproj
cmake ../ -G "Visual Studio 14 2015 Win64" -DCMAKE_INSTALL_PREFIX="${Env:CMAKE_INSTALL_PREFIX}" -DPYTHON_BINDING=OFF -DMINGW_GFORTRAN="$env:MINGW_GFORTRAN" -DGIT="C:/Program Files/Git/cmd/git.exe"
if ($lastexitcode -ne 0){ exit $lastexitcode }
msbuild INSTALL.vcxproj /p:Configuration=Debug
if ($lastexitcode -ne 0){ exit $lastexitcode }
$Env:Path = $Env:Path -replace "dummy","Git"
}

function test_project
{
cd %PROJECT_SOURCE_DIR%/build
ctest -N
ctest --build-config Debug --exclude-regex example
if ($lastexitcode -ne 0)
{
type Testing/Temporary/LastTest.log
exit $lastexitcode
}
}

0 comments on commit a3c25a2

Please sign in to comment.