forked from google-research/dex-lang
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdex.cabal
148 lines (136 loc) · 5.08 KB
/
dex.cabal
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
cabal-version: 2.2
-- Copyright 2019 Google LLC
--
-- Use of this source code is governed by a BSD-style
-- license that can be found in the LICENSE file or at
-- https://developers.google.com/open-source/licenses/bsd
name: dex
version: 0.1.0.0
author: Dougal Maclaurin
maintainer: [email protected]
license-file: LICENSE
build-type: Simple
data-files: lib/*.dx
extra-source-files: lib/*.dx,
src/lib/dexrt.bc,
static/index.js, static/style.css
flag cuda
description: Enables building with CUDA support
default: False
flag optimized
description: Enables GHC optimizations
default: False
flag live
description: Enables live-editing environments (web notebook and terminal)
default: True
flag llvm-head
description: Use the bleeding-edge version of LLVM
default: False
flag foreign
description: Build the C interface to Dex
default: True
library dex-resources
if os(darwin)
exposed-modules: Resources
build-depends: base, bytestring, file-embed
hs-source-dirs: src/resources
default-language: Haskell2010
default-extensions: CPP
library
exposed-modules: Env, Syntax, Type, Inference, JIT, LLVMExec,
Parser, Util, Imp, Imp.Builder, Imp.Optimize,
PPrint, Algebra, Parallelize, Optimize, Serialize
Builder, Cat, Export,
Simplify, TopLevel,
Autodiff, Interpreter, Logging, CUDA,
LLVM.JIT, LLVM.Shims, Err, LabeledItems,
SaferNames.Name, SaferNames.LazyMap,
SaferNames.Syntax, SaferNames.Bridge
if flag(live)
exposed-modules: Actor, RenderHtml, LiveOutput
other-modules: Paths_dex
build-depends: base, containers, mtl, bytestring,
llvm-hs-pure, llvm-hs,
-- Parsing
megaparsec, parser-combinators,
-- Text output
prettyprinter, text,
-- Portable system utilities
filepath, directory, ansi-terminal, process, temporary,
-- Serialization
store, aeson
if flag(live)
build-depends: warp, wai, blaze-html, http-types, cmark, binary
cpp-options: -DDEX_LIVE
cxx-options: -DDEX_LIVE
if !os(darwin)
exposed-modules: Resources
hs-source-dirs: src/resources
build-depends: file-embed
else
build-depends: dex-resources
default-language: Haskell2010
hs-source-dirs: src/lib
ghc-options: -Wall -fPIC -threaded -optP-Wno-nonportable-include-path
-Wno-unticked-promoted-constructors
cxx-sources: src/lib/dexrt.cpp
cxx-options: -std=c++11 -fPIC
default-extensions: CPP, DeriveTraversable, TypeApplications, OverloadedStrings,
TupleSections, ScopedTypeVariables, LambdaCase, PatternSynonyms,
BlockArguments, GADTs, TypeOperators, DataKinds
pkgconfig-depends: libpng
if flag(cuda)
include-dirs: /usr/local/cuda/include
extra-libraries: cuda
cxx-options: -DDEX_CUDA
cpp-options: -DDEX_CUDA
if flag(optimized)
ghc-options: -O3
else
ghc-options: -O0
if flag(llvm-head)
cpp-options: -DDEX_LLVM_VERSION=HEAD
exposed-modules: LLVM.HEAD.JIT
else
cpp-options: -DDEX_LLVM_VERSION=9
exposed-modules: LLVM.V9.JIT, LLVM.V9.Shims
executable dex
main-is: dex.hs
other-extensions: OverloadedStrings
build-depends: dex, base, containers, haskeline, prettyprinter, mtl,
optparse-applicative, ansi-wl-pprint,
unix, store, bytestring, directory
if os(darwin)
build-depends: dex-resources
default-language: Haskell2010
hs-source-dirs: src
default-extensions: CPP, LambdaCase, BlockArguments
ghc-options: -optP-Wno-nonportable-include-path
if flag(live)
cpp-options: -DDEX_LIVE
if flag(optimized)
ghc-options: -O3
else
ghc-options: -O0
foreign-library Dex
if flag(foreign)
buildable: True
else
buildable: False
type: native-shared
other-modules: Dex.Foreign.API, Dex.Foreign.Util, Dex.Foreign.JIT
, Dex.Foreign.Context, Dex.Foreign.Serialize
build-depends: base, mtl, containers, llvm-hs, dex
if os(darwin)
build-depends: dex-resources
hs-source-dirs: src/
c-sources: src/Dex/Foreign/rts.c
cc-options: -std=c11 -fPIC
ghc-options: -Wall -fPIC -optP-Wno-nonportable-include-path
default-language: Haskell2010
default-extensions: TypeApplications, ScopedTypeVariables, LambdaCase,
BlockArguments
if flag(optimized)
ghc-options: -O3
else
ghc-options: -O0