Skip to content

Commit

Permalink
Switch to simple cabal build
Browse files Browse the repository at this point in the history
  • Loading branch information
lehins committed Jun 24, 2020
1 parent fd61cfa commit c07f147
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 48 deletions.
12 changes: 7 additions & 5 deletions massiv-bench/bench/Append.hs
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,18 @@ import Prelude as P
main :: IO ()
main = do
let !sz = Sz (600 :. 1000)
!len = totalElem sz
!arr = computeAs P $ resize' (Sz len) $ arrRLightIx2 DL Par sz
!arr2D = computeAs P $ arrRLightIx2 DL Par sz
!arr = computeAs P $ resize' (Sz $ totalElem sz) arr2D
defaultMain
[ mkAppendBenchGroup "LeftToRight" (Dim 1) sz
, mkAppendBenchGroup "TopToBottom" (Dim 2) sz
, bgroup
"Monoid"
"Append"
[ bench "mappend" $ whnf (\a -> A.computeAs P (toLoadArray a <> toLoadArray a)) arr
, bench "appendDL" $
whnfIO (A.computeAs P <$> appendOuterM (toLoadArray arr) (toLoadArray arr))
, bench "appendOuterM" $
whnfIO (A.computeAs P <$> appendOuterM (toLoadArray arr2D) (toLoadArray arr2D))
, bench "appendM (inner)" $ whnfIO (A.computeAs P <$> A.appendM 1 arr2D arr2D)
, bench "appendM (outer)" $ whnfIO (A.computeAs P <$> A.appendM 2 arr2D arr2D)
, bench "mconcat" $ whnf (\a -> A.computeAs P (mconcat [toLoadArray a, toLoadArray a])) arr
]
, bgroup
Expand Down
29 changes: 0 additions & 29 deletions massiv/Setup.hs
Original file line number Diff line number Diff line change
@@ -1,33 +1,4 @@
{-# LANGUAGE CPP #-}
{-# OPTIONS_GHC -Wall #-}
module Main (main) where

#ifndef MIN_VERSION_cabal_doctest
#define MIN_VERSION_cabal_doctest(x,y,z) 0
#endif

#if MIN_VERSION_cabal_doctest(1,0,0)

import Distribution.Extra.Doctest ( defaultMainWithDoctests )
main :: IO ()
main = defaultMainWithDoctests "doctests"

#else

#ifdef MIN_VERSION_Cabal
-- If the macro is defined, we have new cabal-install,
-- but for some reason we don't have cabal-doctest in package-db
--
-- Probably we are running cabal sdist, when otherwise using new-build
-- workflow
#warning You are configuring this package without cabal-doctest installed. \
The doctests test-suite will not work as a result. \
To fix this, install cabal-doctest before configuring.
#endif

import Distribution.Simple

main :: IO ()
main = defaultMain

#endif
8 changes: 1 addition & 7 deletions massiv/massiv.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ author: Alexey Kuleshevich
maintainer: [email protected]
copyright: 2018-2020 Alexey Kuleshevich
category: Data, Data Structures, Parallelism
build-type: Custom
build-type: Simple
extra-source-files: README.md
, CHANGELOG.md
cabal-version: >=1.10
Expand All @@ -26,12 +26,6 @@ flag unsafe-checks
default: False
manual: True

custom-setup
setup-depends:
base
, Cabal
, cabal-doctest >=1.0.6

library
hs-source-dirs: src
exposed-modules: Data.Massiv.Array
Expand Down
8 changes: 1 addition & 7 deletions massiv/tests/doctests.hs
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
module Main where

import Build_doctests (flags, pkgs, module_sources)
import Data.Foldable (traverse_)
import Test.DocTest (doctest)

main :: IO ()
main = do
traverse_ putStrLn args
doctest args
where
args = flags ++ pkgs ++ module_sources
main = doctest ["src"]

0 comments on commit c07f147

Please sign in to comment.