1load("//third_party:glog.buck.bzl", "define_glog") 2load("//third_party:xnnpack.buck.bzl", "define_xnnpack") 3load("//third_party:kineto.buck.bzl", "define_kineto") 4load("//:buckbuild.bzl", "third_party") 5 6define_glog() 7 8define_xnnpack(third_party) 9 10define_kineto() 11 12# a placeholder for libraries that are not implemented in OSS 13cxx_library( 14 name = "no-op", 15 visibility = ['PUBLIC'], 16) 17 18cxx_library( 19 name = "rt", 20 exported_platform_linker_flags = [ 21 ("^linux-.*$", ["-lrt"]), 22 ], 23 visibility = ['PUBLIC'], 24) 25 26cxx_library( 27 name = "fmt", 28 srcs = ['fmt/src/format.cc'], 29 deps = [], 30 compiler_flags = ['-w', '-Wno-error=format-zero-length', '-Wno-error=vla', '-Wno-incompatible-pointer-types-discards-qualifiers', '-Wno-unused-label', '-Wno-deprecated-declarations', '-Wno-implicit-function-declaration', '-Wno-error', '-Wno-non-pod-varargs', '-Wno-format-security', '-Wno-c++11-narrowing', '-Wno-ignored-attributes', '-Wno-return-std-move', '-Wno-shadow', '-Wno-sign-compare', '-Wno-switch', '-Wno-undef', '-Wno-uninitialized', '-Wno-unknown-pragmas', '-Wno-unknown-warning-option', '-Wno-unused-function', '-Wno-unused-local-typedef', '-Wno-unused-value', '-Wno-unused-variable', '-Wno-register', '-Wno-format', '-Wno-unused-lambda-capture', '-Wno-missing-braces', '-Wno-unused-parameter', '-Wno-unreachable-code', '-Wno-inconsistent-missing-destructor-override', '-Wno-implicit-fallthrough', '-Wno-ignored-qualifiers', '-Wno-pedantic', '-Wno-deprecated-copy', '-Wno-non-virtual-dtor', '-Wno-null-pointer-arithmetic', '-Wno-implicit-const-int-float-conversion', '-Wno-tautological-unsigned-enum-zero-compare', '-Wno-embedded-directive', '-Wno-int-conversion', '-Wno-nonnull', '-Wno-variadic-macros', '-Wno-zero-length-array', '-Wno-missing-prototypes', '-fno-exceptions', '-fno-rtti', '-Wno-braced-scalar-init', '-fvisibility-inlines-hidden'], 31 preferred_linkage = "static", 32 exported_preprocessor_flags = ['-DFMT_EXCEPTIONS=0'], 33 header_namespace = "third_party/fmt", 34 public_system_include_directories = ['fmt/include'], 35 raw_headers = glob(["fmt/include/fmt/*.h"]), 36 soname = "libthird-party_fmt_fmt.$(ext)", 37 visibility = ['PUBLIC'], 38) 39 40cxx_library( 41 name = "pthreadpool", 42 srcs = ['pthreadpool/src/legacy-api.c', 'pthreadpool/src/memory.c', 'pthreadpool/src/portable-api.c', 'pthreadpool/src/pthreads.c'], 43 deps = [ 44 ":FXdiv", 45 ":pthreadpool_header", 46 ], 47 compiler_flags = [ 48 "-w", 49 "-Os", 50 "-fstack-protector-strong", 51 "-fno-delete-null-pointer-checks" 52 ], 53 headers = { 54 'threadpool-atomics.h': 'pthreadpool/src/threadpool-atomics.h', 55 'threadpool-common.h': 'pthreadpool/src/threadpool-common.h', 56 'threadpool-object.h': 'pthreadpool/src/threadpool-object.h', 57 'threadpool-utils.h': 'pthreadpool/src/threadpool-utils.h', 58 }, 59 header_namespace = "", 60 preferred_linkage = "static", 61 link_whole = False, 62 platform_preprocessor_flags = [['windows', ['-D_WINDOWS', '-D_WIN32', '-DWIN32', '-DNOMINMAX', '-D_CRT_SECURE_NO_WARNINGS', '-D_USE_MATH_DEFINES']], ['windows.*64$', ['-D_WIN64']]], 63 preprocessor_flags = ['-DPTHREADPOOL_USE_FUTEX=0', '-DPTHREADPOOL_USE_GCD=0'], 64 reexport_all_header_dependencies = True, 65 visibility = ['PUBLIC'], 66) 67 68cxx_library( 69 name = "pthreadpool_header", 70 header_namespace = "", 71 exported_headers = { 72 "pthreadpool.h": "pthreadpool/include/pthreadpool.h", 73 }, 74 reexport_all_header_dependencies = True, 75 visibility = ["PUBLIC"], 76) 77 78cxx_library( 79 name = "pocketfft_header", 80 header_namespace = "", 81 exported_headers = { 82 "pocketfft_hdronly.h": "pocketfft/pocketfft_hdronly.h", 83 }, 84 reexport_all_header_dependencies = True, 85 visibility = ["PUBLIC"], 86) 87 88cxx_library( 89 name = "FXdiv", 90 header_namespace = "", 91 exported_headers = { 92 "fxdiv.h": "FXdiv/include/fxdiv.h", 93 }, 94 reexport_all_header_dependencies = True, 95 visibility = ["PUBLIC"], 96) 97 98cxx_library( 99 name = "psimd", 100 header_namespace = "", 101 exported_headers = { 102 "psimd.h": "psimd/include/psimd.h", 103 }, 104 preferred_linkage = "static", 105 visibility = ["PUBLIC"], 106) 107 108cxx_library( 109 name = "cpuinfo", 110 srcs = [ 111 "cpuinfo/wrappers/api.c", 112 "cpuinfo/wrappers/arm/android/properties.c", 113 "cpuinfo/wrappers/arm/cache.c", 114 "cpuinfo/wrappers/arm/linux/aarch32-isa.c", 115 "cpuinfo/wrappers/arm/linux/aarch64-isa.c", 116 "cpuinfo/wrappers/arm/linux/chipset.c", 117 "cpuinfo/wrappers/arm/linux/clusters.c", 118 "cpuinfo/wrappers/arm/linux/cpuinfo.c", 119 "cpuinfo/wrappers/arm/linux/hwcap.c", 120 "cpuinfo/wrappers/arm/linux/init.c", 121 "cpuinfo/wrappers/arm/linux/midr.c", 122 "cpuinfo/wrappers/arm/mach/init.c", 123 "cpuinfo/wrappers/arm/uarch.c", 124 "cpuinfo/wrappers/cache.c", 125 "cpuinfo/wrappers/init.c", 126 "cpuinfo/wrappers/linux/cpulist.c", 127 "cpuinfo/wrappers/linux/multiline.c", 128 "cpuinfo/wrappers/linux/processors.c", 129 "cpuinfo/wrappers/linux/smallfile.c", 130 "cpuinfo/wrappers/log.c", 131 "cpuinfo/wrappers/mach/topology.c", 132 "cpuinfo/wrappers/x86/cache/descriptor.c", 133 "cpuinfo/wrappers/x86/cache/deterministic.c", 134 "cpuinfo/wrappers/x86/cache/init.c", 135 "cpuinfo/wrappers/x86/info.c", 136 "cpuinfo/wrappers/x86/init.c", 137 "cpuinfo/wrappers/x86/isa.c", 138 "cpuinfo/wrappers/x86/linux/cpuinfo.c", 139 "cpuinfo/wrappers/x86/linux/init.c", 140 "cpuinfo/wrappers/x86/mach/init.c", 141 "cpuinfo/wrappers/x86/name.c", 142 "cpuinfo/wrappers/x86/topology.c", 143 "cpuinfo/wrappers/x86/uarch.c", 144 "cpuinfo/wrappers/x86/vendor.c", 145 "cpuinfo/wrappers/x86/windows/init.c", 146 ], 147 include_directories = ["cpuinfo/src"], 148 public_include_directories = ["cpuinfo/include"], 149 raw_headers = glob([ 150 "cpuinfo/src/**/*.h", 151 "cpuinfo/src/**/*.c", 152 ]), 153 preferred_linkage = "static", 154 preprocessor_flags = [ 155 "-DCPUINFO_LOG_LEVEL=2", 156 "-D_GNU_SOURCE=1", 157 ], 158 visibility = ["PUBLIC"], 159 deps = [ 160 ":clog", 161 ], 162) 163 164cxx_library( 165 name = "clog", 166 srcs = [ 167 "cpuinfo/deps/clog/src/clog.c", 168 ], 169 raw_headers = glob([ 170 "cpuinfo/deps/clog/include/*.h", 171 ]), 172 public_include_directories = [ 173 "cpuinfo/deps/clog/include/", 174 ], 175 force_static = True, 176 visibility = ["PUBLIC"], 177) 178 179cxx_library( 180 name = "FP16", 181 raw_headers = glob([ 182 "FP16/include/*.h", 183 ]), 184 public_include_directories = [ 185 "FP16/include/", 186 ], 187 force_static = True, 188 visibility = ["PUBLIC"], 189) 190 191 192cxx_library( 193 name = "miniz", 194 srcs = ["miniz-2.1.0/miniz.c"], 195 header_namespace = "", 196 exported_headers = {"miniz.h": "miniz-2.1.0/miniz.h"}, 197 exported_preprocessor_flags = [ 198 "-DMINIZ_DISABLE_ZIP_READER_CRC32_CHECKS", 199 ], 200 visibility = ["PUBLIC"], 201) 202 203remote_file( 204 name = "typing-extensions-download", 205 url = "https://files.pythonhosted.org/packages/75/e1/932e06004039dd670c9d5e1df0cd606bf46e29a28e65d5bb28e894ea29c9/typing_extensions-4.2.0-py3-none-any.whl", 206 sha1 = "ff0849420e94f425818bff5d0f25e3cdfaba8601", 207 out = "typing_extensions-4.2.0-py3-none-any.whl", 208) 209 210prebuilt_python_library( 211 name = "typing-extensions", 212 binary_src = ":typing-extensions-download", 213 visibility = ["PUBLIC"], 214 deps = [":typing-extensions-download"], 215) 216 217remote_file( 218 name = "pyyaml-download", 219 url = "https://files.pythonhosted.org/packages/12/fc/a4d5a7554e0067677823f7265cb3ae22aed8a238560b5133b58cda252dad/PyYAML-6.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", 220 sha1 = "11aa9c5fe2d890b6a73212beadc7c8a4265ebc39", 221 out = "pyyaml.whl", 222) 223 224prebuilt_python_library( 225 name = "pyyaml", 226 binary_src = ":pyyaml-download", 227 visibility = ["PUBLIC"], 228 deps = [":pyyaml-download"], 229) 230 231cxx_library( 232 name = "ruy_lib", 233 srcs = glob( 234 ["ruy/**/*.cc"], 235 exclude = [ 236 "ruy/ruy/test_*.cc", 237 "ruy/ruy/*_test.cc", 238 "ruy/example/*.cc", 239 "ruy/ruy/profiler/test.cc", 240 "ruy/ruy/benchmark.cc", 241 ], 242 ), 243 compiler_flags = ["-Os"], 244 preferred_linkage = "static", 245 public_include_directories = ["ruy"], 246 raw_headers = glob(["ruy/**/*.h"]), 247 visibility = [ 248 "PUBLIC", 249 ], 250) 251 252cxx_library( 253 name = "flatbuffers-api", 254 public_include_directories = ["flatbuffers/include"], 255 raw_headers = [ 256 "flatbuffers/include/flatbuffers/base.h", 257 "flatbuffers/include/flatbuffers/flatbuffers.h", 258 "flatbuffers/include/flatbuffers/stl_emulation.h", 259 ], 260 preferred_linkage = "static", 261 visibility = ["PUBLIC"], 262) 263 264cxx_library( 265 name = "flatc_library", 266 srcs = [ 267 "flatbuffers/src/code_generators.cpp", 268 "flatbuffers/src/flatc.cpp", 269 "flatbuffers/src/idl_gen_fbs.cpp", 270 "flatbuffers/src/idl_gen_text.cpp", 271 "flatbuffers/src/idl_parser.cpp", 272 "flatbuffers/src/reflection.cpp", 273 "flatbuffers/src/util.cpp", 274 ], 275 public_include_directories = [ 276 "flatbuffers/grpc", 277 "flatbuffers/include", 278 ], 279 raw_headers = [ 280 "flatbuffers/include/flatbuffers/flatc.h", 281 "flatbuffers/include/flatbuffers/base.h", 282 "flatbuffers/include/flatbuffers/flatbuffers.h", 283 "flatbuffers/include/flatbuffers/stl_emulation.h", 284 "flatbuffers/include/flatbuffers/code_generators.h", 285 "flatbuffers/include/flatbuffers/flexbuffers.h", 286 "flatbuffers/include/flatbuffers/hash.h", 287 "flatbuffers/include/flatbuffers/idl.h", 288 "flatbuffers/include/flatbuffers/minireflect.h", 289 "flatbuffers/include/flatbuffers/reflection.h", 290 "flatbuffers/include/flatbuffers/reflection_generated.h", 291 "flatbuffers/include/flatbuffers/util.h", 292 ], 293 preferred_linkage = "static", 294 visibility = ["PUBLIC"], 295) 296 297cxx_binary( 298 name = "flatc", 299 srcs = [ 300 "flatbuffers/grpc/src/compiler/cpp_generator.cc", 301 "flatbuffers/grpc/src/compiler/go_generator.cc", 302 "flatbuffers/grpc/src/compiler/java_generator.cc", 303 "flatbuffers/grpc/src/compiler/python_generator.cc", 304 "flatbuffers/grpc/src/compiler/swift_generator.cc", 305 "flatbuffers/grpc/src/compiler/ts_generator.cc", 306 "flatbuffers/src/annotated_binary_text_gen.cpp", 307 "flatbuffers/src/binary_annotator.cpp", 308 "flatbuffers/src/bfbs_gen_lua.cpp", 309 "flatbuffers/src/bfbs_gen_nim.cpp", 310 "flatbuffers/src/flatc_main.cpp", 311 "flatbuffers/src/idl_gen_binary.cpp", 312 "flatbuffers/src/idl_gen_cpp.cpp", 313 "flatbuffers/src/idl_gen_csharp.cpp", 314 "flatbuffers/src/idl_gen_dart.cpp", 315 "flatbuffers/src/idl_gen_go.cpp", 316 "flatbuffers/src/idl_gen_grpc.cpp", 317 "flatbuffers/src/idl_gen_java.cpp", 318 "flatbuffers/src/idl_gen_ts.cpp", # idl_gen_js_ts.cpp in fbsource 319 "flatbuffers/src/idl_gen_json_schema.cpp", 320 "flatbuffers/src/idl_gen_kotlin.cpp", 321 "flatbuffers/src/idl_gen_lobster.cpp", 322 "flatbuffers/src/idl_gen_lua.cpp", 323 "flatbuffers/src/idl_gen_php.cpp", 324 "flatbuffers/src/idl_gen_python.cpp", 325 "flatbuffers/src/idl_gen_rust.cpp", 326 "flatbuffers/src/idl_gen_swift.cpp", 327 "flatbuffers/src/idl_gen_text.cpp", 328 "flatbuffers/src/util.cpp", 329 ], 330 include_directories = [ 331 "flatbuffers/grpc", 332 "flatbuffers/include", 333 ], 334 raw_headers = [ 335 "flatbuffers/grpc/src/compiler/cpp_generator.h", 336 "flatbuffers/grpc/src/compiler/go_generator.h", 337 "flatbuffers/grpc/src/compiler/java_generator.h", 338 "flatbuffers/grpc/src/compiler/python_generator.h", 339 "flatbuffers/grpc/src/compiler/schema_interface.h", 340 "flatbuffers/grpc/src/compiler/swift_generator.h", 341 "flatbuffers/grpc/src/compiler/ts_generator.h", 342 ], 343 visibility = ["PUBLIC"], 344 deps = [":flatc_library"], 345) 346 347cxx_library( 348 name = "gtest_headers", 349 exported_preprocessor_flags = [ 350 "-DGTEST_USE_OWN_TR1_TUPLE=0", 351 "-DGTEST_HAS_TR1_TUPLE=0", 352 "-D_CRT_DECLARE_NONSTDC_NAMES", 353 "-D_CRT_NONSTDC_NO_WARNINGS", 354 "-D_CRT_NONSTDC_NO_DEPRECATE", 355 ], 356 include_directories = [ 357 "googletest/googletest", 358 ], 359 public_system_include_directories = [ 360 "googletest/googletest/include", 361 ], 362 raw_headers = glob([ 363 "googletest/googletest/src/**/*.h", 364 "googletest/googletest/include/**/*.h", 365 ]), 366 visibility = [ 367 "PUBLIC", 368 ], 369) 370 371cxx_library( 372 name = "gtest", 373 srcs = [ 374 "googletest/googletest/src/gtest-all.cc", 375 "googletest/googletest/src/gtest_main.cc", 376 ], 377 include_directories = [ 378 "googletest/googletest", 379 ], 380 raw_headers = glob([ 381 "googletest/googletest/src/**/*.cc", 382 "googletest/googletest/src/**/*.h", 383 ]), 384 visibility = [ 385 "PUBLIC", 386 ], 387 exported_deps = [ 388 ":gtest_headers", 389 ], 390) 391 392cxx_library( 393 name = "gmock", 394 srcs = [ 395 "googletest/googlemock/src/gmock-all.cc", 396 ], 397 include_directories = [ 398 "googletest/googlemock", 399 ], 400 public_system_include_directories = [ 401 "googletest/googlemock/include", 402 ], 403 raw_headers = glob([ 404 "googletest/googlemock/include/**/*.h", 405 "googletest/googlemock/src/**/*.cc", 406 ]), 407 visibility = ["PUBLIC"], 408 deps = [ 409 ":gtest", 410 ], 411 exported_deps = [ 412 ":gtest_headers", 413 ], 414) 415