% Installing pandoc Installing pandoc from Source ============================= This method will work on all architectures for which the GHC compiler is available. Installing GHC -------------- To compile Pandoc, you'll need [GHC] version 6.8 or greater. If you don't have GHC already, you can get it from the [GHC Download] page. If you're compiling GHC from source, be sure to get the `extralibs` in addition to the base tarball. Pandoc requires Cabal version 1.2 or greater. If your GHC comes with an older version of Cabal, you'll need to to [install Cabal] separately. You can check your Cabal version using `ghc-pkg list`. If you're running MacOS X, you can also install GHC using [MacPorts] or [Fink]. If you're on a [debian]-based linux system (such as [Ubuntu]), you can get GHC and some required libraries using `apt-get`: sudo apt-get install ghc6 libghc6-xhtml-dev libghc6-mtl-dev libghc6-network-dev [GHC]: http://www.haskell.org/ghc/ [GHC Download]: http://www.haskell.org/ghc/download.html [Cabal]: http://www.haskell.org/cabal/ [install Cabal]: http://www.haskell.org/cabal/download.html [MacPorts]: http://macports.org [Fink]: http://finkproject.org [Ubuntu]: http://www.ubuntu.com [debian]: http://www.debian.org/ Installing prerequisites ------------------------ Pandoc needs the `utf8-string` and `zip-archive` to compile. Check your packaging system to see if they are included. If not, you will need to compile them from source. On \*nix systems, the easiest way to do this is to install the [cabal-install] tool. See the section [Quick Installation on Unix] for instructions. [cabal-install]: http://hackage.haskell.org/trac/hackage/wiki/CabalInstall [Quick Installation on Unix]: http://hackage.haskell.org/trac/hackage/wiki/CabalInstall#QuickInstallationonUnix Once you've got `cabal-install` installed, you can install the needed libraries by doing cabal install utf8-string cabal install zip-archive Alternatively, you can install these libraries using the [standard Cabal method], but you will have to install their dependencies manually. [standard Cabal method]: http://haskell.org/haskellwiki/Cabal/How_to_install_a_Cabal_package Getting the source ------------------ Download the source tarball from [pandoc's google code site]. Extract the contents into a subdirectory: tar xvzf pandoc-x.y.tar.gz [pandoc's google code site]: http://pandoc.googlecode.com Now choose one of the following methods for compiling and installing pandoc. If you are on a linux or unix-based system, you can [install pandoc using Make]. If not, you should [install pandoc using Cabal]. [install pandoc using Make]: #installing-pandoc-using-make [install pandoc using Cabal]: #installing-pandoc-using-cabal [build options]: #build-options Installing Pandoc using Make ---------------------------- 1. Change to the directory containing the Pandoc distribution. 2. Compile: make If you get "Unknown modifier" errors, it is probably because `make` on your system is not [GNU `make`]. Try using `gmake` instead. If you get a message saying that the `zip-archive` or `utf8-string` libraries cannot be found, and you have installed these using `cabal-install`, it is probably because by default `cabal-install` installs libraries to the user's directory rather than globally. Try again with CABALOPTS=--user make 3. See if it worked (optional, but recommended): make test Note: if you see errors like the following, they're due to differences between different versions of the xhtml library, and can safely be disregarded: 2c2 <