I have trouble install Haskell

Hi,
I'm a beginner, very new to Tidal. I got trouble to install Haskell.
I got this error:

[ Error ] Build failed with NonZeroExit 1 "./configure" ["--prefix=/Users/xx/.ghcup/ghc/8.8.3"]
"ghcup --cache install recommended" failed!

I tried to find a solution on the internet and in the forum but no luck so far.
Any help would be very appreciated.
Nitcha

What operating system? What is the exact command that produced the error that you showed?

Adding onto what jwaldmann said, if you're trying to build Haskell yourself (which it sounds like you may be doing because there's an error in the configure), you may want to try to see if there's an install available for your system either through a package manager or a prebuilt binary.

The poster seem to be using the ghcup method https://www.haskell.org/ghcup/ of installing the binaries of a Haskell compiler (ghc) and build system (cabal).

I never uses this method. I guess it cabal-installs (that is, compiles from source) some "recommended" packages. One of them involves some C code, which must be "./configure"d, and this fails, probably because necessary header files are not present. This would be solved by installing the *-dev packages. But all of this is guess-work.

(NB: You cannot "install Haskell" as Haskell is a language. You can install a compiler, etc.)

Hi @nitchafame,

I see you're on a Mac, I assume running the easy tidal-bootstrap method. It looks like it is trying to install Haskell (via the 'ghcup' method), but failing. Usually on a Mac this is due to needing some add-on Mac development stuff. The install script should make sure this is installed, but it seems something went wrong..

Try running this:
xcode-select --install

.. and then re-running the tidal-bootstrap installer. If it doesn't help, please share the full output, thanks!

Hi All,
Thank you all for the answers.

jwaldmann, Thank you for correcting me on that. Would the *-dev be a solution? I'm not familiar with the package but I'll try to look into it.

Yaxu, exactly, I'm on Mac (macOS Mojave 10.14.6 with Xcode 10.2.1 installed). I ran both manual, which uses ghcup method that said on the Haskell site, and later the easy tidal-bootstrap, no luck for me. I'm assuming them both running the same commands. I actually tried running the command xcode-select --install but also got an error. The full output is:

$ xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates

$ curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh

Welcome to Haskell!

This script will download and install the following binaries:
  * ghcup - The Haskell toolchain installer (for managing GHC/cabal versions)
  * ghc   - The Glasgow Haskell Compiler
  * cabal - The Cabal build tool

ghcup installs only into the following directory, which can be removed anytime:
  /Users/nitchafame/.ghcup

Press ENTER to proceed or ctrl-c to abort.
Note that this script can be re-run at any given time.

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 9615k  100 9615k    0     0  5685k      0  0:00:01  0:00:01 --:--:-- 5686k
[ Info  ] Upgrading GHCup...
[ Warn  ] No GHCup update available

System requirements 
  Note: On OS X, in the course of running ghcup you will be given a dialog box to install the command line tools. Accept and the requirements will be installed for you. You will then need to run the command again.

Press ENTER to proceed or ctrl-c to abort.
Installation may take a while.

[ Info  ] verifying digest of: ghc-8.8.3-x86_64-apple-darwin.tar.xz
[ Info  ] Unpacking: ghc-8.8.3-x86_64-apple-darwin.tar.xz to /var/folders/hw/n__pngp14k976y642j151cl40000gn/T/ghcup-arZZim
[ Info  ] Installing GHC (this may take a while)
[ ghc-configure ] checking whether we are using the GNU C compiler... yes
[ ghc-configure ] checking whether gcc accepts -g... yes
[ ghc-configure ] checking for gcc option to accept ISO C89... none needed
[ ghc-configure ] checking how to run the C preprocessor... gcc -E
[ ghc-configure ] checking for gcc option to accept ISO C99... unsupported
[ ghc-configure ] configure: error: C99-compatible compiler needed
[ Error ] Build failed with NonZeroExit 1 "./configure" ["--prefix=/Users/xx/.ghcup/ghc/8.8.3"]
"ghcup --cache install recommended" failed!

ps. sorry for my format if it's wrong. All of these are new to me.
Thank you

Thanks @nitchafame. Reading around it looks like installing something else has caused some problems with the compiler. Have you installed some things with homebrew / brew? If so, a good thing to do would be to run this:

brew doctor

and follow the instructions. Or here is a command which should move the problem files for you (from /usr/local/include, backing them up to a new folder /tmp/includes):

mkdir /tmp/includes
brew doctor 2>&1 | grep "/usr/local/include" | awk '{$1=$1;print}' | xargs -I _ mv _ /tmp/includes

I found this here:

1 Like

Thank you so much for the fast reply.
I used the command but got a lot of permission denied, then I ran just brew doctor and following one of the instruction about Xcode. I ended up decided to delete it because I don't want to update OS.
Then it works! I was able to successfully install.

After that I ran into error on Atom:

t>: error:
    Could not find module ‘Sound.Tidal.Context’
    It is not a module in the current program, or in any known package.

but following these commands from another thread,

. .ghcup/env
cabal update
cabal install tidal --lib

now it works!!
Thank you so much for all the fast reply and helps.

1 Like