mirror of
https://github.com/saymrwulf/pytorch.git
synced 2026-05-14 20:57:59 +00:00
Trying a quick patch to install protobuf 2.6
Summary: Closes https://github.com/caffe2/caffe2/pull/1964 Reviewed By: orionr Differential Revision: D6994739 Pulled By: pjh5 fbshipit-source-id: dbef0c7e5b5ade1580effa463fe19f04b8a0a276
This commit is contained in:
parent
16cd3f4a9e
commit
3036346af6
3 changed files with 29 additions and 2 deletions
|
|
@ -2,6 +2,23 @@
|
|||
|
||||
set -ex
|
||||
|
||||
# This function installs protobuf 2.6
|
||||
install_protobuf_26() {
|
||||
pb_dir="/usr/temp_pb_install_dir"
|
||||
mkdir -p $pb_dir
|
||||
|
||||
# On the nvidia/cuda:9-cudnn7-devel-centos7 image we need this symlink or
|
||||
# else it will fail with
|
||||
# g++: error: ./../lib64/crti.o: No such file or directory
|
||||
ln -s /usr/lib64 "$pb_dir/lib64"
|
||||
|
||||
curl -LO "https://github.com/google/protobuf/releases/download/v2.6.1/protobuf-2.6.1.tar.gz"
|
||||
tar -xvz -C "$pb_dir" --strip-components 1 -f protobuf-2.6.1.tar.gz
|
||||
pushd "$pb_dir" && ./configure && make && make check && sudo make install && sudo ldconfig
|
||||
popd
|
||||
rm -rf $pb_dir
|
||||
}
|
||||
|
||||
install_ubuntu() {
|
||||
# Use AWS mirror if running in EC2
|
||||
if [ -n "${EC2:-}" ]; then
|
||||
|
|
@ -30,6 +47,12 @@ install_ubuntu() {
|
|||
protobuf-compiler \
|
||||
sudo
|
||||
|
||||
# Ubuntu 14.04 ships with protobuf 2.5, but ONNX needs protobuf >= 2.6
|
||||
# so we install that here if on 14.04
|
||||
if [[ "$UBUNTU_VERSION" == 14.04 ]]; then
|
||||
install_protobuf_26
|
||||
fi
|
||||
|
||||
# Cleanup
|
||||
apt-get autoclean && apt-get clean
|
||||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
|
@ -62,11 +85,13 @@ install_centos() {
|
|||
lmdb-devel \
|
||||
make \
|
||||
opencv-devel \
|
||||
protobuf-c-compiler \
|
||||
protobuf-c-devel \
|
||||
snappy-devel \
|
||||
sudo
|
||||
|
||||
# Centos7 ships with protobuf 2.5, but ONNX needs protobuf >= 2.6
|
||||
# so we always install install that here
|
||||
install_protobuf_26
|
||||
|
||||
# Cleanup
|
||||
yum clean all
|
||||
rm -rf /var/cache/yum
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ FROM nvidia/cuda:${CUDA_VERSION}-cudnn${CUDNN_VERSION}-devel-ubuntu${UBUNTU_VERS
|
|||
|
||||
# Install required packages to build Caffe2
|
||||
ARG EC2
|
||||
ARG UBUNTU_VERSION
|
||||
ADD ./install_base.sh install_base.sh
|
||||
RUN bash ./install_base.sh && rm install_base.sh
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ FROM ubuntu:${UBUNTU_VERSION}
|
|||
|
||||
# Install required packages to build Caffe2
|
||||
ARG EC2
|
||||
ARG UBUNTU_VERSION
|
||||
ADD ./install_base.sh install_base.sh
|
||||
RUN bash ./install_base.sh && rm install_base.sh
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue