From aa02f7f3622dca8c7b03e745cdb8a10797f32f61 Mon Sep 17 00:00:00 2001 From: avijit-nervana Date: Thu, 23 Aug 2018 22:56:22 -0700 Subject: Updated build files --- third_party/ngraph/ngraph.BUILD | 8 ++--- third_party/ngraph/ngraph_tf.BUILD | 2 +- third_party/ngraph/tbb.BUILD | 72 +++++++++++++++++++++----------------- 3 files changed, 45 insertions(+), 37 deletions(-) (limited to 'third_party/ngraph') diff --git a/third_party/ngraph/ngraph.BUILD b/third_party/ngraph/ngraph.BUILD index f1cf8acbf6..3d9c3ac044 100644 --- a/third_party/ngraph/ngraph.BUILD +++ b/third_party/ngraph/ngraph.BUILD @@ -4,7 +4,7 @@ exports_files(["LICENSE"]) cc_library( name = "ngraph_headers", - hdrs = glob(["src/ngraph/**/*.hpp"]) , + hdrs = glob(["src/ngraph/**/*.hpp"]), visibility = ["//visibility:public"], ) @@ -102,7 +102,7 @@ cc_library( "-I external/nlohmann_json_lib/include/", '-D SHARED_LIB_EXT=\\".so\\"', '-D NGRAPH_VERSION=\\"0.5.0\\"', - '-D NGRAPH_DEX_ONLY', + "-D NGRAPH_DEX_ONLY", ], visibility = ["//visibility:public"], alwayslink = 1, @@ -124,8 +124,8 @@ cc_library( "src/ngraph/pass/*.hpp", "src/ngraph/runtime/*.cpp", "src/ngraph/type/*.cpp", - "src/ngraph/runtime/interpreter/*.cpp", - "src/ngraph/runtime/interpreter/*.hpp", + #"src/ngraph/runtime/interpreter/*.cpp", + #"src/ngraph/runtime/interpreter/*.hpp", ]), deps = [ ":ngraph_headers", diff --git a/third_party/ngraph/ngraph_tf.BUILD b/third_party/ngraph/ngraph_tf.BUILD index 0647d9926a..d0231e468e 100644 --- a/third_party/ngraph/ngraph_tf.BUILD +++ b/third_party/ngraph/ngraph_tf.BUILD @@ -71,7 +71,7 @@ tf_cc_test( ], extra_copts = [ "-fexceptions ", - "-D NGRAPH_EMBEDDED_IN_TENSORFLOW=1", + #"-D NGRAPH_EMBEDDED_IN_TENSORFLOW=1", "-I external/ngraph_tf/src", "-I external/ngraph_tf/logging", "-I external/ngraph/src", diff --git a/third_party/ngraph/tbb.BUILD b/third_party/ngraph/tbb.BUILD index c3e7f7fd35..7c760cb3b3 100644 --- a/third_party/ngraph/tbb.BUILD +++ b/third_party/ngraph/tbb.BUILD @@ -2,42 +2,50 @@ licenses(["notice"]) # 3-Clause BSD exports_files(["LICENSE"]) +# Taken from: https://github.com/rnburn/satyr/blob/master/bazel/tbb.BUILD +# License: MIT +# See: https://github.com/rnburn/satyr/blob/master/LICENSE + genrule( - name = "build_tbb", - srcs = glob(["**"]) + [ - "@local_config_cc//:toolchain", - ], - cmd = """ - set -e - WORK_DIR=$$PWD - DEST_DIR=$$PWD/$(@D) - export PATH=$$(dirname $(AR)):$$PATH - export CXXFLAGS=$(CC_FLAGS) - export NM=$(NM) - export AR=$(AR) - cd $$(dirname $(location :Makefile)) - - #TBB's build needs some help to figure out what compiler it's using - if $$CXX --version | grep clang &> /dev/null; then + name = "build_tbb", + srcs = glob(["**"]) + [ + "@local_config_cc//:toolchain", + ], + cmd = """ + set -e + WORK_DIR=$$PWD + DEST_DIR=$$PWD/$(@D) + export PATH=$$(dirname $(AR)):$$PATH + export CXXFLAGS=$(CC_FLAGS) + export NM=$(NM) + export AR=$(AR) + cd $$(dirname $(location :Makefile)) + + #TBB's build needs some help to figure out what compiler it's using + if $$CXX --version | grep clang &> /dev/null; then COMPILER_OPT="compiler=clang" - else - COMPILER_OPT="compiler=gcc" - fi + else + COMPILER_OPT="compiler=gcc" - # uses extra_inc=big_iron.inc to specify that static libraries are - # built. See https://software.intel.com/en-us/forums/intel-threading-building-blocks/topic/297792 - make tbb_build_prefix="build" \ + # # Workaround for TBB bug + # # See https://github.com/01org/tbb/issues/59 + # CXXFLAGS="$$CXXFLAGS -flifetime-dse=1" + fi + + # uses extra_inc=big_iron.inc to specify that static libraries are + # built. See https://software.intel.com/en-us/forums/intel-threading-building-blocks/topic/297792 + make tbb_build_prefix="build" \ extra_inc=big_iron.inc \ $$COMPILER_OPT; \ - echo cp build/build_{release,debug}/*.a $$DEST_DIR - cp build/build_{release,debug}/*.a $$DEST_DIR - cd $$WORK_DIR - """, - outs = [ - "libtbb.a", - "libtbbmalloc.a", - ] + echo cp build/build_{release,debug}/*.a $$DEST_DIR + cp build/build_{release,debug}/*.a $$DEST_DIR + cd $$WORK_DIR + """, + outs = [ + "libtbb.a", + "libtbbmalloc.a", + ], ) cc_library( @@ -45,8 +53,8 @@ cc_library( hdrs = glob([ "include/serial/**", "include/tbb/**/**", - ]), + ]), srcs = ["libtbb.a"], includes = ["include"], visibility = ["//visibility:public"], -) \ No newline at end of file +) -- cgit v1.2.3