# PackageCompiler hangs while compiling nonincremental system image on Julia v1.11

**URL:** <https://discourse.julialang.org/t/packagecompiler-hangs-while-compiling-nonincremental-system-image-on-julia-v1-11/128099>\
**Category:** General Usage\
**Created:** [April 15, 2025, 2:31pm UTC](https://discourse.julialang.org/t/packagecompiler-hangs-while-compiling-nonincremental-system-image-on-julia-v1-11/128099 "2025-04-15T14:31:09Z")\
**Posts on this page:** 1\
**Showing post:** 52

<div class="post-metadata">

**Author:** ![uwestoehr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/uwestoehr/32/216201_2.png) [@uwestoehr](https://discourse.julialang.org/u/uwestoehr)\
**Post date:** [April 22, 2025, 10:46pm UTC](https://discourse.julialang.org/t/packagecompiler-hangs-while-compiling-nonincremental-system-image-on-julia-v1-11/128099/52 "2025-04-22T22:46:43Z")

</div>

> [@PatrickHaecker](#):
>
> Can you please test whether the compilation takes still longer with the [fix from the PR](https://github.com/JuliaLang/PackageCompiler.jl/pull/1042)?

@kristoffer.carlsson , @PatrickHaecker , I made now a brief test:

- on a laptop that is used only for office purposes, thus should have a clean Windows 10
- Julia was uninstalled, all its traces cleaned, then computer restarted, then Julia was installed using the standalone official installer.
- Before PackageCompile was executed, I only added “PackageCompiler” and Distributions"
- For the test I used the module of “Juliastic”: [Is linear and HEAD.](https://codeberg.org/donovaly/Juliastic/src/branch/main/src/Juliastic.jl)
- for the precompilation, this file: [Change, you can set the number of hexadecimal digits is replaced with the --template option.](https://codeberg.org/donovaly/Juliastic/src/branch/main/build/precompilation.jl)
- the command for the Julia REPL is:

```julia-auto
lib_input_path= "D:\\Julia\\Juliastic"
cd(lib_input_path)
using PackageCompiler
lib_name= "Juliastic"
lib_output= joinpath(lib_input_path, "CompilationResult")
precomp_file= joinpath(lib_input_path, "build", "precompilation.jl")
lib_header= joinpath(lib_input_path, "build", lib_name * ".h")
create_library(lib_input_path, lib_output;
 incremental= false, force= true, filter_stdlibs= true, lib_name= lib_name,
 precompile_execution_file= precomp_file,
 header_files= [lib_header])

```

### At first Julia 1.10.9

- The CPU has 12 threads, so I set JULIA\_NUM\_THREADS to 12.

result: compilation works, total time 363 seconds, here a screen shot with all details. Note the warnings about threads.

 ![julia_alkBRh0Ftg](https://global.discourse-cdn.com/julialang/original/3X/9/d/9daab13380fd317be9cc35ec036d0df6e90b0c84.png)

### 1.11.5

- JULIA\_NUM\_THREADS to 12

result: compilations hands (the bug why we have this discussion), but see the screenshot with the compilation times:

Step 1: 79% longer  
Step 2: 30% longer

 ![julia_5HcC6QIXcs](https://global.discourse-cdn.com/julialang/original/3X/d/f/df1df262a722360df46ba6a60e265a499b843cfd.png)

### 1.11.5 with patch

- JULIA\_NUM\_THREADS to 12
- I applied [Fix hanging system image creation if multiple threads are set - Pull Request #1042 - JuliaLang/PackageCompiler.jl - GitHub](https://github.com/JuliaLang/PackageCompiler.jl/pull/1042)

result: compilation works, total time 593 seconds, here a screen shot with all details. Note that there are now no warnings about threads.  
But the compilation time increased by 63 %

 ![julia_9ucXdjEgO0](https://global.discourse-cdn.com/julialang/original/3X/a/f/af27a623c142c4953d3875ec8bc97a52a4401f31.png)

So the patch makes it compiling, but the performance loss with 1.11.x is severe.

---

_[View the full topic](https://discourse.julialang.org/t/packagecompiler-hangs-while-compiling-nonincremental-system-image-on-julia-v1-11/128099)._
