-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCargo.toml
112 lines (91 loc) · 2.91 KB
/
Cargo.toml
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
[package]
name = "approportionment"
version = "0.1.0"
edition = "2021"
[[bin]]
name = "approportionment"
path = "rust/bin/main.rs"
[[bin]]
name = "survey_example"
path = "rust/bin/survey_example.rs"
[[bin]]
name = "survey_individual"
path = "rust/bin/survey_individual.rs"
[[bin]]
name = "mal_example"
path = "rust/bin/mal_example.rs"
[lib]
name = "libapproportionment"
path = "rust/lib.rs"
crate-type = ["cdylib", "lib"]
[profile.release]
# debug = 1 # Turn on for profiling
lto = true
# These are slightly faster on everything except for non-STV methods with
# 10000 voters. Not convincing enough to switch. Binary size is halved though.
#codegen-units = 1
#panic = "abort"
#strip = true
[profile.bench]
lto = true
[features]
default = ["binary"]
binary = ["dep:serde", "dep:serde_dhall", "dep:arrow"]
wasm = ["dep:wasm-bindgen", "dep:serde-wasm-bindgen", "voters_sample"]
wasm_debug = ["wasm", "dep:web-sys"]
# extra features
progress_bar = ["dep:indicatif"]
voters_sample = []
# performance
intrinsics = []
fma_non_stv = []
fma_stv = []
# unit tests
test_real_stv = []
# example binary
counts_by_round = []
[dependencies]
# These dependencies are shared by both binary and wasm
# enables wasm-pack support for getrandom (and arrow)
getrandom = { version = "0.2", features = ["js"] }
rand = "0.8.5"
rand_distr = "0.4.3"
rayon = "1.6.0"
fastrand = "1.8.0"
rand_core = "0.6.4"
# These dependencies are only used for the binary
serde = { version = "1.0.148", features = ["derive"], optional = true }
serde_dhall = { version = "0.12.0", optional = true }
indicatif = { version = "0.17.2", optional = true }
arrow = { version = "28.0.0", optional = true }
# These dependencies are only used for the wasm lib
wasm-bindgen = { version = "0.2", features = ["serde-serialize"], optional = true }
serde-wasm-bindgen = { version = "0.4.5", optional = true }
# https://github.com/smol-rs/fastrand/issues/27
instant = {version="*", features=["wasm-bindgen"]}
# This dependency is only used for wasm_debug
web-sys = {version = "0.3", optional = true, features = ["console"]}
# For counts_by_round and the two other binaries
csv = {version = "1.2.2", optional = true}
serde_json = {version = "1.0.108", optional = true}
[dev-dependencies]
criterion = { version = "0.4.0", features = [ "html_reports" ]}
proptest = "1.1.0"
iai = "0.1"
# This is a dependency to itself, just to an older commit.
# The purpose is to enable property based regression testing
approportionment-prev = {git = "https://github.com/akazukin5151/approportionment.git", package="approportionment", rev="0246cf2"}
# TODO: c987aaa fixed a bug, so if regression test fails it can be expected.
# verify that the failure is due to the bug fixed by c987aaa, if it is,
# then change the rev to c987aaa
chrono = "0.4.24"
serde_json = "1.0"
paste = "1.0"
[[bench]]
name = "benchmarks"
harness = false
[[bench]]
name = "iai_benches"
harness = false
[package.metadata.wasm-pack.profile.release]
wasm-opt = ['-O4']