Commit d4c8d895 authored by Ben Gamari's avatar Ben Gamari 🐢
Browse files

users-guide: Consistently document LLVM version requirement

(cherry picked from commit fdccc666)
parent 16c7d9dc
...@@ -108,6 +108,9 @@ Language ...@@ -108,6 +108,9 @@ Language
Compiler Compiler
~~~~~~~~ ~~~~~~~~
- LLVM code generator (e.g. :ghc-flag:`-fllvm`) compatible with LLVM releases in
the |llvm-version| series.
- Add warning flag :ghc-flag:`-Wmissing-export-lists` which causes the type - Add warning flag :ghc-flag:`-Wmissing-export-lists` which causes the type
checker to warn when a module does not include an explicit export list. checker to warn when a module does not include an explicit export list.
......
...@@ -40,7 +40,7 @@ performance as good as the native code generator but for some cases can ...@@ -40,7 +40,7 @@ performance as good as the native code generator but for some cases can
produce much faster code. This is especially true for numeric, array produce much faster code. This is especially true for numeric, array
heavy code using packages like vector. The penalty is a significant heavy code using packages like vector. The penalty is a significant
increase in compilation times. Select the LLVM backend with the increase in compilation times. Select the LLVM backend with the
``-fllvm`` flag. Currently *LLVM 2.8* and later are supported. :ghc-flag:`-fllvm` flag.
You must install and have LLVM available on your ``PATH`` for the LLVM code You must install and have LLVM available on your ``PATH`` for the LLVM code
generator to work. Specifically GHC needs to be able to call the ``opt`` generator to work. Specifically GHC needs to be able to call the ``opt``
...@@ -48,12 +48,17 @@ and ``llc`` tools. Secondly, if you are running Mac OS X with LLVM 3.0 ...@@ -48,12 +48,17 @@ and ``llc`` tools. Secondly, if you are running Mac OS X with LLVM 3.0
or greater then you also need the `Clang C or greater then you also need the `Clang C
compiler <http://clang.llvm.org>`__ compiler available on your ``PATH``. compiler <http://clang.llvm.org>`__ compiler available on your ``PATH``.
.. note::
Note that this GHC release expects an LLVM version in the |llvm-version|
release series.
To install LLVM and Clang: To install LLVM and Clang:
- *Linux*: Use your package management tool. - *Linux*: Use your package management tool.
- *Mac OS X*: Clang is included by default on recent OS X machines when - *Mac OS X*: Clang is included by default on recent OS X machines when
XCode is installed (from ``10.6`` and later). LLVM is not included. XCode is installed (from 10.6 and later). LLVM is not included.
In order to use the LLVM based code generator, you should install the In order to use the LLVM based code generator, you should install the
`Homebrew <http://mxcl.github.com/homebrew/>`__ package manager for `Homebrew <http://mxcl.github.com/homebrew/>`__ package manager for
OS X. Alternatively you can download binaries for LLVM and Clang from OS X. Alternatively you can download binaries for LLVM and Clang from
...@@ -73,7 +78,7 @@ C Code Generator (``-fvia-C``) ...@@ -73,7 +78,7 @@ C Code Generator (``-fvia-C``)
This is the oldest code generator in GHC and is generally not included This is the oldest code generator in GHC and is generally not included
any more having been deprecated around GHC 7.0. Select it with the any more having been deprecated around GHC 7.0. Select it with the
``-fvia-C`` flag. :ghc-flag:`-fvia-C` flag.
The C code generator is only supported when GHC is built in The C code generator is only supported when GHC is built in
unregisterised mode, a mode where GHC produces "portable" C code as unregisterised mode, a mode where GHC produces "portable" C code as
...@@ -81,7 +86,7 @@ output to facilitate porting GHC itself to a new platform. This mode ...@@ -81,7 +86,7 @@ output to facilitate porting GHC itself to a new platform. This mode
produces much slower code though so it's unlikely your version of GHC produces much slower code though so it's unlikely your version of GHC
was built this way. If it has then the native code generator probably was built this way. If it has then the native code generator probably
won't be available. You can check this information by calling won't be available. You can check this information by calling
``ghc --info`` (see :ref:`ghc-info`). ``ghc --info`` (see :ghc-flag:`--info`).
.. _unreg: .. _unreg:
...@@ -112,4 +117,4 @@ to build GHC with the appropriate options set. Consult the GHC Building ...@@ -112,4 +117,4 @@ to build GHC with the appropriate options set. Consult the GHC Building
Guide for details. Guide for details.
You can check if your GHC is unregisterised by calling You can check if your GHC is unregisterised by calling
``ghc --info`` (see :ref:`ghc-info`). ``ghc --info`` (see :ghc-flag:`--info`).
...@@ -24,6 +24,10 @@ source_suffix = '.rst' ...@@ -24,6 +24,10 @@ source_suffix = '.rst'
source_encoding = 'utf-8-sig' source_encoding = 'utf-8-sig'
master_doc = 'index' master_doc = 'index'
rst_prolog = """
.. |llvm-version| replace:: {llvm_version}
""".format(llvm_version=ghc_config.llvm_version)
# General information about the project. # General information about the project.
project = u'Glasgow Haskell Compiler' project = u'Glasgow Haskell Compiler'
copyright = u'2015, GHC Team' copyright = u'2015, GHC Team'
......
...@@ -16,3 +16,5 @@ lib_versions = { ...@@ -16,3 +16,5 @@ lib_versions = {
} }
version = '@ProjectVersion@' version = '@ProjectVersion@'
llvm_version = '@LlvmVersion@'
...@@ -527,6 +527,11 @@ Options affecting code generation ...@@ -527,6 +527,11 @@ Options affecting code generation
via LLVM requires LLVM's :command:`opt` and :command:`llc` executables to be via LLVM requires LLVM's :command:`opt` and :command:`llc` executables to be
in :envvar:`PATH`. in :envvar:`PATH`.
.. note::
Note that this GHC release expects an LLVM version in the |llvm-version|
release series.
.. ghc-flag:: -fno-code .. ghc-flag:: -fno-code
:shortdesc: Omit code generation :shortdesc: Omit code generation
:type: dynamic :type: dynamic
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment