Generating Julia binaries with JuMP issue

I want to create an executable for the julia file., for this i try to follow the instructions from link Creating a binary from Julia code · PackageCompiler

when i try the below command on windows with julia version 1.9.2, juMP v1.13.0 it fails…

julia --startup-file=no -J"E:\Programs\Julia-1.9.2\lib\julia\sys.dll" --output-o sys.o custom_sysimage.jl -Wl --export-all-symbols

fatal: error thrown and no exception handler available.
ReadOnlyMemoryError()

memcpy at C:\WINDOWS\System32\msvcrt.dll (unknown line)
ios_write at C:/workdir/src/support\ios.c:432
unsafe_write at .\iostream.jl:43
write at .\strings\io.jl:244 [inlined]
print at .\strings\io.jl:246 [inlined]
#with_output_color#962 at .\util.jl:80
with_output_color at .\util.jl:71 [inlined]
#printstyled#963 at .\util.jl:130 [inlined]
printstyled at .\util.jl:130
unknown function (ip: 00000255a2d75301)
display_error at .\client.jl:110
unknown function (ip: 00000255a2d7475a)
display_error at .\client.jl:114
unknown function (ip: 00000255a2d72e76)
jl_apply at C:/workdir/src\julia.h:1879 [inlined]
jl_f__call_latest at C:/workdir/src\builtins.c:774
#invokelatest#2 at .\essentials.jl:816 [inlined]
invokelatest at .\essentials.jl:813 [inlined]
_start at .\client.jl:524
unknown function (ip: 000002559604c673)
jl_apply at C:/workdir/src\julia.h:1879 [inlined]
true_main at C:/workdir/src\jlapi.c:573
jl_repl_entrypoint at C:/workdir/src\jlapi.c:717
mainCRTStartup at C:/workdir/cli\loader_exe.c:59
BaseThreadInitThunk at C:\WINDOWS\System32\KERNEL32.DLL (unknown line)
RtlUserThreadStart at C:\WINDOWS\SYSTEM32\ntdll.dll (unknown line)

Am I doing something wrong? How to fix this?

I tried on ubuntu, with commands below

  1. julia --startup-file=no -J"/home/rupesh/julia-1.9.2/lib/julia/sys.so" custom_sysimage.jl
    failed to compile statement: precompile(Tuple{typeof(JuMP.parse_constraint_call), Function, Bool, Base.Val{:==}, Symbol, Expr})
    failed to compile statement: precompile(Tuple{typeof(JuMP.parse_constraint_call), Function, Bool, Base.Val{:==}, Symbol, Symbol})

but when i run command below file sys.o is not generated, see below?

rupesh@rupesh-pc:~/juliasampes$ julia --startup-file=no --output-o sys.o -J"/home/rupesh/julia-1.9.2/lib/julia/sys.so" --debug-info=0 custom_sysimage.jl
rupesh@rupesh-pc:~/juliasampes$ ls
custom_sysimage.jl PipeClient.jl Project.toml taxpayer_precompile.jl
Manifest.toml PipeServer.jl taxpayer.jl water.jl
rupesh@rupesh-pc:~/juliasampes$

is the --output-o flag removed in julia 1.9.2, since with --help the flag is not shown?

Can there be compatibility issues with JuMP? What should be the best version combination to use?

I usually create executables using the create_app function from PackageCompiler Apps · PackageCompiler. If it doesn’t work on your machine, you could try Julia 1.8.5 and the latest version of JuMP

ok thanks let me try it out.