File tree Expand file tree Collapse file tree 5 files changed +57
-0
lines changed Expand file tree Collapse file tree 5 files changed +57
-0
lines changed Original file line number Diff line number Diff line change 1414
1515workspace (name = "zkir" )
1616
17+ load ("//bazel:zkir_deps.bzl" , "zkir_deps" )
18+
19+ zkir_deps ()
20+
1721load ("@bazel_tools//tools/build_defs/repo:http.bzl" , "http_archive" )
1822
1923LLVM_COMMIT = "f8287f6c373fcf993643dd6f0e30dde304c1be73"
Original file line number Diff line number Diff line change 1+ """
2+ This module configures dependencies for the ZKIR project.
3+ """
4+
5+ load ("//third_party/omp:omp_configure.bzl" , "omp_configure" )
6+
7+ def zkir_deps ():
8+ omp_configure (name = "local_config_omp" )
Original file line number Diff line number Diff line change 1+ load("@rules_cc//cc:defs.bzl", "cc_library")
2+
3+ package(default_visibility = ["//visibility:public"])
4+
5+ HEADERS = [
6+ "omp.h",
7+ "ompx.h",
8+ "omp-tools.h",
9+ "ompt.h",
10+ ]
11+
12+ # NOTE: This is only for macos.
13+ # On other platforms openmp should work without local config.
14+ genrule(
15+ name = "link_headers",
16+ outs = HEADERS,
17+ cmd = """
18+ mkdir -p $(@D)/
19+ for file in $(OUTS); do
20+ file=$${file##*/}
21+ ln -sf /opt/homebrew/opt/libomp/include/$$file $(@D)/$$file
22+ done
23+ """,
24+ )
25+
26+ cc_library(
27+ name = "omp",
28+ hdrs = HEADERS,
29+ include_prefix = "third_party/omp/include",
30+ includes = ["."],
31+ linkopts = [
32+ "-L/opt/homebrew/opt/libomp/lib",
33+ "-lomp",
34+ ],
35+ )
Original file line number Diff line number Diff line change 1+ """
2+ This module configures OpenMP for use with Bazel.
3+ """
4+
5+ def _omp_configure_impl (repository_ctx ):
6+ repository_ctx .symlink (Label ("//third_party/omp:omp.BUILD" ), "BUILD.bazel" )
7+
8+ omp_configure = repository_rule (
9+ implementation = _omp_configure_impl ,
10+ )
You can’t perform that action at this time.
0 commit comments