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 1842 - (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 1842 (* FIXME: won't need the isAbsolute check in 110.75 *)
46 :     fun findExe (paths, name) = if OS.Path.isAbsolute name
47 :     then name
48 :     else (case PathUtil.findExe paths name
49 :     of SOME p => p
50 :     | NONE => raise Fail(concat["unable to find ", name, " executable"])
51 :     (* end case *))
52 : jhr 1115 in
53 :     val dnorm = findExe ([diderotBin, installBin, diderotSrc // "dnorm"], "dnorm")
54 :     val cc = let
55 :     val (cmd::args) = String.tokens Char.isSpace "@CC@"
56 :     val cmd = findExe (PATH, cmd)
57 :     val args = if ("@CFLAG_M64@" <> "") then "@CFLAG_M64@" :: args else args
58 :     in
59 :     String.concatWith " " (cmd::args)
60 :     end
61 : jhr 1232 val cflags = {
62 :     base = "@CFLAGS_BASE@",
63 :     pthread = "@PTHREAD_CFLAGS@",
64 : jhr 1840 cl = "@CPPFLAGS_CL@",
65 : jhr 1232 debug = "-g -O0",
66 :     (* ndebug = "-march=native -O3 -DNDEBUG" *) (* gcc complains about -march=native, even though the man page says it is supported *)
67 :     ndebug = "-O3 -DNDEBUG"
68 :     }
69 : jhr 1842 val ld = let
70 :     val (cmd::args) = String.tokens Char.isSpace "@LD@"
71 :     val cmd = findExe (PATH, cmd)
72 :     in
73 :     String.concatWith " " (cmd :: args)
74 :     end
75 : jhr 1232 val extraLibs = {
76 :     base = "@LIBM@",
77 :     pthread = "@PTHREAD_LIBS@",
78 :     cl = "@CL_LIBS@"
79 :     }
80 : jhr 1115 end (* local *)
81 : jhr 1232
82 :     (* other configuration options *)
83 :     val clEnabled = @CL_ENABLED@
84 :     val clVersion = if clEnabled
85 :     then let
86 :     val major = @CL_VERSION@ div 10000
87 :     val minor = (@CL_VERSION@ div 100) mod 100
88 :     val patch = @CL_VERSION@ mod 100
89 :     in
90 :     if patch > 0 then [major, minor, patch] else [major, minor]
91 :     end
92 :     else []
93 :     val cudaEnabled = @CUDA_ENABLED@
94 : jhr 1115 end (* local *)
95 :    
96 :     end

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