aboutsummaryrefslogtreecommitdiff
path: root/ox-arrays.cabal
blob: ecd3ba706fe99f5ac0be5aaccba3a3507a4bdab4 (plain)
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
cabal-version:   3.0
name:            ox-arrays
version:         0.1.0.0
author:          Tom Smeding
license:         BSD-3-Clause
build-type:      Simple

extra-source-files: cbits/arith_lists.h

flag trace-wrappers
  description:
    Compile modules that define wrappers around the array methods that trace
    their arguments and results. This is conditional on a flag because these
    modules make documentation generation fail.
    (https://gitlab.haskell.org/ghc/ghc/-/issues/24964 , should be fixed in
    GHC 9.12)
  default: False
  manual: True

flag nonportable-simd
  description:
    Assume the binary will be run on the same CPU as where it is built. Setting
    this flag causes `-march=native` to be passed to the C compiler when
    compiling arithmetic operations. The result is generally much faster
    arithmetic operations, but the executable is much less portable to
    different computers.
  default: False
  manual: True

library
  exposed-modules:
    Data.Array.Mixed.Internal.Arith
    Data.Array.Mixed.Lemmas
    Data.Array.Mixed.Permutation
    Data.Array.Mixed.Shape
    Data.Array.Mixed.Types
    Data.Array.Mixed.XArray
    Data.Array.Nested
    Data.Array.Nested.Internal.Convert
    Data.Array.Nested.Internal.Mixed
    Data.Array.Nested.Internal.Lemmas
    Data.Array.Nested.Internal.Ranked
    Data.Array.Nested.Internal.Shape
    Data.Array.Nested.Internal.Shaped

  if flag(trace-wrappers)
    exposed-modules:
      Data.Array.Nested.Trace
      Data.Array.Nested.Trace.TH

  build-depends:
    strided-array-ops,

    base >=4.18 && <4.21,
    deepseq,
    ghc-typelits-knownnat,
    ghc-typelits-natnormalise,
    orthotope,
    template-haskell,
    vector
  hs-source-dirs: src

  default-language: Haskell2010
  ghc-options: -Wall
  other-extensions: TemplateHaskell

library strided-array-ops
  exposed-modules:
    Data.Array.Strided
    Data.Array.Strided.Array
    Data.Array.Strided.Arith
    Data.Array.Strided.Arith.Internal
    Data.Array.Strided.Arith.Internal.Foreign
    Data.Array.Strided.Arith.Internal.Lists
    Data.Array.Strided.Arith.Internal.Lists.TH
  build-depends:
    base,
    ghc-typelits-knownnat,
    ghc-typelits-natnormalise,
    template-haskell,
    vector
  hs-source-dirs: ops
  c-sources: cbits/arith.c

  cc-options: -O3 -Wall -Wextra -std=c99
  if flag(nonportable-simd)
    cc-options: -march=native
  elif arch(x86_64) || arch(i386)
    -- hmatrix assumes sse2, so we can too
    cc-options: -msse2

  default-language: Haskell2010
  ghc-options: -Wall
  other-extensions: TemplateHaskell

test-suite test
  type: exitcode-stdio-1.0
  main-is: Main.hs
  other-modules:
    Gen
    Tests.C
    Tests.Permutation
    Util
  build-depends:
    ox-arrays,
    base,
    bytestring,
    ghc-typelits-knownnat,
    ghc-typelits-natnormalise,
    hedgehog,
    orthotope,
    random,
    tasty,
    tasty-hedgehog,
    vector
  hs-source-dirs: test
  default-language: Haskell2010
  ghc-options: -Wall

test-suite example
  type: exitcode-stdio-1.0
  main-is: Main.hs
  build-depends:
    ox-arrays,
    base
  hs-source-dirs: example
  default-language: Haskell2010
  ghc-options: -Wall

benchmark bench
  type: exitcode-stdio-1.0
  main-is: Main.hs
  build-depends:
    ox-arrays,
    strided-array-ops,
    base,
    hmatrix,
    orthotope,
    tasty-bench,
    vector
  hs-source-dirs: bench
  default-language: Haskell2010
  ghc-options: -Wall