haskell-numerics / hmatrix

Linear algebra and numerical computation
381 stars 104 forks source link

Segmentation fault #234

Closed idontgetoutmuch closed 6 years ago

idontgetoutmuch commented 7 years ago
*Main> S.inv (S.matrix [ 3.0, 0.0, 0.0, 3.0 ] :: S.Sq 2)
Segmentation fault: 11
albertoruiz commented 7 years ago

Perhaps there is some problem with the external libraries. I have just succesfully tested the latest version in ubuntu, with liblapack-dev and libatlas-base-dev.

$ ghc-pkg list /opt/ghc/8.2.1/lib/ghc-8.2.1/package.conf.d Cabal-2.0.0.2 array-0.5.2.0 base-4.10.0.0 binary-0.8.5.1 bytestring-0.10.8.2 containers-0.5.10.2 deepseq-1.4.3.0 directory-1.3.0.2 filepath-1.4.1.2 ghc-8.2.1 ghc-boot-8.2.1 ghc-boot-th-8.2.1 ghc-compact-0.1.0.0 ghc-prim-0.5.1.0 ghci-8.2.1 haskeline-0.7.4.0 hoopl-3.10.2.2 hpc-0.6.0.3 integer-gmp-1.0.1.0 pretty-1.1.3.3 process-1.6.1.0 rts-1.0 template-haskell-2.12.0.0 terminfo-0.4.1.0 time-1.8.0.2 transformers-0.5.2.0 unix-2.7.2.2 xhtml-3000.2.2 /home/developer/.ghc/x86_64-linux-8.2.1/package.conf.d HUnit-1.6.0.0 QuickCheck-2.10.0.1 call-stack-0.1.0 hTensor-0.9.1 hmatrix-0.18.1.0 hmatrix-glpk-0.6.0.0 hmatrix-gsl-0.18.0.1 hmatrix-special-0.4.0.1 hmatrix-tests-0.6.0.0 primitive-0.6.2.0 random-1.1 split-0.2.3.2 storable-complex-0.2.2 tf-random-0.5 vector-0.12.0.1

$ ghci -XDataKinds GHCi, version 8.0.2: http://www.haskell.org/ghc/ :? for help Prelude> import Numeric.LinearAlgebra.Static Prelude Numeric.LinearAlgebra.Static> inv (matrix [3,0,0,3] :: Sq 2) (matrix [ 0.3333333333333333, 0.0 , 0.0, 0.3333333333333333 ] :: L 2 2)

idontgetoutmuch commented 7 years ago

Thanks for looking. I agree it's probably my config. It's still causing me a problem but feel free to close the ticket.

nh2 commented 7 years ago

@albertoruiz I'm a bit confused by your outputs, it says

/opt/ghc/8.2.1/lib/ghc-8.2.1/package.conf.d

but further down

GHCi, version 8.0.2

That's two different GHC versions.

albertoruiz commented 7 years ago

Sorry, I run the test in a normal terminal, outside the docker container used for a clean install. I have tested again without problems.

Thanks for pointing this out.

$ docker run -ti --rm -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix hmatrix-ghc-8.2 developer@8c07e11e3b83:~ $ ghc-pkg list /opt/ghc/8.2.1/lib/ghc-8.2.1/package.conf.d Cabal-2.0.0.2 array-0.5.2.0 base-4.10.0.0 binary-0.8.5.1 bytestring-0.10.8.2 containers-0.5.10.2 deepseq-1.4.3.0 directory-1.3.0.2 filepath-1.4.1.2 ghc-8.2.1 ghc-boot-8.2.1 ghc-boot-th-8.2.1 ghc-compact-0.1.0.0 ghc-prim-0.5.1.0 ghci-8.2.1 haskeline-0.7.4.0 hoopl-3.10.2.2 hpc-0.6.0.3 integer-gmp-1.0.1.0 pretty-1.1.3.3 process-1.6.1.0 rts-1.0 template-haskell-2.12.0.0 terminfo-0.4.1.0 time-1.8.0.2 transformers-0.5.2.0 unix-2.7.2.2 xhtml-3000.2.2 /home/developer/.ghc/x86_64-linux-8.2.1/package.conf.d HUnit-1.6.0.0 QuickCheck-2.10.0.1 call-stack-0.1.0 hTensor-0.9.1 hmatrix-0.18.1.0 hmatrix-glpk-0.6.0.0 hmatrix-gsl-0.18.0.1 hmatrix-special-0.4.0.1 hmatrix-tests-0.6.0.0 primitive-0.6.2.0 random-1.1 split-0.2.3.2 storable-complex-0.2.2 tf-random-0.5 vector-0.12.0.1 developer@8c07e11e3b83:~$ ghci -XDataKinds GHCi, version 8.2.1: http://www.haskell.org/ghc/ :? for help Prelude> import Numeric.LinearAlgebra.Static Prelude Numeric.LinearAlgebra.Static> inv (matrix [3,0,0,3] :: Sq 2) (matrix [ 0.3333333333333333, 0.0 , 0.0, 0.3333333333333333 ] :: L 2 2) Prelude Numeric.LinearAlgebra.Static>

idontgetoutmuch commented 6 years ago

Cannot now reproduce.