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

"ERROR: Unable to find compatible target in system image" when building #62

Open
eschnett opened this issue Jun 2, 2019 · 3 comments
Open

Comments

@eschnett
Copy link

eschnett commented Jun 2, 2019

I am trying to build the example on MacOS with Julia 1.1 (self-built). This does not work:

julia> build_app_bundle("/Users/eschnett/.julia/packages/ApplicationBuilder/kMUzZ/examples/hello.jl", appname="hello")
  Using calculated bundle_identifier: 'com.eschnett.hello'
~~~~~~ Creating mac app in "/Users/eschnett/src/jl/HelloWorld/builddir/hello.app" ~~~~~~~
~~~~~~ Compiling a binary from '/Users/eschnett/.julia/packages/ApplicationBuilder/kMUzZ/examples/hello.jl'... ~~~~~~~
Julia program file:
  "/Users/eschnett/src/jl/HelloWorld/builddir/hello.app/Contents/MacOS/applicationbuilderutils.jl"
C program file:
  "/Users/eschnett/.julia/packages/ApplicationBuilder/kMUzZ/src/program.c"
Build directory:
  "/Users/eschnett/src/jl/HelloWorld/builddir/hello.app/Contents/MacOS"
ERROR: Unable to find compatible target in system image.
ERROR: failed process: Process(`/Users/eschnett/julia-1.1/bin/julia --compiled-modules=yes --cpu-target=x86-64 --optimize=3 -g0 --output-o=hello.a --track-allocation=none --code-coverage=none --history-file=yes --inline=yes --math-mode=ieee --compile=yes --track-allocation=none --sysimage-native-code=yes --sysimage=/Users/eschnett/julia-1.1/lib/julia/sys.dylib --compiled-modules=yes --optimize=2 /Users/eschnett/.julia/packages/PackageCompiler/oT98U/sysimg/run_julia_code.jl`, ProcessExited(1)) [1]
@NHDaly
Copy link
Owner

NHDaly commented Jun 19, 2019

Ah, sorry, it's because --cpu-target=x86-64 is incompatible with self-built julia. You can either:

  1. Use a shipped julia binary, or
  2. Change the cpu target to cpu_target="native" in build_app_bundle(). But If you do this, then your app will be significantly less portable to other machines (it will only run on other machines with identical cpus).
  • We should add this information to the README

Sorry, something went wrong.

@blaiseli
Copy link

@NHDaly Thanks to the above information, I was finally able to build an executable with PackageCompiler.jl, (within a singularity container) that could run on our computing cluster. Both the cpu_target="x86_64" (seems to work with underscore, as in the output of gcc -dumpmachine) and the "is incompatible with self-built julia" pieces of information were crucial to make this work.

Indeed, I had initially tried to use the cpu_target option with the julia version present in my workstation, and I got the error message that lead me to this issue. When done during the %post phase of the singularity container build, this worked, likely because the official docker image on which my container is based contains a "shipped julia binary".

Definitely worth adding these important pieces information in the README of PackageCompiler.jl, in my opinion.

Now, I shoud try ApplicationBuilder.jlto see if I can make something able to run without a container.

Thanks.

(The deps/build.jl and the singularity definition file are available at commit 09c31ab0 of https://gitlab.pasteur.fr/bli/qaf_demux/tree/master/Julia/QafDemux)

@KristofferC
Copy link

Note that using the same CPU target that Julia itself uses is likely a good idea: https://github.com/KristofferC/PackageCompilerX.jl/blob/1aedf81497fe195cca28d7e6287a189e1fb26518/src/PackageCompilerX.jl#L13

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

No branches or pull requests

4 participants