You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by ma...@apache.org on 2018/06/07 16:33:07 UTC

[incubator-mxnet] branch devel-arm updated (c83b3ec -> 750b246)

This is an automated email from the ASF dual-hosted git repository.

marcoabreu pushed a change to branch devel-arm
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git.


    from c83b3ec  [MXNET-115] USE_LAPACK is forced on all platforms with OpenBLAS and cmake (#11094)
     new 4852477  Fixed armv7 wheel
     new 6d02ddd  Fixed bash default value substitution
     new 41a9bd2  Fixed whitespace errors
     new af03d1a  Added unzip installation to crosscompile docker images
     new f4e080a  Removed deprecated apt lists removal
     new 47d1b35  Moved common parts to scripts for docker builds
     new 41d065e  Disabled bundled OpenMP for cross compilation
     new 1f0d76d  Added make based build for armv7 as option
     new ec41928  Renamed install_openblas.sh -> arm_openblas.sh
     new ed33e5f  [MXNET-523] Fix build with OpenCV 2 (rpi)
     new d612b57  [MXNET-523] Fix build with OpenCV 2 (rpi)
     new 914d163  attempt to fix CI
     new 821a60f  Fix wheels for ARMv7 and Jetson
     new 9bf3e5c  Fix armv6 build and dockerfile
     new 6bd37f9  Reduce memory usage on ndarray tests (topk)
     new 750b246  Switch to release build in arm

The 16 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 CMakeLists.txt                                     | 16 +++-
 ci/docker/Dockerfile.build.arm64                   | 15 ++--
 ci/docker/Dockerfile.build.armv6                   | 16 ++--
 ci/docker/Dockerfile.build.armv7                   | 24 ++++--
 ci/docker/Dockerfile.build.jetson                  | 15 ++--
 .../docker/install/arm_openblas.sh                 | 14 ++--
 .../CPPLINT.cfg => ci/docker/install/ubuntu_arm.sh |  9 +-
 ci/docker/runtime_functions.sh                     | 96 ++++++++++++++--------
 .../predict-cpp/CMakeLists.txt                     |  4 +-
 ...rosscompile.jetson.mk => crosscompile.armv7.mk} | 13 ++-
 tests/python/unittest/test_ndarray.py              |  5 +-
 11 files changed, 147 insertions(+), 80 deletions(-)
 copy example/rcnn/script/additional_deps.sh => ci/docker/install/arm_openblas.sh (81%)
 copy cpp-package/include/mxnet-cpp/CPPLINT.cfg => ci/docker/install/ubuntu_arm.sh (92%)
 mode change 100644 => 100755
 copy make/{crosscompile.jetson.mk => crosscompile.armv7.mk} (96%)

-- 
To stop receiving notification emails like this one, please contact
marcoabreu@apache.org.

[incubator-mxnet] 12/16: attempt to fix CI

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

marcoabreu pushed a commit to branch devel-arm
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git

commit 914d1635612a9867171552b76d6411c5d238b8c7
Author: Pedro Larroy <pe...@gmail.com>
AuthorDate: Thu Jun 7 09:54:55 2018 +0000

    attempt to fix CI
---
 CMakeLists.txt | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3e39836..8a1765a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -658,14 +658,15 @@ if(USE_OPENCV AND OpenCV_VERSION_MAJOR GREATER 2)
   if(MSVC)
     target_link_libraries(im2rec mxnet)
   else()
-    target_link_libraries(im2rec ${BEGIN_WHOLE_ARCHIVE} mxnet_static ${END_WHOLE_ARCHIVE}
+    target_link_libraries(im2rec ${BEGIN_WHOLE_ARCHIVE} mxnet_static ${END_WHOLE_ARCHIVE})
+  endif()
+  target_link_libraries(im2rec
     ${mxnet_LINKER_LIBS}
     ${OpenCV_LIBS}
     dmlc
     ${nnvm_LINKER_LIBS}
     ${pslite_LINKER_LIBS}
     )
-  endif()
 else()
     message(WARNING "OpenCV_VERSION_MAJOR: ${OpenCV_VERSION_MAJOR}, version 3 with imgcodecs \
     is required for im2rec, im2rec will not be available")

-- 
To stop receiving notification emails like this one, please contact
marcoabreu@apache.org.

[incubator-mxnet] 13/16: Fix wheels for ARMv7 and Jetson

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

marcoabreu pushed a commit to branch devel-arm
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git

commit 821a60f5720363bebcbf81a655d25be61690b5d2
Author: Pedro Larroy <pe...@gmail.com>
AuthorDate: Wed Mar 28 17:17:31 2018 +0200

    Fix wheels for ARMv7 and Jetson
---
 ci/docker/runtime_functions.sh | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/ci/docker/runtime_functions.sh b/ci/docker/runtime_functions.sh
index 501f3cf..8a0cd63 100755
--- a/ci/docker/runtime_functions.sh
+++ b/ci/docker/runtime_functions.sh
@@ -74,7 +74,6 @@ build_jetson() {
     make -j$(nproc)
 
     build_wheel /work/mxnet/python /work/mxnet/lib
-
     popd
 }
 
@@ -96,7 +95,7 @@ build_armv6() {
         -DUSE_OPENCV=OFF \
         -DUSE_OPENMP=OFF \
         -DUSE_SIGNAL_HANDLER=ON \
-        -DCMAKE_BUILD_TYPE=Release \
+        -DCMAKE_BUILD_TYPE=RelWithDebInfo \
         -DUSE_MKL_IF_AVAILABLE=OFF \
         -DUSE_LAPACK=OFF \
         -DBUILD_CPP_EXAMPLES=OFF \
@@ -105,7 +104,6 @@ build_armv6() {
 
     ninja
     build_wheel
-
     popd
 }
 
@@ -142,7 +140,6 @@ build_armv7() {
 
     ninja
     build_wheel
-
     popd
 }
 

-- 
To stop receiving notification emails like this one, please contact
marcoabreu@apache.org.

[incubator-mxnet] 15/16: Reduce memory usage on ndarray tests (topk)

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

marcoabreu pushed a commit to branch devel-arm
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git

commit 6bd37f9b60b74c7b220d30bd909f0044234bab53
Author: Pedro Larroy <pe...@gmail.com>
AuthorDate: Wed Mar 28 17:45:18 2018 +0200

    Reduce memory usage on ndarray tests (topk)
---
 tests/python/unittest/test_ndarray.py | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/tests/python/unittest/test_ndarray.py b/tests/python/unittest/test_ndarray.py
index a060465..7c50a42 100644
--- a/tests/python/unittest/test_ndarray.py
+++ b/tests/python/unittest/test_ndarray.py
@@ -711,9 +711,8 @@ def test_order():
                  k=dat_size*dat_size*dat_size*dat_size, is_ascend=False)
     assert_almost_equal(nd_ret_argsort, gt)
 
-    # test topk with a big shape
-    a = mx.nd.arange(0, 54686454, step=1, repeat=1)
-    assert_almost_equal(a.topk(k=54686454).asnumpy(), a.asnumpy()[::-1])
+    a = mx.nd.arange(0, 1024, step=1, repeat=1)
+    assert_almost_equal(a.topk(k=1024).asnumpy(), a.asnumpy()[::-1])
 
     # Repeat those tests that don't involve indices.  These should pass even with
     # duplicated input data values (over many repeated runs with different random seeds,

-- 
To stop receiving notification emails like this one, please contact
marcoabreu@apache.org.

[incubator-mxnet] 06/16: Moved common parts to scripts for docker builds

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

marcoabreu pushed a commit to branch devel-arm
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git

commit 47d1b356299c7eb9eda0cccbc3d79269153cb139
Author: Anton Chernov <me...@gmail.com>
AuthorDate: Fri Jun 1 12:29:10 2018 +0000

    Moved common parts to scripts for docker builds
---
 ci/docker/Dockerfile.build.arm64                   | 15 ++++++------
 ci/docker/Dockerfile.build.armv6                   | 15 ++++++------
 ci/docker/Dockerfile.build.armv7                   | 12 ++++------
 ci/docker/Dockerfile.build.jetson                  | 15 ++++++------
 .../install_openblas.sh}                           | 27 ++++++++--------------
 .../ubuntu_arm.sh}                                 | 27 +++++-----------------
 6 files changed, 44 insertions(+), 67 deletions(-)

diff --git a/ci/docker/Dockerfile.build.arm64 b/ci/docker/Dockerfile.build.arm64
index eeb4656..f2af47b 100755
--- a/ci/docker/Dockerfile.build.arm64
+++ b/ci/docker/Dockerfile.build.arm64
@@ -27,15 +27,16 @@ ENV FC /usr/bin/${CROSS_TRIPLE}-gfortran
 ENV HOSTCC gcc
 ENV TARGET ARMV8
 
-RUN apt update && apt install -y unzip
+WORKDIR /work/deps
 
-WORKDIR /work
+COPY install/ubuntu_arm.sh /work/
+RUN /work/ubuntu_arm.sh
 
-# Build OpenBLAS
-RUN git clone --recursive -b v0.2.20 https://github.com/xianyi/OpenBLAS.git && \
-    cd OpenBLAS && \
-    make -j$(nproc) && \
-    PREFIX=${CROSS_ROOT} make install
+COPY install/install_openblas.sh /work/
+RUN /work/install_openblas.sh
+
+ENV OpenBLAS_HOME=${CROSS_ROOT}
+ENV OpenBLAS_DIR=${CROSS_ROOT}
 
 COPY runtime_functions.sh /work/
 WORKDIR /work/mxnet
diff --git a/ci/docker/Dockerfile.build.armv6 b/ci/docker/Dockerfile.build.armv6
index 53113d0..f769450 100755
--- a/ci/docker/Dockerfile.build.armv6
+++ b/ci/docker/Dockerfile.build.armv6
@@ -25,15 +25,16 @@ ENV FC=/usr/bin/${CROSS_TRIPLE}-gfortran
 ENV HOSTCC gcc
 ENV TARGET ARMV6
 
-RUN apt update && apt install -y unzip
-
 WORKDIR /work/deps
 
-# Build OpenBLAS
-RUN git clone --recursive -b v0.2.20 https://github.com/xianyi/OpenBLAS.git && \
-    cd OpenBLAS && \
-    make -j$(nproc) && \
-    make PREFIX=$CROSS_ROOT install
+COPY install/ubuntu_arm.sh /work/
+RUN /work/ubuntu_arm.sh
+
+COPY install/install_openblas.sh /work/
+RUN /work/install_openblas.sh
+
+ENV OpenBLAS_HOME=${CROSS_ROOT}
+ENV OpenBLAS_DIR=${CROSS_ROOT}
 
 COPY runtime_functions.sh /work/
 WORKDIR /work/mxnet
diff --git a/ci/docker/Dockerfile.build.armv7 b/ci/docker/Dockerfile.build.armv7
index 04c0892..b773e1e 100755
--- a/ci/docker/Dockerfile.build.armv7
+++ b/ci/docker/Dockerfile.build.armv7
@@ -25,15 +25,13 @@ ENV HOSTCC gcc
 ENV TARGET ARMV7
 ENV FC /usr/bin/${CROSS_TRIPLE}-gfortran
 
-RUN apt update && apt install -y unzip
-
 WORKDIR /work/deps
 
-# Build OpenBLAS
-RUN git clone --recursive -b v0.2.20 https://github.com/xianyi/OpenBLAS.git && \
-    cd OpenBLAS && \
-    make -j$(nproc) && \
-    make PREFIX=$CROSS_ROOT install
+COPY install/ubuntu_arm.sh /work/
+RUN /work/ubuntu_arm.sh
+
+COPY install/install_openblas.sh /work/
+RUN /work/install_openblas.sh
 
 ENV OpenBLAS_HOME=${CROSS_ROOT}
 ENV OpenBLAS_DIR=${CROSS_ROOT}
diff --git a/ci/docker/Dockerfile.build.jetson b/ci/docker/Dockerfile.build.jetson
index b79c192..8dad5b9 100755
--- a/ci/docker/Dockerfile.build.jetson
+++ b/ci/docker/Dockerfile.build.jetson
@@ -31,15 +31,16 @@ ENV FC /usr/bin/${CROSS_TRIPLE}-gfortran
 ENV HOSTCC gcc
 ENV TARGET ARMV8
 
-RUN apt update && apt-get install -y unzip
+WORKDIR /work/deps
 
-WORKDIR /work
+COPY install/ubuntu_arm.sh /work/
+RUN /work/ubuntu_arm.sh
 
-# Build OpenBLAS
-RUN git clone --recursive -b v0.2.20 https://github.com/xianyi/OpenBLAS.git && \
-    cd OpenBLAS && \
-    make -j$(nproc) && \
-    PREFIX=${CROSS_ROOT} make install
+COPY install/install_openblas.sh /work/
+RUN /work/install_openblas.sh
+
+ENV OpenBLAS_HOME=${CROSS_ROOT}
+ENV OpenBLAS_DIR=${CROSS_ROOT}
 
 # Setup CUDA build env (including configuring and copying nvcc)
 COPY --from=cudabuilder /usr/local/cuda /usr/local/cuda
diff --git a/ci/docker/Dockerfile.build.armv6 b/ci/docker/install/install_openblas.sh
similarity index 62%
copy from ci/docker/Dockerfile.build.armv6
copy to ci/docker/install/install_openblas.sh
index 53113d0..fa2e5ca 100755
--- a/ci/docker/Dockerfile.build.armv6
+++ b/ci/docker/install/install_openblas.sh
@@ -1,4 +1,5 @@
-# -*- mode: dockerfile -*-
+#!/usr/bin/env bash
+
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
 # distributed with this work for additional information
@@ -15,25 +16,15 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-#
-# Dockerfile to build MXNet for ARMv6
-
-FROM dockcross/linux-armv6
 
-ENV ARCH armv6l
-ENV FC=/usr/bin/${CROSS_TRIPLE}-gfortran
-ENV HOSTCC gcc
-ENV TARGET ARMV6
+set -ex
 
-RUN apt update && apt install -y unzip
+git clone --recursive -b v0.2.20 https://github.com/xianyi/OpenBLAS.git
 
-WORKDIR /work/deps
+cd OpenBLAS
+make -j$(nproc)
+PREFIX=${CROSS_ROOT} make install
 
-# Build OpenBLAS
-RUN git clone --recursive -b v0.2.20 https://github.com/xianyi/OpenBLAS.git && \
-    cd OpenBLAS && \
-    make -j$(nproc) && \
-    make PREFIX=$CROSS_ROOT install
+cd ..
 
-COPY runtime_functions.sh /work/
-WORKDIR /work/mxnet
+rm -rf OpenBLAS
diff --git a/ci/docker/Dockerfile.build.armv6 b/ci/docker/install/ubuntu_arm.sh
similarity index 62%
copy from ci/docker/Dockerfile.build.armv6
copy to ci/docker/install/ubuntu_arm.sh
index 53113d0..becb012 100755
--- a/ci/docker/Dockerfile.build.armv6
+++ b/ci/docker/install/ubuntu_arm.sh
@@ -1,4 +1,5 @@
-# -*- mode: dockerfile -*-
+#!/usr/bin/env bash
+
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
 # distributed with this work for additional information
@@ -15,25 +16,9 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-#
-# Dockerfile to build MXNet for ARMv6
-
-FROM dockcross/linux-armv6
-
-ENV ARCH armv6l
-ENV FC=/usr/bin/${CROSS_TRIPLE}-gfortran
-ENV HOSTCC gcc
-ENV TARGET ARMV6
-
-RUN apt update && apt install -y unzip
-
-WORKDIR /work/deps
 
-# Build OpenBLAS
-RUN git clone --recursive -b v0.2.20 https://github.com/xianyi/OpenBLAS.git && \
-    cd OpenBLAS && \
-    make -j$(nproc) && \
-    make PREFIX=$CROSS_ROOT install
+set -ex
 
-COPY runtime_functions.sh /work/
-WORKDIR /work/mxnet
+apt update
+apt install -y \
+    unzip

-- 
To stop receiving notification emails like this one, please contact
marcoabreu@apache.org.

[incubator-mxnet] 08/16: Added make based build for armv7 as option

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

marcoabreu pushed a commit to branch devel-arm
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git

commit 1f0d76d54a7fb34b345093ae6552f5f6fb28f963
Author: Anton Chernov <me...@gmail.com>
AuthorDate: Wed Jun 6 15:32:58 2018 +0000

    Added make based build for armv7 as option
---
 ci/docker/runtime_functions.sh |  11 ++-
 make/crosscompile.armv7.mk     | 198 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 207 insertions(+), 2 deletions(-)

diff --git a/ci/docker/runtime_functions.sh b/ci/docker/runtime_functions.sh
index 21f1bdc..501f3cf 100755
--- a/ci/docker/runtime_functions.sh
+++ b/ci/docker/runtime_functions.sh
@@ -70,10 +70,10 @@ build_jetson() {
     set -ex
     pushd .
 
-    mv make/crosscompile.jetson.mk make/config.mk
+    cp make/crosscompile.jetson.mk ./config.mk
     make -j$(nproc)
 
-    build_wheel
+    build_wheel /work/mxnet/python /work/mxnet/lib
 
     popd
 }
@@ -112,6 +112,13 @@ build_armv6() {
 build_armv7() {
     set -ex
     pushd .
+
+    # uncomment for make based build
+    # cp make/crosscompile.armv7.mk ./config.mk
+    # make -j$(nproc)
+
+    # build_wheel /work/mxnet/python /work/mxnet/lib
+    
     cd /work/build
 
     # Lapack functionality will be included and statically linked to openblas.
diff --git a/make/crosscompile.armv7.mk b/make/crosscompile.armv7.mk
new file mode 100644
index 0000000..4740245
--- /dev/null
+++ b/make/crosscompile.armv7.mk
@@ -0,0 +1,198 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you 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.
+
+#-------------------------------------------------------------------------------
+#  Template configuration for compiling mxnet
+#
+#  If you want to change the configuration, please use the following
+#  steps. Assume you are on the root directory of mxnet. First copy the this
+#  file so that any local changes will be ignored by git
+#
+#  $ cp make/config.mk .
+#
+#  Next modify the according entries, and then compile by
+#
+#  $ make
+#
+#  or build in parallel with 8 threads
+#
+#  $ make -j8
+#-------------------------------------------------------------------------------
+
+#---------------------
+# For cross compilation we only explictily set a compiler when one is not already present.
+#--------------------
+
+ifndef CC
+export CC = gcc
+endif
+ifndef CXX
+export CXX = g++
+endif
+ifndef NVCC
+export NVCC = nvcc
+endif
+
+# whether compile with options for MXNet developer
+DEV = 0
+
+# whether compile with debug
+DEBUG = 0
+
+# whether to turn on segfault signal handler to log the stack trace
+USE_SIGNAL_HANDLER = 1
+
+# the additional link flags you want to add
+ADD_LDFLAGS =
+
+# the additional compile flags you want to add
+ADD_CFLAGS =
+
+#---------------------------------------------
+# matrix computation libraries for CPU/GPU
+#---------------------------------------------
+
+# whether use CUDA during compile
+USE_CUDA = 0
+
+# add the path to CUDA library to link and compile flag
+# if you have already add them to environment variable, leave it as NONE
+USE_CUDA_PATH = NONE
+
+# whether to enable CUDA runtime compilation
+ENABLE_CUDA_RTC = 0
+
+# whether use CuDNN R3 library
+USE_CUDNN = 0
+
+#whether to use NCCL library
+USE_NCCL = 0
+#add the path to NCCL library
+USE_NCCL_PATH = NONE
+
+# whether use opencv during compilation
+# you can disable it, however, you will not able to use
+# imbin iterator
+USE_OPENCV = 0
+
+#whether use libjpeg-turbo for image decode without OpenCV wrapper
+USE_LIBJPEG_TURBO = 0
+#add the path to libjpeg-turbo library
+USE_LIBJPEG_TURBO_PATH = NONE
+
+# use openmp for parallelization
+USE_OPENMP = 1
+
+# whether use MKL-DNN library
+USE_MKLDNN = 0
+
+# whether use NNPACK library
+USE_NNPACK = 0
+
+# choose the version of blas you want to use
+# can be: mkl, blas, atlas, openblas
+# in default use atlas for linux while apple for osx
+UNAME_S := $(shell uname -s)
+USE_BLAS = openblas
+
+# whether use lapack during compilation
+# only effective when compiled with blas versions openblas/apple/atlas/mkl
+USE_LAPACK = 1
+
+# path to lapack library in case of a non-standard installation
+USE_LAPACK_PATH =
+
+# add path to intel library, you may need it for MKL, if you did not add the path
+# to environment variable
+USE_INTEL_PATH = NONE
+
+# If use MKL only for BLAS, choose static link automatically to allow python wrapper
+ifeq ($(USE_BLAS), mkl)
+USE_STATIC_MKL = 1
+else
+USE_STATIC_MKL = NONE
+endif
+
+#----------------------------
+# Settings for power and arm arch
+#----------------------------
+USE_SSE = 0
+
+# Turn off F16C instruction set support
+USE_F16C = 0
+
+#----------------------------
+# distributed computing
+#----------------------------
+
+# whether or not to enable multi-machine supporting
+USE_DIST_KVSTORE = 0
+
+# whether or not allow to read and write HDFS directly. If yes, then hadoop is
+# required
+USE_HDFS = 0
+
+# path to libjvm.so. required if USE_HDFS=1
+LIBJVM = NONE
+
+# whether or not allow to read and write AWS S3 directly. If yes, then
+# libcurl4-openssl-dev is required, it can be installed on Ubuntu by
+# sudo apt-get install -y libcurl4-openssl-dev
+USE_S3 = 0
+
+#----------------------------
+# performance settings
+#----------------------------
+# Use operator tuning
+USE_OPERATOR_TUNING = 1
+
+# Use gperftools if found
+USE_GPERFTOOLS = 1
+
+# Use JEMalloc if found, and not using gperftools
+USE_JEMALLOC = 1
+
+#----------------------------
+# additional operators
+#----------------------------
+
+# path to folders containing projects specific operators that you don't want to put in src/operators
+EXTRA_OPERATORS =
+
+#----------------------------
+# other features
+#----------------------------
+
+# Create C++ interface package
+USE_CPP_PACKAGE = 0
+
+#----------------------------
+# plugins
+#----------------------------
+
+# whether to use caffe integration. This requires installing caffe.
+# You also need to add CAFFE_PATH/build/lib to your LD_LIBRARY_PATH
+# CAFFE_PATH = $(HOME)/caffe
+# MXNET_PLUGINS += plugin/caffe/caffe.mk
+
+# WARPCTC_PATH = $(HOME)/warp-ctc
+# MXNET_PLUGINS += plugin/warpctc/warpctc.mk
+
+# whether to use sframe integration. This requires build sframe
+# git@github.com:dato-code/SFrame.git
+# SFRAME_PATH = $(HOME)/SFrame
+# MXNET_PLUGINS += plugin/sframe/plugin.mk

-- 
To stop receiving notification emails like this one, please contact
marcoabreu@apache.org.

[incubator-mxnet] 10/16: [MXNET-523] Fix build with OpenCV 2 (rpi)

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

marcoabreu pushed a commit to branch devel-arm
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git

commit ed33e5f1bbf7e529081a8f74b7b0337e3bcda85a
Author: Pedro Larroy <pe...@gmail.com>
AuthorDate: Wed Jun 6 17:28:16 2018 +0000

    [MXNET-523] Fix build with OpenCV 2 (rpi)
---
 CMakeLists.txt | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 962c738..3e39836 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -321,14 +321,15 @@ endif()
 
 # ---[ OpenCV
 if(USE_OPENCV)
-  find_package(OpenCV QUIET COMPONENTS core highgui imgproc imgcodecs)
+  find_package(OpenCV COMPONENTS core highgui imgproc imgcodecs)
   if(NOT OpenCV_FOUND) # if not OpenCV 3.x, then imgcodecs are not found
+    message(STATUS "OpenCV imgcodecs missing")
     find_package(OpenCV REQUIRED COMPONENTS core highgui imgproc)
   endif()
   include_directories(SYSTEM ${OpenCV_INCLUDE_DIRS})
   list(APPEND mxnet_LINKER_LIBS ${OpenCV_LIBS})
   message(STATUS " OpenCV_LIBS=${OpenCV_LIBS}")
-  message(STATUS "OpenCV found (${OpenCV_CONFIG_PATH})")
+  message(STATUS "OpenCV ${OpenCV_VERSION} found (${OpenCV_CONFIG_PATH})")
   add_definitions(-DMXNET_USE_OPENCV=1)
 else(USE_OPENCV)
   message(STATUS "OpenCV Disabled")
@@ -652,20 +653,22 @@ if(USE_PLUGINS_WARPCTC)
 endif()
 
 
-if(USE_OPENCV)
+if(USE_OPENCV AND OpenCV_VERSION_MAJOR GREATER 2)
   add_executable(im2rec "tools/im2rec.cc")
   if(MSVC)
     target_link_libraries(im2rec mxnet)
   else()
-    target_link_libraries(im2rec ${BEGIN_WHOLE_ARCHIVE} mxnet_static ${END_WHOLE_ARCHIVE})
-  endif()
-  target_link_libraries(im2rec
+    target_link_libraries(im2rec ${BEGIN_WHOLE_ARCHIVE} mxnet_static ${END_WHOLE_ARCHIVE}
     ${mxnet_LINKER_LIBS}
     ${OpenCV_LIBS}
     dmlc
     ${nnvm_LINKER_LIBS}
     ${pslite_LINKER_LIBS}
     )
+  endif()
+else()
+    message(WARNING "OpenCV_VERSION_MAJOR: ${OpenCV_VERSION_MAJOR}, version 3 with imgcodecs \
+    is required for im2rec, im2rec will not be available")
 endif()
 
 target_link_libraries(mxnet PUBLIC dmlc)

-- 
To stop receiving notification emails like this one, please contact
marcoabreu@apache.org.

[incubator-mxnet] 16/16: Switch to release build in arm

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

marcoabreu pushed a commit to branch devel-arm
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git

commit 750b24615a46494f2f6797ae71e998acecd44a0b
Author: Pedro Larroy <pe...@gmail.com>
AuthorDate: Fri May 25 13:10:02 2018 +0200

    Switch to release build in arm
---
 ci/docker/runtime_functions.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ci/docker/runtime_functions.sh b/ci/docker/runtime_functions.sh
index 8a0cd63..24836d5 100755
--- a/ci/docker/runtime_functions.sh
+++ b/ci/docker/runtime_functions.sh
@@ -95,7 +95,7 @@ build_armv6() {
         -DUSE_OPENCV=OFF \
         -DUSE_OPENMP=OFF \
         -DUSE_SIGNAL_HANDLER=ON \
-        -DCMAKE_BUILD_TYPE=RelWithDebInfo \
+        -DCMAKE_BUILD_TYPE=Release\
         -DUSE_MKL_IF_AVAILABLE=OFF \
         -DUSE_LAPACK=OFF \
         -DBUILD_CPP_EXAMPLES=OFF \
@@ -165,7 +165,7 @@ build_arm64() {
         -DUSE_OPENCV=OFF\
         -DUSE_OPENMP=OFF\
         -DUSE_SIGNAL_HANDLER=ON\
-        -DCMAKE_BUILD_TYPE=RelWithDebInfo\
+        -DCMAKE_BUILD_TYPE=Release\
         -DUSE_MKL_IF_AVAILABLE=OFF\
         -G Ninja /work/mxnet
     ninja

-- 
To stop receiving notification emails like this one, please contact
marcoabreu@apache.org.

[incubator-mxnet] 09/16: Renamed install_openblas.sh -> arm_openblas.sh

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

marcoabreu pushed a commit to branch devel-arm
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git

commit ec4192809d580350d6c80a91349f4e8cbda2a733
Author: Anton Chernov <me...@gmail.com>
AuthorDate: Wed Jun 6 16:27:45 2018 +0000

    Renamed install_openblas.sh -> arm_openblas.sh
---
 ci/docker/Dockerfile.build.arm64                           | 4 ++--
 ci/docker/Dockerfile.build.armv6                           | 4 ++--
 ci/docker/Dockerfile.build.armv7                           | 4 ++--
 ci/docker/Dockerfile.build.jetson                          | 4 ++--
 ci/docker/install/{install_openblas.sh => arm_openblas.sh} | 0
 5 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/ci/docker/Dockerfile.build.arm64 b/ci/docker/Dockerfile.build.arm64
index f2af47b..7a2e172 100755
--- a/ci/docker/Dockerfile.build.arm64
+++ b/ci/docker/Dockerfile.build.arm64
@@ -32,8 +32,8 @@ WORKDIR /work/deps
 COPY install/ubuntu_arm.sh /work/
 RUN /work/ubuntu_arm.sh
 
-COPY install/install_openblas.sh /work/
-RUN /work/install_openblas.sh
+COPY install/arm_openblas.sh /work/
+RUN /work/arm_openblas.sh
 
 ENV OpenBLAS_HOME=${CROSS_ROOT}
 ENV OpenBLAS_DIR=${CROSS_ROOT}
diff --git a/ci/docker/Dockerfile.build.armv6 b/ci/docker/Dockerfile.build.armv6
index f769450..f9ec0f5 100755
--- a/ci/docker/Dockerfile.build.armv6
+++ b/ci/docker/Dockerfile.build.armv6
@@ -30,8 +30,8 @@ WORKDIR /work/deps
 COPY install/ubuntu_arm.sh /work/
 RUN /work/ubuntu_arm.sh
 
-COPY install/install_openblas.sh /work/
-RUN /work/install_openblas.sh
+COPY install/arm_openblas.sh /work/
+RUN /work/arm_openblas.sh
 
 ENV OpenBLAS_HOME=${CROSS_ROOT}
 ENV OpenBLAS_DIR=${CROSS_ROOT}
diff --git a/ci/docker/Dockerfile.build.armv7 b/ci/docker/Dockerfile.build.armv7
index b773e1e..04002dc 100755
--- a/ci/docker/Dockerfile.build.armv7
+++ b/ci/docker/Dockerfile.build.armv7
@@ -30,8 +30,8 @@ WORKDIR /work/deps
 COPY install/ubuntu_arm.sh /work/
 RUN /work/ubuntu_arm.sh
 
-COPY install/install_openblas.sh /work/
-RUN /work/install_openblas.sh
+COPY install/arm_openblas.sh /work/
+RUN /work/arm_openblas.sh
 
 ENV OpenBLAS_HOME=${CROSS_ROOT}
 ENV OpenBLAS_DIR=${CROSS_ROOT}
diff --git a/ci/docker/Dockerfile.build.jetson b/ci/docker/Dockerfile.build.jetson
index 8dad5b9..5bbc5d4 100755
--- a/ci/docker/Dockerfile.build.jetson
+++ b/ci/docker/Dockerfile.build.jetson
@@ -36,8 +36,8 @@ WORKDIR /work/deps
 COPY install/ubuntu_arm.sh /work/
 RUN /work/ubuntu_arm.sh
 
-COPY install/install_openblas.sh /work/
-RUN /work/install_openblas.sh
+COPY install/arm_openblas.sh /work/
+RUN /work/arm_openblas.sh
 
 ENV OpenBLAS_HOME=${CROSS_ROOT}
 ENV OpenBLAS_DIR=${CROSS_ROOT}
diff --git a/ci/docker/install/install_openblas.sh b/ci/docker/install/arm_openblas.sh
similarity index 100%
rename from ci/docker/install/install_openblas.sh
rename to ci/docker/install/arm_openblas.sh

-- 
To stop receiving notification emails like this one, please contact
marcoabreu@apache.org.

[incubator-mxnet] 07/16: Disabled bundled OpenMP for cross compilation

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

marcoabreu pushed a commit to branch devel-arm
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git

commit 41d065e1965a9cce9457efc9a5363ca826527481
Author: Anton Chernov <me...@gmail.com>
AuthorDate: Tue Jun 5 10:19:19 2018 +0000

    Disabled bundled OpenMP for cross compilation
---
 CMakeLists.txt | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index e57c00b..962c738 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -340,7 +340,11 @@ if(USE_OPENMP)
   find_package(OpenMP REQUIRED)
   # This should build on Windows, but there's some problem and I don't have a Windows box, so
   # could a Windows user please fix?
-  if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/openmp/CMakeLists.txt AND SYSTEM_ARCHITECTURE STREQUAL "x86_64" AND NOT MSVC)
+  if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/openmp/CMakeLists.txt
+     AND SYSTEM_ARCHITECTURE STREQUAL "x86_64"
+     AND NOT MSVC
+     AND NOT CMAKE_CROSSCOMPILING)
+
     # Intel/llvm OpenMP: https://github.com/llvm-mirror/openmp
     set(OPENMP_STANDALONE_BUILD TRUE)
     set(LIBOMP_ENABLE_SHARED TRUE)

-- 
To stop receiving notification emails like this one, please contact
marcoabreu@apache.org.

[incubator-mxnet] 11/16: [MXNET-523] Fix build with OpenCV 2 (rpi)

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

marcoabreu pushed a commit to branch devel-arm
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git

commit d612b57fdf7d47a361737bda926ff3ec64c91afc
Author: Pedro Larroy <pe...@gmail.com>
AuthorDate: Wed Jun 6 17:28:16 2018 +0000

    [MXNET-523] Fix build with OpenCV 2 (rpi)
---
 example/image-classification/predict-cpp/CMakeLists.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/example/image-classification/predict-cpp/CMakeLists.txt b/example/image-classification/predict-cpp/CMakeLists.txt
index a2f52b9..c42d191 100644
--- a/example/image-classification/predict-cpp/CMakeLists.txt
+++ b/example/image-classification/predict-cpp/CMakeLists.txt
@@ -1,7 +1,7 @@
 # Check OpenCV
-if(NOT USE_OPENCV OR NOT OpenCV_FOUND)
+if(NOT USE_OPENCV OR NOT OpenCV_FOUND OR OpenCV_VERSION_MAJOR LESS 3)
   message(WARNING "\
-OpenCV should be enabled and found to build image classification example, skipping...")
+OpenCV version >= 3 should be enabled and found to build image classification example, skipping...")
   return()
 endif()
 

-- 
To stop receiving notification emails like this one, please contact
marcoabreu@apache.org.

[incubator-mxnet] 05/16: Removed deprecated apt lists removal

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

marcoabreu pushed a commit to branch devel-arm
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git

commit f4e080a3c3da05190fd75855df8280ff623c36f9
Author: Anton Chernov <me...@gmail.com>
AuthorDate: Tue May 29 09:31:54 2018 +0200

    Removed deprecated apt lists removal
---
 ci/docker/Dockerfile.build.arm64  | 4 +---
 ci/docker/Dockerfile.build.armv6  | 4 +---
 ci/docker/Dockerfile.build.armv7  | 4 +---
 ci/docker/Dockerfile.build.jetson | 4 +---
 4 files changed, 4 insertions(+), 12 deletions(-)

diff --git a/ci/docker/Dockerfile.build.arm64 b/ci/docker/Dockerfile.build.arm64
index 2b46e66..eeb4656 100755
--- a/ci/docker/Dockerfile.build.arm64
+++ b/ci/docker/Dockerfile.build.arm64
@@ -27,9 +27,7 @@ ENV FC /usr/bin/${CROSS_TRIPLE}-gfortran
 ENV HOSTCC gcc
 ENV TARGET ARMV8
 
-RUN apt-get update && \
-    apt-get install -y unzip && \
-    rm -rf /var/lib/apt/lists/*
+RUN apt update && apt install -y unzip
 
 WORKDIR /work
 
diff --git a/ci/docker/Dockerfile.build.armv6 b/ci/docker/Dockerfile.build.armv6
index 42ac214..53113d0 100755
--- a/ci/docker/Dockerfile.build.armv6
+++ b/ci/docker/Dockerfile.build.armv6
@@ -25,9 +25,7 @@ ENV FC=/usr/bin/${CROSS_TRIPLE}-gfortran
 ENV HOSTCC gcc
 ENV TARGET ARMV6
 
-RUN apt-get update && \
-    apt-get install -y unzip && \
-    rm -rf /var/lib/apt/lists/*
+RUN apt update && apt install -y unzip
 
 WORKDIR /work/deps
 
diff --git a/ci/docker/Dockerfile.build.armv7 b/ci/docker/Dockerfile.build.armv7
index 0ba4025..04c0892 100755
--- a/ci/docker/Dockerfile.build.armv7
+++ b/ci/docker/Dockerfile.build.armv7
@@ -25,9 +25,7 @@ ENV HOSTCC gcc
 ENV TARGET ARMV7
 ENV FC /usr/bin/${CROSS_TRIPLE}-gfortran
 
-RUN apt-get update && \
-    apt-get install -y unzip && \
-    rm -rf /var/lib/apt/lists/*
+RUN apt update && apt install -y unzip
 
 WORKDIR /work/deps
 
diff --git a/ci/docker/Dockerfile.build.jetson b/ci/docker/Dockerfile.build.jetson
index affe4a9..b79c192 100755
--- a/ci/docker/Dockerfile.build.jetson
+++ b/ci/docker/Dockerfile.build.jetson
@@ -31,9 +31,7 @@ ENV FC /usr/bin/${CROSS_TRIPLE}-gfortran
 ENV HOSTCC gcc
 ENV TARGET ARMV8
 
-RUN apt-get update && \
-    apt-get install -y unzip && \
-    rm -rf /var/lib/apt/lists/*
+RUN apt update && apt-get install -y unzip
 
 WORKDIR /work
 

-- 
To stop receiving notification emails like this one, please contact
marcoabreu@apache.org.

[incubator-mxnet] 14/16: Fix armv6 build and dockerfile

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

marcoabreu pushed a commit to branch devel-arm
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git

commit 9bf3e5c28512bdc39b7c39e852928fe4274c77f1
Author: Pedro Larroy <pe...@gmail.com>
AuthorDate: Wed May 23 13:47:58 2018 +0200

    Fix armv6 build and dockerfile
---
 ci/docker/Dockerfile.build.armv6 | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/ci/docker/Dockerfile.build.armv6 b/ci/docker/Dockerfile.build.armv6
index f9ec0f5..79fb4c6 100755
--- a/ci/docker/Dockerfile.build.armv6
+++ b/ci/docker/Dockerfile.build.armv6
@@ -20,6 +20,9 @@
 
 FROM dockcross/linux-armv6
 
+RUN apt-get update
+RUN apt-get install -y unzip
+
 ENV ARCH armv6l
 ENV FC=/usr/bin/${CROSS_TRIPLE}-gfortran
 ENV HOSTCC gcc

-- 
To stop receiving notification emails like this one, please contact
marcoabreu@apache.org.

[incubator-mxnet] 02/16: Fixed bash default value substitution

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

marcoabreu pushed a commit to branch devel-arm
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git

commit 6d02ddd2d4f68fa1f0f1abf2d80d4b80d2fe676e
Author: Anton Chernov <me...@gmail.com>
AuthorDate: Fri May 25 14:11:39 2018 +0200

    Fixed bash default value substitution
---
 ci/docker/runtime_functions.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ci/docker/runtime_functions.sh b/ci/docker/runtime_functions.sh
index 6805446..74edd0c 100755
--- a/ci/docker/runtime_functions.sh
+++ b/ci/docker/runtime_functions.sh
@@ -36,8 +36,8 @@ build_wheel() {
     set -ex
     pushd .
 
-    PYTHON_DIR = ${1:/work/mxnet/python}
-    BUILD_DIR = ${2:/work/build}
+    PYTHON_DIR = ${1:-/work/mxnet/python}
+    BUILD_DIR = ${2:-/work/build}
 
     # build
 

-- 
To stop receiving notification emails like this one, please contact
marcoabreu@apache.org.

[incubator-mxnet] 03/16: Fixed whitespace errors

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

marcoabreu pushed a commit to branch devel-arm
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git

commit 41a9bd2df6d79981baf2d8f9a816a2a76b0c0095
Author: Anton Chernov <me...@gmail.com>
AuthorDate: Fri May 25 17:45:03 2018 +0200

    Fixed whitespace errors
---
 ci/docker/runtime_functions.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/ci/docker/runtime_functions.sh b/ci/docker/runtime_functions.sh
index 74edd0c..21f1bdc 100755
--- a/ci/docker/runtime_functions.sh
+++ b/ci/docker/runtime_functions.sh
@@ -36,8 +36,8 @@ build_wheel() {
     set -ex
     pushd .
 
-    PYTHON_DIR = ${1:-/work/mxnet/python}
-    BUILD_DIR = ${2:-/work/build}
+    PYTHON_DIR=${1:-/work/mxnet/python}
+    BUILD_DIR=${2:-/work/build}
 
     # build
 
@@ -50,8 +50,8 @@ build_wheel() {
 
     # Fix pathing issues in the wheel.  We need to move libmxnet.so from the data folder to the
     # mxnet folder, then repackage the wheel.
-    WHEEL = `readlink -f dist/*.whl`
-    TMPDIR = `mktemp -d`
+    WHEEL=`readlink -f dist/*.whl`
+    TMPDIR=`mktemp -d`
     unzip -d ${TMPDIR} ${WHEEL}
     rm ${WHEEL}
     cd ${TMPDIR}

-- 
To stop receiving notification emails like this one, please contact
marcoabreu@apache.org.

[incubator-mxnet] 04/16: Added unzip installation to crosscompile docker images

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

marcoabreu pushed a commit to branch devel-arm
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git

commit af03d1a98a6ca057d2bf5797fe7f3ebaaad5d211
Author: Anton Chernov <me...@gmail.com>
AuthorDate: Fri May 25 17:12:32 2018 +0000

    Added unzip installation to crosscompile docker images
---
 ci/docker/Dockerfile.build.arm64  | 4 ++++
 ci/docker/Dockerfile.build.armv6  | 4 ++++
 ci/docker/Dockerfile.build.armv7  | 5 +++++
 ci/docker/Dockerfile.build.jetson | 4 ++++
 4 files changed, 17 insertions(+)

diff --git a/ci/docker/Dockerfile.build.arm64 b/ci/docker/Dockerfile.build.arm64
index ec94960..2b46e66 100755
--- a/ci/docker/Dockerfile.build.arm64
+++ b/ci/docker/Dockerfile.build.arm64
@@ -27,6 +27,10 @@ ENV FC /usr/bin/${CROSS_TRIPLE}-gfortran
 ENV HOSTCC gcc
 ENV TARGET ARMV8
 
+RUN apt-get update && \
+    apt-get install -y unzip && \
+    rm -rf /var/lib/apt/lists/*
+
 WORKDIR /work
 
 # Build OpenBLAS
diff --git a/ci/docker/Dockerfile.build.armv6 b/ci/docker/Dockerfile.build.armv6
index 20739da..42ac214 100755
--- a/ci/docker/Dockerfile.build.armv6
+++ b/ci/docker/Dockerfile.build.armv6
@@ -25,6 +25,10 @@ ENV FC=/usr/bin/${CROSS_TRIPLE}-gfortran
 ENV HOSTCC gcc
 ENV TARGET ARMV6
 
+RUN apt-get update && \
+    apt-get install -y unzip && \
+    rm -rf /var/lib/apt/lists/*
+
 WORKDIR /work/deps
 
 # Build OpenBLAS
diff --git a/ci/docker/Dockerfile.build.armv7 b/ci/docker/Dockerfile.build.armv7
index 102409a..0ba4025 100755
--- a/ci/docker/Dockerfile.build.armv7
+++ b/ci/docker/Dockerfile.build.armv7
@@ -23,6 +23,11 @@ FROM dockcross/linux-armv7
 ENV ARCH armv7l
 ENV HOSTCC gcc
 ENV TARGET ARMV7
+ENV FC /usr/bin/${CROSS_TRIPLE}-gfortran
+
+RUN apt-get update && \
+    apt-get install -y unzip && \
+    rm -rf /var/lib/apt/lists/*
 
 WORKDIR /work/deps
 
diff --git a/ci/docker/Dockerfile.build.jetson b/ci/docker/Dockerfile.build.jetson
index c358edb..affe4a9 100755
--- a/ci/docker/Dockerfile.build.jetson
+++ b/ci/docker/Dockerfile.build.jetson
@@ -31,6 +31,10 @@ ENV FC /usr/bin/${CROSS_TRIPLE}-gfortran
 ENV HOSTCC gcc
 ENV TARGET ARMV8
 
+RUN apt-get update && \
+    apt-get install -y unzip && \
+    rm -rf /var/lib/apt/lists/*
+
 WORKDIR /work
 
 # Build OpenBLAS

-- 
To stop receiving notification emails like this one, please contact
marcoabreu@apache.org.

[incubator-mxnet] 01/16: Fixed armv7 wheel

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

marcoabreu pushed a commit to branch devel-arm
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git

commit 48524773adbfa1b29455c9250a2e9ee42d44bad1
Author: Anton Chernov <me...@gmail.com>
AuthorDate: Thu May 24 17:29:24 2018 +0200

    Fixed armv7 wheel
---
 ci/docker/Dockerfile.build.armv7 | 23 +++++++----
 ci/docker/runtime_functions.sh   | 88 ++++++++++++++++++++++++++--------------
 2 files changed, 73 insertions(+), 38 deletions(-)

diff --git a/ci/docker/Dockerfile.build.armv7 b/ci/docker/Dockerfile.build.armv7
index c249306..102409a 100755
--- a/ci/docker/Dockerfile.build.armv7
+++ b/ci/docker/Dockerfile.build.armv7
@@ -16,17 +16,24 @@
 # specific language governing permissions and limitations
 # under the License.
 #
-# Dockerfile to build MXNet for Android ARMv7
+# Dockerfile to build MXNet for ARMv7 (Android & RPi)
 
 FROM dockcross/linux-armv7
 
-ENV ARCH armv71
-ENV CC /usr/bin/arm-linux-gnueabihf-gcc
-ENV CXX /usr/bin/arm-linux-gnueabihf-g++
+ENV ARCH armv7l
+ENV HOSTCC gcc
+ENV TARGET ARMV7
 
-RUN apt-get update && \
-    apt-get install -y libopenblas-dev:armhf && \
-    rm -rf /var/lib/apt/lists/*
+WORKDIR /work/deps
+
+# Build OpenBLAS
+RUN git clone --recursive -b v0.2.20 https://github.com/xianyi/OpenBLAS.git && \
+    cd OpenBLAS && \
+    make -j$(nproc) && \
+    make PREFIX=$CROSS_ROOT install
+
+ENV OpenBLAS_HOME=${CROSS_ROOT}
+ENV OpenBLAS_DIR=${CROSS_ROOT}
 
 COPY runtime_functions.sh /work/
-WORKDIR /work/build
+WORKDIR /work/mxnet
diff --git a/ci/docker/runtime_functions.sh b/ci/docker/runtime_functions.sh
index fa9de61..6805446 100755
--- a/ci/docker/runtime_functions.sh
+++ b/ci/docker/runtime_functions.sh
@@ -31,6 +31,37 @@ clean_repo() {
     git submodule update --init --recursive
 }
 
+build_wheel() {
+
+    set -ex
+    pushd .
+
+    PYTHON_DIR = ${1:/work/mxnet/python}
+    BUILD_DIR = ${2:/work/build}
+
+    # build
+
+    export MXNET_LIBRARY_PATH=${BUILD_DIR}/libmxnet.so
+
+    cd ${PYTHON_DIR}
+    python setup.py bdist_wheel --universal
+
+    # repackage
+
+    # Fix pathing issues in the wheel.  We need to move libmxnet.so from the data folder to the
+    # mxnet folder, then repackage the wheel.
+    WHEEL = `readlink -f dist/*.whl`
+    TMPDIR = `mktemp -d`
+    unzip -d ${TMPDIR} ${WHEEL}
+    rm ${WHEEL}
+    cd ${TMPDIR}
+    mv *.data/data/mxnet/libmxnet.so mxnet
+    zip -r ${WHEEL} .
+    cp ${WHEEL} ${BUILD_DIR}
+    rm -rf ${TMPDIR}
+
+    popd
+}
 
 # Build commands: Every platform in docker/Dockerfile.build.<platform> should have a corresponding
 # function here with the same suffix:
@@ -38,24 +69,12 @@ clean_repo() {
 build_jetson() {
     set -ex
     pushd .
+
     mv make/crosscompile.jetson.mk make/config.mk
     make -j$(nproc)
 
-    export MXNET_LIBRARY_PATH=`pwd`/libmxnet.so
-    cd /work/mxnet/python
-    python setup.py bdist_wheel --universal
+    build_wheel
 
-    # Fix pathing issues in the wheel.  We need to move libmxnet.so from the data folder to the
-    # mxnet folder, then repackage the wheel.
-    WHEEL=`readlink -f dist/*.whl`
-    TMPDIR=`mktemp -d`
-    unzip -d $TMPDIR $WHEEL
-    rm $WHEEL
-    cd $TMPDIR
-    mv *.data/data/mxnet/libmxnet.so mxnet
-    zip -r $WHEEL .
-    cp $WHEEL /work/build
-    rm -rf $TMPDIR
     popd
 }
 
@@ -72,7 +91,7 @@ build_armv6() {
     # We do not need OpenMP, since most armv6 systems have only 1 core
 
     cmake \
-        -DCMAKE_TOOLCHAIN_FILE=$CROSS_ROOT/Toolchain.cmake \
+        -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} \
         -DUSE_CUDA=OFF \
         -DUSE_OPENCV=OFF \
         -DUSE_OPENMP=OFF \
@@ -83,11 +102,10 @@ build_armv6() {
         -DBUILD_CPP_EXAMPLES=OFF \
         -Dmxnet_LINKER_LIBS=-lgfortran \
         -G Ninja /work/mxnet
+
     ninja
-    export MXNET_LIBRARY_PATH=`pwd`/libmxnet.so
-    cd /work/mxnet/python
-    python setup.py bdist_wheel --universal
-    cp dist/*.whl /work/build
+    build_wheel
+
     popd
 }
 
@@ -95,19 +113,29 @@ build_armv7() {
     set -ex
     pushd .
     cd /work/build
-    cmake\
-        -DUSE_CUDA=OFF\
-        -DUSE_OPENCV=OFF\
-        -DUSE_OPENMP=OFF\
-        -DUSE_SIGNAL_HANDLER=ON\
-        -DCMAKE_BUILD_TYPE=RelWithDebInfo\
-        -DUSE_MKL_IF_AVAILABLE=OFF\
+
+    # Lapack functionality will be included and statically linked to openblas.
+    # But USE_LAPACK needs to be set to OFF, otherwise the main CMakeLists.txt
+    # file tries to add -llapack. Lapack functionality though, requires -lgfortran
+    # to be linked additionally.
+
+    cmake \
+        -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} \
+        -DCMAKE_CROSSCOMPILING=ON \
+        -DUSE_CUDA=OFF \
+        -DUSE_OPENCV=OFF \
+        -DUSE_OPENMP=ON \
+        -DUSE_SIGNAL_HANDLER=ON \
+        -DCMAKE_BUILD_TYPE=Release \
+        -DUSE_MKL_IF_AVAILABLE=OFF \
+        -DUSE_LAPACK=OFF \
+        -DBUILD_CPP_EXAMPLES=OFF \
+        -Dmxnet_LINKER_LIBS=-lgfortran \
         -G Ninja /work/mxnet
+
     ninja
-    export MXNET_LIBRARY_PATH=`pwd`/libmxnet.so
-    cd /work/mxnet/python
-    python setup.py bdist_wheel --universal
-    cp dist/*.whl /work/build
+    build_wheel
+
     popd
 }
 

-- 
To stop receiving notification emails like this one, please contact
marcoabreu@apache.org.