Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

{devel}[foss/2016b] TensorFlow v1.0.1, SWIG v3.0.10, wheel v0.30.0a0, ... #4412

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions easybuild/easyconfigs/b/Bazel/Bazel-0.4.5-foss-2016b.eb
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# @author: Robert Schmidt (OHRI)
# @author: Guilherme Peretti-Pezzi (CSCS)

easyblock = "CmdCp"

name = 'Bazel'
version = '0.4.5'

homepage = 'http://bazel.io/'
description = """Bazel is a build tool that builds code quickly and reliably.
It is used to build the majority of Google's software."""

toolchain = {'name': 'foss', 'version': '2016b'}

sources = ['%(namelower)s-%(version)s-dist.zip']
source_urls = ['https://github.com/bazelbuild/bazel/releases/download/%(version)s']

dependencies = [
('Java', '1.8.0_121', "", True),
]

# Remove hardcoded absolute paths from CROSSTOOL and cc_configure.bzl
build_cmd = "sed -i s#'/usr/bin/ar'#$EBROOTBINUTILS'/bin/ar#g' tools/cpp/CROSSTOOL && "
build_cmd += "sed -i s#'/usr/bin/ld'#$EBROOTBINUTILS'/bin/ld#g' tools/cpp/CROSSTOOL && "
build_cmd += "sed -i s#'/usr/bin/cpp'#$EBROOTGCCCORE'/bin/cpp#g' tools/cpp/CROSSTOOL && "
build_cmd += "sed -i s#'/usr/bin/dwp'#$EBROOTBINUTILS'/bin/dwp#g' tools/cpp/CROSSTOOL && "
build_cmd += "sed -i s#'/usr/bin/gcc'#$EBROOTGCCCORE'/bin/gcc#g' tools/cpp/CROSSTOOL && "
build_cmd += "sed -i s#'-B/usr/bin/#-B'$EBROOTBINUTILS'/bin/#g' tools/cpp/CROSSTOOL && "
build_cmd += "sed -i s#'cxx_builtin_include_directory: \"/usr/lib/gcc/\"#cxx_builtin_include_directory: \"'$EBROOTGCCCORE'/lib/gcc/x86_64-unknown-linux-gnu/5.3.0/include\"#g' tools/cpp/CROSSTOOL && "
build_cmd += "sed -i s#'cxx_builtin_include_directory: \"/usr/local/include\"#cxx_builtin_include_directory: \"'$EBROOTGCCCORE'/lib/gcc/x86_64-unknown-linux-gnu/5.3.0/include-fixed\"#g' tools/cpp/CROSSTOOL && "
build_cmd += "sed -i s#'cxx_builtin_include_directory: \"/usr/include\"#cxx_builtin_include_directory: \"'$EBROOTGCCCORE'/include/c++/5.3.0/\"#g' tools/cpp/CROSSTOOL && "
build_cmd += "sed -i s#'\"/usr/bin/\" + k'#'\"'$EBROOTBINUTILS'/bin/\"#g' tools/cpp/cc_configure.bzl && "
build_cmd += "sed -i s#'B/usr/bin'#'B'$EBROOTBINUTILS'/bin/#g' tools/cpp/cc_configure.bzl && "
build_cmd += "export EXTRA_BAZEL_ARGS='--jobs=24' && "
build_cmd += "./compile.sh"

cmds_map = [('.*', build_cmd)]

files_to_copy = [(['output/bazel'], 'bin')]

sanity_check_paths = {
'files': ['bin/bazel'],
'dirs': [],
}

moduleclass = 'devel'
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# @author: gppezzi, marcelsc

name = 'SWIG'
version = '3.0.10'
versionsuffix= '-Python-%(pyver)s'

homepage = 'http://www.swig.org/'
description = """SWIG is a software development tool that connects programs written in C and C++ with
a variety of high-level programming languages."""

toolchain = {'name': 'foss', 'version': '2016b'}
toolchainopts = {'pic': True, 'opt': True, 'optarch': True}

source_urls = [SOURCEFORGE_SOURCE]
sources = [SOURCELOWER_TAR_GZ]

dependencies = [
('Python', '3.5.2'),
('PCRE', '8.38'),
]

moduleclass = 'devel'

Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# @author:
# Marcel Schoengens (CSCS)
# Guilherme Peretti-Pezzi (CSCS)
# Victor Holanda Rusu (CSCS)

easyblock = "CmdCp"

name = 'TensorFlow'
version = '1.0.1'
pyver = '3.5.2'
versionsuffix = '-Python-%s' % pyver

homepage = 'https://www.tensorflow.org/'
description = """An open-source software library for Machine Intelligence."""

toolchain = {'name': 'foss', 'version': '2016b'}

builddependencies = [
('wheel', '0.30.0a0', '-Python-%(pyver)s'),
('Bazel', '0.4.5'),
]

dependencies = [
('Python', pyver),
('SWIG', '3.0.10', '-Python-%(pyver)s'),
('protobuf-python', '3.2.0', '-Python-%(pyver)s'),
]

sources = ['v%(version)s.tar.gz']
source_urls = ['https://github.com/tensorflow/tensorflow/archive/']


# Patch to remove hardcoded paths for GCC and Binutils
patches = [('tensorflow-v%(version)s-Python-%(pyver)s-foss.patch')]

with_configure = False

whl_file = "tensorflow-%(version)s-cp35-cp35m-linux_x86_64.whl"

build_str = "export TEST_TMPDIR=/dev/shm/$USER/bazelout/ && "
build_str += "chmod +x configure-cscs.sh && "
build_str += "./configure-cscs.sh && "
# Fix for Bazel that ignores LD_LIBRARY_PATH when building protobuf
build_str += "find $TEST_TMPDIR -name protobuf.bzl -exec sed -i '/mnemonic=\"ProtoCompile\",/a\ \ \ \ \ \ \ \ use_default_shell_env=True,' {} \; && "
build_str += "bazel build --verbose_failures --copt=-mavx --copt=-mavx2 --copt=-mfma --copt=-msse4.2 --copt=-msse4.1 "
build_str += "-c opt //tensorflow/tools/pip_package:build_pip_package && "
build_str += "bazel-bin/tensorflow/tools/pip_package/build_pip_package %(builddir)s &&"
build_str += "pip install --no-deps --prefix %(builddir)s %(builddir)s/" + whl_file

cmds_map = [
('v%(version)s.tar.gz', build_str),
]

files_to_copy = [
(['%(builddir)s/' + whl_file], '%(installdir)s'),
(['%(builddir)s/bin'], '%(installdir)s'),
(['%(builddir)s/lib'], '%(installdir)s'),
]

sanity_check_paths={
'files': [whl_file],
'dirs': ['lib/python%(pyshortver)s/site-packages'],
}

modextrapaths = {
'PYTHONPATH' : 'lib/python%(pyshortver)s/site-packages',
}

moduleclass = 'devel'
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# This script provides answers to interactive ./configure and replaces paths for GCC and Binutils
# @author:
# Marcel Schoengens (CSCS)
# Guilherme Peretti-Pezzi (CSCS)
# Victor Holanda Rusu (CSCS)
diff --git a/configure-cscs.sh b/configure-cscs.sh
new file mode 100644
index 0000000..799fdbf
--- /dev/null
+++ b/configure-cscs.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+sed -i s\@'$EBROOTGCCCORE'@"$EBROOTGCCCORE"@g third_party/gpus/crosstool/CROSSTOOL.tpl
+sed -i s\@'$EBROOTBINUTILS'@"$EBROOTBINUTILS"@g third_party/gpus/crosstool/CROSSTOOL.tpl
+sed -i s\@'$EBROOTGCCCORE'@"$EBROOTGCCCORE"@g third_party/gpus/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc.tpl
+
+CONF_IN="configure.in"
+
+echo $EBROOTPYTHON"/bin/python" > $CONF_IN
+echo "-march=native" >> $CONF_IN
+echo "n" >> $CONF_IN
+echo "n" >> $CONF_IN
+echo "n" >> $CONF_IN
+echo "n" >> $CONF_IN
+echo $EBROOTPYTHON"/lib/python3.5/site-packages" >> $CONF_IN
+echo "n" >> $CONF_IN
+echo "n" >> $CONF_IN
+
+cat $CONF_IN
+echo "---"
+./configure < $CONF_IN
+
+exit
diff --git a/tensorflow/core/platform/default/build_config.bzl b/tensorflow/core/platform/default/build_config.bzl
index 48ef8df..be831d5 100644
--- a/tensorflow/core/platform/default/build_config.bzl
+++ b/tensorflow/core/platform/default/build_config.bzl
@@ -8,7 +8,7 @@ load("//tensorflow:tensorflow.bzl", "if_not_mobile")
WITH_GCP_SUPPORT = False
WITH_HDFS_SUPPORT = False
WITH_XLA_SUPPORT = False
-WITH_JEMALLOC = True
+WITH_JEMALLOC = False

# Appends a suffix to a list of deps.
def tf_deps(deps, suffix):
diff -ru tensorflow-1.0.0-orig/third_party/gpus/crosstool/CROSSTOOL.tpl tensorflow-1.0.0/third_party/gpus/crosstool/CROSSTOOL.tpl
--- tensorflow-1.0.0-orig/third_party/gpus/crosstool/CROSSTOOL.tpl 2017-02-11 07:33:43.000000000 +0100
+++ tensorflow-1.0.0/third_party/gpus/crosstool/CROSSTOOL.tpl 2017-03-28 19:17:42.743394544 +0200
@@ -42,10 +42,10 @@
target_system_name: "local"
toolchain_identifier: "local_linux"

- tool_path { name: "ar" path: "/usr/bin/ar" }
- tool_path { name: "compat-ld" path: "/usr/bin/ld" }
- tool_path { name: "cpp" path: "/usr/bin/cpp" }
- tool_path { name: "dwp" path: "/usr/bin/dwp" }
+ tool_path { name: "ar" path: "$EBROOTBINUTILS/bin/ar" }
+ tool_path { name: "compat-ld" path: "$EBROOTBINUTILS/bin/ld" }
+ tool_path { name: "cpp" path: "$EBROOTGCCCORE/bin/cpp" }
+ tool_path { name: "dwp" path: "$EBROOTBINUTILS/bin/dwp" }
# As part of the TensorFlow release, we place some cuda-related compilation
# files in @local_config_cuda//crosstool/clang/bin, and this relative
# path, combined with the rest of our Bazel configuration causes our
@@ -56,21 +56,23 @@
cxx_flag: "-std=c++11"
linker_flag: "-Wl,-no-as-needed"
linker_flag: "-lstdc++"
- linker_flag: "-B/usr/bin/"
+ linker_flag: "-B$EBROOTBINUTILS/bin/"
+# linker_flag: "-L$EBROOTGCCCORE/lib64/"
+ linker_flag: "-Wl,-rpath, $EBROOTGCCCORE/lib64/"

%{gcc_host_compiler_includes}
- tool_path { name: "gcov" path: "/usr/bin/gcov" }
+ tool_path { name: "gcov" path: "$EBROOTGCCCORE/bin/gcov" }

# C(++) compiles invoke the compiler (as that is the one knowing where
# to find libraries), but we provide LD so other rules can invoke the linker.
- tool_path { name: "ld" path: "/usr/bin/ld" }
+ tool_path { name: "ld" path: "$EBROOTBINUTILS/bin/ld" }

- tool_path { name: "nm" path: "/usr/bin/nm" }
- tool_path { name: "objcopy" path: "/usr/bin/objcopy" }
+ tool_path { name: "nm" path: "$EBROOTBINUTILS/bin/nm" }
+ tool_path { name: "objcopy" path: "$EBROOTBINUTILS/bin/objcopy" }
objcopy_embed_flag: "-I"
objcopy_embed_flag: "binary"
- tool_path { name: "objdump" path: "/usr/bin/objdump" }
- tool_path { name: "strip" path: "/usr/bin/strip" }
+ tool_path { name: "objdump" path: "$EBROOTBINUTILS/bin/objdump" }
+ tool_path { name: "strip" path: "$EBROOTBINUTILS/bin/strip" }

# Anticipated future default.
unfiltered_cxx_flag: "-no-canonical-prefixes"
diff -ru tensorflow-1.0.0-orig/third_party/gpus/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc.tpl tensorflow-1.0.0/third_party/gpus/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc.tpl
--- tensorflow-1.0.0-orig/third_party/gpus/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc.tpl 2017-02-11 07:33:43.000000000 +0100
+++ tensorflow-1.0.0/third_party/gpus/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc.tpl 2017-03-28 19:18:57.039063443 +0200
@@ -51,7 +51,7 @@

CURRENT_DIR = os.path.dirname(sys.argv[0])
NVCC_PATH = CURRENT_DIR + '/../../../cuda/bin/nvcc'
-LLVM_HOST_COMPILER_PATH = ('/usr/bin/gcc')
+LLVM_HOST_COMPILER_PATH = ('$EBROOTGCCCORE/bin/gcc')
PREFIX_DIR = os.path.dirname(GCC_HOST_COMPILER_PATH)
NVCC_VERSION = '%{cuda_version}'

Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# @author: marcelsc, gppezzi

easyblock = 'PythonPackage'

name = 'wheel'
version = '0.30.0a0'
versionsuffix = '-Python-%(pyver)s'

homepage = 'https://pypi.python.org/pypi/wheel'
description = """A built-package format for Python."""

toolchain = {'name': 'foss', 'version': '2016b'}

source_urls = [PYPI_SOURCE]
sources = [SOURCE_TAR_GZ]

dependencies = [
('Python', '3.5.2'),
]

sanity_check_paths = {
'files': ['bin/wheel'],
'dirs': ['lib/python%(pyshortver)s/site-packages'],
}

moduleclass = 'tools'