1 # Copyright 2016-2020 Jing Li
2 # Copyright (c) 2019 Samsung Electronics Co., Ltd. All Rights Reserved
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
20 # Install 'add-apt-repository'
21 RUN apt-get update && apt-get -qqy install software-properties-common
24 RUN apt-get update && apt-get -qqy install build-essential cmake scons git g++-arm-linux-gnueabihf g++-aarch64-linux-gnu
26 # Install extra dependencies (Caffe, nnkit)
27 RUN apt-get update && apt-get -qqy install libboost-all-dev libgflags-dev libgoogle-glog-dev libatlas-base-dev libhdf5-dev
29 # Install protocol buffer
30 RUN apt-get update && apt-get -qqy install libprotobuf-dev protobuf-compiler
33 RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -qqy install doxygen graphviz wget zip unzip clang-format-3.9 python3 python3-pip python3-venv hdf5-tools pylint
34 RUN pip3 install --upgrade pip
35 RUN pip3 install yapf==0.22.0 numpy
37 # Install google test (source)
38 RUN apt-get update && apt-get -qqy install libgtest-dev
40 # Install build tool gcc version 8.x and set alternative link (c++17 support)
41 RUN apt-get update && apt-get -qqy install g++-8 g++-8-arm-linux-gnueabihf g++-8-aarch64-linux-gnu
42 RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 80 \
43 --slave /usr/bin/g++ g++ /usr/bin/g++-8 \
44 --slave /usr/bin/gcov gcov /usr/bin/gcov-8
45 RUN update-alternatives --install /usr/bin/arm-linux-gnueabihf-gcc arm-linux-gnueabihf-gcc /usr/bin/arm-linux-gnueabihf-gcc-8 80 \
46 --slave /usr/bin/arm-linux-gnueabihf-g++ arm-linux-gnueabihf-g++ /usr/bin/arm-linux-gnueabihf-g++-8 \
47 --slave /usr/bin/arm-linux-gnueabihf-gcov arm-linux-gnueabihf-gcov /usr/bin/arm-linux-gnueabihf-gcov-8
48 RUN update-alternatives --install /usr/bin/aarch64-linux-gnu-gcc aarch64-linux-gnu-gcc /usr/bin/aarch64-linux-gnu-gcc-8 80 \
49 --slave /usr/bin/aarch64-linux-gnu-g++ aarch64-linux-gnu-g++ /usr/bin/aarch64-linux-gnu-g++-8 \
50 --slave /usr/bin/aarch64-linux-gnu-gcov aarch64-linux-gnu-gcov /usr/bin/aarch64-linux-gnu-gcov-8
52 # Install lcov 1.13-4 for gcc-8 support (installed lcov 1.13-3 can't support gcc-8)
53 RUN wget http://launchpadlibrarian.net/370213541/lcov_1.13-4_all.deb
54 RUN dpkg -i lcov_1.13-4_all.deb
56 # Build and install google test static libraries
58 RUN cmake /usr/src/gtest
65 RUN echo 'deb [trusted=yes] http://download.tizen.org/tools/latest-release/Ubuntu_18.04/ /' | cat >> /etc/apt/sources.list
66 RUN apt-get update && apt-get -qqy install gbs
67 RUN wget http://download.tizen.org/sdk/tizenstudio/official/binary/sdb_3.1.4_ubuntu-64.zip -O sdb.zip
68 RUN unzip -d tmp sdb.zip && rm sdb.zip
69 RUN cp tmp/data/tools/sdb /usr/bin/. && rm -rf tmp
72 RUN apt-get install -y --no-install-recommends openjdk-8-jdk
74 # download and install Gradle
75 # https://services.gradle.org/distributions/
76 ARG GRADLE_VERSION=6.4.1
79 wget -q https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-${GRADLE_DIST}.zip && \
80 unzip gradle*.zip && \
81 ls -d */ | sed 's/\/*$//g' | xargs -I{} mv {} gradle && \
84 # download and install Android SDK
85 # https://developer.android.com/studio#command-tools
86 ARG ANDROID_SDK_VERSION=6514223
87 ENV ANDROID_SDK_ROOT /opt/android-sdk
88 RUN mkdir -p ${ANDROID_SDK_ROOT}/cmdline-tools && \
89 wget -q https://dl.google.com/android/repository/commandlinetools-linux-${ANDROID_SDK_VERSION}_latest.zip && \
90 unzip *tools*linux*.zip -d ${ANDROID_SDK_ROOT}/cmdline-tools && \
93 # accept the license agreements of the SDK components
94 RUN mkdir -p ${ANDROID_SDK_ROOT}/licenses
95 RUN echo 24333f8a63b6825ea9c5514f83c2829b004d1fee > ${ANDROID_SDK_ROOT}/licenses/android-sdk-license
96 RUN echo d56f5187479451eabf01fb78af6dfcb131a6481e >> ${ANDROID_SDK_ROOT}/licenses/android-sdk-license
98 # Env variable for gradle build
99 ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
100 ENV GRADLE_HOME /opt/gradle
101 ENV PATH ${PATH}:${GRADLE_HOME}/bin:${ANDROID_SDK_ROOT}/cmdline-tools/tools/bin:${ANDROID_SDK_ROOT}/platform-tools
102 ENV ANDROID_HOME ${ANDROID_SDK_ROOT}
105 RUN sdkmanager --install "ndk;20.0.5594570"
106 RUN sdkmanager "platform-tools"
108 # Env for ko encoding build
114 # Clean archives (to reduce image size)