-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathbuild.hs
53 lines (42 loc) · 1.66 KB
/
build.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
{-# OPTIONS_GHC -Wall #-}
{-# LANGUAGE ScopedTypeVariables #-}
import Development.Shake
import Development.Shake.FilePath
main :: IO ()
main = shakeArgs shakeOptions{shakeFiles="_build"} $ do
want [ "diagrams" </> "symplectic" <.> "png"
, "RunAccGPU" <.> "ll"
, "TimeAccGPU" <.> "txt"
, "TimeJulGPU" <.> "txt"
, "RunJulGPU" <.> "ll"
]
let compile file = do
need [file]
cmd "ghc --make -O2" file
"diagrams" </> "symplectic" <.> "png" %> \_out -> do
need ["SymplecticMain"]
cmd "./SymplecticMain"
"SymplecticMain" %> \out -> do
compile (out -<.> "hs")
"RunAccGPU" <.> "ll" %> \out -> do
need ["RunAccGPU"]
(Exit _code, Stdout (_stdout :: String), Stderr (stderr :: String)) <-
cmd "./RunAccGPU +ACC -ddump-cc -dverbose -ACC"
writeFileChanged out stderr
"TimeAccGPU" <.> "txt" %> \out -> do
need ["RunAccGPU"]
(Exit _code, Stdout (_stdout :: String), Stderr (stderr :: String)) <-
cmd "./RunAccGPU +RTS -s"
writeFileChanged out stderr
"RunAccGPU" %> \out -> do
compile (out -<.> "hs")
"TimeJulGPU" <.> "txt" %> \out -> do
need ["JuliaCPU.jl"]
(Exit _code, Stdout (_stdout :: String), Stderr (stderr :: String)) <-
cmd "time /Applications/Julia-0.5.app/Contents/Resources/julia/bin/julia JuliaCPU.jl"
writeFileChanged out stderr
"RunJulGPU" <.> "ll" %> \out -> do
need ["JuliaLLVM.jl"]
(Exit _code, Stdout (stdout :: String), Stderr (_stderr :: String)) <-
cmd "/Applications/Julia-0.5.app/Contents/Resources/julia/bin/julia JuliaLLVM.jl"
writeFileChanged out stdout