Skip to content

Commit 41c63c0

Browse files
jameskermodeclaude
andcommitted
Fix juliac compilation: use -C generic as Julia flag
The --cpu-target flag must be passed to Julia itself (-C generic), not to juliac.jl which doesn't recognize it. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 1afc9cc commit 41c63c0

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

export/test/test_export.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,12 @@ using Libdl
6767
# Use juliac.jl script
6868
try
6969
# juliac.jl usage: julia juliac.jl [options] <source.jl>
70-
# Note: --project must come BEFORE juliac_script (it's a Julia arg, not juliac arg)
70+
# Note: Julia args (--project, --startup-file, -C) must come BEFORE juliac_script
7171
# --experimental is required to enable --trim
7272
# --compile-ccallable is required to export @ccallable functions
73-
# --cpu-target=generic makes the library portable across different CPU types
74-
juliac_cmd = `$(Base.julia_cmd()) --startup-file=no --project=$(EXPORT_DIR) $(juliac_script) --experimental --compile-ccallable --cpu-target=generic --output-lib $(lib_path) --trim=safe $(model_file)`
73+
# -C generic (--cpu-target=generic) makes the library portable across different CPU types
74+
julia_exe = joinpath(Sys.BINDIR, "julia")
75+
juliac_cmd = `$(julia_exe) --startup-file=no -C generic --project=$(EXPORT_DIR) $(juliac_script) --experimental --compile-ccallable --output-lib $(lib_path) --trim=safe $(model_file)`
7576
@info "Running: $juliac_cmd"
7677
run(juliac_cmd)
7778
catch e

0 commit comments

Comments
 (0)