Skip to content

Commit

Permalink
Fix weakdeps in Julia <1.9 with PackageExtensionsCompat
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergio Sánchez Ramírez committed Jul 3, 2024
1 parent 74d9d8e commit d2278e9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ CEnum = "fa961155-64e5-5f13-b03f-caf6b980ea82"
Cassette = "7057c7e9-c182-5462-911a-8362d720325c"
Enzyme = "7da242da-08ed-463a-9acd-ee780be4f1d9"
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
PackageExtensionCompat = "65ce6f38-6b18-4e1d-a461-8949797d7930"
Preferences = "21216c6a-2e73-6563-6e65-726566657250"
Reactant_jll = "0192cb87-2b54-54ad-80e0-3be72ad8a3c0"

Expand All @@ -32,6 +33,7 @@ CEnum = "0.4, 0.5"
Cassette = "0.3"
Enzyme = "0.11, 0.12"
NNlib = "0.9"
PackageExtensionCompat = "1"
Preferences = "1.4"
Reactant_jll = "0.0.11"
julia = "1"
5 changes: 5 additions & 0 deletions src/Reactant.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
module Reactant

using PackageExtensionCompat

include("mlir/MLIR.jl")
include("XLA.jl")
include("utils.jl")
Expand Down Expand Up @@ -884,6 +886,9 @@ end

const registry = Ref{MLIR.IR.DialectRegistry}()
function __init__()
# PackageExtensionCompat: required for weakdeps to work in Julia <1.9
@require_extensions

registry[] = MLIR.IR.DialectRegistry()
@ccall MLIR.API.mlir_c.InitializeRegistryAndPasses(
registry[]::MLIR.API.MlirDialectRegistry
Expand Down

0 comments on commit d2278e9

Please sign in to comment.