# Problem Generating executable

**URL:** <https://discourse.julialang.org/t/problem-generating-executable/77716>\
**Category:** General Usage\
**Tags:** question\
**Created:** [March 10, 2022, 7:45pm UTC](https://discourse.julialang.org/t/problem-generating-executable/77716 "2022-03-10T19:45:44Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Amro](https://avatars.discourse-cdn.com/v4/letter/a/4491bb/32.png) [@Amro](https://discourse.julialang.org/u/Amro)\
**Post date:** [March 10, 2022, 7:45pm UTC](https://discourse.julialang.org/t/problem-generating-executable/77716/1 "2022-03-10T19:45:44Z")

</div>

When I run the below code, it gives the below error. How can I solve the problem?

```julia
using PackageCompiler: PackageCompiler, create_sysimage, create_app, create_library
using Pkg
ENV["JULIA_DEBUG"] = "PackageCompiler"
mkpath(joinpath("$(@ __DIR__ )", "Generated"))
Pkg.activate("$(@ __DIR__ )")
Pkg.resolve()
Pkg.instantiate(; verbose = false)
tmp_app_source_dir = "$(@ __DIR__ )"
app_compiled_dir = "$(@ __DIR__ )\\Generated"
create_app(tmp_app_source_dir, app_compiled_dir; force=true,
                       executables=["NetlistEMTP" => "julia_main"
                                    ])
Activating environment at `c:\Users\amroa\OneDrive - polymtl.ca\AmroAlsabbagh\Code\Julia\Tests and Notes\12- Create exe file\Netlist\NetlistEMTP\Project.toml`
  No Changes to `C:\Users\amroa\OneDrive - polymtl.ca\AmroAlsabbagh\Code\Julia\Tests and Notes\12- Create exe file\Netlist\NetlistEMTP\Project.toml`
  No Changes to `C:\Users\amroa\OneDrive - polymtl.ca\AmroAlsabbagh\Code\Julia\Tests and Notes\12- Create exe file\Netlist\NetlistEMTP\Manifest.toml`
Precompiling project...
  1 dependency successfully precompiled in 4 seconds (77 already precompiled)
PackageCompiler: bundled artifacts:
  ├── ATK_jll - 2.219 MiB
  ├── Bzip2_jll - 2.232 MiB
  ├── Cairo_jll - 13.579 MiB
  ├── Expat_jll - 1.125 MiB
  ├── Fontconfig_jll - 3.017 MiB
  ├── FreeType2_jll - 4.737 MiB
  ├── FriBidi_jll - 570.671 KiB
  ├── GTK3_jll - 73.302 MiB
  ├── Gettext_jll - 19.930 MiB
  ├── Glib_jll - 20.546 MiB
  ├── Graphite2_jll - 696.780 KiB
  ├── HarfBuzz_jll - 6.257 MiB
  ├── JpegTurbo_jll - 4.951 MiB
  ├── LERC_jll - 758.367 KiB
  ├── LZO_jll - 1.084 MiB
  ├── Libepoxy_jll - 13.043 MiB
  ├── Libffi_jll - 205.667 KiB
  ├── Libgcrypt_jll - 6.433 MiB
  ├── Libgpg_error_jll - 2.227 MiB
  ├── Libiconv_jll - 2.245 MiB
  ├── Libtiff_jll - 9.779 MiB
  ├── NativeFileDialog_jll - 474.944 KiB
  ├── PCRE_jll - 4.222 MiB
  ├── Pango_jll - 4.738 MiB
  ├── Pixman_jll - 5.945 MiB
  ├── Wayland_protocols_jll - 465.663 KiB
ERROR: LoadError: IOError: open("c:\\Users\\amroa\\OneDrive - polymtl.ca\\AmroAlsabbagh\\Code\\Julia\\Tests and Notes\\12- Create exe file\\Netlist\\NetlistEMTP\\Generated\\share\\julia\\artifacts\\f42f9d226c70f0bc88e5f897d914d9de1ac2ce03\\share\\wayland-protocols\\stable\\presentation-time\\presentation-time.xml", 769, 33206): no such file or directory (ENOENT)     
Stacktrace:
  [1] uv_error
    @ .\libuv.jl:97 [inlined]
  [2] open(path::String, flags::UInt16, mode::UInt64)
    @ Base.Filesystem .\filesystem.jl:87
  [5] cptree(src::String, dst::String; force::Bool, follow_symlinks::Bool) (repeats 4 times)
    @ Base.Filesystem .\file.jl:328
  [6] cp(src::String, dst::String; force::Bool, follow_symlinks::Bool)
    @ Base.Filesystem .\file.jl:353
  [7] cp
    @ .\file.jl:349 [inlined]
  [8] bundle_artifacts(ctx::Pkg.Types.Context, dest_dir::String; include_lazy_artifacts::Bool)
    @ PackageCompiler C:\Users\amroa\.julia\packages\PackageCompiler\wpsGv\src\PackageCompiler.jl:1124
  [9] create_app(package_dir::String, app_dir::String; executables::Vector{Pair{String, String}}, precompile_execution_file::Vector{String}, precompile_statements_file::Vector{String}, incremental::Bool, filter_stdlibs::Bool, force::Bool, c_driver_program::String, cpu_target::String, include_lazy_artifacts::Bool, sysimage_build_args::Cmd, include_transitive_dependencies::Bool) 
    @ PackageCompiler C:\Users\amroa\.julia\packages\PackageCompiler\wpsGv\src\PackageCompiler.jl:699
 [10] top-level scope
    @ c:\Users\amroa\OneDrive - polymtl.ca\AmroAlsabbagh\Code\Julia\Tests and Notes\12- Create exe file\Netlist\NetlistEMTP\codeTocimpileSourceCode.jl:22in expression starting at c:\Users\amroa\OneDrive - polymtl.ca\AmroAlsabbagh\Code\Julia\Tests and Notes\12- Create exe file\Netlist\NetlistEMTP\codeTocimpileSourceCode.jl:22

```

 ![ff](https://global.discourse-cdn.com/julialang/original/3X/c/7/c78c557794ecd6de3cce675ce98f8f4b5deec9c0.png)

---

<div class="post-metadata">

**Author:** ![goerch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/goerch/32/29122_2.png) [@goerch](https://discourse.julialang.org/u/goerch)\
**Post date:** [March 10, 2022, 8:43pm UTC](https://discourse.julialang.org/t/problem-generating-executable/77716/2 "2022-03-10T20:43:23Z")

</div>

Hi Amro,

I seem to understand the problem stems from `presentation-time.xml`. Is this a public resource from any package involved or a private resource?

P.S.: I consider it slightly offensive to ask one member of the community to ask for help specifically?

---

<div class="post-metadata">

**Author:** ![goerch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/goerch/32/29122_2.png) [@goerch](https://discourse.julialang.org/u/goerch)\
**Post date:** [March 10, 2022, 9:01pm UTC](https://discourse.julialang.org/t/problem-generating-executable/77716/4 "2022-03-10T21:01:33Z")

</div>

> [@Amro](#):
>
> I did not get this sentence. Could you please explain it more?

Is it your own file or a file from a package installed by `Pkg`?

Concluding from the path I’d assume it to be part of `wayland-protocols`, but who knows what it is and why it is not there? Pretty unclear to me, how to get a reproducer out of this.

---

<div class="post-metadata">

**Author:** ![goerch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/goerch/32/29122_2.png) [@goerch](https://discourse.julialang.org/u/goerch)\
**Post date:** [March 10, 2022, 9:17pm UTC](https://discourse.julialang.org/t/problem-generating-executable/77716/6 "2022-03-10T21:17:27Z")

</div>

So if it is your file and expected in `wayland-protocols` I’d first suspect some kind of absolute vs. relative path mismatch. Can you help us out here somehow (some `PackageCompiler` configuration for example)?

---

<div class="post-metadata">

**Author:** ![goerch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/goerch/32/29122_2.png) [@goerch](https://discourse.julialang.org/u/goerch)\
**Post date:** [March 10, 2022, 9:51pm UTC](https://discourse.julialang.org/t/problem-generating-executable/77716/8 "2022-03-10T21:51:02Z")

</div>

OK, here is what I tried on Julia 1.7.2: new project folder with `netlist.jl`

```julia
module NetlistEMTP

using NativeFileDialog, JLD2, Parameters

Base.@ccallable function julia_main()::Cint
  try
    netlisttranslator()
  catch
      Base.invokelatest(Base.display_error, Base.catch_stack())
      return 1
  end
  return 0
end

#=
Here all sub-functions called by netlisttranslator()
netlisttranslator()
=#
end

```

and `packagecompiler.jl`

```julia
using PackageCompiler: PackageCompiler, create_sysimage, create_app, create_library
using Pkg
ENV["JULIA_DEBUG"] = "PackageCompiler"
mkpath(joinpath("$(@ __DIR__ )", "Generated"))
Pkg.activate("$(@ __DIR__ )")
Pkg.resolve()
Pkg.instantiate(; verbose = false)
tmp_app_source_dir = "$(@ __DIR__ )"
app_compiled_dir = "$(@ __DIR__ )\\Generated"
create_app(tmp_app_source_dir, app_compiled_dir; force=true,
                       executables=["NetlistEMTP" => "julia_main"
                                    ])

```

Running `include("packagecompiler.jl")` doesn’t result in an error for me. So it seems to me you somehow have to reduce your MWE or explain it in another way that we can follow up?

---

<div class="post-metadata">

**Author:** ![goerch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/goerch/32/29122_2.png) [@goerch](https://discourse.julialang.org/u/goerch)\
**Post date:** [March 18, 2022, 1:07pm UTC](https://discourse.julialang.org/t/problem-generating-executable/77716/12 "2022-03-18T13:07:02Z")

</div>

@Amro: I believe we have a problem with your M(inimal)W(orking)E(xample) here, because it involves a package setup. I don’t know the recommended way to communicate about MWEs like this. Do others recommend to use an example GitHub repository in such cases?
