Skip to main content
added 117 characters in body
Source Link
S. Pan
  • 136
  • 3
  1. download bazel-4.5-dist.zip and follow these steps to install, newer versions of bazel don't work as of 2017-09-04

    ~$ cd
    ~$ wget https://github.com/bazelbuild/bazel/releases/download/0.4.5/bazel-0.4.5-dist.zip
    ~$ cd /usr/src
    ~$ mkdir bazel-0.4.5-dist.zip
    ~$ cd bazel-0.4.5-dist
    ~# mv ~/bazel-0.4.5-dist.zip ./
    ~# unzip bazel-0.4.5-dist.zip
    ~# ./compile.sh

     ~$ cd ~$ wget https://github.com/bazelbuild/bazel/releases/download/0.4.5/bazel-0.4.5-dist.zip ~$ cd /usr/src ~$ mkdir bazel-0.4.5-dist.zip ~$ cd bazel-0.4.5-dist ~# mv ~/bazel-0.4.5-dist.zip ./ ~# unzip bazel-0.4.5-dist.zip ~# ./compile.sh 
  2. Modify ~/.bashrc to activate devtoolset-2 instead of devtoolset-6. Tensorflow will not build with newer gcc, only up to gcc 4

    in ~/.bashrc

     source /opt/rh/devtoolset-2/enable #source /opt/rh/devtoolset-6/enable 
  3. Clone tensorflow into /usr/src

     ~$ cd /usr/src ~# git clone https://github.com/tensorflow/tensorflow 
  4. Configure tensorflow

     ~$ cd tensorflow ~# ./configure 

in ~/.bashrc

source /opt/rh/devtoolset-2/enable #source /opt/rh/devtoolset-6/enable 
  1. Clone tensorflow into /usr/src

    ~$ cd /usr/src
    ~# git clone https://github.com/tensorflow/tensorflow

  2. Configure tensorflow

    ~$ cd tensorflow
    ~# ./configure

  1. go to /usr/src/tensorflow/third_party/gpus/crosstool modify CROSSTOOL_clang.tpl and CROSSTOOL_nvcc.tpl add the following line to the section labeled "toolchain"

    linker_flag : "-B/opt/rh/devtoolset-2/root/usr/bin"

     linker_flag : "-B/opt/rh/devtoolset-2/root/usr/bin" 
  2. Build tensorflow

    ~$ cd /usr/src/tensorflow
    ~# bazel build --config=opt --config=cuda //tensorflow/tools/pip_package:build_pip_package

     ~$ cd /usr/src/tensorflow ~# bazel build --config=opt --config=cuda //tensorflow/tools/pip_package:build_pip_package 
  3. Create pip package

    ~# bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg

     ~# bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg 
  4. Install custom pip package

    ~# sudo pip install /tmp/tensorflow_pkg/tensorflow-1.3.0-cp34-cp34m-linux_x86_64.whl

     ~# sudo pip install /tmp/tensorflow_pkg/tensorflow-1.3.0-cp34-cp34m-linux_x86_64.whl 
  1. download bazel-4.5-dist.zip and follow these steps to install, newer versions of bazel don't work as of 2017-09-04

    ~$ cd
    ~$ wget https://github.com/bazelbuild/bazel/releases/download/0.4.5/bazel-0.4.5-dist.zip
    ~$ cd /usr/src
    ~$ mkdir bazel-0.4.5-dist.zip
    ~$ cd bazel-0.4.5-dist
    ~# mv ~/bazel-0.4.5-dist.zip ./
    ~# unzip bazel-0.4.5-dist.zip
    ~# ./compile.sh

  2. Modify ~/.bashrc to activate devtoolset-2 instead of devtoolset-6. Tensorflow will not build with newer gcc, only up to gcc 4

in ~/.bashrc

source /opt/rh/devtoolset-2/enable #source /opt/rh/devtoolset-6/enable 
  1. Clone tensorflow into /usr/src

    ~$ cd /usr/src
    ~# git clone https://github.com/tensorflow/tensorflow

  2. Configure tensorflow

    ~$ cd tensorflow
    ~# ./configure

  1. go to /usr/src/tensorflow/third_party/gpus/crosstool modify CROSSTOOL_clang.tpl and CROSSTOOL_nvcc.tpl add the following line to the section labeled "toolchain"

    linker_flag : "-B/opt/rh/devtoolset-2/root/usr/bin"

  2. Build tensorflow

    ~$ cd /usr/src/tensorflow
    ~# bazel build --config=opt --config=cuda //tensorflow/tools/pip_package:build_pip_package

  3. Create pip package

    ~# bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg

  4. Install custom pip package

    ~# sudo pip install /tmp/tensorflow_pkg/tensorflow-1.3.0-cp34-cp34m-linux_x86_64.whl

  1. download bazel-4.5-dist.zip and follow these steps to install, newer versions of bazel don't work as of 2017-09-04

     ~$ cd ~$ wget https://github.com/bazelbuild/bazel/releases/download/0.4.5/bazel-0.4.5-dist.zip ~$ cd /usr/src ~$ mkdir bazel-0.4.5-dist.zip ~$ cd bazel-0.4.5-dist ~# mv ~/bazel-0.4.5-dist.zip ./ ~# unzip bazel-0.4.5-dist.zip ~# ./compile.sh 
  2. Modify ~/.bashrc to activate devtoolset-2 instead of devtoolset-6. Tensorflow will not build with newer gcc, only up to gcc 4

    in ~/.bashrc

     source /opt/rh/devtoolset-2/enable #source /opt/rh/devtoolset-6/enable 
  3. Clone tensorflow into /usr/src

     ~$ cd /usr/src ~# git clone https://github.com/tensorflow/tensorflow 
  4. Configure tensorflow

     ~$ cd tensorflow ~# ./configure 
  1. go to /usr/src/tensorflow/third_party/gpus/crosstool modify CROSSTOOL_clang.tpl and CROSSTOOL_nvcc.tpl add the following line to the section labeled "toolchain"

     linker_flag : "-B/opt/rh/devtoolset-2/root/usr/bin" 
  2. Build tensorflow

     ~$ cd /usr/src/tensorflow ~# bazel build --config=opt --config=cuda //tensorflow/tools/pip_package:build_pip_package 
  3. Create pip package

     ~# bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg 
  4. Install custom pip package

     ~# sudo pip install /tmp/tensorflow_pkg/tensorflow-1.3.0-cp34-cp34m-linux_x86_64.whl 
added 117 characters in body
Source Link
S. Pan
  • 136
  • 3

I had to rebuild the tensorflow pip package from source to make it work in CentOS 6 because there's some fundamental issue with the default pip package and which glibc was used to build it for CentOS6. Here's a memo I made of it. (Note I did this a month ago)

  1. download bazel-4.5-dist.zip and follow these steps to install, newer versions of bazel don't work as of 2017-09-04

    ~$ cd
    ~$ wget https://github.com/bazelbuild/bazel/releases/download/0.4.5/bazel-0.4.5-dist.zip
    ~$ cd /usr/src
    ~$ mkdir bazel-0.4.5-dist.zip
    ~$ cd bazel-0.4.5-dist
    ~# mv ~/bazel-0.4.5-dist.zip ./
    ~# unzip bazel-0.4.5-dist.zip
    ~# ./compile.sh

  2. Modify ~/.bashrc to activate devtoolset-2 instead of devtoolset-6. Tensorflow will not build with newer gcc, only up to gcc 4

in ~/.bashrc

source /opt/rh/devtoolset-2/enable #source /opt/rh/devtoolset-6/enable 
  1. Clone tensorflow into /usr/src

    ~$ cd /usr/src
    ~# git clone https://github.com/tensorflow/tensorflow

  2. Configure tensorflow

    ~$ cd tensorflow
    ~# ./configure

Select "No" for all support options except CUDA. Everything else should be default

  1. go to /usr/src/tensorflow/third_party/gpus/crosstool modify CROSSTOOL_clang.tpl and CROSSTOOL_nvcc.tpl add the following line to the section labeled "toolchain"

    linker_flag : "-B/opt/rh/devtoolset-2/root/usr/bin"

  2. Build tensorflow

    ~$ cd /usr/src/tensorflow
    ~# bazel build --config=opt --config=cuda //tensorflow/tools/pip_package:build_pip_package

  3. Create pip package

    ~# bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg

  4. Install custom pip package

    ~# sudo pip install /tmp/tensorflow_pkg/tensorflow-1.3.0-cp34-cp34m-linux_x86_64.whl

I had to rebuild the tensorflow pip package from source to make it work in CentOS 6. Here's a memo I made of it. (Note I did this a month ago)

  1. download bazel-4.5-dist.zip and follow these steps to install, newer versions of bazel don't work as of 2017-09-04

    ~$ cd
    ~$ wget https://github.com/bazelbuild/bazel/releases/download/0.4.5/bazel-0.4.5-dist.zip
    ~$ cd /usr/src
    ~$ mkdir bazel-0.4.5-dist.zip
    ~$ cd bazel-0.4.5-dist
    ~# mv ~/bazel-0.4.5-dist.zip ./
    ~# unzip bazel-0.4.5-dist.zip
    ~# ./compile.sh

  2. Modify ~/.bashrc to activate devtoolset-2 instead of devtoolset-6. Tensorflow will not build with newer gcc, only up to gcc 4

in ~/.bashrc

source /opt/rh/devtoolset-2/enable #source /opt/rh/devtoolset-6/enable 
  1. Clone tensorflow into /usr/src

    ~$ cd /usr/src
    ~# git clone https://github.com/tensorflow/tensorflow

  2. Configure tensorflow

    ~$ cd tensorflow
    ~# ./configure

Select "No" for all support options except CUDA. Everything else should be default

  1. go to /usr/src/tensorflow/third_party/gpus/crosstool modify CROSSTOOL_clang.tpl and CROSSTOOL_nvcc.tpl add the following line to the section labeled "toolchain"

    linker_flag : "-B/opt/rh/devtoolset-2/root/usr/bin"

  2. Build tensorflow

    ~$ cd /usr/src/tensorflow
    ~# bazel build --config=opt --config=cuda //tensorflow/tools/pip_package:build_pip_package

  3. Create pip package

    ~# bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg

  4. Install custom pip package

    ~# sudo pip install /tmp/tensorflow_pkg/tensorflow-1.3.0-cp34-cp34m-linux_x86_64.whl

I had to rebuild the tensorflow pip package from source to make it work in CentOS 6 because there's some fundamental issue with the default pip package and which glibc was used to build it for CentOS6. Here's a memo I made of it. (Note I did this a month ago)

  1. download bazel-4.5-dist.zip and follow these steps to install, newer versions of bazel don't work as of 2017-09-04

    ~$ cd
    ~$ wget https://github.com/bazelbuild/bazel/releases/download/0.4.5/bazel-0.4.5-dist.zip
    ~$ cd /usr/src
    ~$ mkdir bazel-0.4.5-dist.zip
    ~$ cd bazel-0.4.5-dist
    ~# mv ~/bazel-0.4.5-dist.zip ./
    ~# unzip bazel-0.4.5-dist.zip
    ~# ./compile.sh

  2. Modify ~/.bashrc to activate devtoolset-2 instead of devtoolset-6. Tensorflow will not build with newer gcc, only up to gcc 4

in ~/.bashrc

source /opt/rh/devtoolset-2/enable #source /opt/rh/devtoolset-6/enable 
  1. Clone tensorflow into /usr/src

    ~$ cd /usr/src
    ~# git clone https://github.com/tensorflow/tensorflow

  2. Configure tensorflow

    ~$ cd tensorflow
    ~# ./configure

Select "No" for all support options except CUDA. Everything else should be default

  1. go to /usr/src/tensorflow/third_party/gpus/crosstool modify CROSSTOOL_clang.tpl and CROSSTOOL_nvcc.tpl add the following line to the section labeled "toolchain"

    linker_flag : "-B/opt/rh/devtoolset-2/root/usr/bin"

  2. Build tensorflow

    ~$ cd /usr/src/tensorflow
    ~# bazel build --config=opt --config=cuda //tensorflow/tools/pip_package:build_pip_package

  3. Create pip package

    ~# bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg

  4. Install custom pip package

    ~# sudo pip install /tmp/tensorflow_pkg/tensorflow-1.3.0-cp34-cp34m-linux_x86_64.whl

Source Link
S. Pan
  • 136
  • 3

I had to rebuild the tensorflow pip package from source to make it work in CentOS 6. Here's a memo I made of it. (Note I did this a month ago)

  1. download bazel-4.5-dist.zip and follow these steps to install, newer versions of bazel don't work as of 2017-09-04

    ~$ cd
    ~$ wget https://github.com/bazelbuild/bazel/releases/download/0.4.5/bazel-0.4.5-dist.zip
    ~$ cd /usr/src
    ~$ mkdir bazel-0.4.5-dist.zip
    ~$ cd bazel-0.4.5-dist
    ~# mv ~/bazel-0.4.5-dist.zip ./
    ~# unzip bazel-0.4.5-dist.zip
    ~# ./compile.sh

  2. Modify ~/.bashrc to activate devtoolset-2 instead of devtoolset-6. Tensorflow will not build with newer gcc, only up to gcc 4

in ~/.bashrc

source /opt/rh/devtoolset-2/enable #source /opt/rh/devtoolset-6/enable 
  1. Clone tensorflow into /usr/src

    ~$ cd /usr/src
    ~# git clone https://github.com/tensorflow/tensorflow

  2. Configure tensorflow

    ~$ cd tensorflow
    ~# ./configure

Select "No" for all support options except CUDA. Everything else should be default

  1. go to /usr/src/tensorflow/third_party/gpus/crosstool modify CROSSTOOL_clang.tpl and CROSSTOOL_nvcc.tpl add the following line to the section labeled "toolchain"

    linker_flag : "-B/opt/rh/devtoolset-2/root/usr/bin"

  2. Build tensorflow

    ~$ cd /usr/src/tensorflow
    ~# bazel build --config=opt --config=cuda //tensorflow/tools/pip_package:build_pip_package

  3. Create pip package

    ~# bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg

  4. Install custom pip package

    ~# sudo pip install /tmp/tensorflow_pkg/tensorflow-1.3.0-cp34-cp34m-linux_x86_64.whl