Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add ppc64le build support. (#472)
* Update version number for release v1.0.18

* Add ppc64le build support.

* Skip this test on ppc64le.
  • Loading branch information
YukioOobuchi authored and YasunariZHashimoto committed Jun 25, 2019
1 parent 7cbd0d0 commit 2382330
Show file tree
Hide file tree
Showing 12 changed files with 285 additions and 57 deletions.
6 changes: 3 additions & 3 deletions build-tools/make/build-with-docker.mk
Expand Up @@ -26,10 +26,10 @@ include $(NNABLA_DIRECTORY)/build-tools/make/options.mk

DOCKER_IMAGE_NAME_BASE ?= nnabla-py$(PYTHON_VERSION_MAJOR)$(PYTHON_VERSION_MINOR)

DOCKER_IMAGE_AUTO_FORMAT ?= $(DOCKER_IMAGE_NAME_BASE)-auto-format:$(shell md5sum $(NNABLA_DIRECTORY)/docker/development/Dockerfile.auto-format |cut -d \ -f 1)
DOCKER_IMAGE_DOC ?= $(DOCKER_IMAGE_NAME_BASE)-doc:$(shell md5sum $(NNABLA_DIRECTORY)/docker/development/Dockerfile.document |cut -d \ -f 1)
DOCKER_IMAGE_AUTO_FORMAT ?= $(DOCKER_IMAGE_NAME_BASE)-auto-format$(ARCH_SUFFIX):$(shell md5sum $(NNABLA_DIRECTORY)/docker/development/Dockerfile.auto-format |cut -d \ -f 1)
DOCKER_IMAGE_DOC ?= $(DOCKER_IMAGE_NAME_BASE)-doc$(ARCH_SUFFIX):$(shell md5sum $(NNABLA_DIRECTORY)/docker/development/Dockerfile.document |cut -d \ -f 1)
DOCKER_IMAGE_BUILD ?= $(DOCKER_IMAGE_NAME_BASE)-build$(ARCH_SUFFIX):$(shell md5sum $(NNABLA_DIRECTORY)/docker/development/Dockerfile.build$(ARCH_SUFFIX) |cut -d \ -f 1)
DOCKER_IMAGE_NNABLA ?= $(DOCKER_IMAGE_NAME_BASE)-nnabla:$(shell md5sum $(NNABLA_DIRECTORY)/docker/development/Dockerfile.build |cut -d \ -f 1)
DOCKER_IMAGE_NNABLA ?= $(DOCKER_IMAGE_NAME_BASE)-nnabla$(ARCH_SUFFIX):$(shell md5sum $(NNABLA_DIRECTORY)/docker/development/Dockerfile.build |cut -d \ -f 1)
DOCKER_IMAGE_ONNX_TEST ?= $(DOCKER_IMAGE_NAME_BASE)-onnx-test$(ARCH_SUFFIX):$(shell md5sum $(NNABLA_DIRECTORY)/docker/development/Dockerfile.onnx-test$(ARCH_SUFFIX) |cut -d \ -f 1)
DOCKER_IMAGE_TF_TEST ?= $(DOCKER_IMAGE_NAME_BASE)-tf-test$(ARCH_SUFFIX):$(shell md5sum $(NNABLA_DIRECTORY)/docker/development/Dockerfile.tf-test |cut -d \ -f 1)

Expand Down
2 changes: 1 addition & 1 deletion build-tools/make/options.mk
Expand Up @@ -69,7 +69,7 @@ DOCKER_RUN_OPTS += -e PARALLEL_BUILD_NUM=$(PARALLEL_BUILD_NUM)
WHEEL_SUFFIX ?=
DOCKER_RUN_OPTS += -e WHEEL_SUFFIX=$(WHEEL_SUFFIX)

ARCH_SUFFIX ?=
ARCH_SUFFIX ?= $(shell bash -c 'if [ "`uname -m`" == "ppc64le" ]; then echo -ppc64le ; fi')
DOCKER_RUN_OPTS += -e ARCH_SUFFIX=$(ARCH_SUFFIX)

########################################################################################################################
Expand Down
4 changes: 0 additions & 4 deletions docker/development/Dockerfile.android
Expand Up @@ -12,8 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# for nnabla>=1.0.17

FROM ubuntu:16.04

RUN apt-get update && apt-get install -y --no-install-recommends \
Expand All @@ -26,9 +24,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
git \
libarchive-dev \
libhdf5-dev \
libopenmpi-dev \
make \
openmpi-bin \
unzip \
wget \
zip \
Expand Down
2 changes: 0 additions & 2 deletions docker/development/Dockerfile.build
Expand Up @@ -12,8 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# for nnabla>=1.0.17

FROM centos:6

ENV LC_ALL C
Expand Down
16 changes: 1 addition & 15 deletions docker/development/Dockerfile.build-armhf
Expand Up @@ -33,9 +33,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
libatlas-dev \
libhdf5-dev \
liblapack-dev \
libopenmpi-dev \
make \
openmpi-bin \
pkg-config \
python \
python-dev \
python-pip \
Expand Down Expand Up @@ -73,25 +72,12 @@ ADD python/test_requirements.txt /tmp/deps/
RUN python3 -m pip install --upgrade pip
RUN python2 -m pip install --upgrade pip


RUN pip install \
--no-cache-dir \
--global-option=build_ext \
--global-option="-I/usr/include/hdf5/serial" \
--global-option="-L/usr/lib/arm-linux-gnueabihf/hdf5/serial" \
h5py
RUN pip install ipython==5.0

RUN pip install -r /tmp/deps/setup_requirements.txt
RUN pip install -r /tmp/deps/requirements.txt
RUN pip install -r /tmp/deps/test_requirements.txt

RUN pip3 install \
--no-cache-dir \
--global-option=build_ext \
--global-option="-I/usr/include/hdf5/serial" \
--global-option="-L/usr/lib/arm-linux-gnueabihf/hdf5/serial" \
h5py
RUN pip3 install ipython

RUN pip3 install -r /tmp/deps/setup_requirements.txt
Expand Down
140 changes: 140 additions & 0 deletions docker/development/Dockerfile.build-ppc64le
@@ -0,0 +1,140 @@
# Copyright (c) 2017 Sony Corporation. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# for nnabla>=1.0.17

FROM ppc64le/centos:7

ENV LC_ALL C
ENV LANG C
ENV LANGUAGE C

RUN yum install -y \
epel-release \
yum-utils \
&& yum install -y \
curl \
freetype-devel \
git \
hdf5 \
hdf5-devel \
lapack-devel \
libjpeg-devel \
liblzma-devel \
libpng-devel \
redhat-lsb-core \
rpm-build \
unzip \
wget \
zip \
zlib-static \
&& yum group install -y "Development Tools" \
&& yum clean all

################################################### cmake
ENV CMAKEVER=3.14.3
RUN mkdir /tmp/deps \
&& cd /tmp/deps \
&& yum install -y cmake3 \
&& curl -L https://github.com/Kitware/CMake/releases/download/v${CMAKEVER}/cmake-${CMAKEVER}.tar.gz -o cmake-${CMAKEVER}.tar.gz \
&& tar xf cmake-${CMAKEVER}.tar.gz \
&& cd cmake-${CMAKEVER} \
&& mkdir build \
&& cd build \
&& cmake3 -DBUILD_TESTING=FALSE .. \
&& make \
&& make install \
&& yum remove -y cmake3 \
&& yum clean all \
&& rm -rf /var/cache/yum/* \
&& cd / \
&& rm -rf /tmp/*

################################################## protobuf
ENV PROTOVER=3.4.1
RUN mkdir /tmp/deps \
&& cd /tmp/deps \
&& curl -L https://github.com/google/protobuf/archive/v${PROTOVER}.tar.gz -o protobuf-v${PROTOVER}.tar.gz \
&& tar xvf protobuf-v${PROTOVER}.tar.gz \
&& cd protobuf-${PROTOVER} \
&& mkdir build \
&& cd build \
&& cmake \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-Dprotobuf_BUILD_TESTS=OFF \
../cmake \
&& make \
&& make install \
&& cd / \
&& rm -rf /tmp/*

################################################## libarchive
RUN mkdir /tmp/deps \
&& cd /tmp/deps \
&& curl -L https://www.libarchive.org/downloads/libarchive-3.3.2.tar.gz -o libarchive-3.3.2.tar.gz \
&& tar xfa libarchive-3.3.2.tar.gz \
&& mkdir libarchive-build \
&& cd libarchive-build \
&& cmake \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON -DENABLE_NETTLE=FALSE -DENABLE_OPENSSL=FALSE \
-DENABLE_LZO=FALSE -DENABLE_LZMA=FALSE -DENABLE_BZip2=FALSE \
-DENABLE_LIBXML2=FALSE -DENABLE_EXPAT=FALSE -DENABLE_PCREPOSIX=FALSE -DENABLE_LibGCC=FALSE \
-DENABLE_CNG=FALSE -DENABLE_TAR=FALSE -DENABLE_TAR_SHARED=FALSE -DENABLE_CPIO=FALSE \
-DENABLE_CPIO_SHARED=FALSE -DENABLE_CAT=FALSE -DENABLE_CAT_SHARED=FALSE -DENABLE_XATTR=FALSE \
-DENABLE_ACL=FALSE -DENABLE_ICONV=FALSE -DENABLE_TEST=FALSE \
../libarchive-3.3.2 \
&& make \
&& make install \
&& cd / \
&& rm -rf /tmp/*

################################################## patchelf
RUN mkdir /tmp/deps \
&& cd /tmp/deps \
&& wget http://nixos.org/releases/patchelf/patchelf-0.9/patchelf-0.9.tar.bz2 \
&& tar xfa patchelf-0.9.tar.bz2 \
&& cd patchelf-0.9 \
&& ./configure \
&& make \
&& make install \
&& cd / \
&& rm -rf /tmp/*

################################################## miniconda3
ARG PYTHON_VERSION_MAJOR
ARG PYTHON_VERSION_MINOR
ENV PYVERNAME=${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}

ADD python/setup_requirements.txt /tmp/deps/
ADD python/requirements.txt /tmp/deps/
ADD python/test_requirements.txt /tmp/deps/

RUN umask 0 \
&& mkdir -p /tmp/deps \
&& cd /tmp/deps \
&& wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-ppc64le.sh \
&& bash Miniconda3-latest-Linux-ppc64le.sh -b -p /opt/miniconda3 \
&& rm -rf Miniconda3-latest-Linux-ppc64le.sh \
&& . /opt/miniconda3/bin/activate \
&& conda create -n nnabla-build python=${PYVERNAME} \
&& conda activate nnabla-build \
&& conda update --all -y \
&& pip install -U -r /tmp/deps/setup_requirements.txt \
&& pip install -U -r /tmp/deps/requirements.txt \
&& pip install -U -r /tmp/deps/test_requirements.txt \
&& conda clean -y --all \
&& cd / \
&& rm -rf /tmp/*

ENV PATH /opt/miniconda3/envs/nnabla-build/bin:$PATH
9 changes: 0 additions & 9 deletions docker/development/Dockerfile.onnx-test
Expand Up @@ -12,8 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# for nnabla>=1.0.17

FROM ubuntu:16.04

ENV LC_ALL C
Expand All @@ -35,22 +33,15 @@ RUN apt-get update \
libgoogle-glog-dev \
libgtest-dev \
libhdf5-dev \
libiomp-dev \
libleveldb-dev \
liblmdb-dev \
libopencv-dev \
libopenmpi-dev \
libprotobuf-dev \
libsnappy-dev \
libssl-dev \
make \
openmpi-bin \
openmpi-doc \
openssl \
unzip \
wget \
zip \
graphviz \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

Expand Down
19 changes: 3 additions & 16 deletions docker/development/Dockerfile.onnx-test-armhf
Expand Up @@ -33,9 +33,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
libatlas-dev \
libhdf5-dev \
liblapack-dev \
libopenmpi-dev \
make \
openmpi-bin \
pkg-config \
python \
python-dev \
python-pip \
Expand Down Expand Up @@ -73,6 +72,7 @@ RUN pip install --no-cache-dir \
autopep8 \
boto3 \
cython \
h5py \
mako \
numpy\>=1.16 \
onnx==1.4.1 \
Expand All @@ -85,17 +85,11 @@ RUN pip install --no-cache-dir \
tqdm \
virtualenv

RUN pip install \
--no-cache-dir \
--global-option=build_ext \
--global-option="-I/usr/include/hdf5/serial" \
--global-option="-L/usr/lib/arm-linux-gnueabihf/hdf5/serial" \
h5py

RUN pip3 install --no-cache-dir \
autopep8 \
boto3 \
cython \
h5py \
mako \
numpy\>=1.16 \
onnx==1.4.1 \
Expand All @@ -108,12 +102,5 @@ RUN pip3 install --no-cache-dir \
tqdm \
virtualenv

RUN pip3 install \
--no-cache-dir \
--global-option=build_ext \
--global-option="-I/usr/include/hdf5/serial" \
--global-option="-L/usr/lib/arm-linux-gnueabihf/hdf5/serial" \
h5py

RUN pip install ipython==5.0
RUN pip3 install ipython

0 comments on commit 2382330

Please sign in to comment.