hmatrix
After 3 days of frustrating trials and errors, I managed to install the new hmatrix package on Slackware 13.1. I post this message in case anyone else hits the same problem, as the process requires some alteration of the standard build process of ATLAS, LAPACK, hmatrix and hmatrix-gsl. The following steps assume that LAPACK is built against an optimized ATLAS library. 1.) By default, ATLAS builds only static libraries. However, hmatrix needs shared objects, so ATLAS should be configured with the --share option and, after the build is complete, the commands make shared and/ore make ptshared need to be issued in BUILDDIR/lib 2.) LAPACK also buils by default only static libraries and, for the same reason as above, we need position independent conde in ALL the objects in liblapack. In order to do this we need to 2.1.) Add -fPIC to OPTS, NOOPT and LOADOPT in LAPACKROOT/make.inc 2.2.) Change the BLASLIB macro in the same file to point to the optimized tatlas (os satlas) library 2.3.) Add the target liblapack.so to SRC/Makefile: ../liblapack.so: $(ALLOBJ) gfortran -shared -W1 -o $@ $(ALLOBJ) (This step is a corected version of http://theoryno3.blogspot.ro/2010/12/compiling-lapack-as-shared-library-in.html ) 3.) Change the extra-libraries line in hmatrix.cabal to read: extra-libraries: tatlas lapack 4.) Change the extra-library line in hmatrix-gsl to read: extra-libraries: gslcblas gsl Again, this procedure worked for may Slackware 13.1 linux box, but I think it will work on any decent linux machine. Thanks everyone for your time and useful comments! Adrian Victor. ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: hmatrix-0.16.0.4 installation problem
I tried the following command line: cabal install --enable-documentation --extra-include-dirs=/usr;local/include --extra-lib-dirs=/usr/local/lib hmatrix and got the following: Resolving dependencies... Configuring hmatrix-0.16.0.4... cabal: Missing dependencies on foreign libraries: * Missing C libraries: blas, lapack This problem can usually be solved by installing the system packages that provide these libraries (you may need the -dev versions). If the libraries are already installed but in a non-standard location then you can use the flags --extra-include-dirs= and --extra-lib-dirs= to specify where they are. Failed to install hmatrix-0.16.0.4 cabal: Error: some packages failed to install: hmatrix-0.16.0.4 failed during the configure step. The exception was: ExitFailure 1 As I said before, the libraries for blas and lapack ARE in /usr/local/lib and the header files ARE in /usr/local/include. Is it possible for hmatrix to look for another version of atlas/blas and lapack? I have installed atlas-3.3.8 and lapack-3.4.0 Adrian. ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
hmatrix-0.16.0.4 installation problem
Hi, I tried to upgrade from hmatrix 0.15.2.1 to hmatrix-0.16.0.4 and both cabal install and cabal configure complained about missing blas and lapack libraries. However, I do have those libraries installed, and I passed their locations through --extra-include-dirs and --extra-lib-dirs with no results. I use cabal 1.20.0.3, ghc 7.8.2 and gcc 4.4.4 on a Slackware-13.1 64-bit linux box. Any idea of what is going wrong (and how to correct it?) Thanks, Adrian-Victor. ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: hmatrix-0.16.0.4 installation problem
Sorry! This is the the failed cabal install command and its output: The blas (libcblas.so) and lapack (both liblapack.a and liblapack.so) are in /usr/local/lib64, so they can be easily found. And the configure script for other software did found them. cabal install --enable-documentation hmatrix Resolving dependencies... Configuring hmatrix-0.16.0.4... cabal: Missing dependencies on foreign libraries: * Missing C libraries: blas, lapack This problem can usually be solved by installing the system packages that provide these libraries (you may need the -dev versions). If the libraries are already installed but in a non-standard location then you can use the flags --extra-include-dirs= and --extra-lib-dirs= to specify where they are. Failed to install hmatrix-0.16.0.4 cabal: Error: some packages failed to install: hmatrix-0.16.0.4 failed during the configure step. The exception was: ExitFailure 1 Adrian-Victor ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: hmatrix-0.16.0.4 installation problem
Hi, Yes, they are in /usr/local/include. Moreover, /usr/local/lib64 is a symbolic link to /usr/local/lib (as may system is a 64-bit anyway), so the libraries should be found regardless of the path they are searched on. I have atlas-3.3.8 and lapack-3.4.0. Are newer versions required? Thanks! Adrian. ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: GHC and GSL
It worked! Thank you very much! I added the following lines to hmatrix.cabal: if os(linux) if arch(x86_64) cc-options: -fPIC Maybe these lines should be included in future versions of the .cabal file. Thank you very, very much! Adrian-Victor ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
GHC and GSL
Hi, I need to import in one of my programs the minimization module form Numeric.GSL.Minimization. When I run even the example code in interactive mode, ghci crashes with a Bus error message. Is this a bug, or is something wrong with my code? The offending program follows: module MinMaxTest where import Numeric.GSL.Minimization objFunc :: [Double] - Double objFunc [x, y] = 10 * (x-1)^2 + 20 * (y-2)^2 + 30 main :: IO () main = do let (s, p) = minimize NMSimplex2 1e-2 30 [1, 1] objFunc [5, 7] print s print p I use ghc-7.6.3 on a Slackware-Linux platform. Can anyone help? Thank you in advance. Adrian-Victor ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
GHC and GSL
That's exactly what happened. Indeed, I work on a 64-bit platform, and the above program works flawlessly in compiled mode (stand-alone executable). It's a bit annoying, because I have to tinker a bit with each module in order to test it, but it works. Any idea what happens with ghci/64-bit? Thank you so much! Adrian-Victor. ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users