packages feed

Z-Data-2.0.0.0: Z-Data.cabal

cabal-version:      2.4
name:               Z-Data
version:            2.0.0.0
synopsis:           Array, vector and text
description:        This package provides array, slice and text operations
license:            BSD-3-Clause
license-file:       LICENSE
author:             Z.Haskell Contributors
maintainer:         winterland1989@gmail.com
copyright:          (c) Z.Haskell Contributors
category:           Data
build-type:         Custom
homepage:           https://github.com/ZHaskell/z-data
bug-reports:        https://github.com/ZHaskell/z-data/issues
extra-source-files:
  AUTHORS
  cbits/bytes.c
  cbits/compute_float_64.c
  cbits/dtoa.c
  cbits/text.c
  cbits/text_width.c
  ChangeLog.md
  LICENSE
  README.md
  third_party/fastvalidate-utf-8/include/simdasciicheck.h
  third_party/fastvalidate-utf-8/include/simdutf8check.h
  third_party/fastvalidate-utf-8/include/simdasciicheck_avx512.h
  third_party/fastvalidate-utf-8/include/simdutf8check_avx512.h
  third_party/fastbase64/include/chromiumbase64.h
  third_party/fastbase64/include/fastavxbase64.h
  third_party/fastbase64/src/fastavxbase64.c
  third_party/fastbase64/src/chromiumbase64.c
  third_party/fastbase64/src/fastavxbase64.c
  third_party/re2/re2/bitmap256.h
  third_party/re2/re2/bitstate.cc
  third_party/re2/re2/compile.cc
  third_party/re2/re2/dfa.cc
  third_party/re2/re2/filtered_re2.cc
  third_party/re2/re2/filtered_re2.h
  third_party/re2/re2/mimics_pcre.cc
  third_party/re2/re2/nfa.cc
  third_party/re2/re2/onepass.cc
  third_party/re2/re2/parse.cc
  third_party/re2/re2/perl_groups.cc
  third_party/re2/re2/pod_array.h
  third_party/re2/re2/prefilter.cc
  third_party/re2/re2/prefilter.h
  third_party/re2/re2/prefilter_tree.cc
  third_party/re2/re2/prefilter_tree.h
  third_party/re2/re2/prog.cc
  third_party/re2/re2/prog.h
  third_party/re2/re2/re2.cc
  third_party/re2/re2/re2.h
  third_party/re2/re2/regexp.cc
  third_party/re2/re2/regexp.h
  third_party/re2/re2/set.cc
  third_party/re2/re2/set.h
  third_party/re2/re2/simplify.cc
  third_party/re2/re2/sparse_array.h
  third_party/re2/re2/sparse_set.h
  third_party/re2/re2/stringpiece.cc
  third_party/re2/re2/stringpiece.h
  third_party/re2/re2/tostring.cc
  third_party/re2/re2/unicode_casefold.cc
  third_party/re2/re2/unicode_casefold.h
  third_party/re2/re2/unicode_groups.cc
  third_party/re2/re2/unicode_groups.h
  third_party/re2/re2/walker-inl.h
  third_party/re2/util/flags.h
  third_party/re2/util/logging.h
  third_party/re2/util/malloc_counter.h
  third_party/re2/util/mix.h
  third_party/re2/util/mutex.h
  third_party/re2/util/rune.cc
  third_party/re2/util/strutil.cc
  third_party/re2/util/strutil.h
  third_party/re2/util/utf.h
  third_party/re2/util/util.h
  third_party/utf8rewind/include/utf8rewind/utf8rewind.h
  third_party/utf8rewind/source/internal/base.h
  third_party/utf8rewind/source/internal/casemapping.c
  third_party/utf8rewind/source/internal/casemapping.h
  third_party/utf8rewind/source/internal/codepoint.c
  third_party/utf8rewind/source/internal/codepoint.h
  third_party/utf8rewind/source/internal/composition.c
  third_party/utf8rewind/source/internal/composition.h
  third_party/utf8rewind/source/internal/database.c
  third_party/utf8rewind/source/internal/database.h
  third_party/utf8rewind/source/internal/decomposition.c
  third_party/utf8rewind/source/internal/decomposition.h
  third_party/utf8rewind/source/internal/seeking.c
  third_party/utf8rewind/source/internal/seeking.h
  third_party/utf8rewind/source/internal/streaming.c
  third_party/utf8rewind/source/internal/streaming.h
  third_party/utf8rewind/source/unicodedatabase.c
  third_party/utf8rewind/source/unicodedatabase.h
  third_party/utf8rewind/source/utf8rewind.c

custom-setup
  setup-depends:
    , base   >=4.5 && <5
    , Cabal  >=2.4 && <4

source-repository head
  type:     git
  location: git://github.com/haskell-Z/z-data.git

flag check-array-bound
  description:
    Add bound check to operations in Z.Data.Array module.

  default:     False
  manual:      True

flag use-avx2
  description:
    Use AVX2 instructions(utf8 validation, base64 codec, etc).

  default:     False
  manual:      True

flag use-avx512
  description:
    Use AVX512(AVX512F, AVX512VL, AVX512BW, AVX512VBMI) instructions(utf8 validation, base64 codec, etc).

  default:     False
  manual:      True


library
  exposed-modules:
    Z.Data.Array
    Z.Data.Array.Base
    Z.Data.Array.Cast
    Z.Data.Array.QQ
    Z.Data.Array.Unaligned
    Z.Data.Array.UnliftedArray
    Z.Data.ASCII
    Z.Data.Builder
    Z.Data.Builder.Base
    Z.Data.Builder.Numeric
    Z.Data.Builder.Numeric.DigitTable
    Z.Data.Builder.Time
    Z.Data.Builder.UUID
    Z.Data.CBytes
    Z.Data.Generics.Utils
    Z.Data.JSON
    Z.Data.JSON.Base
    Z.Data.JSON.Builder
    Z.Data.JSON.Converter
    Z.Data.JSON.Value
    Z.Data.Parser
    Z.Data.Parser.Base
    Z.Data.Parser.Numeric
    Z.Data.Parser.Time
    Z.Data.Parser.UUID
    Z.Data.PrimRef
    Z.Data.Text
    Z.Data.Text.Base
    Z.Data.Text.Extra
    Z.Data.Text.Print
    Z.Data.Text.Regex
    Z.Data.Text.Search
    Z.Data.Text.UTF8Codec
    Z.Data.Text.UTF8Rewind
    Z.Data.Vector
    Z.Data.Vector.Base
    Z.Data.Vector.Base64
    Z.Data.Vector.Extra
    Z.Data.Vector.FlatIntMap
    Z.Data.Vector.FlatIntSet
    Z.Data.Vector.FlatMap
    Z.Data.Vector.FlatSet
    Z.Data.Vector.Hex
    Z.Data.Vector.QQ
    Z.Data.Vector.Search
    Z.Data.Vector.Sort
    Z.Foreign
    Z.Foreign.CPtr

  build-depends:
    , base                  >=4.16   && <5.0
    , bytestring            >=0.10.4 && <0.12
    , case-insensitive      ^>=1.2
    , containers            ^>=0.6
    , deepseq               ^>=1.4
    , hashable              ^>=1.3
    , primitive             >=0.7.3  && <0.8
    , QuickCheck            >=2.10
    , random                >=1.2.0  && <1.3
    , scientific            >=0.3.7  && <0.4
    , tagged                ^>=0.8
    , template-haskell      >=2.14.0
    , time                  >=1.9    && <2.0
    , unordered-containers  ^>=0.2
    , unicode-collation     >=0.1.3 && <0.2
    , uuid-types            >=1.0.4 && <2.0

  include-dirs:
    third_party/fastbase64/include
    third_party/fastvalidate-utf-8/include
    third_party/utf8rewind/include/utf8rewind
    third_party/utf8rewind/source/internal
    third_party/utf8rewind/source
    third_party/re2

  includes:
    utf8rewind.h
    chromiumbase64.h

  if arch(x86_64)
    includes:
      simdasciicheck.h
      simdutf8check.h

    if flag(use-avx2)
        includes:
          fastavxbase64.h

    if flag(use-avx512)
        includes:
          simdasciicheck_avx512.h
          simdutf8check_avx512.h
          fastavx512bwbase64.h

  c-sources:
    cbits/bytes.c
    cbits/compute_float_64.c
    cbits/dtoa.c
    cbits/text.c
    cbits/text_width.c
    third_party/fastbase64/src/chromiumbase64.c
    third_party/utf8rewind/source/internal/casemapping.c
    third_party/utf8rewind/source/internal/codepoint.c
    third_party/utf8rewind/source/internal/composition.c
    third_party/utf8rewind/source/internal/database.c
    third_party/utf8rewind/source/internal/decomposition.c
    third_party/utf8rewind/source/internal/seeking.c
    third_party/utf8rewind/source/internal/streaming.c
    third_party/utf8rewind/source/unicodedatabase.c
    third_party/utf8rewind/source/utf8rewind.c

  if arch(x86_64)
    if flag(use-avx2)
        c-sources:
          third_party/fastbase64/src/fastavxbase64.c

    if flag(use-avx512)
        c-sources:
          third_party/fastbase64/src/fastavx512bwbase64.c

  cxx-sources:
    cbits/regex.cc
    third_party/re2/re2/bitstate.cc
    third_party/re2/re2/compile.cc
    third_party/re2/re2/dfa.cc
    third_party/re2/re2/filtered_re2.cc
    third_party/re2/re2/mimics_pcre.cc
    third_party/re2/re2/nfa.cc
    third_party/re2/re2/onepass.cc
    third_party/re2/re2/parse.cc
    third_party/re2/re2/perl_groups.cc
    third_party/re2/re2/prefilter.cc
    third_party/re2/re2/prefilter_tree.cc
    third_party/re2/re2/prog.cc
    third_party/re2/re2/re2.cc
    third_party/re2/re2/regexp.cc
    third_party/re2/re2/set.cc
    third_party/re2/re2/simplify.cc
    third_party/re2/re2/stringpiece.cc
    third_party/re2/re2/tostring.cc
    third_party/re2/re2/unicode_casefold.cc
    third_party/re2/re2/unicode_groups.cc
    third_party/re2/util/rune.cc
    third_party/re2/util/strutil.cc

  default-language:   Haskell2010
  build-tool-depends: hsc2hs:hsc2hs -any

  cc-options:         -std=c11 -Wall -Wno-pointer-to-int-cast -Wno-unused-function
  -- currently it's ignored, see https://github.com/haskell/cabal/pull/6226
  -- we work around this issue using Setup.hs
  cxx-options:        -std=c++11
  if os(osx)
    cxx-options:        -stdlib=libc++

  if arch(x86_64)
    if flag(use-avx512)
      cc-options:       -march=cannonlake
      cxx-options:      -march=cannonlake
    else
      if flag(use-avx2)
        cc-options:     -mavx2
        cxx-options:    -mavx2
      else
        cc-options:     -msse4.2
        cxx-options:    -msse4.2

  if os(windows)
    extra-libraries: stdc++
    cc-options:      -DWIN32_LEAN_AND_MEAN -D_WIN32_WINNT=0x0600
    cxx-options:     -DWIN32_LEAN_AND_MEAN -D_WIN32_WINNT=0x0600
  else
    if os(osx)
      extra-libraries: 
        c++
        pthread
    else
      extra-libraries:
        stdc++
        pthread

  if flag(check-array-bound)
    cpp-options:   -DCHECK_ARRAY_BOUND

  ghc-options:
    -Wall -Wno-unticked-promoted-constructors  -Wno-incomplete-patterns

  default-extensions:
    BangPatterns
    BinaryLiterals
    CApiFFI
    CPP
    ConstraintKinds
    DataKinds
    DefaultSignatures
    DeriveAnyClass
    DeriveGeneric
    DerivingStrategies
    ExistentialQuantification
    FlexibleContexts
    FlexibleInstances
    GeneralizedNewtypeDeriving
    KindSignatures
    MagicHash
    MultiParamTypeClasses
    MultiWayIf
    OverloadedStrings
    PartialTypeSignatures
    PatternSynonyms
    PolyKinds
    QuantifiedConstraints
    QuasiQuotes
    RankNTypes
    RecordWildCards
    ScopedTypeVariables
    StandaloneDeriving
    TemplateHaskell
    TupleSections
    TypeApplications
    TypeFamilies
    TypeFamilyDependencies
    TypeOperators
    UnboxedTuples
    UnliftedFFITypes
    ViewPatterns

test-suite Z-Data-Test
  type:               exitcode-stdio-1.0
  hs-source-dirs:     test/
  main-is:            Spec.hs
  ghc-options:        -threaded
  default-language:   Haskell2010
  build-tool-depends: hsc2hs:hsc2hs -any, hspec-discover:hspec-discover -any
  other-modules:
    Z.Data.Array.UnalignedSpec
    Z.Data.Builder.NumericSpec
    Z.Data.Builder.TimeSpec
    Z.Data.CBytesSpec
    Z.Data.JSON.BaseSpec
    Z.Data.JSON.ValueSpec
    Z.Data.Parser.BaseSpec
    Z.Data.Parser.NumericSpec
    Z.Data.Parser.TimeSpec
    Z.Data.Text.BaseSpec
    Z.Data.Text.ExtraSpec
    Z.Data.Text.PrintSpec
    Z.Data.Text.SearchSpec
    Z.Data.Vector.Base64Spec
    Z.Data.Vector.BaseSpec
    Z.Data.Vector.ExtraSpec
    Z.Data.Vector.FlatMapSpec
    Z.Data.Vector.FlatSetSpec
    Z.Data.Vector.HexSpec
    Z.Data.Vector.SearchSpec
    Z.Data.Vector.SortSpec
    Z.ForeignSpec

  build-depends:
    , base
    , containers
    , hashable
    , hspec                 >=2.5.4
    , HUnit
    , primitive
    , QuickCheck            >=2.10
    , quickcheck-instances
    , scientific
    , time
    , unordered-containers
    , Z-Data

  c-sources:          test/cbits/ffi.c

  if flag(check-array-bound)
    cpp-options:   -DCHECK_ARRAY_BOUND