github.com/alwaysproblem/mlserving-tutorial@v0.0.0-20221124033215-121cfddbfbf4/TFserving/CustomOp/custom-op/add_index/BUILD (about) 1 licenses(["notice"]) # Apache 2.0 2 3 package(default_visibility = ["//visibility:public"]) 4 5 config_setting( 6 name = "windows", 7 constraint_values = ["@bazel_tools//platforms:windows"], 8 ) 9 10 cc_binary( 11 name = 'python/ops/_add_index_ops.so', 12 srcs = [ 13 "cc/kernels/add_index_kernels.cc", 14 "cc/ops/add_index_ops.cc", 15 ], 16 linkshared = 1, 17 deps = [ 18 "@local_config_tf//:libtensorflow_framework", 19 "@local_config_tf//:tf_header_lib", 20 ], 21 features = select({ 22 ":windows": ["windows_export_all_symbols"], 23 "//conditions:default": [], 24 }), 25 # note: here, if compile with 2.10 need to confirm that '-std=c++17' 26 copts = select({ 27 ":windows": ["/DEIGEN_STRONG_INLINE=inline", "-DTENSORFLOW_MONOLITHIC_BUILD", "/DPLATFORM_WINDOWS", "/DEIGEN_HAS_C99_MATH", "/DTENSORFLOW_USE_EIGEN_THREADPOOL", "/DEIGEN_AVOID_STL_ARRAY", "/Iexternal/gemmlowp", "/wd4018", "/wd4577", "/DNOGDI", "/UTF_COMPILE_LIBRARY"], 28 "//conditions:default": ["-pthread", "-std=c++17",], 29 }), 30 ) 31 32 py_library( 33 name = "add_index_ops_py", 34 srcs = ([ 35 "python/ops/add_index_ops.py", 36 ]), 37 data = [ 38 ":python/ops/_add_index_ops.so" 39 ], 40 srcs_version = "PY2AND3", 41 ) 42 43 py_test( 44 name = "add_index_ops_py_test", 45 srcs = [ 46 "python/ops/add_index_ops_test.py" 47 ], 48 main = "python/ops/add_index_ops_test.py", 49 deps = [ 50 ":add_index_ops_py", 51 ], 52 srcs_version = "PY2AND3", 53 ) 54 55 py_library( 56 name = "add_index_py", 57 srcs = ([ 58 "__init__.py", 59 "python/__init__.py", 60 "python/ops/__init__.py", 61 ]), 62 deps = [ 63 ":add_index_ops_py" 64 ], 65 srcs_version = "PY2AND3", 66 )