Ubuntu – “cannot determine current directory” while building Haskell in 13.04


I'm trying to install the Haskell Platform on Raring. Since there's no apt package, I've downloaded the GHC 7.4.2 binary x86_64 distribution (which is a prerequisite), and I am trying to run ./configure. It's failing with the following message:

checking for path to top of build tree... utils/ghc-pwd/dist/build/tmp/ghc-pwd: error while loading shared libraries: libgmp.so.3: cannot open shared object file: No such file or directory

configure: error: cannot determine current directory

How can I fix this?

Best Answer

Note that I would usually just do sudo apt-get install haskell-platform, which should just sort everything out. However it hasn't been packaged for 13.04 yet.

Get these dependencies, if you don't already have them:

sudo apt-get install -y libgmp3-dev freeglut3 freeglut3-dev

The Haskell platform seems to be looking for a libgmp.so.3, but the libgmp package only supplies libgmp.so, libgmp.so.10 and libgmp.so.10.0.5. The fix:

sudo ln -s /usr/lib/x86_64-linux-gnu/libgmp.so.10 /usr/lib/libgmp.so.3

(Disclaimer: This worked for me. Not sure if it's a sensible thing to do)