From 5fb4696f2c290d86aab03fcc8358d55eacd0e174 Mon Sep 17 00:00:00 2001 From: Matt Fishman Date: Sat, 19 Oct 2024 22:02:31 -0400 Subject: [PATCH] [ITensorsPackageCompilerExt] Superseding indictment of ITensorsPackageCompilerExt (#1550) --- Project.toml | 2 +- .../ITensorsPackageCompilerExt.jl | 1 - src/packagecompile/compile.jl | 6 ------ test/Project.toml | 1 + test/ext/ITensorsPackageCompilerExt/Project.toml | 4 ++++ test/ext/ITensorsPackageCompilerExt/runtests.jl | 10 ++++++++++ test/runtests.jl | 1 + 7 files changed, 17 insertions(+), 8 deletions(-) create mode 100644 test/ext/ITensorsPackageCompilerExt/Project.toml create mode 100644 test/ext/ITensorsPackageCompilerExt/runtests.jl diff --git a/Project.toml b/Project.toml index a4f511869b..f7f9e50b0a 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "ITensors" uuid = "9136182c-28ba-11e9-034c-db9fb085ebd5" authors = ["Matthew Fishman ", "Miles Stoudenmire "] -version = "0.6.21" +version = "0.6.22" [deps] Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" diff --git a/ext/ITensorsPackageCompilerExt/ITensorsPackageCompilerExt.jl b/ext/ITensorsPackageCompilerExt/ITensorsPackageCompilerExt.jl index 78b7166e74..3bb7b57ac1 100644 --- a/ext/ITensorsPackageCompilerExt/ITensorsPackageCompilerExt.jl +++ b/ext/ITensorsPackageCompilerExt/ITensorsPackageCompilerExt.jl @@ -1,4 +1,3 @@ module ITensorsPackageCompilerExt include("compile.jl") -include("precompile_itensors.jl") end diff --git a/src/packagecompile/compile.jl b/src/packagecompile/compile.jl index 0034ab0971..093e73dac3 100644 --- a/src/packagecompile/compile.jl +++ b/src/packagecompile/compile.jl @@ -40,12 +40,6 @@ function compile(; backend=Algorithm"PackageCompiler"(), kwargs...) return compile(backend; kwargs...) end -function compile(::Algorithm; kwargs...) - return error( - "As of ITensors v0.5, you must install `PackageCompiler.jl` (`using Pkg: Pkg; Pkg.add(\"PackageCompiler\")`) and execute `using PackageCompiler` to use `ITensors.compile`.", - ) -end - @doc """ ITensors.compile(; dir = "$(default_compile_dir())", filename = "$(default_compile_filename())") diff --git a/test/Project.toml b/test/Project.toml index 48b6cfc79e..509e3a49f0 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -12,6 +12,7 @@ KrylovKit = "0b1a1467-8014-51b9-945f-bf0ae24f4b77" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" NDTensors = "23ae76d9-e61a-49c4-8f12-3f1a16adf9cf" OptimKit = "77e91f04-9b3b-57a6-a776-40b61faaebe0" +PackageCompiler = "9b87118b-4619-50d2-8e1e-99f35a4d4d9d" Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" QuadGK = "1fd47b50-473d-5c70-9696-f719f8f3bcdc" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" diff --git a/test/ext/ITensorsPackageCompilerExt/Project.toml b/test/ext/ITensorsPackageCompilerExt/Project.toml new file mode 100644 index 0000000000..9b60c20322 --- /dev/null +++ b/test/ext/ITensorsPackageCompilerExt/Project.toml @@ -0,0 +1,4 @@ +[deps] +ITensors = "9136182c-28ba-11e9-034c-db9fb085ebd5" +PackageCompiler = "9b87118b-4619-50d2-8e1e-99f35a4d4d9d" +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" diff --git a/test/ext/ITensorsPackageCompilerExt/runtests.jl b/test/ext/ITensorsPackageCompilerExt/runtests.jl new file mode 100644 index 0000000000..08cae7400b --- /dev/null +++ b/test/ext/ITensorsPackageCompilerExt/runtests.jl @@ -0,0 +1,10 @@ +@eval module $(gensym()) +using ITensors: ITensors +using PackageCompiler: PackageCompiler +using Test: @testset, @test +@testset "ITensorsPackageCompilerExt" begin + # Testing `ITensors.compile` would take too long so we just check + # that `ITensorsPackageCompilerExt` overloads `ITensors.compile`. + @test hasmethod(ITensors.compile, Tuple{ITensors.Algorithm"PackageCompiler"}) +end +end diff --git a/test/runtests.jl b/test/runtests.jl index 60782dca54..88af73a005 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -20,6 +20,7 @@ ITensors.disable_threaded_blocksparse() "threading", "lib/ContractionSequenceOptimization", "ext/ITensorsChainRulesCoreExt", + "ext/ITensorsPackageCompilerExt", "ext/ITensorsVectorInterfaceExt", ] @time for dir in dirs