From 38d7b765f024b1f1aa42daf8b94050e43383ebec Mon Sep 17 00:00:00 2001 From: Alberto Ruiz Date: Mon, 4 May 2009 10:11:04 +0000 Subject: minor change in configure.hs --- configure.hs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/configure.hs b/configure.hs index 3b0aaa3..2764dbc 100644 --- a/configure.hs +++ b/configure.hs @@ -36,7 +36,8 @@ opts = [ "" -- Ubuntu/Debian ] -- compile a simple program with symbols from GSL and LAPACK with the given libs -testprog libs fmks = "echo \"int main(){zgesvd_(); gsl_sf_gamma();}\" > /tmp/dummy.c; gcc /tmp/dummy.c " +testprog libs fmks = "echo \"#include \nint main(){zgesvd_(); gsl_sf_gamma();}\"" + ++" > /tmp/dummy.c; gcc /tmp/dummy.c -o /tmp/dummy " ++ f1 libs ++ " " ++ f2 fmks ++ " > /dev/null 2> /dev/null" f1 = unwords . map ("-l"++) . words @@ -44,6 +45,13 @@ f2 = unwords . map ("-framework "++) . words check libs fmks = (ExitSuccess ==) `fmap` system (testprog libs fmks) +-- simple test for GSL +testGSL = "echo \"#include \nint main(){gsl_sf_gamma();}\"" + ++" > /tmp/dummy.c; gcc /tmp/dummy.c -o /tmp/dummy -lgsl -lgslcblas" + ++ " > /dev/null 2> /dev/null" + +checkGSL = (ExitSuccess ==) `fmap` system (testGSL) + -- test different configurations until the first one works try _ _ [] = return Nothing try b f (opt:rest) = do @@ -80,7 +88,10 @@ main = do case r of Nothing -> do putStrLn " FAIL" - putStrLn " *** Sorry, I can't link gsl and lapack." + g <- checkGSL + if g + then putStrLn " *** Sorry, I can't link LAPACK." + else putStrLn " *** Sorry, I can't link GSL." putStrLn " *** Please make sure that the appropriate -dev packages are installed." putStrLn " *** You can also specify the required libraries using" putStrLn " *** cabal install hmatrix --configure-option=link:lib1,lib2,lib3,etc." -- cgit v1.2.3