Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Manylinux attempt #293

Merged
merged 10 commits into from
May 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,5 @@ workflows:
- bionic_gcc7_coverage
- cosmic_gcc8_asan
- cosmic_clang7
- bionic_clang6_release
- bionic_clang6_release

12 changes: 4 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,23 +74,19 @@ matrix:
- env: PAGMO_BUILD="OSXPython27"
os: osx
osx_image: xcode6.4
- env: PAGMO_BUILD="manylinux64Py27m" DOCKER_IMAGE="quay.io/pypa/manylinux1_x86_64"
- env: PAGMO_BUILD="manylinux64Py37" DOCKER_IMAGE="pagmo2/manylinux1_x86_64_with_deps"
sudo: required
services:
- docker
- env: PAGMO_BUILD="manylinux64Py27mu" DOCKER_IMAGE="quay.io/pypa/manylinux1_x86_64"
- env: PAGMO_BUILD="manylinux64Py36" DOCKER_IMAGE="pagmo2/manylinux1_x86_64_with_deps"
sudo: required
services:
- docker
- env: PAGMO_BUILD="manylinux64Py37" DOCKER_IMAGE="quay.io/pypa/manylinux1_x86_64"
- env: PAGMO_BUILD="manylinux64Py27" DOCKER_IMAGE="pagmo2/manylinux1_x86_64_with_deps"
sudo: required
services:
- docker
- env: PAGMO_BUILD="manylinux64Py36" DOCKER_IMAGE="quay.io/pypa/manylinux1_x86_64"
sudo: required
services:
- docker
- env: PAGMO_BUILD="manylinux64Py35" DOCKER_IMAGE="quay.io/pypa/manylinux1_x86_64"
- env: PAGMO_BUILD="manylinux64Py27mu" DOCKER_IMAGE="pagmo2/manylinux1_x86_64_with_deps"
sudo: required
services:
- docker
Expand Down
4 changes: 2 additions & 2 deletions tools/install_appveyor_mingw.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def run_command(raw_command, directory=None, verbose=True):
python_version = r'27'
python_folder = r'Python27-x64'
python_library = r'C:\\' + python_folder + r'\\libs\\python27.dll '
# Fot py27 I could not get it to work with the appveyor python (I was close but got tired).
# For py27 I could not get it to work with the appveyor python (I was close but got tired).
# Since this is anyway going to disappear (py27 really!!!), I am handling it as a one time workaround using the old py27 patched by bluescarni
rm_fr(r'c:\\Python27-x64')
wget(r'https://github.com/bluescarni/binary_deps/raw/master/python27_mingw_64.7z', 'python.7z')
Expand Down Expand Up @@ -123,7 +123,7 @@ def run_command(raw_command, directory=None, verbose=True):

# Proceed to the build.
# NOTE: at the moment boost 1.70 seems to have problem to autodetect
# the mingw library (with CMake 1.13 currently installed in appveyor)
# the mingw library (with CMake 3.13 currently installed in appveyor)
# Thus we manually point to the boost libs.
common_cmake_opts = r'-DCMAKE_PREFIX_PATH=c:\\local ' + \
r'-DCMAKE_INSTALL_PREFIX=c:\\local ' + \
Expand Down
98 changes: 20 additions & 78 deletions tools/install_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,97 +6,30 @@ set -x
# Exit on error.
set -e

CMAKE_VERSION="3.12.0"
EIGEN3_VERSION="3.3.4"
BOOST_VERSION="1.67.0"
NLOPT_VERSION="2.4.2"
TBB_VERSION="2019_U5"

if [[ ${PAGMO_BUILD} == *37 ]]; then
PYTHON_DIR="cp37-cp37m"
BOOST_PYTHON_LIBRARY_NAME="libboost_python37.so"
PYTHON_VERSION="37"
elif [[ ${PAGMO_BUILD} == *36 ]]; then
PYTHON_DIR="cp36-cp36m"
elif [[ ${PAGMO_BUILD} == *35 ]]; then
PYTHON_DIR="cp35-cp35m"
BOOST_PYTHON_LIBRARY_NAME="libboost_python36.so"
PYTHON_VERSION="36"
elif [[ ${PAGMO_BUILD} == *27mu ]]; then
PYTHON_DIR="cp27-cp27mu"
elif [[ ${PAGMO_BUILD} == *27m ]]; then
BOOST_PYTHON_LIBRARY_NAME="libboost_python27mu.so"
PYTHON_VERSION="27"
elif [[ ${PAGMO_BUILD} == *27 ]]; then
PYTHON_DIR="cp27-cp27m"
BOOST_PYTHON_LIBRARY_NAME="libboost_python27.so"
PYTHON_VERSION="27"
else
echo "Invalid build type: ${PAGMO_BUILD}"
exit 1
fi

# HACK: for python 3.x, the include directory
# is called 'python3.xm' rather than just 'python3.x'.
# This confuses the build system of Boost.Python, thus
# we create a symlink to 'python3.x'.
cd /opt/python/${PYTHON_DIR}/include
PY_INCLUDE_DIR_NAME=`ls`
# If the include dir ends with 'm', create a symlink
# without the 'm'.
if [[ $PY_INCLUDE_DIR_NAME == *m ]]; then
ln -s $PY_INCLUDE_DIR_NAME `echo $PY_INCLUDE_DIR_NAME|sed 's/.$//'`
fi

cd
mkdir install
cd install

# TBB
curl -L https://github.com/01org/tbb/archive/${TBB_VERSION}.tar.gz > tbb.tar.gz
tar xvf tbb.tar.gz > /dev/null 2>&1
cd tbb-${TBB_VERSION}
make > /dev/null 2>&1
cd build
mv *_release release
mv *_debug debug
cd release
cp libtbb* /usr/lib64/
cd ../debug
cp libtbb* /usr/lib64/
ldconfig
cd ../../include/
cp -r tbb /usr/local/include/
cd ../../

# Install CMake
curl -L https://github.com/Kitware/CMake/archive/v${CMAKE_VERSION}.tar.gz > v${CMAKE_VERSION}
tar xzf v${CMAKE_VERSION} > /dev/null 2>&1
cd CMake-${CMAKE_VERSION}/
./configure > /dev/null
gmake -j2 > /dev/null
gmake install > /dev/null
cd ..

# Install Eigen
curl -L https://bitbucket.org/eigen/eigen/get/${EIGEN3_VERSION}.tar.gz > ${EIGEN3_VERSION}
tar xzf ${EIGEN3_VERSION} > /dev/null 2>&1
cd eigen*
mkdir build
cd build
cmake ../ > /dev/null
make install > /dev/null
cd ..
cd ..

# Boost (python, system, filesystem libs needed)
curl -L http://dl.bintray.com/boostorg/release/${BOOST_VERSION}/source/boost_`echo ${BOOST_VERSION}|tr "." "_"`.tar.bz2 > boost_`echo ${BOOST_VERSION}|tr "." "_"`.tar.bz2
tar xjf boost_`echo ${BOOST_VERSION}|tr "." "_"`.tar.bz2
cd boost_`echo ${BOOST_VERSION}|tr "." "_"`
sh bootstrap.sh --with-python=/opt/python/${PYTHON_DIR}/bin/python > /dev/null
./bjam --toolset=gcc link=shared threading=multi cxxflags="-std=c++11" variant=release --with-python --with-serialization -j2 install > /dev/null
cd ..

# NLopt
# NOTE: use alternative mirror as the one from the original webpage is faulty.
curl -L http://pkgs.fedoraproject.org/repo/pkgs/NLopt/NLopt-${NLOPT_VERSION}.tar.gz/d0b8f139a4acf29b76dbae69ade8ac54/NLopt-${NLOPT_VERSION}.tar.gz > NLopt-${NLOPT_VERSION}.tar.gz
tar xzf NLopt-${NLOPT_VERSION}.tar.gz
cd nlopt-${NLOPT_VERSION}
./configure --enable-shared --disable-static > /dev/null
make -j2 install > /dev/null
cd ..

# Python mandatory deps.
/opt/python/${PYTHON_DIR}/bin/pip install cloudpickle numpy
# Python optional deps.
Expand All @@ -113,10 +46,19 @@ fi
cd /pagmo2
mkdir build_pagmo
cd build_pagmo
cmake ../ -DPAGMO_WITH_EIGEN3=yes -DPAGMO_WITH_NLOPT=yes -DCMAKE_BUILD_TYPE=Release
cmake -DBoost_NO_BOOST_CMAKE=ON \
-DPAGMO_WITH_EIGEN3=yes \
-DPAGMO_WITH_NLOPT=yes \
-DPAGMO_WITH_IPOPT=yes \
-DCMAKE_BUILD_TYPE=Release ../;
make install
cd ../build
cmake -DCMAKE_BUILD_TYPE=Release -DPAGMO_BUILD_PYGMO=yes -DPAGMO_BUILD_PAGMO=no -DPYTHON_EXECUTABLE=/opt/python/${PYTHON_DIR}/bin/python ../;
cmake -DBoost_NO_BOOST_CMAKE=ON \
-DCMAKE_BUILD_TYPE=Release \
-DPAGMO_BUILD_PYGMO=yes \
-DPAGMO_BUILD_PAGMO=no \
-DBoost_PYTHON${PYTHON_VERSION}_LIBRARY_RELEASE=/usr/local/lib/${BOOST_PYTHON_LIBRARY_NAME} \
-DPYTHON_EXECUTABLE=/opt/python/${PYTHON_DIR}/bin/python ../;
make -j2 install
cd wheel
# Copy the installed pygmo files, wherever they might be in /usr/local,
Expand Down