diff options
author | Alberto Ruiz <aruiz@um.es> | 2011-12-23 14:21:36 +0100 |
---|---|---|
committer | Alberto Ruiz <aruiz@um.es> | 2011-12-23 14:21:36 +0100 |
commit | d0eb68801e7c8de0996f6799db5ea691588467fa (patch) | |
tree | e72251dc5013e316b89402685626be44a5f253e8 | |
parent | 863fd69b44d6e65544973871043d89d1d6c50a9e (diff) |
ok also with ghc-7.0
-rw-r--r-- | hmatrix.cabal | 16 | ||||
-rw-r--r-- | lib/Data/Packed/Internal/Vector.hs | 18 | ||||
-rw-r--r-- | lib/Numeric/ContainerBoot.hs | 20 | ||||
-rw-r--r-- | lib/Numeric/GSL/Polynomials.hs | 2 | ||||
-rw-r--r-- | packages/glpk/hmatrix-glpk.cabal | 5 | ||||
-rw-r--r-- | packages/special/hmatrix-special.cabal | 8 |
6 files changed, 44 insertions, 25 deletions
diff --git a/hmatrix.cabal b/hmatrix.cabal index 387e4e6..79ac491 100644 --- a/hmatrix.cabal +++ b/hmatrix.cabal | |||
@@ -148,9 +148,16 @@ library | |||
148 | 148 | ||
149 | -- ghc-prof-options: -auto | 149 | -- ghc-prof-options: -auto |
150 | 150 | ||
151 | ghc-options: -Wall -fno-warn-missing-signatures | 151 | |
152 | -fno-warn-orphans | 152 | if impl(ghc < 7.4) |
153 | -fno-warn-unused-binds | 153 | ghc-options: -Wall -fno-warn-missing-signatures |
154 | -fno-warn-orphans | ||
155 | -fno-warn-unused-binds | ||
156 | -fno-warn-dodgy-imports | ||
157 | else | ||
158 | ghc-options: -Wall -fno-warn-missing-signatures | ||
159 | -fno-warn-orphans | ||
160 | -fno-warn-unused-binds | ||
154 | 161 | ||
155 | if flag(unsafe) | 162 | if flag(unsafe) |
156 | cpp-options: -DUNSAFE | 163 | cpp-options: -DUNSAFE |
@@ -179,6 +186,9 @@ library | |||
179 | if impl(ghc == 7.0.1) | 186 | if impl(ghc == 7.0.1) |
180 | cpp-options: -DNONORMVTEST | 187 | cpp-options: -DNONORMVTEST |
181 | 188 | ||
189 | if impl(ghc < 7.4) | ||
190 | cpp-options: -DNOPOLYKINDS -DABSTRACTCINT | ||
191 | |||
182 | if flag(mkl) | 192 | if flag(mkl) |
183 | if arch(x86_64) | 193 | if arch(x86_64) |
184 | extra-libraries: gsl mkl_lapack mkl_intel_lp64 mkl_sequential mkl_core | 194 | extra-libraries: gsl mkl_lapack mkl_intel_lp64 mkl_sequential mkl_core |
diff --git a/lib/Data/Packed/Internal/Vector.hs b/lib/Data/Packed/Internal/Vector.hs index f48c4b2..e85ba6e 100644 --- a/lib/Data/Packed/Internal/Vector.hs +++ b/lib/Data/Packed/Internal/Vector.hs | |||
@@ -23,6 +23,7 @@ module Data.Packed.Internal.Vector ( | |||
23 | createVector, vec, | 23 | createVector, vec, |
24 | asComplex, asReal, float2DoubleV, double2FloatV, | 24 | asComplex, asReal, float2DoubleV, double2FloatV, |
25 | stepF, stepD, condF, condD, | 25 | stepF, stepD, condF, condD, |
26 | conjugateQ, conjugateC, | ||
26 | fwriteVector, freadVector, fprintfVector, fscanfVector, | 27 | fwriteVector, freadVector, fprintfVector, fscanfVector, |
27 | cloneVector, | 28 | cloneVector, |
28 | unsafeToForeignPtr, | 29 | unsafeToForeignPtr, |
@@ -344,7 +345,22 @@ condD x y l e g = unsafePerformIO $ do | |||
344 | foreign import ccall "condF" c_condF :: CInt -> PF -> CInt -> PF -> CInt -> PF -> TFFF | 345 | foreign import ccall "condF" c_condF :: CInt -> PF -> CInt -> PF -> CInt -> PF -> TFFF |
345 | foreign import ccall "condD" c_condD :: CInt -> PD -> CInt -> PD -> CInt -> PD -> TVVV | 346 | foreign import ccall "condD" c_condD :: CInt -> PD -> CInt -> PD -> CInt -> PD -> TVVV |
346 | 347 | ||
347 | ---------------------------------------------------------------- | 348 | -------------------------------------------------------------------------------- |
349 | |||
350 | conjugateAux fun x = unsafePerformIO $ do | ||
351 | v <- createVector (dim x) | ||
352 | app2 fun vec x vec v "conjugateAux" | ||
353 | return v | ||
354 | |||
355 | conjugateQ :: Vector (Complex Float) -> Vector (Complex Float) | ||
356 | conjugateQ = conjugateAux c_conjugateQ | ||
357 | foreign import ccall "conjugateQ" c_conjugateQ :: TQVQV | ||
358 | |||
359 | conjugateC :: Vector (Complex Double) -> Vector (Complex Double) | ||
360 | conjugateC = conjugateAux c_conjugateC | ||
361 | foreign import ccall "conjugateC" c_conjugateC :: TCVCV | ||
362 | |||
363 | -------------------------------------------------------------------------------- | ||
348 | 364 | ||
349 | cloneVector :: Storable t => Vector t -> IO (Vector t) | 365 | cloneVector :: Storable t => Vector t -> IO (Vector t) |
350 | cloneVector v = do | 366 | cloneVector v = do |
diff --git a/lib/Numeric/ContainerBoot.hs b/lib/Numeric/ContainerBoot.hs index d913435..6ce4760 100644 --- a/lib/Numeric/ContainerBoot.hs +++ b/lib/Numeric/ContainerBoot.hs | |||
@@ -3,7 +3,9 @@ | |||
3 | {-# LANGUAGE FlexibleInstances #-} | 3 | {-# LANGUAGE FlexibleInstances #-} |
4 | {-# LANGUAGE MultiParamTypeClasses #-} | 4 | {-# LANGUAGE MultiParamTypeClasses #-} |
5 | {-# LANGUAGE UndecidableInstances #-} | 5 | {-# LANGUAGE UndecidableInstances #-} |
6 | #ifndef NOPOLYKINDS | ||
6 | {-# LANGUAGE PolyKinds #-} | 7 | {-# LANGUAGE PolyKinds #-} |
8 | #endif | ||
7 | 9 | ||
8 | ----------------------------------------------------------------------------- | 10 | ----------------------------------------------------------------------------- |
9 | -- | | 11 | -- | |
@@ -46,14 +48,11 @@ import Data.Packed.ST as ST | |||
46 | import Numeric.Conversion | 48 | import Numeric.Conversion |
47 | import Data.Packed.Internal | 49 | import Data.Packed.Internal |
48 | import Numeric.GSL.Vector | 50 | import Numeric.GSL.Vector |
49 | import Foreign.C.Types(CInt(..)) | ||
50 | import Data.Complex | 51 | import Data.Complex |
51 | import Control.Monad(ap) | 52 | import Control.Monad(ap) |
52 | 53 | ||
53 | import Numeric.LinearAlgebra.LAPACK(multiplyR,multiplyC,multiplyF,multiplyQ) | 54 | import Numeric.LinearAlgebra.LAPACK(multiplyR,multiplyC,multiplyF,multiplyQ) |
54 | 55 | ||
55 | import System.IO.Unsafe | ||
56 | |||
57 | ------------------------------------------------------------------- | 56 | ------------------------------------------------------------------- |
58 | 57 | ||
59 | type family IndexOf c | 58 | type family IndexOf c |
@@ -510,21 +509,6 @@ type instance ElementOf (Matrix a) = a | |||
510 | 509 | ||
511 | ------------------------------------------------------------ | 510 | ------------------------------------------------------------ |
512 | 511 | ||
513 | conjugateAux fun x = unsafePerformIO $ do | ||
514 | v <- createVector (dim x) | ||
515 | app2 fun vec x vec v "conjugateAux" | ||
516 | return v | ||
517 | |||
518 | conjugateQ :: Vector (Complex Float) -> Vector (Complex Float) | ||
519 | conjugateQ = conjugateAux c_conjugateQ | ||
520 | foreign import ccall "conjugateQ" c_conjugateQ :: TQVQV | ||
521 | |||
522 | conjugateC :: Vector (Complex Double) -> Vector (Complex Double) | ||
523 | conjugateC = conjugateAux c_conjugateC | ||
524 | foreign import ccall "conjugateC" c_conjugateC :: TCVCV | ||
525 | |||
526 | ----------------------------------------------------- | ||
527 | |||
528 | class Build f where | 512 | class Build f where |
529 | build' :: BoundsOf f -> f -> ContainerOf f | 513 | build' :: BoundsOf f -> f -> ContainerOf f |
530 | 514 | ||
diff --git a/lib/Numeric/GSL/Polynomials.hs b/lib/Numeric/GSL/Polynomials.hs index 9d1cf8c..c0318d7 100644 --- a/lib/Numeric/GSL/Polynomials.hs +++ b/lib/Numeric/GSL/Polynomials.hs | |||
@@ -19,7 +19,9 @@ module Numeric.GSL.Polynomials ( | |||
19 | polySolve | 19 | polySolve |
20 | ) where | 20 | ) where |
21 | 21 | ||
22 | #ifndef ABSTRACTCINT | ||
22 | import Foreign.C.Types(CInt(..)) | 23 | import Foreign.C.Types(CInt(..)) |
24 | #endif | ||
23 | import Data.Packed.Internal | 25 | import Data.Packed.Internal |
24 | import Data.Complex | 26 | import Data.Complex |
25 | import System.IO.Unsafe (unsafePerformIO) | 27 | import System.IO.Unsafe (unsafePerformIO) |
diff --git a/packages/glpk/hmatrix-glpk.cabal b/packages/glpk/hmatrix-glpk.cabal index ea6d0ce..3231ef7 100644 --- a/packages/glpk/hmatrix-glpk.cabal +++ b/packages/glpk/hmatrix-glpk.cabal | |||
@@ -30,7 +30,10 @@ library | |||
30 | 30 | ||
31 | c-sources: lib/Numeric/LinearProgramming/glpk.c | 31 | c-sources: lib/Numeric/LinearProgramming/glpk.c |
32 | 32 | ||
33 | ghc-options: -Wall | 33 | if impl(ghc < 7.4) |
34 | ghc-options: -Wall -fno-warn-dodgy-imports | ||
35 | else | ||
36 | ghc-options: -Wall | ||
34 | 37 | ||
35 | extra-libraries: glpk | 38 | extra-libraries: glpk |
36 | 39 | ||
diff --git a/packages/special/hmatrix-special.cabal b/packages/special/hmatrix-special.cabal index 4dd884b..25880a9 100644 --- a/packages/special/hmatrix-special.cabal +++ b/packages/special/hmatrix-special.cabal | |||
@@ -66,8 +66,12 @@ library | |||
66 | 66 | ||
67 | other-modules: Numeric.GSL.Special.Internal | 67 | other-modules: Numeric.GSL.Special.Internal |
68 | 68 | ||
69 | ghc-options: -Wall -fno-warn-unused-binds | 69 | if impl(ghc < 7.4) |
70 | 70 | ghc-options: -Wall -fno-warn-unused-binds | |
71 | -fno-warn-dodgy-imports | ||
72 | else | ||
73 | ghc-options: -Wall -fno-warn-orphans | ||
74 | |||
71 | if flag(safe-cheap) | 75 | if flag(safe-cheap) |
72 | cpp-options: -DSAFE_CHEAP=safe | 76 | cpp-options: -DSAFE_CHEAP=safe |
73 | else | 77 | else |