From e11c5e1b48ec66d0f4fc512618beb1f41f266d5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20S=C3=A1nchez=20Ram=C3=ADrez?= Date: Fri, 13 Dec 2024 15:29:28 +0100 Subject: [PATCH] hardcode julia dep --- deps/ReactantExtra/BUILD | 4 +++- deps/ReactantExtra/WORKSPACE | 3 +++ deps/ReactantExtra/third_party/julia/BUILD | 0 deps/ReactantExtra/third_party/julia/julia.BUILD | 10 ++++++++++ deps/ReactantExtra/third_party/julia/workspace.bzl | 9 +++++++++ .../libcxxwrap_julia/libcxxwrap_julia.BUILD | 6 +++++- 6 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 deps/ReactantExtra/third_party/julia/BUILD create mode 100644 deps/ReactantExtra/third_party/julia/julia.BUILD create mode 100644 deps/ReactantExtra/third_party/julia/workspace.bzl diff --git a/deps/ReactantExtra/BUILD b/deps/ReactantExtra/BUILD index 6cf250ac6..b265b69b4 100644 --- a/deps/ReactantExtra/BUILD +++ b/deps/ReactantExtra/BUILD @@ -377,7 +377,9 @@ cc_library( "-Werror=return-type", "-Werror=unused-result", "-Wno-error=stringop-truncation", - # "-I$(location @libcxxwrap_julia//:include)" + # "-I$(location @libcxxwrap_julia//:include)", + "-Iexternal/libcxxwrap_julia/include/", + "-Iexternal/julia/include/julia/", ], alwayslink = True, linkstatic = True, diff --git a/deps/ReactantExtra/WORKSPACE b/deps/ReactantExtra/WORKSPACE index a8c606a99..9ed0b83b0 100644 --- a/deps/ReactantExtra/WORKSPACE +++ b/deps/ReactantExtra/WORKSPACE @@ -2,6 +2,9 @@ workspace(name = "Reactant") load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") +load("//third_party/julia:workspace.bzl", julia_workspace = "repo") +julia_workspace() + load("//third_party/libcxxwrap_julia:workspace.bzl", libcxxwrap_julia_workspace = "repo") libcxxwrap_julia_workspace() diff --git a/deps/ReactantExtra/third_party/julia/BUILD b/deps/ReactantExtra/third_party/julia/BUILD new file mode 100644 index 000000000..e69de29bb diff --git a/deps/ReactantExtra/third_party/julia/julia.BUILD b/deps/ReactantExtra/third_party/julia/julia.BUILD new file mode 100644 index 000000000..7df4ebe20 --- /dev/null +++ b/deps/ReactantExtra/third_party/julia/julia.BUILD @@ -0,0 +1,10 @@ +licenses(["notice"]) + +package(default_visibility = ["//visibility:public"]) + +cc_import( + name = "julia", + hdrs = glob(["include/**/*"]), + includes = ["include"], + shared_library = "lib/libjulia.dylib", +) diff --git a/deps/ReactantExtra/third_party/julia/workspace.bzl b/deps/ReactantExtra/third_party/julia/workspace.bzl new file mode 100644 index 000000000..019e52d1a --- /dev/null +++ b/deps/ReactantExtra/third_party/julia/workspace.bzl @@ -0,0 +1,9 @@ +"""Loads julia.""" + +def repo(): + # TODO change this to download the real artifacts or build them from source? + native.new_local_repository( + name = "julia", + path = "/Users/mofeing/.julia/juliaup/julia-1.11.2+0.aarch64.apple.darwin14/", + build_file = "//third_party/julia:julia.BUILD", + ) diff --git a/deps/ReactantExtra/third_party/libcxxwrap_julia/libcxxwrap_julia.BUILD b/deps/ReactantExtra/third_party/libcxxwrap_julia/libcxxwrap_julia.BUILD index 6c4bd3f2c..1c9dba4fe 100644 --- a/deps/ReactantExtra/third_party/libcxxwrap_julia/libcxxwrap_julia.BUILD +++ b/deps/ReactantExtra/third_party/libcxxwrap_julia/libcxxwrap_julia.BUILD @@ -5,7 +5,11 @@ package(default_visibility = ["//visibility:public"]) cc_import( name = "libcxxwrap_julia", - hdrs = glob(["include/jlcxx/*.hpp"]), + hdrs = glob(["include/**/*.hpp"]), + includes = ["include"], shared_library = "lib/libcxxwrap_julia.dylib", visibility = ["//visibility:public"], + deps = [ + "@julia", + ], )