diff --git a/Wrapping/Python/PackageUtility/PythonWheelDocker/Dockerfile-x86_64 b/Wrapping/Python/PackageUtility/PythonWheelDocker/Dockerfile-x86_64 index bfcb58e978..e74e537b74 100644 --- a/Wrapping/Python/PackageUtility/PythonWheelDocker/Dockerfile-x86_64 +++ b/Wrapping/Python/PackageUtility/PythonWheelDocker/Dockerfile-x86_64 @@ -1,36 +1,61 @@ FROM quay.io/pypa/manylinux1_x86_64 MAINTAINER Insight Software Consortium ENV http_proxy http://www-int2.dkfz-heidelberg.de:3128/ ENV https_proxy https://www-int2.dkfz-heidelberg.de:3128/ -ADD https://cmake.org/files/v3.11/cmake-3.11.4.tar.gz \ +ENV QT_VERSION_A=5.11 +ENV QT_VERSION_B=5.11.2 + +ENV CMAKE_VERSION_A=3.11 +ENV CMAKE_VERSION_B=3.11.4 + +ADD https://cmake.org/files/v${CMAKE_VERSION_A}/cmake-${CMAKE_VERSION_B}-Linux-x86_64.sh \ https://www.openssl.org/source/openssl-1.0.2h.tar.gz \ /tmp/ ADD http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz \ https://gmplib.org/download/gmp/gmp-6.0.0a.tar.bz2 \ http://www.mpfr.org/mpfr-3.1.3/mpfr-3.1.3.tar.bz2 \ https://ftp.gnu.org/gnu/mpc/mpc-1.0.2.tar.gz \ http://bugseng.com/products/ppl/download/ftp/releases/1.1/ppl-1.1.tar.bz2 \ http://www.bastoul.net/cloog/pages/download/cloog-0.18.1.tar.gz \ http://ftp.gnu.org/gnu/gcc/gcc-4.9.4/gcc-4.9.4.tar.bz2 \ http://ftp.gnu.org/gnu/binutils/binutils-2.24.tar.bz2 \ http://download.osgeo.org/libtiff/tiff-4.0.9.tar.gz \ /tmp/archives/ RUN yum -y install nano libXt-devel tcp_wrappers +########################################################## Install CMAKE #################################################### +RUN cd /tmp \ + && mkdir /opt/cmake \ + && chmod +x cmake-${CMAKE_VERSION_B}-Linux-x86_64.sh \ + && sh ./cmake-${CMAKE_VERSION_B}-Linux-x86_64.sh --prefix=/opt/cmake --skip-license \ + && ln -s /opt/cmake/bin/cmake /usr/local/bin/cmake \ + && cmake --version + WORKDIR /tmp/ -COPY ./imagefiles/install.sh ./ + +########################################################## Install GCC ###################################################### +########################################################## Install libTiff ################################################## +########################################################## Install OpenSSL ################################################## +COPY ./imagefiles/install-openssl.sh ./ COPY ./imagefiles/install-gcc.sh ./ COPY ./imagefiles/install-libtiff.sh ./ RUN bash -v install-gcc.sh /usr/local && \ bash -v install-libtiff.sh && \ bash -v install.sh && \ rm -rf /tmp/* +########################################################## Install QT ####################################################### +COPY files/qt-noninteractive.qs /opt/qt-noninteractive.qs +RUN wget https://download.qt.io/archive/qt/${QT_VERSION_A}/${QT_VERSION_B}/qt-opensource-linux-x64-${QT_VERSION_B}.run \ + && chmod +x qt-opensource-linux-x64-${QT_VERSION_B}.run \ + && ./qt-opensource-linux-x64-${QT_VERSION_B}.run --script /opt/qt-noninteractive.qs -platform minimal --proxy --verbose \ + && rm qt-opensource-linux-x64-${QT_VERSION_B}.run + # User is expected to mount directory to "/work" ENTRYPOINT ["bash", "-c", "groupadd -o -g $_GROUPID $_USER && useradd -m -o -g $_GROUPID $_USER -u $_USERID && su $_USER /work/io/imagefiles/cmd.sh" ] diff --git a/Wrapping/Python/PackageUtility/PythonWheelDocker/imagefiles/cmd.sh b/Wrapping/Python/PackageUtility/PythonWheelDocker/imagefiles/cmd.sh index 92ab482d29..9c7ea56121 100755 --- a/Wrapping/Python/PackageUtility/PythonWheelDocker/imagefiles/cmd.sh +++ b/Wrapping/Python/PackageUtility/PythonWheelDocker/imagefiles/cmd.sh @@ -1,68 +1,70 @@ #!/bin/sh set -x export SRC_DIR="/tmp/mitk" export BLD_DIR="/tmp/bin" export OUT_DIR="/var/io" MITK_GIT_TAG=T25826-RadiomicsGUIUpdate PYTHON_VERSIONS=${PYTHON_VERSIONS:-$(ls /opt/python | sed -e 's/cp2[0-6][^ ]\+ \?//g')} NPROC=$(grep -c processor /proc/cpuinfo) export MAKEFLAGS="-j ${NPROC}" function build_mitk { echo "MITK_GIT_TAG: ${MITK_GIT_TAG}" git clone https://phabricator.mitk.org/source/mitk.git ${SRC_DIR} && (cd ${SRC_DIR} && git checkout ${MITK_GIT_TAG} ) && rm -rf ${BLD_DIR} && mkdir -p ${BLD_DIR} && cd ${BLD_DIR} && cmake \ + -DCMAKE_BUILD_TYPE:STRING=Release \ + -DQt5_DIR:PATH=/qt/${QT_VERSION_B}/gcc_64/lib/cmake/Qt5/ \ + -DMITK_USE_HDF5:BOOL=ON \ -DBUILD_TESTING:BOOL=OFF \ -DMITK_USE_SWIG:BOOL=ON \ -DMITK_USE_MatchPoint=ON\ -DMITK_USE_Vigra=ON\ - -DMITK_USE_Qt5:BOOL=OFF \ - -DMITK_USE_CTK:BOOL=OFF \ - -DMITK_USE_BLUEBERRY:BOOL=OFF \ + -DMITK_USE_Qt5:BOOL=ON \ + -DMITK_USE_CTK:BOOL=ON \ + -DMITK_USE_BLUEBERRY:BOOL=ON \ -DCMAKE_C_COMPILER:FILEPATH=/usr/local/bin/gcc \ -DCMAKE_CXX_COMPILER:FILEPATH=/usr/local/bin/g++ \ - -DMITK_WHITELIST:STRING=Wrapping \ -DCMAKE_BUILD_TYPE:STRING=Release \ ${SRC_DIR} && make -j8 } function build_mitk_python { PYTHON_EXECUTABLE=/opt/python/${PYTHON}/bin/python PYTHON_INCLUDE_DIR="$( find -L /opt/python/${PYTHON}/include/ -name Python.h -exec dirname {} \; )" echo "" echo "PYTHON_EXECUTABLE:${PYTHON_EXECUTABLE}" echo "PYTHON_INCLUDE_DIR:${PYTHON_INCLUDE_DIR}" echo "PYTHON_LIBRARY:${PYTHON_LIBRARY}" cd ${BLD_DIR}/MITK-build && cmake \ -DWRAP_PYTHON:BOOL=ON \ -DPYTHON_INCLUDE_DIR:PATH=${PYTHON_INCLUDE_DIR} \ -DPYTHON_EXECUTABLE:FILEPATH=${PYTHON_EXECUTABLE} \ . make dist -B } build_mitk || exit 1 for PYTHON in ${PYTHON_VERSIONS}; do build_mitk_python && auditwheel repair $(find ${BLD_DIR}/MITK-build/Wrapping/Python/dist -name pyMITK*.whl) -w ${OUT_DIR}/wheelhouse/ rm $(find ${BLD_DIR}/MITK-build/Wrapping/Python/dist/ -name pyMITK*.whl) done diff --git a/Wrapping/Python/PackageUtility/PythonWheelDocker/imagefiles/imagefiles/cmd.sh b/Wrapping/Python/PackageUtility/PythonWheelDocker/imagefiles/imagefiles/cmd.sh deleted file mode 100644 index d876ad6cfc..0000000000 --- a/Wrapping/Python/PackageUtility/PythonWheelDocker/imagefiles/imagefiles/cmd.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/sh - -set -x - -export SRC_DIR="/tmp/mitk" -export BLD_DIR="/tmp/bin" -export OUT_DIR="/var/io" - -MITK_GIT_TAG=T24046-SwigBasedPythonWrapping - -PYTHON_VERSIONS=${PYTHON_VERSIONS:-$(ls /opt/python | sed -e 's/cp2[0-6][^ ]\+ \?//g')} - -NPROC=$(grep -c processor /proc/cpuinfo) -export MAKEFLAGS="-j ${NPROC}" - - -function build_mitk { - - echo "MITK_GIT_TAG: ${MITK_GIT_TAG}" - - git clone https://phabricator.mitk.org/source/mitk.git ${SRC_DIR} && - (cd ${SRC_DIR} && git checkout ${MITK_GIT_TAG} ) && - rm -rf ${BLD_DIR} && - mkdir -p ${BLD_DIR} && cd ${BLD_DIR} && - cmake \ - -DBUILD_TESTING:BOOL=OFF \ - -DMITK_USE_SWIG:BOOL=ON \ - -DMITK_USE_Qt5:BOOL=OFF \ - -DMITK_USE_CTK:BOOL=OFF \ - -DMITK_USE_BLUEBERRY:BOOL=OFF \ - -DCMAKE_C_COMPILER:FILEPATH=/usr/local/bin/gcc \ - -DCMAKE_CXX_COMPILER:FILEPATH=/usr/local/bin/g++ \ - -DMITK_WHITELIST:STRING=Wrapping \ - -DCMAKE_BUILD_TYPE:STRING=Release \ - ${SRC_DIR} && - make -j8 -} - -function build_mitk_python { - - PYTHON_EXECUTABLE=/opt/python/${PYTHON}/bin/python - PYTHON_INCLUDE_DIR="$( find -L /opt/python/${PYTHON}/include/ -name Python.h -exec dirname {} \; )" - - echo "" - echo "PYTHON_EXECUTABLE:${PYTHON_EXECUTABLE}" - echo "PYTHON_INCLUDE_DIR:${PYTHON_INCLUDE_DIR}" - echo "PYTHON_LIBRARY:${PYTHON_LIBRARY}" - - cd ${BLD_DIR}/MITK-build && - cmake \ - -DWRAP_PYTHON:BOOL=ON \ - -DPYTHON_INCLUDE_DIR:PATH=${PYTHON_INCLUDE_DIR} \ - -DPYTHON_EXECUTABLE:FILEPATH=${PYTHON_EXECUTABLE} \ - . - make dist -B -} - -build_mitk || exit 1 - - -for PYTHON in ${PYTHON_VERSIONS}; do - build_mitk_python && - auditwheel repair $(find ${BLD_DIR}/MITK-build/Wrapping/Python/dist -name pyMITK*.whl) -w ${OUT_DIR}/wheelhouse/ - rm $(find ${BLD_DIR}/MITK-build/Wrapping/Python/dist/ -name pyMITK*.whl) -done - diff --git a/Wrapping/Python/PackageUtility/PythonWheelDocker/imagefiles/imagefiles/install-gcc.sh b/Wrapping/Python/PackageUtility/PythonWheelDocker/imagefiles/imagefiles/install-gcc.sh deleted file mode 100644 index b36458f281..0000000000 --- a/Wrapping/Python/PackageUtility/PythonWheelDocker/imagefiles/imagefiles/install-gcc.sh +++ /dev/null @@ -1,680 +0,0 @@ -#!/bin/bash -# -# Date: 2015-09-29 -# -# This downloads, builds and installs the gcc-4.9.3 compiler and boost -# 1.58. It handles the dependent packages like gmp-6.0.0a, mpfr-3.1.3, -# mpc-1.0.2, ppl-1.1, cloog-0.18.0 and binutils-2.24. -# -# To install gcc-4.9.3 in ~/tmp/gcc-4.9.3/rtf/bin you would run this -# script as follows: -# -# % # Install in ~/tmp/gcc-4.9.3/rtf/bin -# % bld.sh ~/tmp/gcc-4.9.3 2>&1 | tee bld.log -# -# If you do not specify a directory, then it will install in the -# current directory which means that following command will also -# install in ~/tmp/gcc-4.9.3/rtf/bin: -# -# % # Install in ~/tmp/gcc-4.9.3/rtf/bin -# % mkdir -p ~/tmp/gcc-4.9.3 -# % cd ~/tmp/gcc-4.9.3 -# % bld.sh 2>&1 | tee bld.log -# -# This script creates 4 subdirectories: -# -# Directory Description -# ========= ================================================== -# archives This is where the package archives are downloaded. -# src This is where the package source is located. -# bld This is where the packages are built from source. -# rtf This is where the packages are installed. -# -# When the build is complete you can safely remove the archives, bld -# and src directory trees to save disk space. -# -# Copyright (C) 2014 Joe Linoff -# -# Permission is hereby granted, free of charge, to any person -# obtaining a copy of this software and associated documentation files -# (the "Software"), to deal in the Software without restriction, -# including without limitation the rights to use, copy, modify, merge, -# publish, distribute, sublicense, and/or sell copies of the Software, -# and to permit persons to whom the Software is furnished to do so, -# subject to the following conditions: -# -# The above copyright notice and this permission notice shall be -# included in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS -# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - -# ================================================================ -# Trim a string, remove internal spaces, convert to lower case. -# ================================================================ -function get-platform-trim { - local s=$(echo "$1" | tr -d '[ \t]' | tr 'A-Z' 'a-z') - echo $s -} - -# ================================================================ -# Get the platform root name. -# ================================================================ -function get-platform-root -{ - if which uname >/dev/null 2>&1 ; then - # Greg Moeller reported that the original code didn't - # work because the -o option is not available on solaris. - # I modified the script to correctly identify that - # case and recover by using the -s option. - if uname -o >/dev/null 2>&1 ; then - # Linux distro - uname -o | tr 'A-Z' 'a-z' - elif uname -s >/dev/null 2>&1 ; then - # Solaris variant - uname -s | tr 'A-Z' 'a-z' - else - echo "unkown" - fi - else - echo "unkown" - fi -} - -# ================================================================ -# Get the platform identifier. -# -# The format of the output is: -# --- -# ^ ^ ^ ^ -# | | | +----- architecture: x86_64, i86pc, etc. -# | | +----------- version: 5.5, 6.4, 10.9, etc. -# | +------------------ distribution: centos, rhel, nexenta, darwin -# +------------------------- platform: linux, sunos, macos -# -# ================================================================ -function get-platform -{ - local plat=$(get-platform-root) - case "$plat" in - "gnu/linux") - d=$(get-platform-trim "$(lsb_release -i)" | awk -F: '{print $2;}') - r=$(get-platform-trim "$(lsb_release -r)" | awk -F: '{print $2;}') - m=$(get-platform-trim "$(uname -m)") - if [[ "$d" == "redhatenterprise"* ]] ; then - # Need a little help for Red Hat because - # they don't make the minor version obvious. - d="rhel_${d:16}" # keep the tail (e.g., es or client) - x=$(get-platform-trim "$(lsb_release -c)" | \ - awk -F: '{print $2;}' | \ - sed -e 's/[^0-9]//g') - r="$r.$x" - fi - echo "linux-$d-$r-$m" - ;; - "cygwin") - x=$(get-platform-trim "$(uname)") - echo "linux-$x" - ;; - "sunos") - d=$(get-platform-trim "$(uname -v)") - r=$(get-platform-trim "$(uname -r)") - m=$(get-platform-trim "$(uname -m)") - echo "sunos-$d-$r-$m" - ;; - "darwin") - d=$(get-platform-trim "$(uname -s)") - r=$(get-platform-trim "$(uname -r)") - m=$(get-platform-trim "$(uname -m)") - echo "macos-$d-$r-$m" - ;; - "unknown") - echo "unk-unk-unk-unk" - ;; - *) - echo "$plat-unk-unk-unk" - ;; - esac -} - -# ================================================================ -# Command header -# Usage : docmd_hdr $ar $* -# Example: docmd_hdr $ar -# ================================================================ -function docmd_hdr { - local ar=$1 - shift - local cmd=($*) - echo - echo " # ================================================================" - if [[ "$ar" != "" ]] ; then - echo " # Archive: $ar" - fi - echo " # PWD: "$(pwd) - echo " # CMD: "${cmd[@]} - echo " # ================================================================" -} - -# ================================================================ -# Execute command with decorations and status testing. -# Usage : docmd $ar -# Example: docmd $ar ls -l -# ================================================================ -function docmd { - docmd_hdr $* - shift - local cmd=($*) - ${cmd[@]} - local st=$? - echo "STATUS = $st" - if (( $st != 0 )) ; then - exit $st; - fi -} - -# ================================================================ -# Report an error and exit. -# Usage : doerr [ .. ] -# Example: doerr "line 1 msg" -# Example: doerr "line 1 msg" "line 2 msg" -# ================================================================ -function doerr { - local prefix="ERROR: " - for ln in "$@" ; do - echo "${prefix}${ln}" - prefix=" " - done - exit 1 -} - -# ================================================================ -# Extract archive information. -# Usage : ard=( $(extract-ar-info $ar) ) -# Example: ard=( $(extract-ar-info $ar) ) -# fn=${ard[1]} -# ext=${ard[2]} -# d=${ard[3]} -# ================================================================ -function extract-ar-info { - local ar=$1 - local fn=$(basename $ar) - local ext=$(echo $fn | awk -F. '{print $NF}') - local d=${fn%.*tar.$ext} - echo $ar - echo $fn - echo $ext - echo $d -} - -# ================================================================ -# Print a banner for a new section. -# Usage : banner STEP $ar -# Example: banner "DOWNLOAD" $ar -# Example: banner "BUILD" $ar -# ================================================================ -function banner { - local step=$1 - local ard=( $(extract-ar-info $2) ) - local ar=${ard[0]} - local fn=${ard[1]} - local ext=${ard[2]} - local d=${ard[3]} - echo - echo '# ================================================================' - echo "# Step : $step" - echo "# Archive: $ar" - echo "# File : $fn" - echo "# Ext : $ext" - echo "# Dir : $d" - echo '# ================================================================' -} - -# ================================================================ -# Make a set of directories -# Usage : mkdirs [ .. ] -# Example: mkdirs foo bar spam spam/foo/bar -# ================================================================ -function mkdirs { - local ds=($*) - #echo "mkdirs" - for d in ${ds[@]} ; do - #echo " testing $d" - if [ ! -d $d ] ; then - #echo " creating $d" - mkdir -p $d - fi - done -} - -# ================================================================ -# Check the current platform to see if it is in the tested list, -# if it isn't, then issue a warning. -# It doesn't work on CentOS 5.x. -# It doesn't work on Mac OS X 10.9 (Maverick) but is close. -# ================================================================ -function check-platform -{ - local plat=$(get-platform) - local tested_plats=( - 'linux-centos-6.4-x86_64') - local plat_found=0 - - echo "PLATFORM: $plat" - for tested_plat in ${tested_plats[@]} ; do - if [[ "$plat" == "$tested_plat" ]] ; then - plat_found=1 - break - fi - done - if (( $plat_found == 0 )) ; then - echo "WARNING: This platform ($plat) has not been tested." - fi -} - -# ================================================================ -# my-readlink -# Some platforms (like darwin) do not support "readlink -f". -# This function checks to see if readlink -f is available, -# if it isn't then it uses a more POSIX compliant approach. -# ================================================================ -function my-readlink -{ - # First make sure that the command works. - readlink -f "$1" 1>/dev/null 2>/dev/null - local st=$? - if (( $st )) ; then - # If readlink didn't work then this may be a platform - # like Mac OS X. - local abspath="$(cd $(dirname .); pwd)" - else - local abspath=$(readlink -f "$1" 2>/dev/null) - fi - echo "$abspath" -} - -# ================================================================ -# DATA -# ================================================================ -# List of archives -# The order is important. -ARS=( - http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz - https://gmplib.org/download/gmp/gmp-6.0.0a.tar.bz2 - http://www.mpfr.org/mpfr-current/mpfr-3.1.3.tar.bz2 - http://www.multiprecision.org/mpc/download/mpc-1.0.2.tar.gz - http://bugseng.com/products/ppl/download/ftp/releases/1.1/ppl-1.1.tar.bz2 - http://www.bastoul.net/cloog/pages/download/cloog-0.18.1.tar.gz - http://ftp.gnu.org/gnu/gcc/gcc-4.9.4/gcc-4.9.4.tar.bz2 - http://ftp.gnu.org/gnu/binutils/binutils-2.24.tar.bz2 - #http://sourceforge.net/projects/boost/files/boost/1.58.0/boost_1_58_0.tar.bz2 - # - # Why glibc is disabled (for now). - # - # glibc does not work on CentOS because the versions of the shared - # libraries we are building are not compatiable with installed - # shared libraries. - # - # This is the run-time error: ELF file OS ABI invalid that I see - # when I try to run binaries compiled with the local glibc-2.15. - # - # Note that the oldest supported ABI for glibc-2.15 is 2.2. The - # CentOS 5.5 ABI is 0. - # http://ftp.gnu.org/gnu/glibc/glibc-2.15.tar.bz2 -) - -# ================================================================ -# MAIN -# ================================================================ -umask 0 - -check-platform - -# Read the command line argument, if it exists. -ROOTDIR=$(my-readlink .) -if (( $# == 1 )) ; then - ROOTDIR=$(my-readlink $1) -elif (( $# > 1 )) ; then - doerr "too many command line arguments ($#), only zero or one is allowed" "foo" -fi - -# Setup the directories. -ARDIR="/tmp/archives" -RTFDIR="$ROOTDIR" -SRCDIR="/tmp/src" -BLDDIR="/tmp/bld" -TSTDIR="/tmp/LOCAL-TEST" - -export PATH="${RTFDIR}/bin:${PATH}" -export LD_LIBRARY_PATH="${RTFDIR}/lib:${RTFDIR}/lib64:${LD_LIBRARY_PATH}" - -echo -echo "# ================================================================" -echo '# Version : gcc-4.9.3 2015-08-15' -echo "# RootDir : $ROOTDIR" -echo "# ArchiveDir : $ARDIR" -echo "# RtfDir : $RTFDIR" -echo "# SrcDir : $SRCDIR" -echo "# BldDir : $BLDDIR" -echo "# TstDir : $TSTDIR" -echo "# Gcc : "$(which gcc) -echo "# GccVersion : "$(gcc --version | head -1) -echo "# Hostname : "$(hostname) -echo "# O/S : "$(uname -s -r -v -m) -echo "# Date : "$(date) -echo "# Platform : "$(get-platform) -echo "# ================================================================" - -mkdirs $ARDIR $RTFDIR $SRCDIR $BLDDIR - -# ================================================================ -# Download -# ================================================================ -#for ar in ${ARS[@]} ; do -# banner 'DOWNLOAD' $ar -# ard=( $(extract-ar-info $ar) ) -# fn=${ard[1]} -# ext=${ard[2]} -# d=${ard[3]} -# if [ -f "${ARDIR}/$fn" ] ; then -# echo "skipping $fn" -# else -# # get -# docmd $ar wget $ar -O "${ARDIR}/$fn" -# fi -#done - -# ================================================================ -# Extract -# ================================================================ -for ar in ${ARS[@]} ; do - banner 'EXTRACT' $ar - ard=( $(extract-ar-info $ar) ) - fn=${ard[1]} - ext=${ard[2]} - d=${ard[3]} - sd="$SRCDIR/$d" - if [ -d $sd ] ; then - echo "skipping $fn" - else - # unpack - pushd $SRCDIR - case "$ext" in - "bz2") - docmd $ar tar jxf ${ARDIR}/$fn - ;; - "gz") - docmd $ar tar zxf ${ARDIR}/$fn - ;; - "tar") - docmd $ar tar xf ${ARDIR}/$fn - ;; - *) - doerr "unrecognized extension: $ext" "Can't continue." - ;; - esac - popd - if [ ! -d $sd ] ; then - # Some archives (like gcc-g++) overlay. We create a dummy - # directory to avoid extracting them every time. - mkdir -p $sd - fi - fi - - # special hack for gmp-6.0.0a - if [[ $d == "gmp-6.0.0a" ]] ; then - if [ ! -f $sd/configure ] ; then - sdn="$SRCDIR/gmp-6.0.0" - echo "fixing $sdn --> $sd" - docmd $sd rm -rf $sd - docmd $sd ln -s $sdn $sd - fi - fi -done - -# ================================================================ -# Build -# ================================================================ -for ar in ${ARS[@]} ; do - banner 'BUILD' $ar - ard=( $(extract-ar-info $ar) ) - fn=${ard[1]} - ext=${ard[2]} - d=${ard[3]} - sd="$SRCDIR/$d" - bd="$BLDDIR/$d" - if [ -d $bd ] ; then - echo "skipping $sd" - else - # Build - regex='^gcc-g\+\+.*' - if [[ $fn =~ $regex ]] ; then - # Don't build/configure the gcc-g++ package explicitly because - # it is part of the regular gcc package. - echo "skipping $sd" - # Dummy - continue - fi - - # Set the CONF_ARGS - plat=$(get-platform) - run_conf=1 - run_boost_bootstrap=0 - case "$d" in - binutils-*) - # Binutils will not compile with strict error - # checking on so I disabled -Werror by setting - # --disable-werror. - CONF_ARGS=( - --disable-cloog-version-check - --disable-ppl-version-check - --disable-werror - --enable-cloog-backend=isl - --enable-lto - --enable-libssp - --enable-gold - --prefix=${RTFDIR} - --with-cloog=${RTFDIR} - --with-gmp=${RTFDIR} - --with-mlgmp=${RTFDIR} - --with-mpc=${RTFDIR} - --with-mpfr=${RTFDIR} - --with-ppl=${RTFDIR} - CC=${RTFDIR}/bin/gcc - CXX=${RTFDIR}/bin/g++ - ) - ;; - - boost_*) - # The boost configuration scheme requires - # that the build occur in the source directory. - run_conf=0 - run_boost_bootstrap=1 - CONF_ARGS=( - --prefix=${RTFDIR} - --with-python=python2.7 - ) - ;; - - cloog-*) - GMPDIR=$(ls -1d ${BLDDIR}/gmp-*) - CONF_ARGS=( - --prefix=${RTFDIR} - --with-gmp-builddir=${GMPDIR} - --with-gmp=build - ) - ;; - - gcc-*) - # We are using a newer version of CLooG (0.18.0). - # I have also made stack protection available - # (similar to DEP in windows). - CONF_ARGS=( - --disable-cloog-version-check - --disable-ppl-version-check - --enable-cloog-backend=isl - --enable-gold - --enable-languages='c,c++' - --enable-lto - --enable-libssp - --prefix=${RTFDIR} - --with-cloog=${RTFDIR} - --with-gmp=${RTFDIR} - --with-mlgmp=${RTFDIR} - --with-mpc=${RTFDIR} - --with-mpfr=${RTFDIR} - --with-ppl=${RTFDIR} - ) - - macplats=("macos-darwin-13.0.0-x86_64" "macos-darwin-13.1.0-x86_64") - for macplat in ${macplats[@]} ; do - if [[ "$plat" == "$macplat" ]] ; then - # Special handling for Mac OS X 10.9. - # Fix the bad reference to CFBase.h in - # src/gcc-4.9.3/libsanitizer/asan/asan_malloc_mac.cc - src="$sd/libsanitizer/asan/asan_malloc_mac.cc" - if [ -f $src ] ; then - if [ ! -f $src.orig ] ; then - cp $src $src.orig - cat $src.orig |\ - sed -e 's@#include @//#include @' >$src - fi - fi - fi - done - ;; - - glibc-*) - CONF_ARGS=( - --enable-static-nss=no - --prefix=${RTFDIR} - --with-binutils=${RTFDIR} - --with-elf - CC=${RTFDIR}/bin/gcc - CXX=${RTFDIR}/bin/g++ - ) - ;; - - gmp-*) - CONF_ARGS=( - --enable-cxx - --prefix=${RTFDIR} - ) - if [[ "$plat" == "linux-cygwin_nt-6.1-wow64" ]] ; then - CONF_ARGS+=('--enable-static') - CONF_ARGS+=('--disable-shared') - fi - ;; - - libiconv-*) - CONF_ARGS=( - --prefix=${RTFDIR} - ) - ;; - - mpc-*) - CONF_ARGS=( - --prefix=${RTFDIR} - --with-gmp=${RTFDIR} - --with-mpfr=${RTFDIR} - ) - if [[ "$plat" == "linux-cygwin_nt-6.1-wow64" ]] ; then - CONF_ARGS+=('--enable-static') - CONF_ARGS+=('--disable-shared') - fi - ;; - - mpfr-*) - CONF_ARGS=( - --prefix=${RTFDIR} - --with-gmp=${RTFDIR} - ) - ;; - - ppl-*) - CONF_ARGS=( - --prefix=${RTFDIR} - --with-gmp=${RTFDIR} - ) - if [[ "$plat" == "linux-cygwin_nt-6.1-wow64" ]] ; then - # Cygwin does not implement long double so I cheated. - CONF_ARGS+=('--enable-static') - CONF_ARGS+=('--disable-shared') - fi - - # We need a special fix for the pax archive prompt. - # Change the configure code. - if [ ! -f "$sd/configure.orig" ] ; then - # Fix the configure code so that it does not use 'pax -r'. - # The problem with 'pax -r' is that it expects a "." input - # from stdin which breaks the flow. - cp $sd/configure{,.orig} - sed -e "s/am__untar='pax -r'/am__untar='tar -xf' #am__untar='pax -r'/" \ - $sd/configure.orig >$sd/configure - fi - - # We need to make a special fix here - src="$sd/src/mp_std_bits.defs.hh" - if [ -f $src ] ; then - if [ ! -f $src.orig ] ; then - if ! grep -q '__GNU_MP_VERSION' $src ; then - cp $src $src.orig - cat $src.orig | \ - awk \ -'{ \ - if($1=="namespace" && $2 == "std") { \ - printf("// Automatically patched by bld.sh for gcc-4.9.3.\n"); \ - printf("#define tininess_before tinyness_before\n"); \ - printf("#if __GNU_MP_VERSION < 5 || (__GNU_MP_VERSION == 5 && __GNU_MP_VERSION_MINOR < 1)\n"); - } \ - print $0; \ - if($1 == "}" && $2=="//" && $3=="namespace") { \ - printf("#endif // #if __GNU_MP_VERSION < 5 || (__GNU_MP_VERSION == 5 && __GNU_MP_VERSION_MINOR < 1)\n"); - } \ -}' >$src - fi - fi - fi - ;; - - *) - doerr "unrecognized package: $d" - ;; - esac - - mkdir -p $bd - pushd $bd - if (( $run_conf )) ; then - docmd $ar $sd/configure --help - docmd $ar $sd/configure ${CONF_ARGS[@]} - docmd $ar make - docmd $ar make install - fi - if (( $run_boost_bootstrap )) ; then - pushd $sd - docmd $ar which g++ - docmd $ar gcc --version - docmd $ar $sd/bootstrap.sh --help - docmd $ar $sd/bootstrap.sh ${CONF_ARGS[@]} - docmd $ar ./b2 --help - docmd $ar ./b2 --clean - docmd $ar ./b2 --reconfigure - docmd $ar ./b2 -a -d+2 --build-dir $bd - docmd $ar ./b2 -d+2 --build-dir $bd install - docmd $ar ./b2 install - popd - fi - - # Redo the tests if anything changed. - if [ -d $TSTDIR ] ; then - rm -rf $TSTDIR - fi - popd - fi -done diff --git a/Wrapping/Python/PackageUtility/PythonWheelDocker/imagefiles/imagefiles/install-libtiff.sh b/Wrapping/Python/PackageUtility/PythonWheelDocker/imagefiles/imagefiles/install-libtiff.sh deleted file mode 100644 index efd0520a98..0000000000 --- a/Wrapping/Python/PackageUtility/PythonWheelDocker/imagefiles/imagefiles/install-libtiff.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -cd /tmp/archive -tar -xzf tiff-4.0.9.tar.gz -C /tmp/ -cd /tmp/tiff-4.0.9 -./configure CC=/usr/local/bin/gcc CXX=/usr/local/bin/g++ -make -make install diff --git a/Wrapping/Python/PackageUtility/PythonWheelDocker/imagefiles/imagefiles/install.sh b/Wrapping/Python/PackageUtility/PythonWheelDocker/imagefiles/install-openssl.sh similarity index 85% rename from Wrapping/Python/PackageUtility/PythonWheelDocker/imagefiles/imagefiles/install.sh rename to Wrapping/Python/PackageUtility/PythonWheelDocker/imagefiles/install-openssl.sh index f01d53b9db..1fc16e7152 100644 --- a/Wrapping/Python/PackageUtility/PythonWheelDocker/imagefiles/imagefiles/install.sh +++ b/Wrapping/Python/PackageUtility/PythonWheelDocker/imagefiles/install-openssl.sh @@ -1,70 +1,58 @@ NPROC=$(grep -c processor /proc/cpuinfo) export MAKEFLAGS="-j ${NPROC}" OPENSSL_ROOT=openssl-1.0.2h OPENSSL_HASH=1d4007e53aad94a5b2002fe045ee7bb0b3d98f1a47f8b2bc851dcd1c74332919 -CMAKE_ROOT=cmake-3.7.2 function check_var { if [ -z "$1" ]; then echo "required variable not defined" exit 1 fi } function do_openssl_build { ./config no-ssl2 no-shared -fPIC --prefix=/usr/local/ssl && MAKEFLAGS="" make && MAKEFLAGS="" make install } function check_sha256sum { local fname=$1 check_var ${fname} local sha256=$2 check_var ${sha256} echo "${sha256} ${fname}" > ${fname}.sha256 sha256sum -c ${fname}.sha256 rm -f ${fname}.sha256 } function build_openssl { local openssl_fname=$1 check_var ${openssl_fname} local openssl_sha256=$2 check_var ${openssl_sha256} && check_sha256sum ${openssl_fname}.tar.gz ${openssl_sha256} && tar -xzf ${openssl_fname}.tar.gz && (cd ${openssl_fname} && do_openssl_build) && rm -rf ${openssl_fname} ${openssl_fname}.tar.gz } build_openssl $OPENSSL_ROOT $OPENSSL_HASH || exit 1 -tar xvzf ${CMAKE_ROOT}.tar.gz && -mkdir /tmp/cmake-build && -(cd /tmp/cmake-build && - ../${CMAKE_ROOT}/bootstrap --parallel=${NPROC} -- \ - -DCMAKE_BUILD_TYPE:STRING=Release \ - -DCMAKE_USE_OPENSSL:BOOL=ON \ - -DOPENSSL_ROOT_DIR:PATH=/usr/local/ssl \ - -DCMAKE_USE_SYSTEM_CURL:BOOL=OFF && - make && - make install) || -exit 1 rm -rf /usr/local/ssl sed -i -e 's/3.4.8"/3.4.8","3.4.9"/g' /opt/_internal/cpython-3.6.4/lib/python3.6/site-packages/auditwheel/policy/policy.json sed -i -e 's/3.4.8"/3.4.8","3.4.10"/g' /opt/_internal/cpython-3.6.4/lib/python3.6/site-packages/auditwheel/policy/policy.json sed -i -e 's/3.4.8"/3.4.8","3.4.11"/g' /opt/_internal/cpython-3.6.4/lib/python3.6/site-packages/auditwheel/policy/policy.json sed -i -e 's/3.4.8"/3.4.8","3.4.12"/g' /opt/_internal/cpython-3.6.4/lib/python3.6/site-packages/auditwheel/policy/policy.json sed -i -e 's/3.4.8"/3.4.8","3.4.13"/g' /opt/_internal/cpython-3.6.4/lib/python3.6/site-packages/auditwheel/policy/policy.json sed -i -e 's/3.4.8"/3.4.8","3.4.14"/g' /opt/_internal/cpython-3.6.4/lib/python3.6/site-packages/auditwheel/policy/policy.json sed -i -e 's/3.4.8"/3.4.8","3.4.15"/g' /opt/_internal/cpython-3.6.4/lib/python3.6/site-packages/auditwheel/policy/policy.json sed -i -e 's/3.4.8"/3.4.8","3.4.16"/g' /opt/_internal/cpython-3.6.4/lib/python3.6/site-packages/auditwheel/policy/policy.json sed -i -e 's/3.4.8"/3.4.8","3.4.17"/g' /opt/_internal/cpython-3.6.4/lib/python3.6/site-packages/auditwheel/policy/policy.json diff --git a/Wrapping/Python/PackageUtility/PythonWheelDocker/imagefiles/install.sh b/Wrapping/Python/PackageUtility/PythonWheelDocker/imagefiles/install.sh index 7c42d1fa00..1fc16e7152 100755 --- a/Wrapping/Python/PackageUtility/PythonWheelDocker/imagefiles/install.sh +++ b/Wrapping/Python/PackageUtility/PythonWheelDocker/imagefiles/install.sh @@ -1,70 +1,58 @@ NPROC=$(grep -c processor /proc/cpuinfo) export MAKEFLAGS="-j ${NPROC}" OPENSSL_ROOT=openssl-1.0.2h OPENSSL_HASH=1d4007e53aad94a5b2002fe045ee7bb0b3d98f1a47f8b2bc851dcd1c74332919 -CMAKE_ROOT=cmake-3.11.4 function check_var { if [ -z "$1" ]; then echo "required variable not defined" exit 1 fi } function do_openssl_build { ./config no-ssl2 no-shared -fPIC --prefix=/usr/local/ssl && MAKEFLAGS="" make && MAKEFLAGS="" make install } function check_sha256sum { local fname=$1 check_var ${fname} local sha256=$2 check_var ${sha256} echo "${sha256} ${fname}" > ${fname}.sha256 sha256sum -c ${fname}.sha256 rm -f ${fname}.sha256 } function build_openssl { local openssl_fname=$1 check_var ${openssl_fname} local openssl_sha256=$2 check_var ${openssl_sha256} && check_sha256sum ${openssl_fname}.tar.gz ${openssl_sha256} && tar -xzf ${openssl_fname}.tar.gz && (cd ${openssl_fname} && do_openssl_build) && rm -rf ${openssl_fname} ${openssl_fname}.tar.gz } build_openssl $OPENSSL_ROOT $OPENSSL_HASH || exit 1 -tar xvzf ${CMAKE_ROOT}.tar.gz && -mkdir /tmp/cmake-build && -(cd /tmp/cmake-build && - ../${CMAKE_ROOT}/bootstrap --parallel=${NPROC} -- \ - -DCMAKE_BUILD_TYPE:STRING=Release \ - -DCMAKE_USE_OPENSSL:BOOL=ON \ - -DOPENSSL_ROOT_DIR:PATH=/usr/local/ssl \ - -DCMAKE_USE_SYSTEM_CURL:BOOL=OFF && - make && - make install) || -exit 1 rm -rf /usr/local/ssl sed -i -e 's/3.4.8"/3.4.8","3.4.9"/g' /opt/_internal/cpython-3.6.4/lib/python3.6/site-packages/auditwheel/policy/policy.json sed -i -e 's/3.4.8"/3.4.8","3.4.10"/g' /opt/_internal/cpython-3.6.4/lib/python3.6/site-packages/auditwheel/policy/policy.json sed -i -e 's/3.4.8"/3.4.8","3.4.11"/g' /opt/_internal/cpython-3.6.4/lib/python3.6/site-packages/auditwheel/policy/policy.json sed -i -e 's/3.4.8"/3.4.8","3.4.12"/g' /opt/_internal/cpython-3.6.4/lib/python3.6/site-packages/auditwheel/policy/policy.json sed -i -e 's/3.4.8"/3.4.8","3.4.13"/g' /opt/_internal/cpython-3.6.4/lib/python3.6/site-packages/auditwheel/policy/policy.json sed -i -e 's/3.4.8"/3.4.8","3.4.14"/g' /opt/_internal/cpython-3.6.4/lib/python3.6/site-packages/auditwheel/policy/policy.json sed -i -e 's/3.4.8"/3.4.8","3.4.15"/g' /opt/_internal/cpython-3.6.4/lib/python3.6/site-packages/auditwheel/policy/policy.json sed -i -e 's/3.4.8"/3.4.8","3.4.16"/g' /opt/_internal/cpython-3.6.4/lib/python3.6/site-packages/auditwheel/policy/policy.json sed -i -e 's/3.4.8"/3.4.8","3.4.17"/g' /opt/_internal/cpython-3.6.4/lib/python3.6/site-packages/auditwheel/policy/policy.json diff --git a/Wrapping/Python/PackageUtility/UbuntuPackageDocker/Dockerfile b/Wrapping/Python/PackageUtility/UbuntuPackageDocker/Dockerfile index af276b6bb5..8f43a85893 100644 --- a/Wrapping/Python/PackageUtility/UbuntuPackageDocker/Dockerfile +++ b/Wrapping/Python/PackageUtility/UbuntuPackageDocker/Dockerfile @@ -1,110 +1,106 @@ FROM ubuntu:16.04 as builder MAINTAINER Michael WORKDIR /opt # Define the target software versions ENV QT_VERSION_A=5.11 ENV QT_VERSION_B=5.11.2 ENV CMAKE_VERSION_A=3.11 ENV CMAKE_VERSION_B=3.11.4 -ENV MITK_HASH T24609-v2018.04-alpha +ENV MITK_HASH T25826-RadiomicsGUIUpdate # These lines are necessary in order to be able to updates the packages from within the DKFZ Network ENV http_proxy http://www-int2.dkfz-heidelberg.de:3128/ ENV https_proxy https://www-int2.dkfz-heidelberg.de:3128/ # Basic development tools RUN apt-get -y update && apt-get -y install \ build-essential \ git \ libfontconfig1-dev \ libwrap0-dev \ libglu1-mesa-dev \ wget \ libxt-dev \ libtiff5-dev \ libdbus-1-3 \ libwrap0-dev \ patchelf # Python development tools RUN apt-get -y update && apt-get -y install \ cython \ python-pip \ unzip \ libsundials-serial-dev \ python3-pip - #auditwheel RUN mkdir /opt/mitk-bin \ && mkdir /opt/bin #ENV QT_VERSION_SCRIPT=594 COPY files/qt-noninteractive.qs /opt/qt-noninteractive.qs RUN wget https://download.qt.io/archive/qt/${QT_VERSION_A}/${QT_VERSION_B}/qt-opensource-linux-x64-${QT_VERSION_B}.run \ && chmod +x qt-opensource-linux-x64-${QT_VERSION_B}.run \ - && ./qt-opensource-linux-x64-${QT_VERSION_B}.run --script /opt/qt-noninteractive.qs -platform minimal --proxy --verbose + && ./qt-opensource-linux-x64-${QT_VERSION_B}.run --script /opt/qt-noninteractive.qs -platform minimal --proxy --verbose \ + && rm qt-opensource-linux-x64-${QT_VERSION_B}.run #COPY files/cmake-3.10.3-Linux-x86_64.sh /cmake-3.10.3-Linux-x86_64.sh RUN wget https://cmake.org/files/v${CMAKE_VERSION_A}/cmake-${CMAKE_VERSION_B}-Linux-x86_64.sh \ && mkdir /opt/cmake \ && chmod +x cmake-${CMAKE_VERSION_B}-Linux-x86_64.sh \ && sh ./cmake-${CMAKE_VERSION_B}-Linux-x86_64.sh --prefix=/opt/cmake --skip-license \ && ln -s /opt/cmake/bin/cmake /usr/local/bin/cmake \ - && cmake --version + && cmake --version \ + && rm cmake-${CMAKE_VERSION_B}-Linux-x86_64.sh -ENV MITK_HASHHASH T25826-RadiomicsGUIUpdate - -RUN git clone -n https://phabricator.mitk.org/source/mitk.git mitk-src && cd mitk-src && git checkout $MITK_HASHHASH \ +RUN git clone -n https://phabricator.mitk.org/source/mitk.git mitk-src && cd mitk-src && git checkout $MITK_HASH \ && cd /opt/mitk-bin \ && cmake \ -DCMAKE_BUILD_TYPE:STRING=Release \ -DQt5_DIR:PATH=/qt/${QT_VERSION_B}/gcc_64/lib/cmake/Qt5/ \ -DMITK_USE_BLUEBERRY:BOOL=ON \ -DMITK_USE_CTK:BOOL=ON \ -DMITK_USE_Qt5:BOOL=ON \ -DMITK_USE_Vigra:BOOL=ON \ -DMITK_USE_HDF5:BOOL=ON \ -DMITK_USE_OpenCV:BOOL=ON \ -DBUILD_TESTING:BOOL=OFF \ -DMITK_USE_SWIG:BOOL=ON \ -DMITK_USE_MatchPoint=ON\ -DCMAKE_BUILD_TYPE:STRING=Release \ -DCMAKE_INSTALL_PREFIX=/opt/install \ -DGIT_EXECUTABLE:PATH=/usr/bin/git \ ../mitk-src \ && make -j"$(nproc)" MITK-Configure RUN cd mitk-bin/MITK-build \ && cmake \ -DBUILD_ClassificationMiniApps:Bool=ON . \ -DBUILD_BasicImageProcessingMiniApps:Bool=ON . \ -DPYTHON_EXECUTABLE:PATH=/usr/bin/python3.5m \ -DPYTHON_INCLUDE_DIR:PATH=/usr/include/python3.5m \ -DPYTHON_LIBRARY:PATH=/usr/lib/x86_64-linux-gnu/libpython3.5m.so \ -DWRAP_PYTHON=ON . \ && make -j"$(nproc)" \ && make dist \ && ldd /opt/mitk-bin/MITK-build/bin/MitkFileConverter | awk 'BEGIN{ORS=" "}$1~/^\//{print $1}$3~/^\//{print $3}' | xargs -i -n 1 -d ' ' cp {} /opt/bin \ && cp /opt/mitk-bin/MITK-build/bin/MitkFileConverter /opt/bin RUN cd /opt/bin/ && patchelf --set-rpath /opt/bin/ MitkFileConverter #&& cd /opt/ \ #&& rm -rf /opt/mitk-* ENV LD_LIBRARY_PATH /opt/bin/ ENV INPUTDIR=/input ENV OUTPUTDIR=/output ENV CONVERTFROM=dcm ENV CONVERTTO=nrrd ENV FILECONVERTER=/opt/mitk-bin/MITK-build/bin COPY mitk_fileconverter.sh /mitk_fileconverter.sh ENTRYPOINT ["/bin/bash", "/mitk_fileconverter.sh"] - - -