1+ cabal-version : 3.0
2+ build-type : Simple
13name : math-functions
24version : 0.3.4.4
3- cabal-version : >= 1.10
4- license : BSD2
5+ license : BSD-2-Clause
56license-file : LICENSE
7+
68author : Bryan O'Sullivan <bos@serpentine.com>,
79 Alexey Khudyakov <alexey.skladnoy@gmail.com>
810maintainer : Alexey Khudyakov <alexey.skladnoy@gmail.com>
911homepage : https://github.com/haskell/math-functions
1012bug-reports : https://github.com/haskell/math-functions/issues
1113category : Math, Numeric
12- build-type : Simple
1314synopsis : Collection of tools for numeric computations
1415description :
1516
@@ -31,7 +32,6 @@ tested-with:
3132 || == 9.4.5
3233 || == 9.6.2
3334
34-
3535extra-source-files :
3636 changelog.md
3737 README.markdown
@@ -42,6 +42,10 @@ extra-source-files:
4242 tests/tables/inputs/*.dat
4343 doc/sinc.hs
4444
45+ source-repository head
46+ type : git
47+ location : https://github.com/bos/math-functions
48+
4549flag system-expm1
4650 description : Use expm1 provided by GHC. On GHCJS we don't have one so we
4751 have to use hand-coded one.
@@ -55,6 +59,12 @@ flag system-erf
5559 default : True
5660 manual : True
5761
62+ flag BenchPAPI
63+ Description : Enable building of benchmarks which use instruction counters.
64+ It requires libpapi and only works on Linux so it's protected by flag
65+ Default : False
66+ Manual : True
67+
5868library
5969 default-language : Haskell2010
6070 other-extensions :
@@ -125,10 +135,13 @@ test-suite math-function-tests
125135 , tasty-hunit >= 0.10
126136 , tasty-quickcheck >= 0.10
127137
128- benchmark math-functions-bench
129- type : exitcode-stdio-1.0
130- if impl(ghcjs)
131- buildable : False
138+
139+ -- We want to be able to build benchmarks using both tasty-bench and tasty-papi.
140+ -- They have similar API so we just create two shim modules which reexport
141+ -- definitions from corresponding library and pick one in cabal file.
142+
143+ common bench-stanza
144+ ghc-options : -Wall -O2
132145 default-language : Haskell2010
133146 other-extensions :
134147 BangPatterns
@@ -140,16 +153,29 @@ benchmark math-functions-bench
140153 TemplateHaskell
141154 TypeFamilies
142155 DeriveGeneric
143- ghc-options : -Wall -O2
144- hs-source-dirs : bench
145- Main-is : bench.hs
146156 build-depends : base >= 4.5 && < 5
147157 , math-functions
148158 , data-default-class
149159 , vector
150160 , random
151- , tasty-bench >= 0.3.4
161+ , tasty
152162
153- source-repository head
154- type : git
155- location : https://github.com/bos/math-functions
163+ benchmark math-functions-bench
164+ import : bench-stanza
165+ type : exitcode-stdio-1.0
166+ if impl(ghcjs)
167+ buildable : False
168+ Main-is : main.hs
169+ Other-modules : Bench
170+ hs-source-dirs : bench bench-time
171+ build-depends : tasty-bench >= 0.3.4
172+
173+ benchmark math-functions-papi
174+ import : bench-stanza
175+ type : exitcode-stdio-1.0
176+ if impl(ghcjs) || !flag(BenchPAPI) || impl(ghc < 8.2 )
177+ buildable : False
178+ Main-is : main.hs
179+ Other-modules : Bench
180+ hs-source-dirs : bench bench-papi
181+ build-depends : tasty-papi >= 0.1.2
0 commit comments