blob: 9adfc5b49d426a54fa00c532a71c8f1683687136 [file] [log] [blame]
# -*- mode: dockerfile -*-
# dockerfile to build libmxnet.so for armv7
FROM dockcross/linux-armv6
ENV ARCH armv6l
ENV BUILD_OPTS "USE_BLAS=openblas USE_SSE=0 USE_OPENCV=0"
ENV CC /usr/bin/arm-linux-gnueabihf-gcc
ENV CXX /usr/bin/arm-linux-gnueabihf-g++
ENV FC /usr/bin/arm-linux-gnueabihf-gfortran
ENV HOSTCC gcc
WORKDIR /work
# Build OpenBLAS
ADD https://api.github.com/repos/xianyi/OpenBLAS/git/refs/heads/master openblas_version.json
RUN git clone https://github.com/xianyi/OpenBLAS.git && \
cd OpenBLAS && \
make -j$(nproc) TARGET=ARMV6 && \
make install && \
ln -s /opt/OpenBLAS/lib/libopenblas.so /usr/lib/gcc/arm-linux-gnueabihf/libopenblas.so && \
ln -s /opt/OpenBLAS/lib/libopenblas.a /usr/lib/gcc/arm-linux-gnueabihf/libopenblas.a && \
ln -s /opt/OpenBLAS/lib/libopenblas.a /usr/lib/gcc/arm-linux-gnueabihf/liblapack.a && \
ln -s /opt/OpenBLAS/lib/libopenblas.a /usr/lib/liblapack.a
ENV LD_LIBRARY_PATH /opt/OpenBLAS/lib
ENV CPLUS_INCLUDE_PATH /opt/OpenBLAS/include
# Build MXNet
#ADD https://api.github.com/repos/apache/incubator-mxnet/git/refs/heads/master mxnet_version.json
#RUN git clone --recursive https://github.com/apache/incubator-mxnet.git mxnet
ADD mxnet mxnet
WORKDIR /work/mxnet
ADD arm.crosscompile.mk make/config.mk
RUN make -j$(nproc) $BUILD_OPTS
WORKDIR /work/build/
RUN cp /work/mxnet/lib/* .