JuliaLang / julia

The Julia Programming Language
https://julialang.org/
MIT License
44.97k stars 5.43k forks source link

Julia builds for `native` CPU, even with `XC_HOST = x86_64-w64-mingw32` #54808

Open topolarity opened 3 weeks ago

topolarity commented 3 weeks ago

Following the instructions at https://github.com/JuliaLang/julia/blob/master/doc/src/devdocs/build/windows.md and building from Cygwin and then distributing to another machine (with a different architecture), I ran into:

ERROR: Unable to find compatible target in cached code image.
Target 0 (alderlake): Rejecting this target due to use of runtime-disabled features

It's not obvious to me which of ARCH / MARCH / JULIA_CPU_TARGET should need setting, but the cross-compiling from Unix instructions probably also behave this way.

vchuravy commented 3 weeks ago

You always need to set JULIA_CPU_TARGET if you want to be able to distribute the resulting binary?

topolarity commented 2 weeks ago

Yeah, this is mostly a documentation issue - the instructions specifically mention moving the result to another machine but never tell you to set JULIA_CPU_TARGET