Created
December 20, 2019 17:40
-
-
Save grantstephens/9cc977540b89f22db4bfdbd7b2466928 to your computer and use it in GitHub Desktop.
Dockefile for building libtensorflow.so (Working for v2.0)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:18.10 | |
RUN apt update && apt install -y \ | |
build-essential \ | |
curl \ | |
git \ | |
wget \ | |
libjpeg-dev \ | |
openjdk-8-jdk \ | |
gcc-7 \ | |
g++-7 \ | |
python \ | |
python-pip \ | |
&& rm -rf /var/lib/lists/* | |
ENV PYTHON_BIN_PATH="/usr/bin/python" \ | |
PYTHON_LIB_PATH="/usr/local/lib/python2.7/dist-packages" \ | |
PYTHONPATH=/tensorflow/lib \ | |
PYTHON_ARG=/tensorflow/lib \ | |
USE_BAZEL_VERSION=0.26.1 \ | |
TF_NEED_CUDA=0 \ | |
TF_NEED_GCP=0 \ | |
TF_CUDA_COMPUTE_CAPABILITIES=5.2,3.5 \ | |
TF_NEED_HDFS=0 \ | |
TF_NEED_OPENCL=0 \ | |
TF_NEED_JEMALLOC=0 \ | |
TF_ENABLE_XLA=0 \ | |
TF_NEED_VERBS=0 \ | |
TF_CUDA_CLANG=0 \ | |
TF_DOWNLOAD_CLANG=0 \ | |
TF_NEED_MKL=0 \ | |
TF_DOWNLOAD_MKL=0 \ | |
TF_NEED_MPI=0 \ | |
TF_NEED_S3=1 \ | |
TF_NEED_KAFKA=0 \ | |
TF_NEED_GDR=0 \ | |
TF_NEED_OPENCL_SYCL=0 \ | |
TF_SET_ANDROID_WORKSPACE=0 \ | |
TF_NEED_AWS=0 \ | |
TF_NEED_IGNITE=0 \ | |
TF_NEED_ROCM=0 \ | |
GCC_HOST_COMPILER_PATH="/usr/bin/gcc" \ | |
CC_OPT_FLAGS="-march=native" \ | |
GCC_VERSION="7" | |
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-$GCC_VERSION 10 && \ | |
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-$GCC_VERSION 10 && \ | |
update-alternatives --set gcc "/usr/bin/gcc-$GCC_VERSION" && \ | |
update-alternatives --set g++ "/usr/bin/g++-$GCC_VERSION" | |
RUN pip install pip six numpy wheel setuptools mock 'future>=0.17.1' && \ | |
pip install keras_applications --no-deps && \ | |
pip install keras_preprocessing --no-deps | |
RUN git clone --depth 1 --branch r2.0 https://github.com/tensorflow/tensorflow.git /tensorflow | |
WORKDIR /tensorflow | |
COPY bazelisk /bin/bazel | |
RUN ./configure | |
RUN bazel build --config=opt \ | |
--linkopt="-lrt" \ | |
--linkopt="-lm" \ | |
--host_linkopt="-lrt" \ | |
--host_linkopt="-lm" \ | |
--action_env="LD_LIBRARY_PATH=${LD_LIBRARY_PATH}" \ | |
//tensorflow:libtensorflow.so |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment