Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ITensorsPackageCompilerExt] Superseding indictment of ITensorsPackageCompilerExt #1550

Merged
merged 2 commits into from
Oct 20, 2024

Conversation

mtfishman
Copy link
Member

@mtfishman mtfishman commented Oct 20, 2024

This PR supersedes #1549 as a fix for #1548 (see also https://itensor.discourse.group/t/itensorspackagecompilerext-precompilation-failure-julia-v1-11/2070).

Closes #1548 and closes #1549 (@kmp5VT).

I noticed that ITensorsPackageCompilerExt was erroneously including and running the compilation script when it is loaded, so that it was actually running ITensor code (such as DMRG) when it was being loaded, while that script should only be run if a user wants to compile ITensor code into a system image.

I don't know why that workflow was ok in Julia 1.10 and below but causes problems during precompilation in Julia 1.11. My only guess is that in Julia 1.11 there was a change to the ordering of when package extension code gets loaded and/or precompiled. Anyway, I'm not sure it is worth investigating since a more sane workflow seems to work without any problems.

I also added a somewhat crude test that checks that ITensors.compile gets overloaded when ITensorsPackageCompilerExt gets loaded. This test would have caught the original issue since the test file would have failed when trying to load ITensorsPackageCompilerExt in the first place.

@mtfishman mtfishman merged commit 5fb4696 into main Oct 20, 2024
15 of 16 checks passed
@mtfishman mtfishman deleted the ITensorsPackageCompilerExt_Julia_1.11_fix branch October 20, 2024 02:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ITensors] [BUG] Julia v1.11 precompile fails when PackageCompiler.jl is also part of the project
1 participant