From 898237c19addd5d62e72e74614b19e9fa74618ec Mon Sep 17 00:00:00 2001 From: Jiabin Yang Date: Thu, 18 Jul 2019 10:24:19 +0800 Subject: [PATCH] Downgrade gcc to 4.8 (#18614) * test=develop, fix docker with paddle nccl problem * test=develop, downgrade gcc to 4.8 for latest-dev * test=develop, downgrade gcc to 4.8 for latest-dev * test=develop, modify cmake to renew all third_party * test=develop, invoke ci * test=develop, invoke ci * test=develop, complie python with wide-unicode * test=deveop, refine env settings * test=deveop, refine env settings --- Dockerfile | 64 +++++++++++++++++++++++++++++++------- cmake/external/eigen.cmake | 1 + 2 files changed, 54 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index 13642de1a7..5db7fa5074 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,6 +25,17 @@ RUN apt-get update && \ libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \ xz-utils tk-dev libffi-dev liblzma-dev +# Downgrade gcc&&g++ +RUN apt-get update +WORKDIR /usr/bin +RUN apt install -y gcc-4.8 g++-4.8 +RUN cp gcc gcc.bak +RUN cp g++ g++.bak +RUN rm gcc +RUN rm g++ +RUN ln -s gcc-4.8 gcc +RUN ln -s g++-4.8 g++ + # Install Python3.6 RUN mkdir -p /root/python_build/ && wget -q https://www.sqlite.org/2018/sqlite-autoconf-3250300.tar.gz && \ tar -zxf sqlite-autoconf-3250300.tar.gz && cd sqlite-autoconf-3250300 && \ @@ -56,6 +67,43 @@ RUN apt-get update && \ net-tools libtool ccache && \ apt-get clean -y +# Install Python2.7.15 to replace original python +WORKDIR /home +ENV version=2.7.15 +RUN wget https://www.python.org/ftp/python/$version/Python-$version.tgz +RUN tar -xvf Python-$version.tgz +WORKDIR /home/Python-$version +RUN ./configure --enable-unicode=ucs4 --enable-shared CFLAGS=-fPIC --prefix=/usr/local/python2.7.15 +RUN make && make install + +RUN echo "export PATH=/usr/local/python2.7.15/include:${PATH}" >> ~/.bashrc +RUN echo "export PATH=/usr/local/python2.7.15/bin:${PATH}" >> ~/.bashrc +RUN echo "export LD_LIBRARY_PATH=/usr/local/python2.7.15/lib:${LD_LIBRARY_PATH}" >> ~/.bashrc +RUN echo "export CPLUS_INCLUDE_PATH=/usr/local/python2.7.15/include/python2.7:$CPLUS_INCLUDE_PATH" >> ~/.bashrc +ENV PATH=/usr/local/python2.7.15/include:${PATH} +ENV PATH=/usr/local/python2.7.15/bin:${PATH} +ENV LD_LIBRARY_PATH=/usr/local/python2.7.15/lib:${LD_LIBRARY_PATH} +ENV CPLUS_INCLUDE_PATH=/usr/local/python2.7.15/include/python2.7:$CPLUS_INCLUDE_PATH +RUN mv /usr/bin/python /usr/bin/python.bak +RUN ln -s /usr/local/python2.7.15/bin/python2.7 /usr/local/bin/python +RUN ln -s /usr/local/python2.7.15/bin/python2.7 /usr/bin/python +WORKDIR /home +RUN wget https://files.pythonhosted.org/packages/b0/d1/8acb42f391cba52e35b131e442e80deffbb8d0676b93261d761b1f0ef8fb/setuptools-40.6.2.zip +RUN apt-get -y install unzip +RUN unzip setuptools-40.6.2.zip +WORKDIR /home/setuptools-40.6.2 +RUN python setup.py build +RUN python setup.py install +WORKDIR /home +RUN wget https://files.pythonhosted.org/packages/69/81/52b68d0a4de760a2f1979b0931ba7889202f302072cc7a0d614211bc7579/pip-18.0.tar.gz +RUN tar -zxvf pip-18.0.tar.gz +WORKDIR pip-18.0 +RUN python setup.py install + +WORKDIR /home +RUN rm Python-$version.tgz setuptools-40.6.2.zip pip-18.0.tar.gz && \ + rm -r Python-$version setuptools-40.6.2 pip-18.0 + # Install Go and glide RUN wget -qO- https://storage.googleapis.com/golang/go1.8.1.linux-amd64.tar.gz | \ tar -xz -C /usr/local && \ @@ -92,17 +140,16 @@ RUN localedef -i en_US -f UTF-8 en_US.UTF-8 # specify sphinx version as 1.5.6 and remove -U option for [pip install -U # sphinx-rtd-theme] since -U option will cause sphinx being updated to newest # version(1.7.1 for now), which causes building documentation failed. -RUN pip3 --no-cache-dir install -U wheel && \ +RUN pip3 --no-cache-dir install -U wheel py-cpuinfo==5.0.0 && \ pip3 --no-cache-dir install -U docopt PyYAML sphinx==1.5.6 && \ pip3 --no-cache-dir install sphinx-rtd-theme==0.1.9 recommonmark && \ - pip3.6 --no-cache-dir install -U wheel && \ + pip3.6 --no-cache-dir install -U wheel py-cpuinfo==5.0.0 && \ pip3.6 --no-cache-dir install -U docopt PyYAML sphinx==1.5.6 && \ pip3.6 --no-cache-dir install sphinx-rtd-theme==0.1.9 recommonmark && \ - pip3.7 --no-cache-dir install -U wheel && \ + pip3.7 --no-cache-dir install -U wheel py-cpuinfo==5.0.0 && \ pip3.7 --no-cache-dir install -U docopt PyYAML sphinx==1.5.6 && \ pip3.7 --no-cache-dir install sphinx-rtd-theme==0.1.9 recommonmark && \ - easy_install -U pip && \ - pip --no-cache-dir install -U pip setuptools wheel && \ + pip --no-cache-dir install -U wheel py-cpuinfo==5.0.0 && \ pip --no-cache-dir install -U docopt PyYAML sphinx==1.5.6 && \ pip --no-cache-dir install sphinx-rtd-theme==0.1.9 recommonmark @@ -125,12 +172,6 @@ RUN pip3.6 --no-cache-dir install pylint pytest astroid isort RUN pip3.7 --no-cache-dir install pylint pytest astroid isort RUN pip --no-cache-dir install pylint pytest astroid isort LinkChecker -# for coverage -RUN pip3 --no-cache-dir install coverage -RUN pip3.6 --no-cache-dir install coverage -RUN pip3.7 --no-cache-dir install coverage -RUN pip --no-cache-dir install coverage - COPY ./python/requirements.txt /root/ RUN pip3 --no-cache-dir install -r /root/requirements.txt RUN pip3.6 --no-cache-dir install -r /root/requirements.txt @@ -166,4 +207,5 @@ RUN mkdir /var/run/sshd RUN echo 'root:root' | chpasswd RUN sed -ri 's/^PermitRootLogin\s+.*/PermitRootLogin yes/' /etc/ssh/sshd_config RUN sed -ri 's/UsePAM yes/#UsePAM yes/g' /etc/ssh/sshd_config +CMD source ~/.bashrc EXPOSE 22 diff --git a/cmake/external/eigen.cmake b/cmake/external/eigen.cmake index dfe81d8f9b..d6d4b79c76 100644 --- a/cmake/external/eigen.cmake +++ b/cmake/external/eigen.cmake @@ -12,6 +12,7 @@ if(NOT WITH_FAST_MATH) add_definitions(-DEIGEN_FAST_MATH=0) endif() + if(WIN32) set(EIGEN_GIT_REPOSITORY https://github.com/wopeizl/eigen-git-mirror) set(EIGEN_GIT_TAG support_cuda9_win) -- GitLab