ITensors.jl icon indicating copy to clipboard operation
ITensors.jl copied to clipboard

[ITensors] [BUG] Precompilation fails on main when developing ITensors.jl

Open jtschneider opened this issue 3 years ago • 5 comments

Description of bug

I am a bit puzzled as to why this fails but when try to develop ITensors.jl and compiling the module from a fresh installation.

Minimal code demonstrating the bug or unexpected behavior

Minimal non-runnable code

julia> ]

(@v1.7) pkg> dev ITensors
     Cloning git-repo `https://github.com/ITensor/ITensors.jl.git`
   Resolving package versions...
    Updating `~/.julia/environments/v1.7/Project.toml`
  [9136182c] ~ ITensors v0.3.10 ⇒ v0.3.10 `~/.julia/dev/ITensors`
    Updating `~/.julia/environments/v1.7/Manifest.toml`
  [9136182c] ~ ITensors v0.3.10 ⇒ v0.3.10 `~/.julia/dev/ITensors`

shell> cd 
/home/jan

shell> cd .julia/dev/ITensors/
/home/jan/.julia/dev/ITensors

(@v1.7) pkg> activate .

(ITensors) pkg> update
    Updating registry at `~/.julia/registries/General.toml`
    Updating `~/.julia/dev/ITensors/Project.toml`
  [c3b6d118] + BitIntegers v0.2.6
  [d360d2e6] + ChainRulesCore v1.14.0
  [34da2185] + Compat v3.43.0
  [85a47980] + Dictionaries v0.3.20
  [f67ccb44] + HDF5 v0.15.7
  [28f27b66] + IsApprox v0.1.4
  [0b1a1467] + KrylovKit v0.5.4
  [7a12625a] + LinearMaps v3.6.1
  [23ae76d9] + NDTensors v0.1.37
  [9b87118b] + PackageCompiler v2.0.5
  [ae029012] + Requires v1.3.0
  [d3ce8812] + SerializedElementArrays v0.1.0
  [90137ffa] + StaticArrays v1.4.4
  [5e0ebb24] + Strided v1.2.2
  [a759f4b9] + TimerOutputs v0.5.18
  [9d95972d] + TupleTools v1.3.0
  [bd1ec220] + Zeros v0.3.0
  [700de1a5] + ZygoteRules v0.2.2
    Updating `~/.julia/dev/ITensors/Manifest.toml`
  [c3b6d118] + BitIntegers v0.2.6
  [a74b3585] + Blosc v0.7.3
  [d360d2e6] + ChainRulesCore v1.14.0
  [34da2185] + Compat v3.43.0
  [85a47980] + Dictionaries v0.3.20
  [e2ba6199] + ExprTools v0.1.8
  [f67ccb44] + HDF5 v0.15.7
  [313cdc1a] + Indexing v1.1.1
  [28f27b66] + IsApprox v0.1.4
  [692b3bcd] + JLLWrappers v1.4.1
  [0b1a1467] + KrylovKit v0.5.4
  [7a12625a] + LinearMaps v3.6.1
  [1914dd2f] + MacroTools v0.5.9
  [23ae76d9] + NDTensors v0.1.37
  [9b87118b] + PackageCompiler v2.0.5
  [21216c6a] + Preferences v1.3.0
  [05181044] + RelocatableFolders v0.1.3
  [ae029012] + Requires v1.3.0
  [6c6a2e73] + Scratch v1.1.0
  [d3ce8812] + SerializedElementArrays v0.1.0
  [90137ffa] + StaticArrays v1.4.4
  [5e0ebb24] + Strided v1.2.2
  [a759f4b9] + TimerOutputs v0.5.18
  [9d95972d] + TupleTools v1.3.0
  [bd1ec220] + Zeros v0.3.0
  [700de1a5] + ZygoteRules v0.2.2
  [0b7ba130] + Blosc_jll v1.21.1+0
  [0234f1f7] + HDF5_jll v1.12.1+0
  [5ced341a] + Lz4_jll v1.9.3+0
  [458c3c95] + OpenSSL_jll v1.1.14+0
  [3161d3a3] + Zstd_jll v1.5.2+0
  [0dad84c5] + ArgTools
  [56f22d72] + Artifacts
  [2a0f44e3] + Base64
  [ade2ca70] + Dates
  [8bb1440f] + DelimitedFiles
  [8ba89e20] + Distributed
  [f43a241f] + Downloads
  [b77e0a4c] + InteractiveUtils
  [4af54fe1] + LazyArtifacts
  [b27032c2] + LibCURL
  [76f85450] + LibGit2
  [8f399da3] + Libdl
  [37e2e46d] + LinearAlgebra
  [56ddb016] + Logging
  [d6f4376e] + Markdown
  [a63ad114] + Mmap
  [ca575930] + NetworkOptions
  [44cfe95a] + Pkg
  [de0858da] + Printf
  [3fa0cd96] + REPL
  [9a3f8284] + Random
  [ea8e919c] + SHA
  [9e88b42a] + Serialization
  [1a1011a3] + SharedArrays
  [6462fe0b] + Sockets
  [2f01184e] + SparseArrays
  [10745b16] + Statistics
  [fa267f1f] + TOML
  [a4e569a6] + Tar
  [8dfed614] + Test
  [cf7118a7] + UUIDs
  [4ec0a83e] + Unicode
  [e66e0078] + CompilerSupportLibraries_jll
  [deac9b47] + LibCURL_jll
  [29816b5a] + LibSSH2_jll
  [c8ffd9c3] + MbedTLS_jll
  [14a3606d] + MozillaCACerts_jll
  [4536629a] + OpenBLAS_jll
  [83775a58] + Zlib_jll
  [8e850b90] + libblastrampoline_jll
  [8e850ede] + nghttp2_jll
  [3f19e933] + p7zip_jll
Precompiling project...
  ✗ ITensors
  0 dependencies successfully precompiled in 5 seconds (37 already precompiled)
  1 dependency errored. To see a full report either run `import Pkg; Pkg.precompile()` or load the package

julia> using Pkg; Pkg.precompile()
Precompiling project...
  ✗ ITensors
  0 dependencies successfully precompiled in 5 seconds (37 already precompiled)

ERROR: The following 1 direct dependency failed to precompile:

ITensors [9136182c-28ba-11e9-034c-db9fb085ebd5]

Failed to precompile ITensors [9136182c-28ba-11e9-034c-db9fb085ebd5] to /home/jan/.julia/compiled/v1.7/ITensors/jl_kdJ5Q0.
WARNING: could not import NDTensors.setblock! into ITensors
ERROR: LoadError: UndefVarError: resize not defined
Stacktrace:
  [1] getproperty(x::Module, f::Symbol)
    @ Base ./Base.jl:35
  [2] top-level scope
    @ ~/.julia/dev/ITensors/src/qn/qnindex.jl:11
  [3] include(mod::Module, _path::String)
    @ Base ./Base.jl:418
  [4] include(x::String)
    @ ITensors ~/.julia/dev/ITensors/src/ITensors.jl:47
  [5] top-level scope
    @ ~/.julia/dev/ITensors/src/ITensors.jl:140
  [6] include
    @ ./Base.jl:418 [inlined]
  [7] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::Nothing)
    @ Base ./loading.jl:1318
  [8] top-level scope
    @ none:1
  [9] eval
    @ ./boot.jl:373 [inlined]
 [10] eval(x::Expr)
    @ Base.MainInclude ./client.jl:453
 [11] top-level scope
    @ none:1
in expression starting at /home/jan/.julia/dev/ITensors/src/qn/qnindex.jl:11
in expression starting at /home/jan/.julia/dev/ITensors/src/ITensors.jl:1
Stacktrace:
 [1] pkgerror(msg::String)
   @ Pkg.Types /usr/share/julia/stdlib/v1.7/Pkg/src/Types.jl:68
 [2] precompile(ctx::Pkg.Types.Context; internal_call::Bool, strict::Bool, warn_loaded::Bool, already_instantiated::Bool, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
   @ Pkg.API /usr/share/julia/stdlib/v1.7/Pkg/src/API.jl:1362
 [3] precompile
   @ /usr/share/julia/stdlib/v1.7/Pkg/src/API.jl:1013 [inlined]
 [4] #precompile#220
   @ /usr/share/julia/stdlib/v1.7/Pkg/src/API.jl:1011 [inlined]
 [5] precompile()
   @ Pkg.API /usr/share/julia/stdlib/v1.7/Pkg/src/API.jl:1011
 [6] top-level scope
   @ REPL[16]:1


Expected output or behavior

I expect the package to precompile when I am developing it.

I don't understand why the following example of using add (as opposed to dev) in a new fresh test environment works:

Code and output of non-failing example when add instead of dev is used

Output of minimal runnable code

(@v1.7) pkg> activate .
  Activating project at `~/test`

(test) pkg> status
      Status `~/test/Project.toml`
  [9136182c] ITensors v0.3.10

(test) pkg> precompile

julia> using ITensors

julia> i=Index(3)
(dim=3|id=344)

julia> randomITensor(i,i')
ITensor ord=2 (dim=3|id=344) (dim=3|id=344)'
NDTensors.Dense{Float64, Vector{Float64}}

Version information

  • Output from versioninfo():
julia> versioninfo()
Julia Version 1.7.2
Commit bf53498635 (2022-02-06 15:21 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Core(TM) i7-10610U CPU @ 1.80GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-12.0.1 (ORCJIT, skylake)
  • Output from using Pkg; Pkg.status("ITensors") in ~/test/
(@v1.7) pkg> activate .
  Activating project at `~/test`

(test) pkg> status
      Status `~/test/Project.toml`
  [9136182c] ITensors v0.3.10

  • Output from using Pkg; Pkg.status("ITensors") in ~/.julia/dev/ITensors
(@v1.7) pkg> activate .
  Activating project at `~/.julia/dev/ITensors`

julia> using Pkg; Pkg.status("ITensors")
     Project ITensors v0.3.10
  No Matches in `~/.julia/dev/ITensors/Project.toml`

(ITensors) pkg> update
    Updating registry at `~/.julia/registries/General.toml`
  No Changes to `~/.julia/dev/ITensors/Project.toml`
  No Changes to `~/.julia/dev/ITensors/Manifest.toml`
Precompiling project...
  ✗ ITensors
  0 dependencies successfully precompiled in 5 seconds (37 already precompiled)
  1 dependency errored. To see a full report either run `import Pkg; Pkg.precompile()` or load the package

jtschneider avatar May 05 '22 17:05 jtschneider

I am not sure whether the dependencies are correct since e.g. the HDF5 package is kept at [f67ccb44] + HDF5 v0.15.7 and is not updated to 0.16.x ... This is the manifest file in the clean ~/test/ environment:

Manifest.toml
# This file is machine-generated - editing it directly is not advised

julia_version = "1.7.2"
manifest_format = "2.0"

[[deps.ArgTools]]
uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f"

[[deps.Artifacts]]
uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"

[[deps.Base64]]
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"

[[deps.BitIntegers]]
deps = ["Random"]
git-tree-sha1 = "5a814467bda636f3dde5c4ef83c30dd0a19928e0"
uuid = "c3b6d118-76ef-56ca-8cc7-ebb389d030a1"
version = "0.2.6"

[[deps.Blosc]]
deps = ["Blosc_jll"]
git-tree-sha1 = "310b77648d38c223d947ff3f50f511d08690b8d5"
uuid = "a74b3585-a348-5f62-a45c-50e91977d574"
version = "0.7.3"

[[deps.Blosc_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Lz4_jll", "Pkg", "Zlib_jll", "Zstd_jll"]
git-tree-sha1 = "91d6baa911283650df649d0aea7c28639273ae7b"
uuid = "0b7ba130-8d10-5ba8-a3d6-c5182647fed9"
version = "1.21.1+0"

[[deps.ChainRulesCore]]
deps = ["Compat", "LinearAlgebra", "SparseArrays"]
git-tree-sha1 = "9950387274246d08af38f6eef8cb5480862a435f"
uuid = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
version = "1.14.0"

[[deps.Compat]]
deps = ["Base64", "Dates", "DelimitedFiles", "Distributed", "InteractiveUtils", "LibGit2", "Libdl", "LinearAlgebra", "Markdown", "Mmap", "Pkg", "Printf", "REPL", "Random", "SHA", "Serialization", "SharedArrays", "Sockets", "SparseArrays", "Statistics", "Test", "UUIDs", "Unicode"]
git-tree-sha1 = "b153278a25dd42c65abbf4e62344f9d22e59191b"
uuid = "34da2185-b29b-5c13-b0c7-acf172513d20"
version = "3.43.0"

[[deps.CompilerSupportLibraries_jll]]
deps = ["Artifacts", "Libdl"]
uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae"

[[deps.Dates]]
deps = ["Printf"]
uuid = "ade2ca70-3891-5945-98fb-dc099432e06a"

[[deps.DelimitedFiles]]
deps = ["Mmap"]
uuid = "8bb1440f-4735-579b-a4ab-409b98df4dab"

[[deps.Dictionaries]]
deps = ["Indexing", "Random"]
git-tree-sha1 = "0340cee29e3456a7de968736ceeb705d591875a2"
uuid = "85a47980-9c8c-11e8-2b9f-f7ca1fa99fb4"
version = "0.3.20"

[[deps.Distributed]]
deps = ["Random", "Serialization", "Sockets"]
uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b"

[[deps.Downloads]]
deps = ["ArgTools", "LibCURL", "NetworkOptions"]
uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6"

[[deps.ExprTools]]
git-tree-sha1 = "56559bbef6ca5ea0c0818fa5c90320398a6fbf8d"
uuid = "e2ba6199-217a-4e67-a87a-7c52f15ade04"
version = "0.1.8"

[[deps.HDF5]]
deps = ["Blosc", "Compat", "HDF5_jll", "Libdl", "Mmap", "Random", "Requires"]
git-tree-sha1 = "698c099c6613d7b7f151832868728f426abe698b"
uuid = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f"
version = "0.15.7"

[[deps.HDF5_jll]]
deps = ["Artifacts", "JLLWrappers", "LibCURL_jll", "Libdl", "OpenSSL_jll", "Pkg", "Zlib_jll"]
git-tree-sha1 = "bab67c0d1c4662d2c4be8c6007751b0b6111de5c"
uuid = "0234f1f7-429e-5d53-9886-15a909be8d59"
version = "1.12.1+0"

[[deps.ITensors]]
deps = ["BitIntegers", "ChainRulesCore", "Compat", "Dictionaries", "HDF5", "IsApprox", "KrylovKit", "LinearAlgebra", "LinearMaps", "NDTensors", "PackageCompiler", "Pkg", "Printf", "Random", "Requires", "SerializedElementArrays", "StaticArrays", "Strided", "TimerOutputs", "TupleTools", "Zeros", "ZygoteRules"]
git-tree-sha1 = "f69ba9534f878c8383336feb9228e57c397113e0"
uuid = "9136182c-28ba-11e9-034c-db9fb085ebd5"
version = "0.3.10"

[[deps.Indexing]]
git-tree-sha1 = "ce1566720fd6b19ff3411404d4b977acd4814f9f"
uuid = "313cdc1a-70c2-5d6a-ae34-0150d3930a38"
version = "1.1.1"

[[deps.InteractiveUtils]]
deps = ["Markdown"]
uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240"

[[deps.IsApprox]]
deps = ["LinearAlgebra"]
git-tree-sha1 = "fcf3bcf04bea6483b9d0aa95cef3963ffb4281be"
uuid = "28f27b66-4bd8-47e7-9110-e2746eb8bed7"
version = "0.1.4"

[[deps.JLLWrappers]]
deps = ["Preferences"]
git-tree-sha1 = "abc9885a7ca2052a736a600f7fa66209f96506e1"
uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210"
version = "1.4.1"

[[deps.KrylovKit]]
deps = ["LinearAlgebra", "Printf"]
git-tree-sha1 = "49b0c1dd5c292870577b8f58c51072bd558febb9"
uuid = "0b1a1467-8014-51b9-945f-bf0ae24f4b77"
version = "0.5.4"

[[deps.LazyArtifacts]]
deps = ["Artifacts", "Pkg"]
uuid = "4af54fe1-eca0-43a8-85a7-787d91b784e3"

[[deps.LibCURL]]
deps = ["LibCURL_jll", "MozillaCACerts_jll"]
uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21"

[[deps.LibCURL_jll]]
deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll", "Zlib_jll", "nghttp2_jll"]
uuid = "deac9b47-8bc7-5906-a0fe-35ac56dc84c0"

[[deps.LibGit2]]
deps = ["Base64", "NetworkOptions", "Printf", "SHA"]
uuid = "76f85450-5226-5b5a-8eaa-529ad045b433"

[[deps.LibSSH2_jll]]
deps = ["Artifacts", "Libdl", "MbedTLS_jll"]
uuid = "29816b5a-b9ab-546f-933c-edad1886dfa8"

[[deps.Libdl]]
uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb"

[[deps.LinearAlgebra]]
deps = ["Libdl", "libblastrampoline_jll"]
uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"

[[deps.LinearMaps]]
deps = ["LinearAlgebra", "SparseArrays", "Statistics"]
git-tree-sha1 = "1693d6d0dfefd24ee97ffc5ea91f1cd2cf77ef6e"
uuid = "7a12625a-238d-50fd-b39a-03d52299707e"
version = "3.6.1"

[[deps.Logging]]
uuid = "56ddb016-857b-54e1-b83d-db4d58db5568"

[[deps.Lz4_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "5d494bc6e85c4c9b626ee0cab05daa4085486ab1"
uuid = "5ced341a-0733-55b8-9ab6-a4889d929147"
version = "1.9.3+0"

[[deps.MacroTools]]
deps = ["Markdown", "Random"]
git-tree-sha1 = "3d3e902b31198a27340d0bf00d6ac452866021cf"
uuid = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
version = "0.5.9"

[[deps.Markdown]]
deps = ["Base64"]
uuid = "d6f4376e-aef5-505a-96c1-9c027394607a"

[[deps.MbedTLS_jll]]
deps = ["Artifacts", "Libdl"]
uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1"

[[deps.Mmap]]
uuid = "a63ad114-7e13-5084-954f-fe012c677804"

[[deps.MozillaCACerts_jll]]
uuid = "14a3606d-f60d-562e-9121-12d972cd8159"

[[deps.NDTensors]]
deps = ["Compat", "Dictionaries", "HDF5", "LinearAlgebra", "Random", "Requires", "StaticArrays", "Strided", "TimerOutputs", "TupleTools"]
git-tree-sha1 = "4fd50190d68f7ee24cf7ea6fd3c5ddbf6351caf8"
uuid = "23ae76d9-e61a-49c4-8f12-3f1a16adf9cf"
version = "0.1.37"

[[deps.NetworkOptions]]
uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908"

[[deps.OpenBLAS_jll]]
deps = ["Artifacts", "CompilerSupportLibraries_jll", "Libdl"]
uuid = "4536629a-c528-5b80-bd46-f80d51c5b363"

[[deps.OpenSSL_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "ab05aa4cc89736e95915b01e7279e61b1bfe33b8"
uuid = "458c3c95-2e84-50aa-8efc-19380b2a3a95"
version = "1.1.14+0"

[[deps.PackageCompiler]]
deps = ["Artifacts", "LazyArtifacts", "Libdl", "Pkg", "Printf", "RelocatableFolders", "UUIDs"]
git-tree-sha1 = "4ad92047603f8e955503f92767577b32508c39af"
uuid = "9b87118b-4619-50d2-8e1e-99f35a4d4d9d"
version = "2.0.5"

[[deps.Pkg]]
deps = ["Artifacts", "Dates", "Downloads", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"]
uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"

[[deps.Preferences]]
deps = ["TOML"]
git-tree-sha1 = "47e5f437cc0e7ef2ce8406ce1e7e24d44915f88d"
uuid = "21216c6a-2e73-6563-6e65-726566657250"
version = "1.3.0"

[[deps.Printf]]
deps = ["Unicode"]
uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7"

[[deps.REPL]]
deps = ["InteractiveUtils", "Markdown", "Sockets", "Unicode"]
uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"

[[deps.Random]]
deps = ["SHA", "Serialization"]
uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"

[[deps.RelocatableFolders]]
deps = ["SHA", "Scratch"]
git-tree-sha1 = "cdbd3b1338c72ce29d9584fdbe9e9b70eeb5adca"
uuid = "05181044-ff0b-4ac5-8273-598c1e38db00"
version = "0.1.3"

[[deps.Requires]]
deps = ["UUIDs"]
git-tree-sha1 = "838a3a4188e2ded87a4f9f184b4b0d78a1e91cb7"
uuid = "ae029012-a4dd-5104-9daa-d747884805df"
version = "1.3.0"

[[deps.SHA]]
uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce"

[[deps.Scratch]]
deps = ["Dates"]
git-tree-sha1 = "0b4b7f1393cff97c33891da2a0bf69c6ed241fda"
uuid = "6c6a2e73-6563-6170-7368-637461726353"
version = "1.1.0"

[[deps.Serialization]]
uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b"

[[deps.SerializedElementArrays]]
deps = ["Serialization"]
git-tree-sha1 = "8e73e49eaebf73486446a3c1eede403bff259826"
uuid = "d3ce8812-9567-47e9-a7b5-65a6d70a3065"
version = "0.1.0"

[[deps.SharedArrays]]
deps = ["Distributed", "Mmap", "Random", "Serialization"]
uuid = "1a1011a3-84de-559e-8e89-a11a2f7dc383"

[[deps.Sockets]]
uuid = "6462fe0b-24de-5631-8697-dd941f90decc"

[[deps.SparseArrays]]
deps = ["LinearAlgebra", "Random"]
uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"

[[deps.StaticArrays]]
deps = ["LinearAlgebra", "Random", "Statistics"]
git-tree-sha1 = "cd56bf18ed715e8b09f06ef8c6b781e6cdc49911"
uuid = "90137ffa-7385-5640-81b9-e52037218182"
version = "1.4.4"

[[deps.Statistics]]
deps = ["LinearAlgebra", "SparseArrays"]
uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"

[[deps.Strided]]
deps = ["LinearAlgebra", "TupleTools"]
git-tree-sha1 = "632001471b256ceac6912c3e64d4b5c65154b216"
uuid = "5e0ebb24-38b0-5f93-81fe-25c709ecae67"
version = "1.2.2"

[[deps.TOML]]
deps = ["Dates"]
uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76"

[[deps.Tar]]
deps = ["ArgTools", "SHA"]
uuid = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e"

[[deps.Test]]
deps = ["InteractiveUtils", "Logging", "Random", "Serialization"]
uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[[deps.TimerOutputs]]
deps = ["ExprTools", "Printf"]
git-tree-sha1 = "d3bfa83f95c706485de9ae755a23a6ce5b1c30a3"
uuid = "a759f4b9-e2f1-59dc-863e-4aeb61b1ea8f"
version = "0.5.18"

[[deps.TupleTools]]
git-tree-sha1 = "3c712976c47707ff893cf6ba4354aa14db1d8938"
uuid = "9d95972d-f1c8-5527-a6e0-b4b365fa01f6"
version = "1.3.0"

[[deps.UUIDs]]
deps = ["Random", "SHA"]
uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"

[[deps.Unicode]]
uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"

[[deps.Zeros]]
deps = ["Test"]
git-tree-sha1 = "7eb4fd47c304c078425bf57da99a56606150d7d4"
uuid = "bd1ec220-6eb4-527a-9b49-e79c3db6233b"
version = "0.3.0"

[[deps.Zlib_jll]]
deps = ["Libdl"]
uuid = "83775a58-1f1d-513f-b197-d71354ab007a"

[[deps.Zstd_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "e45044cd873ded54b6a5bac0eb5c971392cf1927"
uuid = "3161d3a3-bdf6-5164-811a-617609db77b4"
version = "1.5.2+0"

[[deps.ZygoteRules]]
deps = ["MacroTools"]
git-tree-sha1 = "8c1a8e4dfacb1fd631745552c8db35d0deb09ea0"
uuid = "700de1a5-db45-46bc-99cf-38207098b444"
version = "0.2.2"

[[deps.libblastrampoline_jll]]
deps = ["Artifacts", "Libdl", "OpenBLAS_jll"]
uuid = "8e850b90-86db-534c-a0d3-1478176c7d93"

[[deps.nghttp2_jll]]
deps = ["Artifacts", "Libdl"]
uuid = "8e850ede-7688-5339-a07c-302acd2aaf8d"

[[deps.p7zip_jll]]
deps = ["Artifacts", "Libdl"]
uuid = "3f19e933-33d8-53b3-aaab-bd5110c3b7a0"

Am I somehow on the wrong branch?? Is main not meant to start off the be developed??

jtschneider avatar May 05 '22 17:05 jtschneider

If I simply revert the changes of https://github.com/ITensor/ITensors.jl/commit/cecd72d4b53ef6e0eb4d20dc41936ebc5782d34d concerning the following lines, that is deleting NDTensors. in front of the function name:

https://github.com/ITensor/ITensors.jl/blob/40fc8deaf94a75e8ae6c00e97d6cf234fdf14a57/src/qn/qnindex.jl#L11

https://github.com/ITensor/ITensors.jl/blob/40fc8deaf94a75e8ae6c00e97d6cf234fdf14a57/src/qn/qnindex.jl#L362

Then I can precompile this version of ITensors. However, I am not sure if this is the intended behaviour of these functions, although we now find the warning WARNING: could not import NDTensors.setblock! into ITensors

julia> pwd()
"/home/jan/.julia/dev/ITensors"

julia> using Pkg

julia> Pkg.activate("./")
  Activating project at `~/.julia/dev/ITensors`

julia> Pkg.precompile()
Precompiling project...
  1 dependency successfully precompiled in 8 seconds (37 already precompiled)

julia> using ITensors
[ Info: Precompiling ITensors [9136182c-28ba-11e9-034c-db9fb085ebd5]
WARNING: could not import NDTensors.setblock! into ITensors

Very interestingly omitting NDTensors. in this line leads to an error: https://github.com/ITensor/ITensors.jl/blob/40fc8deaf94a75e8ae6c00e97d6cf234fdf14a57/src/qn/qnindex.jl#L206

julia> Pkg.precompile()
Precompiling project...
  ✗ ITensors
  0 dependencies successfully precompiled in 5 seconds (37 already precompiled)

ERROR: The following 1 direct dependency failed to precompile:

ITensors [9136182c-28ba-11e9-034c-db9fb085ebd5]

Failed to precompile ITensors [9136182c-28ba-11e9-034c-db9fb085ebd5] to /home/jan/.julia/compiled/v1.7/ITensors/jl_jj0ACM.
WARNING: could not import NDTensors.setblock! into ITensors
ERROR: LoadError: error in method definition: function NDTensors.eachblock must be explicitly imported to be extended
Stacktrace:
  [1] top-level scope
    @ none:0
  [2] top-level scope
    @ ~/.julia/dev/ITensors/src/qn/qnindex.jl:206
  [3] include(mod::Module, _path::String)
    @ Base ./Base.jl:418
  [4] include(x::String)
    @ ITensors ~/.julia/dev/ITensors/src/ITensors.jl:47
  [5] top-level scope
    @ ~/.julia/dev/ITensors/src/ITensors.jl:140
  [6] include
    @ ./Base.jl:418 [inlined]
  [7] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::Nothing)
    @ Base ./loading.jl:1318
  [8] top-level scope
    @ none:1
  [9] eval
    @ ./boot.jl:373 [inlined]
 [10] eval(x::Expr)
    @ Base.MainInclude ./client.jl:453
 [11] top-level scope
    @ none:1
in expression starting at /home/jan/.julia/dev/ITensors/src/qn/qnindex.jl:206
in expression starting at /home/jan/.julia/dev/ITensors/src/ITensors.jl:1
Stacktrace:
 [1] pkgerror(msg::String)
   @ Pkg.Types /usr/share/julia/stdlib/v1.7/Pkg/src/Types.jl:68
 [2] precompile(ctx::Pkg.Types.Context; internal_call::Bool, strict::Bool, warn_loaded::Bool, already_instantiated::Bool, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
   @ Pkg.API /usr/share/julia/stdlib/v1.7/Pkg/src/API.jl:1362
 [3] precompile
   @ /usr/share/julia/stdlib/v1.7/Pkg/src/API.jl:1013 [inlined]
 [4] #precompile#220
   @ /usr/share/julia/stdlib/v1.7/Pkg/src/API.jl:1011 [inlined]
 [5] precompile()
   @ Pkg.API /usr/share/julia/stdlib/v1.7/Pkg/src/API.jl:1011
 [6] top-level scope
   @ REPL[13]:1

jtschneider avatar May 05 '22 21:05 jtschneider

If I simply revert the changes of cecd72d concerning the following lines, that is deleting NDTensors. in front of the function name:

https://github.com/ITensor/ITensors.jl/blob/40fc8deaf94a75e8ae6c00e97d6cf234fdf14a57/src/qn/qnindex.jl#L11

https://github.com/ITensor/ITensors.jl/blob/40fc8deaf94a75e8ae6c00e97d6cf234fdf14a57/src/qn/qnindex.jl#L362

This cannot be the solution as I cannot run the following basic function randomMPS() with conserved QNs:

julia> using ITensors

julia> N = 12
12

julia> sites_qn = siteinds("S=1", N; conserve_qns = true);

julia> psi0_qn = randomMPS(sites_qn, [if isodd(n)
                       "Up"
                   else
                       "Dn"
                   end for n = 1:N]; linkdims = 2)
ERROR: LoadError: BoundsError
Stacktrace:
  [1] _deleteat!(a::Vector{Pair{QN, Int64}}, inds::Vector{Int64}, dltd::Base.Nowhere)
    @ Base ./array.jl:1490
  [2] _deleteat!
    @ ./array.jl:1475 [inlined]
  [3] deleteat!
    @ ./array.jl:1469 [inlined]
  [4] deleteat!
    @ ~/.julia/dev/ITensors/src/qn/qnindex.jl:383 [inlined]
  [5] svd(T::NDTensors.BlockSparseTensor{Float64, 2, Tuple{Index{Vector{Pair{QN, Int64}}}, Index{Vector{Pair{QN, Int64}}}}, NDTensors.BlockSparse{Float64, Vector{Float64}, 2}}; kwargs::Base.Pairs{Symbol, Any, Tuple{Symbol, Symbol}, NamedTuple{(:maxdim, :utags), Tuple{Int64, String}}})
    @ NDTensors ~/.julia/packages/NDTensors/hSwie/src/blocksparse/linearalgebra.jl:113
  [6] svd(A::ITensor, Linds::Vector{Index{Vector{Pair{QN, Int64}}}}; kwargs::Base.Pairs{Symbol, Any, Tuple{Symbol, Symbol}, NamedTuple{(:maxdim, :utags), Tuple{Int64, String}}})
    @ ITensors ~/.julia/dev/ITensors/src/decomp.jl:109
  [7] randomizeMPS!(M::MPS, sites::Vector{Index{Vector{Pair{QN, Int64}}}}, linkdim::Int64)
    @ ITensors ~/.julia/dev/ITensors/src/mps/mps.jl:116
  [8] #randomMPS#863
    @ ~/.julia/dev/ITensors/src/mps/mps.jl:215 [inlined]
  [9] #randomMPS#862
    @ ~/.julia/dev/ITensors/src/mps/mps.jl:209 [inlined]
 [10] top-level scope
    @ ~/.julia/dev/ITensors/src/packagecompile/script_to_watch.jl:66
in expression starting at /home/jan/.julia/dev/ITensors/src/packagecompile/script_to_watch.jl:1



jtschneider avatar May 05 '22 22:05 jtschneider

Hi, thanks for letting us know. I'm not sure exactly the reason for the issues you are seeing but in my experience when precompilation fails, I'm still able to use ITensors.jl after logging out of the REPL and restarting it. Is that the case for you if you start over on the main branch and revert any changes you made? (Also yes we are developing on the branch named main.)

Regarding conflicts with other dependencies, I've had some trouble with this at times also, primarily because the Julia package manager is not always very explicit about which packages are blocking others from being upgraded. But you can find out more information about that by following some of the steps outlined here: https://itensor.github.io/ITensors.jl/stable/faq/JuliaPkg.html

emstoudenmire avatar May 06 '22 15:05 emstoudenmire

So sorry guys for the fuss! I simply reverted to commit https://github.com/ITensor/ITensors.jl/commit/1ebc7a38b2193590097121526aa881e54518fc4f which was tagged v0.3.10 and implemented my proposed feature from there on. I reckon a merge with main will be uncomplicated...

Anyhow, I'd rather discuss the proposed feature that I implemented; it's about the compilation of the system image. For that I'll head over to the PR https://github.com/ITensor/ITensors.jl/pull/911

jtschneider avatar May 07 '22 11:05 jtschneider

@jtschneider has this issue been resolved?

kmp5VT avatar Mar 10 '23 12:03 kmp5VT

@jtschneider has this issue been resolved? yes

jtschneider avatar Mar 10 '23 13:03 jtschneider