-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.py
43 lines (27 loc) · 929 Bytes
/
build.py
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
import os
import sys
import cryptoTools.build
import thirdparty.getBitpolymul as getBitpolymul
def getParallel(args):
par = multiprocessing.cpu_count()
for x in args:
if x.startswith("--par="):
val = x.split("=",1)[1]
par = int(val)
if par < 1:
par = 1
return par
def Setup(install, prefix, par):
dir_path = os.path.dirname(os.path.realpath(__file__))
os.chdir(dir_path + "/thirdparty")
getBitpolymul.get(install,prefix, par)
os.chdir(dir_path)
if __name__ == "__main__":
(mainArgs, cmake) = cryptoTools.build.parseArgs()
install, prefix = cryptoTools.build.getInstallArgs(mainArgs)
par = cryptoTools.build.getParallel(mainArgs)
bitpolymul = "--bitpolymul" in mainArgs
setup = "--setup" in mainArgs
if setup and bitpolymul:
Setup(install, prefix, par)
cryptoTools.build.main("libOTe")