-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathbuild.zig
More file actions
114 lines (102 loc) · 3.34 KB
/
Copy pathbuild.zig
File metadata and controls
114 lines (102 loc) · 3.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
const std = @import("std");
const kalignPackageVersion = "3.6.0";
const targets: []const std.Target.Query = &.{
.{ .cpu_arch = .aarch64, .os_tag = .macos },
.{ .cpu_arch = .aarch64, .os_tag = .linux },
.{ .cpu_arch = .x86_64, .os_tag = .linux, .abi = .gnu },
.{ .cpu_arch = .x86_64, .os_tag = .linux, .abi = .musl },
};
const cflags = [_][]const u8{
"-DKALIGN_PACKAGE_VERSION=\"" ++ kalignPackageVersion ++ "\"",
"-DKALIGN_PACKAGE_NAME=\"kalign\"",
"-DKALIGN_ALN_SERIAL_THRESHOLD=250",
"-DKALIGN_KMEANS_UPGMA_THRESHOLD=50",
};
pub fn build(b: *std.Build) !void {
const optimize = b.standardOptimizeOption(.{});
for (targets) |t| {
// --- Static library module ---
const lib_mod = b.createModule(.{
.target = b.resolveTargetQuery(t),
.optimize = optimize,
.link_libc = true,
});
lib_mod.addIncludePath(b.path("lib/src"));
lib_mod.addIncludePath(b.path("lib/include"));
lib_mod.addCSourceFiles(.{ .files = &kalign_lib_sources, .flags = &cflags });
const lib = b.addLibrary(.{
.name = "tldevel",
.linkage = .static,
.root_module = lib_mod,
});
b.installArtifact(lib);
// --- Executable module ---
const bin_mod = b.createModule(.{
.target = b.resolveTargetQuery(t),
.optimize = optimize,
.link_libc = true,
});
bin_mod.addIncludePath(b.path("lib/src"));
bin_mod.addIncludePath(b.path("lib/include"));
bin_mod.addCSourceFiles(.{ .files = &kalign_sources, .flags = &cflags });
bin_mod.linkLibrary(lib);
const kalign_bin = b.addExecutable(.{
.name = "kalign",
.root_module = bin_mod,
});
b.installArtifact(kalign_bin);
// Install into a per-target subdirectory (e.g. zig-out/x86_64-linux-gnu/kalign)
const target_output = b.addInstallArtifact(kalign_bin, .{
.dest_dir = .{
.override = .{
.custom = try t.zigTriple(b.allocator),
},
},
});
b.getInstallStep().dependOn(&target_output.step);
}
}
const kalign_lib_sources = [_][]const u8{
"lib/src/test.c",
"lib/src/tldevel.c",
"lib/src/tlmisc.c",
"lib/src/tlrng.c",
"lib/src/esl_stopwatch.c",
"lib/src/msa_alloc.c",
"lib/src/msa_op.c",
"lib/src/msa_io.c",
"lib/src/msa_misc.c",
"lib/src/msa_check.c",
"lib/src/msa_cmp.c",
"lib/src/msa_sort.c",
"lib/src/alphabet.c",
"lib/src/task.c",
"lib/src/bisectingKmeans.c",
"lib/src/sequence_distance.c",
"lib/src/bpm.c",
"lib/src/euclidean_dist.c",
"lib/src/pick_anchor.c",
"lib/src/aln_wrap.c",
"lib/src/aln_apair_dist.c",
"lib/src/aln_add.c",
"lib/src/aln_param.c",
"lib/src/aln_run.c",
"lib/src/aln_mem.c",
"lib/src/aln_setup.c",
"lib/src/aln_controller.c",
"lib/src/aln_seqseq.c",
"lib/src/aln_seqprofile.c",
"lib/src/aln_profileprofile.c",
"lib/src/aln_refine.c",
"lib/src/sp_score.c",
"lib/src/weave_alignment.c",
"lib/src/poar.c",
"lib/src/consensus_msa.c",
"lib/src/anchor_consistency.c",
"lib/src/msa_consistency.c",
"lib/src/ensemble.c",
};
const kalign_sources = [_][]const u8{
"src/run_kalign.c",
"src/parameters.c",
};