directions to do a release quality build of GHC == 8.0.* with the Make based build system with all the docs
context: this is a draft for planned edits / cleanups to the current mac build directions
-
have apple command line tools installed, as well as mactex, and your favorite OS X package manager (which for the rest of these directions we assume is brew)
-
since we assume we're using brew, install it!
-
go to the dejavu fonts site and download the most recent tar.bz2 of the ttf files, like this one (note: yes the download site for the fonts is source forge). there should be a
ttf
folder full of ttf files, highlight all of them and open them (eg cmd+o), thefontbook
app should launch and you should just have to click OK to add them via ~ 6 dialogues -
install a ghc version 7.8 or 7.10 via whatever approach you personally prefer
-
brew install autoconf automake; brew tap homebrew/dupes ; brew tap homebrew/versions ; brew install llvm37
-
make sure that you have a cabal-instal 1.24 or newer (so that your cabal will play nice with ghc 8 once you've got it)
a) if you dont have it yet, do the following
b)
git clone https://github.com/haskell/cabal.git; cd cabal ; cabal update ; cabal install ./Cabal ./cabal-install
c) now
cabal --version
should report that its some 1.24 -
check that everything mentioned so far is visible in your path! eg recent MacTex installs to
/Library/TeX/texbin/
-
now we also want to be able to build docs, and the easiest approach is to do
brew install python3 ; pip3 install sphinx
after whichsphinx-build
should be in your path! -
with your fancy new cabal 1.24, also
cabal install happy alex hscolour
to make sure you have recent versions of those! -
if you want to use GCC instead of CLANG to build ghc,
brew install gcc5
orbrew install gcc6
, which will respectively addgcc-5
orgcc-6
to your path -
ok, lets get started! Either you have source tree tarball from a release candidate OR you're building from a fresh git checkout
-
git clone --recursive git://git.haskell.org/ghc.git ghc-8.0-my-ghc-tree -b ghc-8.0
-
cd ghc-8.0-my-ghc-tree ; cp mk/build.mk.sample mk/build.mk
-
add to the top of
mk/build.mk
the following (make sure there is not trailing white space on these lines! Make will run wrong if any line has trailing white space)
# Full build with max optimisation and everything enabled (very slow build)
BuildFlavour = perf
EXTRA_HADDOCK_OPTS=--hyperlinked-source
HADDOCK_DOCS = YES
BUILD_SPHINX_HTML = YES
BUILD_SPHINX_PDF = YES
BUILD_DPH=NO
# Uncomment the following to force `integer-gmp` to use the in-tree GMP 5.0.4
# (other sometimes useful configure-options: `--with-gmp-{includes,libraries}`)
libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-intree-gmp
# Don't strip debug and other unneeded symbols from libraries and executables.
STRIP_CMD = :
-
type
perl boot
-
decide if you want to use clang or gcc-5 or gcc-6, and do
export CC=gcc-5
or eg (set -xl CC gcc-5
) equivalent in your shell! theres valid Reasons to choose either apple clang or gcc (or the explicit path instead of just the name) -
set -xl MACOSX_DEPLOYMENT_TARGET 10.7
or the bash equivalent ofexport MACOSX_DEPLOYMENT_TARGET=10.7
a) if you're on OSX 10.11, invoke configure as
./configure -with-gcc=$pathToMyCC --with-nm=$(xcrun --find nm-classic)
b) if you're not on 10.11, but earlier, ./configure -with-gcc=$pathToMyCC
suffices
-
type
ulimit -n 10000 ; make -j4
where instead of 4 choose whatever number of cores you want. Theulimit
part is to circumvent a lazy io issue that impacts how haddock processes large projects at the time of this writing (April 2016, haskell/haddock#495) -
once the build ends, you can do
make binary-dist
to get a binary dist tar.xz
Need to add
cabal install hscolour
to the directions