Skip to content

Commit 2cf7050

Browse files
alonre24chayim
andauthored
Build onnx in UBUNTU16 docker (#647)
* Build onnx in UBUNTU16 docker * quick hack for cmake *ONLY FOR TESTING* * hack ho * Change build config to "Release" Co-authored-by: Chayim I. Kirshen <c@kirshen.com>
1 parent c8f4711 commit 2cf7050

File tree

2 files changed

+18
-13
lines changed

2 files changed

+18
-13
lines changed
Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,45 @@
11
# BUILD redisfab/onnxruntime-x64-${OS}:$(ONNXRUNTIME_VER)
2-
32
ARG OS=ubuntu:16.04
4-
53
#----------------------------------------------------------------------------------------------
64
FROM ${OS}
7-
85
ARG ONNXRUNTIME_REPO=https://github.com/RedisAI/onnxruntime
96
ARG ONNXRUNTIME_VER=1.7.1
107
ARG ARCH=x64
118

129
RUN apt-get -qq update
13-
RUN apt-get -qq install -y curl wget tar git \
14-
build-essential cmake \
10+
RUN apt-get install -y software-properties-common
11+
RUN add-apt-repository ppa:deadsnakes/ppa
12+
RUN apt-get -qq update
13+
14+
RUN apt-get -qq install -y python3.6 curl wget tar git \
15+
build-essential \
1516
libcurl4-openssl-dev libssl-dev libatlas-base-dev zlib1g-dev \
1617
python3 python3-pip python3-dev python3-numpy
18+
RUN wget -q https://github.com/Kitware/CMake/releases/download/v3.19.7/cmake-3.19.7-Linux-x86_64.tar.gz -O /tmp/cmake.tgz
19+
WORKDIR /tmp
20+
RUN tar -zxpf /tmp/cmake.tgz
21+
RUN mv /tmp/cmake*/bin/* /usr/bin
22+
RUN mv /tmp/cmake-*/share/cmake* /usr/share/
23+
24+
RUN rm /usr/bin/python3
25+
RUN ln -s /usr/bin/python3.6 /usr/bin/python3
26+
1727
RUN pip3 install --upgrade pip setuptools wheel
1828

1929
ENV LANG=en_US.UTF-8
2030
RUN apt-get install -y locales && \
2131
sed -i -e "s/# $LANG.*/$LANG UTF-8/" /etc/locale.gen && \
2232
dpkg-reconfigure --frontend=noninteractive locales && \
2333
update-locale LANG=$LANG
24-
2534
WORKDIR /build
26-
27-
ARG BUILDTYPE=MinSizeRel
28-
35+
ARG BUILDTYPE=Release
2936
ARG BUILDARGS="--config ${BUILDTYPE} --parallel"
30-
3137
RUN git clone --single-branch --branch rel-${ONNXRUNTIME_VER} ${ONNXRUNTIME_REPO} onnxruntime
3238
WORKDIR /build/onnxruntime
33-
RUN git fetch --recurse-submodules -j4
39+
RUN git fetch --recurse-submodules
3440
RUN ./build.sh ${BUILDARGS} --update --build
3541
RUN ./build.sh ${BUILDARGS} --build_shared_lib
3642
# RUN ./build.sh ${BUILDARGS} --enable_pybind --build_wheel
37-
3843
ADD ./pack.sh /build
3944
WORKDIR /build
4045
RUN ./pack.sh ${ONNXRUNTIME_VER} ${ARCH}

opt/build/onnxruntime/pack.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ VER="$1"
55
PLATFORM="$2"
66

77
mkdir -p pack/include pack/lib
8-
cp onnxruntime/build/Linux/MinSizeRel/libonnxruntime.so.${VER} pack/lib/
8+
cp onnxruntime/build/Linux/Release/libonnxruntime.so.${VER} pack/lib/
99
cp onnxruntime/docs/C_API_Guidelines.md pack/
1010
cp onnxruntime/LICENSE pack/
1111
cp onnxruntime/README.md pack/

0 commit comments

Comments
 (0)