diff options
author | Alberto Ruiz <aruiz@um.es> | 2008-10-27 17:00:07 +0000 |
---|---|---|
committer | Alberto Ruiz <aruiz@um.es> | 2008-10-27 17:00:07 +0000 |
commit | 86c7aed1de8efe5988f994867d35addb6b62a655 (patch) | |
tree | 01062a04188f8a8e06aa76e0287ea99caf6f2343 /README | |
parent | edf12982f21c56c21bfc21eb2b2fcbc406838130 (diff) |
simplified README
Diffstat (limited to 'README')
-rw-r--r-- | README | 128 |
1 files changed, 6 insertions, 122 deletions
@@ -2,63 +2,16 @@ | |||
2 | A simple scientific library for Haskell | 2 | A simple scientific library for Haskell |
3 | ----------------------------------------- | 3 | ----------------------------------------- |
4 | 4 | ||
5 | REQUIREMENTS ---------------------------- | 5 | INSTALLATION |
6 | |||
7 | 1) GNU Scientific Library (http://www.gnu.org/software/gsl). | ||
8 | In Ubuntu we need the package "libgsl0-dev". | ||
9 | |||
10 | 2) BLAS/LAPACK (http://www.netlib.org/lapack). | ||
11 | An optimized implementation is recommended. I have tested: | ||
12 | |||
13 | - ATLAS (http://math-atlas.sourceforge.net). | ||
14 | In Ubuntu the required packages are "refblas3-dev", "lapack3-dev", | ||
15 | and "atlas3-base-dev" (or a version tuned for your machine). | ||
16 | |||
17 | - Intel's MKL (http://www.intel.com/cd/software/products). | ||
18 | There is a free noncommercial download of MKL for Linux. | ||
19 | |||
20 | For ghc-6.8.x you may also need: | ||
21 | |||
22 | - libgmp3-dev. | ||
23 | |||
24 | The following packages are used for simple graphics: | ||
25 | |||
26 | - gnuplot | ||
27 | - imagemagick | ||
28 | |||
29 | GNU-Octave can be used to check if the results | ||
30 | obtained by this library are correct. | ||
31 | |||
32 | INSTALLATION -------------------------------------- | ||
33 | |||
34 | Automatic (using cabal-install and HackageDB): | ||
35 | 6 | ||
7 | Recommended method (ok in Ubuntu/Debian systems): | ||
8 | $ sudo apt-get install libgsl0-dev refblas3-dev lapack3-dev atlas3-[your_arch]-dev | ||
36 | $ cabal install hmatrix | 9 | $ cabal install hmatrix |
37 | 10 | ||
38 | Manual: | 11 | Detailed installation instructions: |
39 | 12 | http://www.hmatrix.googlepages.com/installation | |
40 | Install storable-complex from HackageDB and then | ||
41 | |||
42 | $ runhaskell Setup.lhs configure --prefix=$HOME --user | ||
43 | $ runhaskell Setup.lhs build | ||
44 | $ runhaskell Setup.lhs haddock | ||
45 | $ runhaskell Setup.lhs install | ||
46 | |||
47 | Using Intel's MKL: | ||
48 | 13 | ||
49 | - add/modify environment variables (e.g. in your .bashrc): | 14 | For installation in Windows see the companion INSTALL file. |
50 | export LD_LIBRARY_PATH=/path/to/mkl/lib/arch | ||
51 | export LIBRARY_PATH=/path/to/mkl/lib/arch | ||
52 | where arch = "32" or "em64t" | ||
53 | |||
54 | - add the "-fmkl" flag in the cabal configuration command: | ||
55 | $ runhaskell Setup.lhs configure --prefix=$HOME --user -fmkl | ||
56 | $ runhaskell Setup.lhs build | ||
57 | $ runhaskell Setup.lhs install | ||
58 | |||
59 | More information: http://www.hmatrix.googlepages.com/installation | ||
60 | |||
61 | See below for installation on Windows. | ||
62 | 15 | ||
63 | TESTS --------------------------------------------- | 16 | TESTS --------------------------------------------- |
64 | 17 | ||
@@ -110,75 +63,6 @@ KNOWN PROBLEMS / BUGS ------------------------------- | |||
110 | - On distributions with old GSL versions you should comment out a couple of functions | 63 | - On distributions with old GSL versions you should comment out a couple of functions |
111 | in the export lists of Ellint.hs and Debye.hs | 64 | in the export lists of Ellint.hs and Debye.hs |
112 | 65 | ||
113 | CHANGES --------------------------------------------------------- | ||
114 | |||
115 | This is a new version of the library previously known as GSLHaskell. | ||
116 | It has been renamed to "hmatrix" because only a small part of GSL is actually | ||
117 | available, and most linear algebra is based on LAPACK. | ||
118 | |||
119 | The code has been extensively refactored. There is a new internal representation | ||
120 | which admits both C and Fortran matrices and avoids many transposes. | ||
121 | |||
122 | There are only minor API changes: | ||
123 | |||
124 | - The matrix product operator (<>) is now overloaded only for matrix-matrix, | ||
125 | matrix-vector and vector-matrix, with the same base type. Dot product and scaling | ||
126 | of vectors or matrices is now denoted by `dot` or (<.>) and `scale` or (.*). | ||
127 | Conversions from real to complex objects must now be explicit. | ||
128 | |||
129 | - Most linear algebra functions admit both real and complex objects. Utilities such as | ||
130 | ident or constant are now polymorphic. | ||
131 | |||
132 | - Runtime errors produced by GSL or LAPACK can be handled using Control.Exeception.catch. | ||
133 | |||
134 | Old GSLHaskell code will work with small modifications. | ||
135 | |||
136 | INSTALLATION ON WINDOWS ---------------------------------------- | ||
137 | |||
138 | 1) Download the developer files gsl-1.8-lib.zip from | ||
139 | http://gnuwin32.sourceforge.net/packages/gsl.htm | ||
140 | and copy the gsl headers folder (under include) to: | ||
141 | C:\ghc\ghc.6.x.1\include | ||
142 | These headers are also available from: | ||
143 | http://perception.inf.um.es/~aruiz/darcs/hmatrix/gsl.zip | ||
144 | |||
145 | 2) Copy libgsl.dll, libcblas.dll (from the binaries package gsl-1.8.bin.zip) | ||
146 | and liblapack.dll (borrowed from the R system) to the ghc folder, e.g.: | ||
147 | C:\ghc\ghc-6.x.x. | ||
148 | Rename libcblas.dll to libblas.dll. | ||
149 | They are needed to compile programs. | ||
150 | These three dlls are available from: | ||
151 | http://perception.inf.um.es/~aruiz/darcs/hmatrix/dll1.zip | ||
152 | |||
153 | 2.5) Remove the following functions from the export list of | ||
154 | lib/Numeric/GSL/Special/Ellint.hs: | ||
155 | ellint_Pcomp_e, ellint_Pcomp, ellint_Dcomp_e, ellint_Dcomp | ||
156 | |||
157 | 3) Install the package as usual: | ||
158 | runhaskell Setup.lhs configure | ||
159 | runhaskell Setup.lhs build | ||
160 | runhaskell Setup.lhs install | ||
161 | |||
162 | 3.5) If configure cannot find ld please see: | ||
163 | http://article.gmane.org/gmane.comp.lang.haskell.cafe/32025 | ||
164 | |||
165 | 4) Copy the dlls available from: | ||
166 | http://perception.inf.um.es/~aruiz/darcs/hmatrix/dll2.zip | ||
167 | to the working directory or C:\windows\system | ||
168 | They are required to run the programs and ghci. | ||
169 | |||
170 | 5) run the tests | ||
171 | |||
172 | Unfortunately the lapack dll supplied by the R system does not include | ||
173 | zgels_, zgelss_, and zgees_, so the functions depending on them | ||
174 | (linearSolveLS, linearSolveSVD, and schur for complex data) | ||
175 | will produce a "non supported in this OS" runtime error. | ||
176 | |||
177 | If you find an alternative free and complete lapack.dll which works well | ||
178 | for this system please let me know. | ||
179 | |||
180 | The examples using graphics do not yet work in windows. | ||
181 | |||
182 | ACKNOWLEDGEMENTS ----------------------------------------------------- | 66 | ACKNOWLEDGEMENTS ----------------------------------------------------- |
183 | 67 | ||
184 | I thank Don Stewart, Henning Thielemann, Bulat Ziganshin and all the people | 68 | I thank Don Stewart, Henning Thielemann, Bulat Ziganshin and all the people |