Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Annotation of /trunk/src/compiler/common/paths_sml.in
ViewVC logotype

Annotation of /trunk/src/compiler/common/paths_sml.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1840 - (view) (download)

1 : jhr 1115 (* paths.sml
2 :     *
3 :     * COPYRIGHT (c) 2011 The Diderot Project (http://diderot-language.cs.uchicago.edu)
4 :     * All rights reserved.
5 :     *
6 :     * @configure_input@
7 :     *)
8 :    
9 :     structure Paths =
10 :     struct
11 :    
12 :     local
13 :     val // = OS.Path.concat
14 :     infixr 4 //
15 :     in
16 :     (* directories for Diderot stuff *)
17 :     val diderotBin = "@DIDEROT_ROOT@" // "bin"
18 : jhr 1232 val diderotLib = "@DIDEROT_ROOT@" // "lib"
19 : jhr 1115 val diderotSrc = "@DIDEROT_ROOT@" // "src"
20 : jhr 1232 val diderotInclude = diderotSrc // "include"
21 : jhr 1115
22 :     (* directories for Teem stuff *)
23 :     val teemBin = "@TEEM_DIR@" // "bin"
24 :     val teemInclude = "@TEEM_DIR@" // "include"
25 :     val teemLib = "@TEEM_DIR@" // "lib"
26 :     val teemLinkFlags = if @LD_NEEDS_RPATH@
27 :     then ["-Wl,-rpath=" ^ teemLib, "-L" ^ teemLib, "-lteem"]
28 :     else ["-L" ^ teemLib, "-lteem"]
29 :    
30 :     (* installation directories for Diderot stuff *)
31 :     val installBin = "@prefix@" // "bin"
32 :     val installInclude = "@prefix@" // "include"
33 :     val installLib = "@prefix@" // "lib"
34 :    
35 :     (* paths to some useful tools *)
36 :     local
37 :     (* get the user's PATH environment variable as a list of paths. Note that this is
38 :     * executed at build time.
39 :     *)
40 :     val PATH = let
41 :     val path = (case (OS.Process.getEnv "PATH") of (SOME p) => p | _ => "")
42 :     in
43 :     String.fields (fn #":" => true | _ => false) path
44 :     end (* getPath *)
45 : jhr 1640 fun findExe (paths, name) = (case PathUtil.findExe paths name
46 :     of SOME p => p
47 :     | NONE => raise Fail(concat["unable to find ", name, " executable"])
48 :     (* end case *))
49 : jhr 1115 in
50 :     val dnorm = findExe ([diderotBin, installBin, diderotSrc // "dnorm"], "dnorm")
51 :     val cc = let
52 :     val (cmd::args) = String.tokens Char.isSpace "@CC@"
53 :     val cmd = findExe (PATH, cmd)
54 :     val args = if ("@CFLAG_M64@" <> "") then "@CFLAG_M64@" :: args else args
55 :     in
56 :     String.concatWith " " (cmd::args)
57 :     end
58 : jhr 1232 val cflags = {
59 :     base = "@CFLAGS_BASE@",
60 :     pthread = "@PTHREAD_CFLAGS@",
61 : jhr 1840 cl = "@CPPFLAGS_CL@",
62 : jhr 1232 debug = "-g -O0",
63 :     (* ndebug = "-march=native -O3 -DNDEBUG" *) (* gcc complains about -march=native, even though the man page says it is supported *)
64 :     ndebug = "-O3 -DNDEBUG"
65 :     }
66 :     val extraLibs = {
67 :     base = "@LIBM@",
68 :     pthread = "@PTHREAD_LIBS@",
69 :     cl = "@CL_LIBS@"
70 :     }
71 : jhr 1115 end (* local *)
72 : jhr 1232
73 :     (* other configuration options *)
74 :     val clEnabled = @CL_ENABLED@
75 :     val clVersion = if clEnabled
76 :     then let
77 :     val major = @CL_VERSION@ div 10000
78 :     val minor = (@CL_VERSION@ div 100) mod 100
79 :     val patch = @CL_VERSION@ mod 100
80 :     in
81 :     if patch > 0 then [major, minor, patch] else [major, minor]
82 :     end
83 :     else []
84 :     val cudaEnabled = @CUDA_ENABLED@
85 : jhr 1115 end (* local *)
86 :    
87 :     end

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0