Skip to content

Instantly share code, notes, and snippets.

@cmd-ntrf
Last active May 13, 2016 01:53
Show Gist options
  • Save cmd-ntrf/075f56bdec63dd4bf89e1ab52d15d980 to your computer and use it in GitHub Desktop.
Save cmd-ntrf/075f56bdec63dd4bf89e1ab52d15d980 to your computer and use it in GitHub Desktop.

TensorFlow with a non-system GCC

Bazel

version : 0.2.2b hash: b74d9b5

module load compilers/java/1.8
module load compilers/gcc/4.8.5 # clumeq group
module load apps/buildtools

cp tools/cpp/CROSSTOOL{,.orig}
sed -i "s;/usr/bin/gcc;$GCC_PREFIX/bin/gcc;g" tools/cpp/CROSSTOOL
sed -i "s;/usr/bin/cpp;$GCC_PREFIX/bin/cpp;g" tools/cpp/CROSSTOOL
sed -i "s;/usr/bin/gcov;$GCC_PREFIX/bin/gcov;g" tools/cpp/CROSSTOOL
sed -i "s;/usr/lib/gcc;$GCC_PREFIX/lib/gcc;g" tools/cpp/CROSSTOOL
# Modify the path to ar, compat-ld, and dwp if binutils is not installed in /usr/bin
# append the following near a library_path line
#   linker_flag: \"-Wl,-rpath=$GCC_PREFIX/lib64\"" 

Remove any mention of -B/usr/bin in tools/cpp/cc_configure.bzl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment