Skip to content

Commit

Permalink
try N.1
Browse files Browse the repository at this point in the history
  • Loading branch information
darioizzo committed Apr 16, 2020
1 parent 7c9e66a commit 1948431
Show file tree
Hide file tree
Showing 5 changed files with 147 additions and 100 deletions.
149 changes: 75 additions & 74 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,83 +9,83 @@ env:

matrix:
include:
- env: PAGMO_PLUGINS_NONFREE_BUILD="manylinux64Py38" DOCKER_IMAGE="pagmo2/manylinux2010_x86_64_with_deps"
sudo: required
services:
- docker
- env: PAGMO_PLUGINS_NONFREE_BUILD="manylinux64Py37" DOCKER_IMAGE="pagmo2/manylinux2010_x86_64_with_deps"
sudo: required
services:
- docker
- env: PAGMO_PLUGINS_NONFREE_BUILD="manylinux64Py36" DOCKER_IMAGE="pagmo2/manylinux2010_x86_64_with_deps"
sudo: required
services:
- docker
- env: PAGMO_PLUGINS_NONFREE_BUILD="DebugGCC"
dist: bionic
compiler: gcc
os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- binutils-gold
- env: PAGMO_PLUGINS_NONFREE_BUILD="ReleaseGCC"
dist: bionic
compiler: gcc
os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- binutils-gold
- env: PAGMO_PLUGINS_NONFREE_BUILD="CoverageGCC"
dist: bionic
compiler: gcc
os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- binutils-gold
- env: PAGMO_PLUGINS_NONFREE_BUILD="ReleaseClang"
dist: bionic
compiler: clang
os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- clang-7
- env: PAGMO_PLUGINS_NONFREE_BUILD="DebugClang"
dist: bionic
compiler: clang
os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- clang-7
- env: PAGMO_PLUGINS_NONFREE_BUILD="Python37"
dist: bionic
compiler: gcc
os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- env: PAGMO_PLUGINS_NONFREE_BUILD="OSXDebug"
#- env: PAGMO_PLUGINS_NONFREE_BUILD="manylinux64Py38" DOCKER_IMAGE="pagmo2/manylinux2010_x86_64_with_deps"
# sudo: required
# services:
# - docker
#- env: PAGMO_PLUGINS_NONFREE_BUILD="manylinux64Py37" DOCKER_IMAGE="pagmo2/manylinux2010_x86_64_with_deps"
# sudo: required
# services:
# - docker
#- env: PAGMO_PLUGINS_NONFREE_BUILD="manylinux64Py36" DOCKER_IMAGE="pagmo2/manylinux2010_x86_64_with_deps"
# sudo: required
# services:
# - docker
#- env: PAGMO_PLUGINS_NONFREE_BUILD="DebugGCC"
# dist: bionic
# compiler: gcc
# os: linux
# addons:
# apt:
# sources:
# - ubuntu-toolchain-r-test
# packages:
# - binutils-gold
#- env: PAGMO_PLUGINS_NONFREE_BUILD="ReleaseGCC"
# dist: bionic
# compiler: gcc
# os: linux
# addons:
# apt:
# sources:
# - ubuntu-toolchain-r-test
# packages:
# - binutils-gold
#- env: PAGMO_PLUGINS_NONFREE_BUILD="CoverageGCC"
# dist: bionic
# compiler: gcc
# os: linux
# addons:
# apt:
# sources:
# - ubuntu-toolchain-r-test
# packages:
# - binutils-gold
#- env: PAGMO_PLUGINS_NONFREE_BUILD="ReleaseClang"
# dist: bionic
# compiler: clang
# os: linux
# addons:
# apt:
# sources:
# - ubuntu-toolchain-r-test
# packages:
# - clang-7
#- env: PAGMO_PLUGINS_NONFREE_BUILD="DebugClang"
# dist: bionic
# compiler: clang
# os: linux
# addons:
# apt:
# sources:
# - ubuntu-toolchain-r-test
# packages:
# - clang-7
#- env: PAGMO_PLUGINS_NONFREE_BUILD="Python37"
# dist: bionic
# compiler: gcc
# os: linux
# addons:
# apt:
# sources:
# - ubuntu-toolchain-r-test
- env: PAGMO_PLUGINS_NONFREE_BUILD="OSXDebug" PAGMO_PLUGINS_NONFREE_BUILD_TYPE="Debug"
os: osx
osx_image: xcode10.3
- env: PAGMO_PLUGINS_NONFREE_BUILD="OSXRelease"
- env: PAGMO_PLUGINS_NONFREE_BUILD="OSXRelease" PAGMO_PLUGINS_NONFREE_BUILD_TYPE="Release"
os: osx
osx_image: xcode10.3
- env: PAGMO_PLUGINS_NONFREE_BUILD="OSXPython37"
- env: PAGMO_PLUGINS_NONFREE_BUILD="OSXPython37" PAGMO_PLUGINS_NONFREE_BUILD_TYPE="Release"
os: osx
osx_image: xcode10.3
script:
Expand All @@ -96,4 +96,5 @@ script:
# command, so that if install_deps.sh fails the whole build fails immediately
# rather than executing install_travis.sh as well. See
# https://github.com/travis-ci/travis-ci/issues/1066
- ../tools/install_deps.sh && ../tools/install_travis.sh
- if [[ "${DCGP_BUILD}" == OSX* ]]; then bash ../tools/travis_osx.sh; fi
- if [[ "${DCGP_BUILD}" != OSX* ]]; then bash ../tools/install_deps.sh && ../tools/install_travis.sh; fi
13 changes: 2 additions & 11 deletions pygmo_plugins_nonfree/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
# Python version check.
if(${PYTHON_VERSION_MAJOR} LESS 2 OR (${PYTHON_VERSION_MAJOR} EQUAL 2 AND ${PYTHON_VERSION_MINOR} LESS 7))
message(FATAL_ERROR "Minimum supported Python version is 2.7.")
endif()

# Setting the rpath
if(UNIX)
# On unix platforms, we set the rpath of the pygmo libraries
# to the lib subdirectory of the install prefix. This allows
# to install pygmo in nonstandard locations (e.g., ~/.local)
# without having to muck around with library search paths.
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
if(${PYTHON_VERSION_MAJOR} LESS 3 )
message(FATAL_ERROR "Minimum supported Python version is 3.x")
endif()

# Create the module
Expand Down
8 changes: 2 additions & 6 deletions tools/install_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,18 @@ if [[ "${PAGMO_PLUGINS_NONFREE_BUILD}" != manylinux* ]]; then
conda_pkgs="boost cmake pagmo-devel cxx-compiler"

# Only Python builds will need these
if [[ "${PAGMO_PLUGINS_NONFREE_BUILD}" == "Python37" || "${PAGMO_PLUGINS_NONFREE_BUILD}" == "OSXPython37" ]]; then
if [[ "${PAGMO_PLUGINS_NONFREE_BUILD}" == "Python37" ]]; then
conda_pkgs="$conda_pkgs python=3.7 pygmo pybind11"
fi

#if [[ "${PAGMO_PLUGINS_NONFREE_BUILD}" == OSX* ]]; then
# conda_pkgs="$conda_pkgs clangdev<10"
#fi

if [[ "${PAGMO_PLUGINS_NONFREE_BUILD}" == Python* ]]; then
conda_pkgs="$conda_pkgs graphviz doxygen sphinx breathe"
fi

# We create the conda environment and activate it
conda create -q -p $deps_dir -y
source activate $deps_dir
conda install $conda_pkgs -y
conda install -c conda-forge/label/cf201901 $conda_pkgs -y
fi

set +e
Expand Down
9 changes: 0 additions & 9 deletions tools/install_travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ set -x
# Exit on error.
set -e

# If needed we make sure conda stuff is found
if [[ "${PAGMO_PLUGINS_NONFREE_BUILD}" != manylinux* ]]; then
export deps_dir=$HOME/local
export PATH="$HOME/miniconda/bin:$PATH"
Expand All @@ -26,14 +25,6 @@ elif [[ "${PAGMO_PLUGINS_NONFREE_BUILD}" == "CoverageGCC" ]]; then
make -j2 VERBOSE=1;
ctest -VV;
bash <(curl -s https://codecov.io/bash) -x gcov-5;
elif [[ "${PAGMO_PLUGINS_NONFREE_BUILD}" == "DebugClang" ]]; then
CXX=clang++-7 CC=clang-7 cmake -DCMAKE_PREFIX_PATH=$deps_dir -DBoost_NO_BOOST_CMAKE=ON -DCMAKE_BUILD_TYPE=Debug -DPPNF_BUILD_TESTS=yes ../;
make -j2 VERBOSE=1;
ctest -VV;
elif [[ "${PAGMO_PLUGINS_NONFREE_BUILD}" == "ReleaseClang" ]]; then
CXX=clang++-7 CC=clang-7 cmake -DCMAKE_PREFIX_PATH=$deps_dir -DBoost_NO_BOOST_CMAKE=ON -DCMAKE_BUILD_TYPE=Release -DPPNF_BUILD_TESTS=yes ../;
make -j2 VERBOSE=1;
ctest -VV;
elif [[ "${PAGMO_PLUGINS_NONFREE_BUILD}" == "OSXDebug" ]]; then
CXX=clang++ CC=clang cmake -DCMAKE_PREFIX_PATH=$deps_dir -DBoost_NO_BOOST_CMAKE=ON -DCMAKE_BUILD_TYPE=Debug -DPPNF_BUILD_TESTS=yes -DCMAKE_CXX_FLAGS="-g0 -O2" ../;
make -j2 VERBOSE=1;
Expand Down
68 changes: 68 additions & 0 deletions tools/travis_osx.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#!/usr/bin/env bash

# Echo each command
set -x

# Exit on error.
set -e

wget https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh;
export deps_dir=$HOME/local
export PATH="$HOME/miniconda/bin:$PATH"
bash miniconda.sh -b -p $HOME/miniconda
conda config --add channels conda-forge --force

conda_pkgs="boost-cpp cmake pagmo-devel cxx-compiler"

if [[ "${DCGP_BUILD}" == *Python37* ]]; then
build_cpp_tests="no"
conda_pkgs="$conda_pkgs python=3.7 pygmo pybind11"
else
build_cpp_tests="yes"
fi

conda create -q -p $deps_dir -y $conda_pkgs
source activate $deps_dir

export deps_dir=$HOME/local
export PATH="$HOME/miniconda/bin:$PATH"
export PATH="$deps_dir/bin:$PATH"

export CXX=clang++
export CC=clang

cmake \
-DCMAKE_PREFIX_PATH=$deps_dir \
-DBoost_NO_BOOST_CMAKE=ON \
-DCMAKE_BUILD_TYPE=${PAGMO_PLUGINS_NONFREE_BUILD_TYPE} \
-DPPNF_BUILD_TESTS=$build_cpp_tests \
-DCMAKE_CXX_FLAGS="-g0 -O2" \
..

make -j2 VERBOSE=1;

if [[ "${PAGMO_PLUGINS_NONFREE_BUILD}" != *Python* ]]; then
# We run the cpp tests
ctest -j4 -V
else
# Compile pygmo_plugins_nonfree.
cmake \
-DCMAKE_INSTALL_PREFIX=$deps_dir \
-DCMAKE_PREFIX_PATH=$deps_dir \
-DBoost_NO_BOOST_CMAKE=ON \
-DCMAKE_BUILD_TYPE=${PAGMO_PLUGINS_NONFREE_BUILD_TYPE} \
-DPPNF_BUILD_TESTS=no \
-DPPNF_BUILD_CPP=no \
-DPPNF_BUILD_PYTHON=yes \
..

make install VERBOSE=1;

# Move out of the build dir.
cd ../tools
python -c "from dcgpy import test; test.run_test_suite(); import pygmo; pygmo.mp_island.shutdown_pool(); pygmo.mp_bfe.shutdown_pool()";
fi

set +e

set +x

0 comments on commit 1948431

Please sign in to comment.