-
Notifications
You must be signed in to change notification settings - Fork 18
/
neo.nimble
123 lines (102 loc) · 2.93 KB
/
neo.nimble
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
115
116
117
118
119
120
121
122
123
mode = ScriptMode.Verbose
packageName = "neo"
version = "0.3.5"
author = "Andrea Ferretti"
description = "Linear Algebra for Nim"
license = "Apache2"
skipDirs = @["tests", "benchmarks", "htmldocs"]
skipFiles = @["_config.yml"]
requires "nim >= 0.18.0", "nimblas >= 0.2.0", "nimcuda >= 0.1.6",
"nimlapack >= 0.1.1"
--forceBuild
when defined(nimdistros):
import distros
if detectOs(Ubuntu) or detectOs(Debian):
foreignDep "libblas-dev"
foreignDep "libopenblas-dev"
foreignDep "liblapack-dev"
elif detectOs(MacOsX):
foreignDep "liblas"
foreignDep "lapack"
else:
foreignDep "libblas"
foreignDep "liblapack"
proc configForTests() =
--hints: off
--linedir: on
--stacktrace: on
--linetrace: on
--debuginfo
--path: "."
--run
proc configForBenchmarks() =
--define: release
--path: "."
--run
task test, "run CPU tests":
configForTests()
setCommand "c", "tests/all.nim"
task testdense, "run CPU dense tests":
configForTests()
setCommand "c", "tests/tdense.nim"
task testsparse, "run CPU sparse tests":
configForTests()
setCommand "c", "tests/tsparse.nim"
task teststatic, "run CPU static tests":
configForTests()
setCommand "c", "tests/tstatics.nim"
task testshared, "run CPU shared heap tests":
configForTests()
--threads:on
setCommand "c", "tests/tshared.nim"
task testopenblas, "run CPU tests on openblas":
configForTests()
--define:"blas=openblas"
--define:"lapack=openblas"
setCommand "c", "tests/all.nim"
task testmkl, "run CPU tests on mkl":
configForTests()
--define:"blas=mkl_intel_lp64"
--clibdir: "/opt/intel/mkl/lib/intel64"
--passl: "/opt/intel/mkl/lib/intel64/libmkl_intel_lp64.a"
--passl: "-lmkl_core"
--passl: "-lmkl_sequential"
--passl: "-lpthread"
--passl: "-lm"
--dynlibOverride:mkl_intel_lp64
setCommand "c", "tests/all.nim"
task compilecuda, "only compile GPU tests (when not having a GPU)":
--hints: off
--linedir: on
--stacktrace: on
--linetrace: on
--debuginfo
--path: "."
--compileOnly
setCommand "c", "tests/allcuda.nim"
task testcuda, "run GPU tests":
configForTests()
--gc:markAndSweep # TODO: remove temporary workaround
setCommand "c", "tests/allcuda.nim"
task testcudadense, "run GPU dense tests":
configForTests()
setCommand "c", "tests/tcudadense.nim"
task testcudasparse, "run GPU sparse tests":
configForTests()
setCommand "c", "tests/tcudasparse.nim"
task testrw, "run tests for rewrite macros":
configForTests()
--define:neoCountRewrites
setCommand "c", "tests/rewrites.nim"
task benchmark, "run CPU benchmarks":
configForBenchmarks()
setCommand "c", "benchmarks/bench_cpu.nim"
task benchmarkcuda, "run GPU benchmarks":
configForBenchmarks()
setCommand "c", "benchmarks/bench_gpu.nim"
task docs, "generate documentation":
exec("mkdir -p htmldocs/neo")
--project
--git.url: "https://github.com/andreaferretti/neo"
--git.commit: master
setCommand "doc", "neo.nim"