Bazel

Mon 11 June 2018


How to create a system system library dependency

new_local_repository(  
    name = "python_linux",
    path = "/usr",
    build_file_content = """
cc_library(  
    name = "python35-lib",
    srcs = ["lib/python3.5/config-3.5m-x86_64-linux-gnu/libpython3.5.so"],
    hdrs = glob(["include/python3.5/*.h"]),
    includes = ["include/python3.5"],
    visibility = ["//visibility:public"]
)
    """
)

Link against a system library

  cc_binary(
      name = "mpi",
      srcs = ["mpi.cc"],
    includes = ["/usr"],
    linkopts = [
        "-fopenmp",
    ],
    deps = [
        "@com_github_glog_glog//:glog",
    ],
)