Skip to content

JULIA_CPU_TARGET is ordered-dependent when compiling with juliac #58952

@Moelf

Description

@Moelf

https://github.com/Moelf/FHist.jl/blob/C_FHist/C_FHist/

julia> versioninfo()
Julia Version 1.13.0-DEV.834
Commit c3282ceaacb (2025-07-08 07:05 UTC)
Build Info:
  Official https://julialang.org release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 24 × AMD Ryzen 9 3900X 12-Core Processor
  WORD_SIZE: 64
  LLVM: libLLVM-20.1.2 (ORCJIT, znver2)
  GC: Built with stock GC
>julia +nightly --project=.. ~/.julia/juliaup/julia-nightly/share/julia/juliac/juliac.jl --output-lib libfhistjl.so --compile-ccallable --experimental --trim C_FHist.jl

JULIA_CPU_TARGET='znver2;generic' julia +nightly

=====================================
Input size: 100000
All close: True
Numpy    time (ms): 1.2849700055085123
FHist.jl time (ms): 0.12393159558996558
=====================================
Input size: 1000000
All close: True
Numpy    time (ms): 6.515748403035104
FHist.jl time (ms): 1.4926746021956205

JULIA_CPU_TARGET='generic;znver2' julia +nightly

=====================================
Input size: 100000
All close: True
Numpy    time (ms): 1.3016978045925498
FHist.jl time (ms): 0.24966440396383405
=====================================
Input size: 1000000
All close: True
Numpy    time (ms): 6.477032997645438
FHist.jl time (ms): 2.470186399295926

Metadata

Metadata

Assignees

No one assigned

    Labels

    compiler:codegenGeneration of LLVM IR and native code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions