Skip to content

Commit 618d47d

Browse files
committed
Add some advice on installing with stack-based workflow
fixes AccelerateHS/accelerate#391
1 parent aee9072 commit 618d47d

6 files changed

Lines changed: 141 additions & 3 deletions

File tree

get-started.html

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,10 @@
9393
<ul>
9494
<li><a href="#get-started">Get Started</a><ul>
9595
<li><a href="#setup-haskell-llvm">1. Setup Haskell &amp; LLVM</a></li>
96-
<li><a href="#install-accelerate">2. Install Accelerate</a></li>
96+
<li><a href="#install-accelerate">2. Install Accelerate</a><ul>
97+
<li><a href="#using-cabal">2.1 Using cabal</a></li>
98+
<li><a href="#using-stack">2.2 Using stack</a></li>
99+
</ul></li>
97100
<li><a href="#run-an-accelerate-program">3. Run an Accelerate program</a></li>
98101
<li><a href="#next-steps">4. Next steps</a></li>
99102
</ul></li>
@@ -107,6 +110,8 @@ <h2 id="setup-haskell-llvm">1. Setup Haskell &amp; LLVM</h2>
107110
<p>Select your operating system:</p>
108111
<p><a href="/get-started/macos" title="macOS" class="os-logo os-choose"> <img src="/media/apple-logo.svg"> </a> <a href="/get-started/linux" title="Linux" class="os-logo os-choose"> <img src="/media/linux-logo.svg"> </a> <a href="/get-started/windows" title="Windows" class="os-logo os-choose"> <img src="/media/windows-logo.svg"> </a></p>
109112
<h2 id="install-accelerate">2. Install Accelerate</h2>
113+
<p>The Haskell ecosystem has two tools to help with building and installing packages: <a href="https://www.haskell.org/cabal/"><code>cabal</code></a> (the default) which installs packages to a global location, and <a href="https://docs.haskellstack.org/en/stable/README/"><code>stack</code></a>, which has a more project-centric focus.</p>
114+
<h3 id="using-cabal">2.1 Using cabal</h3>
110115
<p>We can now install the core Accelerate library:</p>
111116
<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">cabal</span> install accelerate</code></pre></div>
112117
<p>This will install the current stable release of Accelerate from <a href="https://hackage.haskell.org">Hackage</a>. If you would like to instead install the latest in-development version, see how to <a href="/get-started/install-from-github.html">install from GitHub</a>.</p>
@@ -117,6 +122,19 @@ <h2 id="install-accelerate">2. Install Accelerate</h2>
117122
<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">cabal</span> install accelerate-llvm-native</code></pre></div>
118123
<p>(Optional) If you have a CUDA capable GPU, you can also install the Accelerate backend for NVIDIA GPUs:</p>
119124
<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">cabal</span> install accelerate-llvm-ptx</code></pre></div>
125+
<h3 id="using-stack">2.2 Using stack</h3>
126+
<p>You can use Accelerate in a stack-based workflow by including the following (or similar) into the <code>stack.yaml</code> file of your project:</p>
127+
<div class="sourceCode"><pre class="sourceCode yaml"><code class="sourceCode yaml"><span class="fu">resolver:</span> lts-9.0
128+
<span class="fu">extra-deps:</span>
129+
<span class="kw">-</span> <span class="st">&#39;accelerate-llvm-1.0.0.0&#39;</span>
130+
<span class="kw">-</span> <span class="st">&#39;accelerate-llvm-native-1.0.0.0&#39;</span>
131+
<span class="kw">-</span> <span class="st">&#39;accelerate-llvm-ptx-1.0.0.0&#39;</span>
132+
<span class="kw">-</span> <span class="st">&#39;cuda-0.7.5.3&#39;</span>
133+
<span class="kw">-</span> <span class="st">&#39;llvm-hs-4.0.1.0&#39;</span>
134+
<span class="kw">-</span> <span class="st">&#39;llvm-hs-pure-4.0.0.0&#39;</span>
135+
<span class="fu">flags:</span>
136+
<span class="fu">llvm-hs:</span>
137+
<span class="fu">shared-llvm:</span> true</code></pre></div>
120138
<h2 id="run-an-accelerate-program">3. Run an Accelerate program</h2>
121139
<p>Copy the following content into a file called <code>Dotp.hs</code>. This simple example computes the dot product of two vectors of single-precision floating-point numbers. If you installed the GPU backend in step <a href="#install-accelerate">2</a>, you can uncomment the third line (delete the leading <code>--</code>) to enable both the CPU and GPU backends.</p>
122140
<div class="sourceCode"><pre class="sourceCode haskell"><code class="sourceCode haskell"><span class="kw">import </span><span class="dt">Data.Array.Accelerate</span> <span class="kw">as</span> <span class="dt">A</span>

get-started/linux.html

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,10 @@
9797
<li><a href="#llvm">1.2 LLVM</a></li>
9898
<li><a href="#cuda-optional">1.3 CUDA (optional)</a></li>
9999
</ul></li>
100-
<li><a href="#install-accelerate">2. Install Accelerate</a></li>
100+
<li><a href="#install-accelerate">2. Install Accelerate</a><ul>
101+
<li><a href="#using-cabal">2.1 Using cabal</a></li>
102+
<li><a href="#using-stack">2.2 Using stack</a></li>
103+
</ul></li>
101104
<li><a href="#run-an-accelerate-program">3. Run an Accelerate program</a></li>
102105
<li><a href="#next-steps">4. Next steps</a></li>
103106
</ul></li>
@@ -128,6 +131,8 @@ <h3 id="llvm">1.2 LLVM</h3>
128131
<h3 id="cuda-optional">1.3 CUDA (optional)</h3>
129132
<p>If you have a CUDA capable NVIDIA GPU (see the <a href="https://en.wikipedia.org/wiki/CUDA#GPUs_supported">list of supported devices</a>) and would like to run Accelerate programs on the GPU, you will need to download and install the CUDA toolkit available <a href="https://developer.nvidia.com/cuda-downloads">here</a>.</p>
130133
<h2 id="install-accelerate">2. Install Accelerate</h2>
134+
<p>The Haskell ecosystem has two tools to help with building and installing packages: <a href="https://www.haskell.org/cabal/"><code>cabal</code></a> (the default) which installs packages to a global location, and <a href="https://docs.haskellstack.org/en/stable/README/"><code>stack</code></a>, which has a more project-centric focus.</p>
135+
<h3 id="using-cabal">2.1 Using cabal</h3>
131136
<p>We can now install the core Accelerate library:</p>
132137
<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">cabal</span> install accelerate</code></pre></div>
133138
<p>This will install the current stable release of Accelerate from <a href="https://hackage.haskell.org">Hackage</a>. If you would like to instead install the latest in-development version, see how to <a href="/get-started/install-from-github.html">install from GitHub</a>.</p>
@@ -138,6 +143,19 @@ <h2 id="install-accelerate">2. Install Accelerate</h2>
138143
<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">cabal</span> install accelerate-llvm-native</code></pre></div>
139144
<p>(Optional) If you have a CUDA capable GPU and installed the CUDA toolkit in step <a href="#cuda-optional">1.3</a>, you can also install the Accelerate backend for NVIDIA GPUs:</p>
140145
<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">cabal</span> install accelerate-llvm-ptx</code></pre></div>
146+
<h3 id="using-stack">2.2 Using stack</h3>
147+
<p>You can use Accelerate in a stack-based workflow by including the following (or similar) into the <code>stack.yaml</code> file of your project:</p>
148+
<div class="sourceCode"><pre class="sourceCode yaml"><code class="sourceCode yaml"><span class="fu">resolver:</span> lts-9.0
149+
<span class="fu">extra-deps:</span>
150+
<span class="kw">-</span> <span class="st">&#39;accelerate-llvm-1.0.0.0&#39;</span>
151+
<span class="kw">-</span> <span class="st">&#39;accelerate-llvm-native-1.0.0.0&#39;</span>
152+
<span class="kw">-</span> <span class="st">&#39;accelerate-llvm-ptx-1.0.0.0&#39;</span>
153+
<span class="kw">-</span> <span class="st">&#39;cuda-0.7.5.3&#39;</span>
154+
<span class="kw">-</span> <span class="st">&#39;llvm-hs-4.0.1.0&#39;</span>
155+
<span class="kw">-</span> <span class="st">&#39;llvm-hs-pure-4.0.0.0&#39;</span>
156+
<span class="fu">flags:</span>
157+
<span class="fu">llvm-hs:</span>
158+
<span class="fu">shared-llvm:</span> true</code></pre></div>
141159
<h2 id="run-an-accelerate-program">3. Run an Accelerate program</h2>
142160
<p>Copy the following content into a file called <code>Dotp.hs</code>. This simple example computes the dot product of two vectors of single-precision floating-point numbers. If you installed the GPU backend in step <a href="#install-accelerate">2</a>, you can uncomment the third line (delete the leading <code>--</code>) to enable both the CPU and GPU backends.</p>
143161
<div class="sourceCode"><pre class="sourceCode haskell"><code class="sourceCode haskell"><span class="kw">import </span><span class="dt">Data.Array.Accelerate</span> <span class="kw">as</span> <span class="dt">A</span>

get-started/macos.html

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,10 @@
9797
<li><a href="#llvm">1.2 LLVM</a></li>
9898
<li><a href="#cuda-optional">1.3 CUDA (optional)</a></li>
9999
</ul></li>
100-
<li><a href="#install-accelerate">2. Install Accelerate</a></li>
100+
<li><a href="#install-accelerate">2. Install Accelerate</a><ul>
101+
<li><a href="#using-cabal">2.1 Using cabal</a></li>
102+
<li><a href="#using-stack">2.2 Using stack</a></li>
103+
</ul></li>
101104
<li><a href="#run-an-accelerate-program">3. Run an Accelerate program</a></li>
102105
<li><a href="#next-steps">4. Next steps</a></li>
103106
</ul></li>
@@ -121,6 +124,8 @@ <h3 id="llvm">1.2 LLVM</h3>
121124
<h3 id="cuda-optional">1.3 CUDA (optional)</h3>
122125
<p>If you have a CUDA capable NVIDIA GPU (see the <a href="https://en.wikipedia.org/wiki/CUDA#GPUs_supported">list of supported devices</a>) and would like to run Accelerate programs on the GPU, you will need to download and install the CUDA toolkit available <a href="https://developer.nvidia.com/cuda-downloads">here</a>.</p>
123126
<h2 id="install-accelerate">2. Install Accelerate</h2>
127+
<p>The Haskell ecosystem has two tools to help with building and installing packages: <a href="https://www.haskell.org/cabal/"><code>cabal</code></a> (the default) which installs packages to a global location, and <a href="https://docs.haskellstack.org/en/stable/README/"><code>stack</code></a>, which has a more project-centric focus.</p>
128+
<h3 id="using-cabal">2.1 Using cabal</h3>
124129
<p>We can now install the core Accelerate library:</p>
125130
<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">cabal</span> install accelerate</code></pre></div>
126131
<p>This will install the current stable release of Accelerate from <a href="https://hackage.haskell.org">Hackage</a>. If you would like to instead install the latest in-development version, see how to <a href="/get-started/install-from-github.html">install from GitHub</a>.</p>
@@ -131,6 +136,19 @@ <h2 id="install-accelerate">2. Install Accelerate</h2>
131136
<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">cabal</span> install accelerate-llvm-native</code></pre></div>
132137
<p>(Optional) If you have a CUDA capable GPU and installed the CUDA toolkit in step <a href="#cuda-optional">1.3</a>, you can also install the Accelerate backend for NVIDIA GPUs:</p>
133138
<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">cabal</span> install accelerate-llvm-ptx</code></pre></div>
139+
<h3 id="using-stack">2.2 Using stack</h3>
140+
<p>You can use Accelerate in a stack-based workflow by including the following (or similar) into the <code>stack.yaml</code> file of your project:</p>
141+
<div class="sourceCode"><pre class="sourceCode yaml"><code class="sourceCode yaml"><span class="fu">resolver:</span> lts-9.0
142+
<span class="fu">extra-deps:</span>
143+
<span class="kw">-</span> <span class="st">&#39;accelerate-llvm-1.0.0.0&#39;</span>
144+
<span class="kw">-</span> <span class="st">&#39;accelerate-llvm-native-1.0.0.0&#39;</span>
145+
<span class="kw">-</span> <span class="st">&#39;accelerate-llvm-ptx-1.0.0.0&#39;</span>
146+
<span class="kw">-</span> <span class="st">&#39;cuda-0.7.5.3&#39;</span>
147+
<span class="kw">-</span> <span class="st">&#39;llvm-hs-4.0.1.0&#39;</span>
148+
<span class="kw">-</span> <span class="st">&#39;llvm-hs-pure-4.0.0.0&#39;</span>
149+
<span class="fu">flags:</span>
150+
<span class="fu">llvm-hs:</span>
151+
<span class="fu">shared-llvm:</span> true</code></pre></div>
134152
<h2 id="run-an-accelerate-program">3. Run an Accelerate program</h2>
135153
<p>Copy the following content into a file called <code>Dotp.hs</code>. This simple example computes the dot product of two vectors of single-precision floating-point numbers. If you installed the GPU backend in step <a href="#install-accelerate">2</a>, you can uncomment the third line (delete the leading <code>--</code>) to enable both the CPU and GPU backends.</p>
136154
<div class="sourceCode"><pre class="sourceCode haskell"><code class="sourceCode haskell"><span class="kw">import </span><span class="dt">Data.Array.Accelerate</span> <span class="kw">as</span> <span class="dt">A</span>

md/get-started.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,15 @@ Select your operating system:
3535

3636
## 2. Install Accelerate
3737

38+
The Haskell ecosystem has two tools to help with building and installing
39+
packages: [`cabal`](https://www.haskell.org/cabal/) (the default) which installs
40+
packages to a global location, and
41+
[`stack`](https://docs.haskellstack.org/en/stable/README/), which has a more
42+
project-centric focus.
43+
44+
45+
### 2.1 Using cabal
46+
3847
We can now install the core Accelerate library:
3948
```sh
4049
cabal install accelerate
@@ -70,6 +79,25 @@ backend for NVIDIA GPUs:
7079
cabal install accelerate-llvm-ptx
7180
```
7281

82+
### 2.2 Using stack
83+
84+
You can use Accelerate in a stack-based workflow by including the following (or
85+
similar) into the `stack.yaml` file of your project:
86+
87+
```yaml
88+
resolver: lts-9.0
89+
extra-deps:
90+
- 'accelerate-llvm-1.0.0.0'
91+
- 'accelerate-llvm-native-1.0.0.0'
92+
- 'accelerate-llvm-ptx-1.0.0.0'
93+
- 'cuda-0.7.5.3'
94+
- 'llvm-hs-4.0.1.0'
95+
- 'llvm-hs-pure-4.0.0.0'
96+
flags:
97+
llvm-hs:
98+
shared-llvm: true
99+
```
100+
73101
74102
## 3. Run an Accelerate program
75103

md/get-started/linux.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,15 @@ CUDA toolkit available [here](https://developer.nvidia.com/cuda-downloads).
8585

8686
## 2. Install Accelerate
8787

88+
The Haskell ecosystem has two tools to help with building and installing
89+
packages: [`cabal`](https://www.haskell.org/cabal/) (the default) which installs
90+
packages to a global location, and
91+
[`stack`](https://docs.haskellstack.org/en/stable/README/), which has a more
92+
project-centric focus.
93+
94+
95+
### 2.1 Using cabal
96+
8897
We can now install the core Accelerate library:
8998
```sh
9099
cabal install accelerate
@@ -121,6 +130,25 @@ NVIDIA GPUs:
121130
cabal install accelerate-llvm-ptx
122131
```
123132

133+
### 2.2 Using stack
134+
135+
You can use Accelerate in a stack-based workflow by including the following (or
136+
similar) into the `stack.yaml` file of your project:
137+
138+
```yaml
139+
resolver: lts-9.0
140+
extra-deps:
141+
- 'accelerate-llvm-1.0.0.0'
142+
- 'accelerate-llvm-native-1.0.0.0'
143+
- 'accelerate-llvm-ptx-1.0.0.0'
144+
- 'cuda-0.7.5.3'
145+
- 'llvm-hs-4.0.1.0'
146+
- 'llvm-hs-pure-4.0.0.0'
147+
flags:
148+
llvm-hs:
149+
shared-llvm: true
150+
```
151+
124152
125153
## 3. Run an Accelerate program
126154

md/get-started/macos.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,15 @@ CUDA toolkit available [here](https://developer.nvidia.com/cuda-downloads).
7575

7676
## 2. Install Accelerate
7777

78+
The Haskell ecosystem has two tools to help with building and installing
79+
packages: [`cabal`](https://www.haskell.org/cabal/) (the default) which installs
80+
packages to a global location, and
81+
[`stack`](https://docs.haskellstack.org/en/stable/README/), which has a more
82+
project-centric focus.
83+
84+
85+
### 2.1 Using cabal
86+
7887
We can now install the core Accelerate library:
7988
```sh
8089
cabal install accelerate
@@ -111,6 +120,25 @@ NVIDIA GPUs:
111120
cabal install accelerate-llvm-ptx
112121
```
113122

123+
### 2.2 Using stack
124+
125+
You can use Accelerate in a stack-based workflow by including the following (or
126+
similar) into the `stack.yaml` file of your project:
127+
128+
```yaml
129+
resolver: lts-9.0
130+
extra-deps:
131+
- 'accelerate-llvm-1.0.0.0'
132+
- 'accelerate-llvm-native-1.0.0.0'
133+
- 'accelerate-llvm-ptx-1.0.0.0'
134+
- 'cuda-0.7.5.3'
135+
- 'llvm-hs-4.0.1.0'
136+
- 'llvm-hs-pure-4.0.0.0'
137+
flags:
138+
llvm-hs:
139+
shared-llvm: true
140+
```
141+
114142
115143
## 3. Run an Accelerate program
116144

0 commit comments

Comments
 (0)