Skip to content

Commit de783d4

Browse files
committed
fix(build): shared step must depend on install step, not compile step
The 'shared' named step depended on c_abi_lib.step (compile) instead of the install step returned by installArtifact(). This meant 'zig build shared' compiled the library but never copied it to zig-out/lib/, so all bindings failed to find it at link/runtime.
1 parent 2e1d513 commit de783d4

1 file changed

Lines changed: 35 additions & 3 deletions

File tree

build.zig

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,12 @@ pub fn build(b: *std.Build) void {
5656
.version = .{ .major = 1, .minor = 1, .patch = 0 },
5757
});
5858

59-
b.installArtifact(c_abi_lib);
59+
const c_abi_install = b.installArtifact(c_abi_lib);
6060

61-
// Install C header alongside library
6261
const header_install = b.addInstallHeaderFile(b.path("src/c/gf16.h"), "gf16.h");
6362

6463
const shared_step = b.step("shared", "Build C-ABI shared library (libgoldenfloat)");
65-
shared_step.dependOn(&c_abi_lib.step);
64+
shared_step.dependOn(&c_abi_install.step);
6665
shared_step.dependOn(&header_install.step);
6766

6867
// ─────────────────────────────────────────────────────────────────
@@ -115,4 +114,37 @@ pub fn build(b: *std.Build) void {
115114
test_step.dependOn(&run_tests.step);
116115
test_step.dependOn(&run_transcendent_tests.step);
117116
test_step.dependOn(&run_c_abi_tests.step);
117+
118+
// ─────────────────────────────────────────────────────────────────
119+
// Benchmarks
120+
// ─────────────────────────────────────────────────────────────────
121+
const bench_008_module = b.createModule(.{
122+
.root_source_file = b.path("benches/bench_008_fashion_mnist.zig"),
123+
.target = target,
124+
.optimize = optimize,
125+
});
126+
const bench_008 = b.addExecutable(.{
127+
.name = "bench_008_fashion_mnist",
128+
.root_module = bench_008_module,
129+
});
130+
const run_bench_008 = b.addRunArtifact(bench_008);
131+
const bench_008_step = b.step("bench-008", "Run BENCH-008: Fashion-MNIST MLP Quantization Validation");
132+
bench_008_step.dependOn(&run_bench_008.step);
133+
134+
const bench_009_module = b.createModule(.{
135+
.root_source_file = b.path("benches/bench_009_transformer_attention.zig"),
136+
.target = target,
137+
.optimize = optimize,
138+
});
139+
const bench_009 = b.addExecutable(.{
140+
.name = "bench_009_transformer_attention",
141+
.root_module = bench_009_module,
142+
});
143+
const run_bench_009 = b.addRunArtifact(bench_009);
144+
const bench_009_step = b.step("bench-009", "Run BENCH-009: Transformer Attention Pattern Analysis");
145+
bench_009_step.dependOn(&run_bench_009.step);
146+
147+
const bench_step = b.step("bench", "Run all benchmarks");
148+
bench_step.dependOn(&run_bench_008.step);
149+
bench_step.dependOn(&run_bench_009.step);
118150
}

0 commit comments

Comments
 (0)