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 && \
34 DEBIAN_FRONTEND=noninteractive \
35 apt-get -qqy install doxygen graphviz wget zip unzip clang-format-3.9 clang-format-8 python3 python3-pip python3-venv hdf5-tools pylint curl
36 RUN pip3 install --upgrade pip
37 RUN pip3 install yapf==0.22.0 numpy
39 # Install google test (source)
40 RUN apt-get update && apt-get -qqy install libgtest-dev
42 # Install build tool gcc version 8.x and set alternative link (c++17 support)
43 RUN apt-get update && apt-get -qqy install g++-8 g++-8-arm-linux-gnueabihf g++-8-aarch64-linux-gnu
44 RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 80 \
45 --slave /usr/bin/g++ g++ /usr/bin/g++-8 \
46 --slave /usr/bin/gcov gcov /usr/bin/gcov-8
47 RUN update-alternatives --install /usr/bin/arm-linux-gnueabihf-gcc arm-linux-gnueabihf-gcc /usr/bin/arm-linux-gnueabihf-gcc-8 80 \
48 --slave /usr/bin/arm-linux-gnueabihf-g++ arm-linux-gnueabihf-g++ /usr/bin/arm-linux-gnueabihf-g++-8 \
49 --slave /usr/bin/arm-linux-gnueabihf-gcov arm-linux-gnueabihf-gcov /usr/bin/arm-linux-gnueabihf-gcov-8
50 RUN update-alternatives --install /usr/bin/aarch64-linux-gnu-gcc aarch64-linux-gnu-gcc /usr/bin/aarch64-linux-gnu-gcc-8 80 \
51 --slave /usr/bin/aarch64-linux-gnu-g++ aarch64-linux-gnu-g++ /usr/bin/aarch64-linux-gnu-g++-8 \
52 --slave /usr/bin/aarch64-linux-gnu-gcov aarch64-linux-gnu-gcov /usr/bin/aarch64-linux-gnu-gcov-8
54 # Install lcov 1.14-2 for gcc-8 support
55 # Default version lcov 1.13-3 can't support gcc-8
56 # lcov 1.13-4 with gcc-8 have bug: reports no coverage for class declaration
58 RUN wget http://archive.ubuntu.com/ubuntu/pool/universe/l/lcov/lcov_1.14-2_all.deb
59 RUN apt-get update && apt-get -qqy install libperlio-gzip-perl libjson-perl
60 RUN dpkg -i lcov_1.14-2_all.deb
64 # Build and install google test static libraries
66 RUN cmake /usr/src/gtest
73 RUN echo 'deb [trusted=yes] http://download.tizen.org/tools/latest-release/Ubuntu_18.04/ /' | cat >> /etc/apt/sources.list
74 RUN apt-get update && apt-get -qqy install gbs
75 RUN wget http://download.tizen.org/sdk/tizenstudio/official/binary/sdb_3.1.4_ubuntu-64.zip -O sdb.zip
76 RUN unzip -d tmp sdb.zip && rm sdb.zip
77 RUN cp tmp/data/tools/sdb /usr/bin/. && rm -rf tmp
80 RUN apt-get install -y --no-install-recommends openjdk-8-jdk
82 # download and install Gradle
83 # https://services.gradle.org/distributions/
84 ARG GRADLE_VERSION=6.4.1
87 wget -q https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-${GRADLE_DIST}.zip && \
88 unzip gradle*.zip && \
89 ls -d */ | sed 's/\/*$//g' | xargs -I{} mv {} gradle && \
92 # download and install Android SDK
93 # https://developer.android.com/studio#command-tools
94 ARG ANDROID_SDK_VERSION=6514223
95 ENV ANDROID_SDK_ROOT /opt/android-sdk
96 RUN mkdir -p ${ANDROID_SDK_ROOT}/cmdline-tools && \
97 wget -q https://dl.google.com/android/repository/commandlinetools-linux-${ANDROID_SDK_VERSION}_latest.zip && \
98 unzip *tools*linux*.zip -d ${ANDROID_SDK_ROOT}/cmdline-tools && \
101 # accept the license agreements of the SDK components
102 RUN mkdir -p ${ANDROID_SDK_ROOT}/licenses
103 RUN echo 24333f8a63b6825ea9c5514f83c2829b004d1fee > ${ANDROID_SDK_ROOT}/licenses/android-sdk-license
104 RUN echo d56f5187479451eabf01fb78af6dfcb131a6481e >> ${ANDROID_SDK_ROOT}/licenses/android-sdk-license
106 # Env variable for gradle build
107 ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
108 ENV GRADLE_HOME /opt/gradle
109 ENV PATH ${PATH}:${GRADLE_HOME}/bin:${ANDROID_SDK_ROOT}/cmdline-tools/tools/bin:${ANDROID_SDK_ROOT}/platform-tools
110 ENV ANDROID_HOME ${ANDROID_SDK_ROOT}
113 RUN sdkmanager --install "ndk;20.0.5594570"
114 RUN sdkmanager "platform-tools"
116 # Env for ko encoding build
122 # Clean archives (to reduce image size)