
2008/6/6 Patrick Perry
Apart from some warnings, the library compiles fine in my system. But there is a minor issue about the library it links against when `./Setup test'. I need to use `-lcblas' instead of `-lblas' to get it to link to correct libraries. I don't know other people's system. But in my system, Gentoo Linux, I use blas library provided by atlas, and libblas.so is a fortran library and libcblas.so is for C.
I don't know of a good way to get around this. It seems like every system has a different convention for the location and name of the cblas libraries. So, everyone has to edit the "extra-libraries" and the "extra-lib-dirs" field in the blas.cabal file. Does anyone know of a better way of doing this?
My preference is to use an autoconf script to solve that problem. ("build-type: Configure" in the cabal file.) For example, the editline and readline C libraries require termcap, which may be linked using one of -lcurses, -ltermcap, etc. The Haskell packages have a configure script which checks which of curses/termcap is available and outputs an editline.buildinfo file with the extra-libraries field filled in. That file is then used automatically by cabal in the build and install phases. See for example: http://code.haskell.org/editline/editline.cabal http://code.haskell.org/editline/configure.ac http://code.haskell.org/editline/editline.buildinfo.in There's also more information is in the Cabal manual: http://haskell.org/cabal/release/latest/doc/users-guide/x30.html#system-depe... Best, -Judah