diff options
author | Alberto Ruiz <aruiz@um.es> | 2011-12-26 11:40:04 +0100 |
---|---|---|
committer | Alberto Ruiz <aruiz@um.es> | 2011-12-26 11:40:04 +0100 |
commit | b421e2393c5a40eba4465b285a259a46409152e9 (patch) | |
tree | 6578ce81d298e600f8df8927efe20f73ee79e5e9 /INSTALL.md | |
parent | 66b17bce538f573fc37090ac1428d7fee8c8b959 (diff) |
thanks and new install file
Diffstat (limited to 'INSTALL.md')
-rw-r--r-- | INSTALL.md | 112 |
1 files changed, 112 insertions, 0 deletions
diff --git a/INSTALL.md b/INSTALL.md new file mode 100644 index 0000000..666bdc8 --- /dev/null +++ b/INSTALL.md | |||
@@ -0,0 +1,112 @@ | |||
1 | |||
2 | # [hmatrix][hmatrix2] installation | ||
3 | |||
4 | This package requires the [Glasgow Haskell Compiler](http://www.haskell.org/ghc/index.html) ghc >= 6.10, and [cabal-install](http://www.haskell.org/haskellwiki/Cabal-Install), conveniently available in the [Haskell Platform](http://hackage.haskell.org/platform), and the development packages for [GSL](http://www.gnu.org/software/gsl) and BLAS/[LAPACK](http://www.netlib.org/lapack). (The graphical functions also require **gnuplot** and **imagemagick**.) | ||
5 | |||
6 | [hmatrix]: http://code.haskell.org/hmatrix | ||
7 | [hmatrix2]: http://perception.inf.um.es/hmatrix | ||
8 | |||
9 | |||
10 | ## Linux ################################################## | ||
11 | |||
12 | |||
13 | Ubuntu/Debian: | ||
14 | |||
15 | $ sudo apt-get install libgsl0-dev liblapack-dev | ||
16 | $ cabal install hmatrix | ||
17 | |||
18 | Arch Linux: If the automatic installation from Hackage fails, install atlas-lapack and gsl, unpack the source, change the build-type to Simple in hmatrix.cabal (line 28) and add extra-libraries: gsl lapack (line 194). | ||
19 | |||
20 | Other distributions may require additional libraries. They can be given in a **--configure-option**. | ||
21 | |||
22 | ## Mac OS/X ############################################### | ||
23 | |||
24 | |||
25 | GSL must be installed via MacPorts: | ||
26 | |||
27 | $ sudo port install gsl-devel +universal | ||
28 | $ cabal install hmatrix | ||
29 | |||
30 | (Contributed by Heinrich Apfelmus and Torsten Kemps-Benedix). | ||
31 | |||
32 | ## Windows ############################################### | ||
33 | |||
34 | We use this [GSL binary](http://www.miscdebris.net/blog/2009/04/20/mingw-345-binaries-of-gnu-scientific-library-112-for-use-with-mingw-and-visual-c/), and blas/lapack dlls built with g77 (contributed by Gilberto Camara). All required files are in [gsl-lapack-windows.zip][winpack]. | ||
35 | |||
36 | |||
37 | 1) Install the Haskell Platform (tested on 2011.2.0.1) | ||
38 | |||
39 | > cabal update | ||
40 | |||
41 | 2) Download and unzip the following file into a stable folder %GSL% | ||
42 | |||
43 | http://perception.inf.um.es/hmatrix/gsl-lapack-windows.zip | ||
44 | |||
45 | 3.a) In a msys shell the installation should be fully automatic: | ||
46 | |||
47 | $ cabal install hmatrix --extra-lib-dir=${GSL} --extra-include-dir=${GSL} | ||
48 | |||
49 | 3.b) Alternatively, in a normal windows cmd: | ||
50 | |||
51 | > cabal unpack hmatrix | ||
52 | |||
53 | Edit hmatrix.cabal, in line 28 change build-type to "Simple", and then | ||
54 | |||
55 | > cabal install --extra-lib-dir=%GSL% --extra-include-dir=%GSL% | ||
56 | |||
57 | It may be necessary to put the dlls in the search path. | ||
58 | |||
59 | |||
60 | NOTE: The examples using graphics do not yet work in windows. | ||
61 | |||
62 | [install]: http://code.haskell.org/hmatrix/INSTALL | ||
63 | [install2]: http://patch-tag.com/r/aruiz/hmatrix/snapshot/current/content/pretty/INSTALL | ||
64 | [winpack]: http://perception.inf.um.es/hmatrix/gsl-lapack-windows.zip | ||
65 | |||
66 | - - - | ||
67 | |||
68 | ## Tests ############################################### | ||
69 | |||
70 | After installation we must verify that the library works as expected: | ||
71 | |||
72 | $ cabal install hmatrix-tests --enable-tests | ||
73 | $ ghci | ||
74 | > Numeric.LinearAlgebra.Tests.runTests 20 | ||
75 | OK, passed 100 tests. | ||
76 | OK, passed 100 tests. | ||
77 | ... etc... | ||
78 | |||
79 | If you get any failure please run lapack's own tests to confirm that your version is not broken. For instance, in ubuntu 9.04, **libatlas-sse2** does not work (see this [bug report](https://bugs.launchpad.net/ubuntu/+source/atlas/+bug/368478)). If your lapack library is ok but hmatrix's tests fail please send a bug report! | ||
80 | |||
81 | - - - | ||
82 | |||
83 | ## Optimized BLAS/LAPACK ########################################## | ||
84 | |||
85 | I have successfully tested ATLAS and MKL on Linux. | ||
86 | |||
87 | ### [ATLAS](http://math-atlas.sourceforge.net/) #################### | ||
88 | |||
89 | In Ubuntu >= 9.04 we need: | ||
90 | |||
91 | $ sudo apt-get install libatlas-base-dev | ||
92 | |||
93 | In older Ubuntu/Debian versions we needed: | ||
94 | |||
95 | $ sudo apt-get install refblas3-dev lapack3-dev atlas3-base-dev | ||
96 | |||
97 | We may use a version (sse2, 3dnow, etc.) optimized for the machine. | ||
98 | |||
99 | ### Intel's MKL ############################################### | ||
100 | |||
101 | There is a free noncommercial download available from Intel's website. To use it I have added the following lines in my .bashrc configuration file: | ||
102 | |||
103 | export LD_LIBRARY_PATH=/path/to/mkl/lib/arch | ||
104 | export LIBRARY_PATH=/path/to/mkl/lib/arch | ||
105 | |||
106 | where arch = 32 or em64t. | ||
107 | |||
108 | The library must be installed with the -fmkl flag: | ||
109 | |||
110 | $ cabal install hmatrix -fmkl | ||
111 | |||
112 | |||