简体   繁体   中英

Building GHC: configure fails on happy despite successful cabal install

I am attempting to build GHC from source following this page . When installing dependencies, I had to install happy and alex :

$ cabal install alex happy
Resolving dependencies...
Configuring alex-3.2.1...
Configuring happy-1.19.5...
Building happy-1.19.5...
Building alex-3.2.1...
Installed alex-3.2.1
Installed happy-1.19.5

yet when running configure I get an error message:

$ ./configure
...
checking for happy... no
checking for version of happy... 
configure: error: Happy version 1.19.4 or later is required to compile GHC.

I am running on Debian stretch :

$ uname -a 
Linux <host> 4.8.0-1-amd64 #1 SMP Debian 4.8.5-1 (2016-10-28) x86_64 GNU/Linux

Can anyone suggest an obvious step I could try to resolve this?

You should install alex and happy as Debian packages as well. On a Debian machine, you can use apt-get for that:

sudo apt-get install alex happy

I suspect you simply don't have them on your PATH. Make sure to include something like

PATH="$HOME/.cabal/bin:$PATH"

in your .bashrc (or startup files for whatever shell you use). Installing them through the package manager simply installed them in a location that was already on your PATH.

Even if you have things working now, you should consider modifying your .bashrc while it's fresh in your head, as other cabal-install'd executables will get put there in the future.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM