Skip to content

Commit 0c6ad85

Browse files
committed
update build instructions for llvm-4.0
1 parent dc99eab commit 0c6ad85

6 files changed

Lines changed: 50 additions & 63 deletions

File tree

get-started.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ <h2 id="install-accelerate">2. Install Accelerate</h2>
111111
<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">cabal</span> install accelerate</code></pre></div>
112112
<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>
113113
<p>This is sufficient to write programs in Accelerate as well as execute them using the included interpreter backend.<a href="#fn1" class="footnoteRef" id="fnref1"><sup>1</sup></a> For good performance however we also need to install one (or both) of the LLVM backends, which will compile Accelerate programs to native code.</p>
114-
<p>Install a version of the <code>llvm-general</code> package suitable for the version of LLVM installed on your system. The first two numbers of the version of LLVM and the <code>llvm-general</code> package must match. We must also install with shared library support so that we can use <code>llvm-general</code> from within <code>ghci</code> (and Template Haskell). For example, if you have LLVM-3.8 installed:</p>
115-
<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">cabal</span> install llvm-general -fshared-llvm --constraint=<span class="st">&quot;llvm-general==3.8.*&quot;</span></code></pre></div>
114+
<p>Install a version of the <code>llvm-hs</code> package suitable for the version of LLVM installed on your system. The first two numbers of the version of LLVM and the <code>llvm-hs</code> package must match. We must also install with shared library support so that we can use <code>llvm-hs</code> from within <code>ghci</code> and Template Haskell. For example, if you have LLVM-4.0 installed:</p>
115+
<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">cabal</span> install llvm-hs -fshared-llvm --constraint=<span class="st">&quot;llvm-hs==4.0.*&quot;</span></code></pre></div>
116116
<p>Install the Accelerate LLVM backend for multicore CPUs:</p>
117117
<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">cabal</span> install accelerate-llvm-native</code></pre></div>
118118
<p>(Optional) If you have a CUDA capable GPU, you can also install the Accelerate backend for NVIDIA GPUs:</p>

get-started/linux.html

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -111,30 +111,29 @@ <h2 id="setup-haskell-llvm">1. Setup Haskell &amp; LLVM</h2>
111111
<p>Selected operating system: <strong>Linux</strong></p>
112112
<p><a href="/get-started/macos" title="macOS" class="os-logo os-faded"> <img src="/media/apple-logo.svg"> </a> <a href="/get-started/linux" title="Linux" class="os-logo"> <img src="/media/linux-logo.svg"> </a> <a href="/get-started/windows" title="Windows" class="os-logo os-faded"> <img src="/media/windows-logo.svg"> </a></p>
113113
<h3 id="ghc">1.1 GHC</h3>
114-
<p>Download and install <a href="https://www.haskell.org/downloads/linux">GHC</a>. Binary package-based installers are available for a number of Linux distributions, as described on the linked site. Accelerate is currently tested with GHC version 7.10.x and 8.0.x, but should also work with 7.8.x. Remember which version of GHC you install, as this will be important in the next step.</p>
114+
<p>Download and install <a href="https://www.haskell.org/downloads/linux">GHC</a>. Binary package-based installers are available for a number of Linux distributions, as described on the linked site. Accelerate is currently tested with GHC version 8.0.x and 7.10.x, but should also work with 7.8.x.</p>
115115
<h3 id="llvm">1.2 LLVM</h3>
116116
<p>Executing an Accelerate program differs from that of regular Haskell programs. Programs written in Accelerate require both the Accelerate library, which contains the operations of the language we use to write programs, as well as a (or several) backend(s) which will compile and execute the program for a particular target architecture, such as CPUs or GPUs.</p>
117-
<p>The two primary Accelerate backends are currently based on <a href="http://llvm.org">LLVM</a>, a mature optimising compiler targeting several architectures. Binary distributions of LLVM are available for Debian and Ubuntu systems at <a href="http://apt.llvm.org">apt.llvm.org</a>, or can be compiled manually from the source releases found <a href="http://llvm.org/releases/download.html">here</a>. If compiling from source be sure to build LLVM with shared library support.</p>
118-
<p>Example process of installing LLVM-3.8 on Ubuntu-16.04:</p>
117+
<p>The two primary Accelerate backends are currently based on <a href="http://llvm.org">LLVM</a>, a mature optimising compiler targeting several architectures. Binary distributions of LLVM are available for Debian and Ubuntu systems at <a href="http://apt.llvm.org">apt.llvm.org</a>, or can be compiled manually from the source releases found <a href="http://llvm.org/releases/download.html">here</a>. If compiling from source be sure to build LLVM with the <code>libLLVM</code> shared library.<a href="#fn1" class="footnoteRef" id="fnref1"><sup>1</sup></a></p>
118+
<p>Example process of installing LLVM-4.0 on Ubuntu-16.04:</p>
119119
<ol style="list-style-type: decimal">
120120
<li><p>Retrieve the archive signature:</p>
121121
<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="fu">wget</span> -O - http://apt.llvm.org/llvm-snapshot.gpg.key <span class="kw">|</span> <span class="fu">sudo</span> apt-key add -</code></pre></div></li>
122122
<li><p>Add the APT package locations:</p>
123123
<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">deb</span> http://apt.llvm.org/xenial/ llvm-toolchain-xenial main
124-
<span class="ex">deb</span> http://apt.llvm.org/xenial/ llvm-toolchain-xenial-3.8 main</code></pre></div></li>
124+
<span class="ex">deb</span> http://apt.llvm.org/xenial/ llvm-toolchain-xenial-4.0 main</code></pre></div></li>
125125
<li><p>Install LLVM:</p>
126-
<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">apt-get</span> install llvm-3.8-dev</code></pre></div></li>
126+
<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">apt-get</span> install llvm-4.0-dev</code></pre></div></li>
127127
</ol>
128-
<p>The LLVM-based Accelerate packages are currently tested with LLVM versions 3.5, 3.8, and 3.9. However, LLVM-3.5 is currently not compatible with GHC-8.0. Please contact us if this is a problem for you. Remember which version of LLVM you install.</p>
129128
<h3 id="cuda-optional">1.3 CUDA (optional)</h3>
130129
<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>
131130
<h2 id="install-accelerate">2. Install Accelerate</h2>
132131
<p>We can now install the core Accelerate library:</p>
133132
<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">cabal</span> install accelerate</code></pre></div>
134133
<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>
135-
<p>This is sufficient to write programs in Accelerate as well as execute them using the included interpreter backend.<a href="#fn1" class="footnoteRef" id="fnref1"><sup>1</sup></a> For good performance however we also need to install one (or both) of the LLVM backends, which will compile Accelerate programs to native code.</p>
136-
<p>Install a version of the <code>llvm-general</code> package suitable for the version of LLVM installed in step <a href="#llvm">1.2</a>.<a href="#fn2" class="footnoteRef" id="fnref2"><sup>2</sup></a> The first two numbers of the version of LLVM and the <code>llvm-general</code> package must match. We must also install with shared library support so that we can use <code>llvm-general</code> from within <code>ghci</code> (and Template Haskell). Continuing the example above where we installed LLVM-3.8:</p>
137-
<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">cabal</span> install llvm-general -fshared-llvm --constraint=<span class="st">&quot;llvm-general==3.8.*&quot;</span></code></pre></div>
134+
<p>This is sufficient to write programs in Accelerate as well as execute them using the included interpreter backend.<a href="#fn2" class="footnoteRef" id="fnref2"><sup>2</sup></a> For good performance however we also need to install one (or both) of the LLVM backends, which will compile Accelerate programs to native code.</p>
135+
<p>Install a version of the <code>llvm-hs</code> package suitable for the version of LLVM installed in step <a href="#llvm">1.2</a>. The first two numbers of the version of LLVM and the <code>llvm-hs</code> package must match. We must also install with shared library support so that we can use <code>llvm-hs</code> from within <code>ghci</code> and Template Haskell. Continuing the example above where we installed LLVM-4.0:</p>
136+
<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">cabal</span> install llvm-hs -fshared-llvm --constraint=<span class="st">&quot;llvm-hs==4.0.*&quot;</span></code></pre></div>
138137
<p>Install the Accelerate LLVM backend for multicore CPUs:</p>
139138
<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">cabal</span> install accelerate-llvm-native</code></pre></div>
140139
<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>
@@ -171,8 +170,8 @@ <h2 id="next-steps">4. Next steps</h2>
171170
<div class="footnotes">
172171
<hr />
173172
<ol>
174-
<li id="fn1"><p>Although the core <code>accelerate</code> package includes an interpreter that can be used to run Accelerate programs, its performance is fairly poor as it is designed as a reference implementation of the language semantics, rather than for performance.<a href="#fnref1"></a></p></li>
175-
<li id="fn2"><p>This constraint is also why we currently can not support LLVM-3.6, LLVM-3.7, or LLVM-3.5 on GHC-8.0; <code>llvm-general</code> is unfortunately not currently available for those targets.<a href="#fnref2"></a></p></li>
173+
<li id="fn1"><p>Include the build options <code>-DLLVM_BUILD_LLVM_DYLIB=True</code> and <code>-DLLVM_LINK_LLVM_DYLIB=True</code>.<a href="#fnref1"></a></p></li>
174+
<li id="fn2"><p>Although the core <code>accelerate</code> package includes an interpreter that can be used to run Accelerate programs, its performance is fairly poor as it is designed as a reference implementation of the language semantics, rather than for performance.<a href="#fnref2"></a></p></li>
176175
</ol>
177176
</div>
178177
</div>

get-started/macos.html

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -114,20 +114,19 @@ <h3 id="ghc">1.1 GHC</h3>
114114
<p>Download and install <a href="https://www.haskell.org/platform/mac.html">GHC</a>. The minimal binary distribution contains GHC-8.0 plus build tools such as <code>cabal</code>, and is the generally recommended option over the full install (which additionally includes some pre-installed libraries). Instructions for installing via the <a href="http://brew.sh">Homebrew</a> or <a href="https://www.macports.org">MacPorts</a> package managers are also available on that page.</p>
115115
<h3 id="llvm">1.2 LLVM</h3>
116116
<p>Executing an Accelerate program differs from that of regular Haskell programs. Programs written in Accelerate require both the Accelerate library, which contains the operations of the language we use to write programs, as well as a (or several) backend(s) which will compile and execute the program for a particular target architecture, such as CPUs or GPUs.</p>
117-
<p>The two primary Accelerate backends are currently based on <a href="http://llvm.org">LLVM</a>, a mature optimising compiler targeting several architectures. LLVM is available through both the Homebrew and MacPorts package managers, or can be compiled manually from the source releases found <a href="http://llvm.org/releases/download.html">here</a>. If compiling from source be sure to build LLVM with shared library support.</p>
118-
<p>Example of installing LLVM-3.8 via <a href="http://brew.sh">Homebrew</a>:</p>
117+
<p>The two primary Accelerate backends are currently based on <a href="http://llvm.org">LLVM</a>, a mature optimising compiler targeting several architectures. LLVM is available through both the Homebrew and MacPorts package managers, or can be compiled manually from the source releases found <a href="http://llvm.org/releases/download.html">here</a>. If compiling from source be sure to build LLVM with the <code>libLLVM</code> shared library.<a href="#fn1" class="footnoteRef" id="fnref1"><sup>1</sup></a></p>
118+
<p>Example of installing LLVM-4.0 via <a href="http://brew.sh">Homebrew</a>:</p>
119119
<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">brew</span> install libffi
120-
<span class="ex">brew</span> install homebrew/versions/llvm38 --all-targets</code></pre></div>
121-
<p>The LLVM-based Accelerate packages are currently tested with LLVM versions 3.5, 3.8, and 3.9. However, LLVM-3.5 is currently not compatible with GHC-8.0. Please contact us if this is a problem for you.</p>
120+
<span class="ex">brew</span> install llvm-hs/homebrew-llvm/llvm-4.0</code></pre></div>
122121
<h3 id="cuda-optional">1.3 CUDA (optional)</h3>
123122
<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>
124123
<h2 id="install-accelerate">2. Install Accelerate</h2>
125124
<p>We can now install the core Accelerate library:</p>
126125
<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">cabal</span> install accelerate</code></pre></div>
127126
<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>
128-
<p>This is sufficient to write programs in Accelerate as well as execute them using the included interpreter backend.<a href="#fn1" class="footnoteRef" id="fnref1"><sup>1</sup></a> For good performance however we also need to install one (or both) of the LLVM backends, which will compile Accelerate programs to native code.</p>
129-
<p>Install a version of the <code>llvm-general</code> package suitable for the version of LLVM installed in step <a href="#llvm">1.2</a>.<a href="#fn2" class="footnoteRef" id="fnref2"><sup>2</sup></a> The first two numbers of the version of LLVM and the <code>llvm-general</code> package must match. We must also install with shared library support so that we can use <code>llvm-general</code> from within <code>ghci</code> (and Template Haskell). Continuing the example above where we installed LLVM-3.8:</p>
130-
<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">cabal</span> install llvm-general -fshared-llvm --constraint=<span class="st">&quot;llvm-general==3.8.*&quot;</span></code></pre></div>
127+
<p>This is sufficient to write programs in Accelerate as well as execute them using the included interpreter backend.<a href="#fn2" class="footnoteRef" id="fnref2"><sup>2</sup></a> For good performance however we also need to install one (or both) of the LLVM backends, which will compile Accelerate programs to native code.</p>
128+
<p>Install a version of the <code>llvm-hs</code> package suitable for the version of LLVM installed in step <a href="#llvm">1.2</a>. The first two numbers of the version of LLVM and the <code>llvm-hs</code> package must match. We must also install with shared library support so that we can use <code>llvm-hs</code> from within <code>ghci</code> and Template Haskell. Continuing the example above where we installed LLVM-4.0:</p>
129+
<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">cabal</span> install llvm-hs -fshared-llvm --constraint=<span class="st">&quot;llvm-hs==4.0.*&quot;</span></code></pre></div>
131130
<p>Install the Accelerate LLVM backend for multicore CPUs:</p>
132131
<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">cabal</span> install accelerate-llvm-native</code></pre></div>
133132
<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>
@@ -164,8 +163,8 @@ <h2 id="next-steps">4. Next steps</h2>
164163
<div class="footnotes">
165164
<hr />
166165
<ol>
167-
<li id="fn1"><p>Although the core <code>accelerate</code> package includes an interpreter that can be used to run Accelerate programs, its performance is fairly poor as it is designed as a reference implementation of the language semantics, rather than for performance.<a href="#fnref1"></a></p></li>
168-
<li id="fn2"><p>This constraint is also why we currently can not support LLVM-3.6, LLVM-3.7, or LLVM-3.5 on GHC-8.0; <code>llvm-general</code> is unfortunately not currently available for those targets.<a href="#fnref2"></a></p></li>
166+
<li id="fn1"><p>Include the build options <code>-DLLVM_BUILD_LLVM_DYLIB=True</code> and <code>-DLLVM_LINK_LLVM_DYLIB=True</code>.<a href="#fnref1"></a></p></li>
167+
<li id="fn2"><p>Although the core <code>accelerate</code> package includes an interpreter that can be used to run Accelerate programs, its performance is fairly poor as it is designed as a reference implementation of the language semantics, rather than for performance.<a href="#fnref2"></a></p></li>
169168
</ol>
170169
</div>
171170
</div>

md/get-started.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@ the included interpreter backend.[^1] For good performance however we also need
5050
to install one (or both) of the LLVM backends, which will compile Accelerate
5151
programs to native code.
5252

53-
Install a version of the `llvm-general` package suitable for the version of LLVM
53+
Install a version of the `llvm-hs` package suitable for the version of LLVM
5454
installed on your system. The first two numbers of the version of LLVM
55-
and the `llvm-general` package must match. We must also install with shared
56-
library support so that we can use `llvm-general` from within `ghci` (and
57-
Template Haskell). For example, if you have LLVM-3.8 installed:
55+
and the `llvm-hs` package must match. We must also install with shared
56+
library support so that we can use `llvm-hs` from within `ghci` and
57+
Template Haskell. For example, if you have LLVM-4.0 installed:
5858
```sh
59-
cabal install llvm-general -fshared-llvm --constraint="llvm-general==3.8.*"
59+
cabal install llvm-hs -fshared-llvm --constraint="llvm-hs==4.0.*"
6060
```
6161

6262
Install the Accelerate LLVM backend for multicore CPUs:

0 commit comments

Comments
 (0)