From d109c791aef6dbb6a15fb65efe5c42121728aed0 Mon Sep 17 00:00:00 2001 From: Alberto Ruiz Date: Wed, 21 Mar 2012 19:42:44 +0100 Subject: fall back to old ode if v2 not available --- Config.hs | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'Config.hs') diff --git a/Config.hs b/Config.hs index 2ea0fa8..3582ef5 100644 --- a/Config.hs +++ b/Config.hs @@ -79,6 +79,18 @@ gsl112 bInfo buildInfo = ++ (join $ map ("-L"++) $ extraLibDirs buildInfo) ++ " -lgsl -lgslcblas" ++ " > /dev/null 2> /dev/null" +-- test for odeiv2 +gslodeiv2 bInfo buildInfo = + "echo \"#include \nint main(){return 0;}\"" + ++" > " ++ (buildDir bInfo) ++ "/dummy.c; gcc " + ++ (buildDir bInfo) ++ "/dummy.c " + ++ (join $ ccOptions buildInfo) ++ " " + ++ (join $ cppOptions buildInfo) ++ " " + ++ (join $ map ("-I"++) $ includeDirs buildInfo) + ++" -o " ++ (buildDir bInfo) ++ "/dummy " + ++ (join $ map ("-L"++) $ extraLibDirs buildInfo) ++ " -lgsl -lgslcblas" + ++ " > /dev/null 2> /dev/null" + checkCommand c = (ExitSuccess ==) `fmap` system c @@ -133,9 +145,11 @@ config bInfo = do return (Just emptyBuildInfo { buildable = False }, []) Just ops -> do putStrLn $ " OK " ++ ops - g <- checkCommand $ gsl112 bInfo buildInfo - let hbi = if g - then emptyBuildInfo { extraLibs = words ops} - else emptyBuildInfo { extraLibs = words ops, ccOptions = ["-DGSL110"]} + g1 <- checkCommand $ gsl112 bInfo buildInfo + let op1 = if g1 then "" else "-DGSL110" + g2 <- checkCommand $ gslodeiv2 bInfo buildInfo + let op2 = if g2 then "" else "-DGSLODE1" + opts = filter (not.null) [op1,op2] + let hbi = emptyBuildInfo { extraLibs = words ops, ccOptions = opts } return (Just hbi, []) -- cgit v1.2.3