ghc.exe could not execute ld.exe while installing zlib - haskell

Im using
Windows 10
cabal-install version 3.2.0.0
GHC version 8.10.2
While trying to install zlib via
cabal install zlib
I get:
Building library for zlib-0.6.2.2..
[1 of 5] Compiling Codec.Compression.Zlib.Stream ( dist\build\Codec\Compression\Zlib\Stream.hs, dist\build\Codec\Compression\Zlib\Stream.o )
ghc.exe: could not execute: C:/GitLabRunner/builds/2WeHDSFP/0/ghc/ghc/inplace/mingw/bin/ld.exe

As the comments discuss, that version of ghc is known broken on windows. (cf https://gitlab.haskell.org/ghc/ghc/-/issues/18550). I suggest upgrading to ghc 8.10.5

Related

Haskell: Trouble updating/detecting cabal

I have both ghci versions 7.10 and 8 installed on my Ubuntu 16.04. I want to install something based on cabal. I already have cabal installed as the command
cabal --version
yields
cabal-install version 1.22.6.0
using version 1.22.5.0 of the Cabal library
But when I go to update with
cabal update
I get
Downloading the latest package list from hackage.haskell.org
cabal: does not exist
So I am not sure what is going on or how to resolve this. I hope to afterwards install gloss which is based on cabal. But
cabal install gloss-examples
yields
Resolving dependencies...
Downloading bindings-DSL-1.0.23...
Downloading bmp-1.2.6.3...
Failed to install bmp-1.2.6.3
Downloading vector-0.10.12.3...
Build log ( /home/username/.cabal/logs/bmp-1.2.6.3.log ):
cabal: /home/username/.cabal/logs/bmp-1.2.6.3.log: does not exist
EDIT: I originally installed ghci 7.10. Then later installed ghci 8. Could this have any effect?
EDIT2: After installing
cabal install Cabal cabal-install
I still get the same error with
cabal update
Also I still cannot
cabal install gloss-examples
But I get a different error this time
Resolving dependencies...
Downloading bindings-DSL-1.0.23...
Downloading bmp-1.2.6.3...
Failed to install bindings-DSL-1.0.23
Downloading vector-0.10.12.3...
Build log ( /home/aa/.cabal/logs/bindings-DSL-1.0.23.log ):
cabal: /home/aa/.cabal/logs/bindings-DSL-1.0.23.log: does not exist
EDIT3: When I installed Cabal, it says that I installed
Installed cabal-install-1.24.0.2
But when I check with
cabal --version
I am still stuck at
cabal-install version 1.22.6.0
which tells me somehow they are not linked.

ghc-mod doesn't see System.Random

After cabal install random, I try ghc-mod list but it still doesn't see the package.
cabal --version
cabal-install version 1.22.6.0
using version 1.22.4.0 of the Cabal library
ghc-mod --version
ghc-mod version 5.5.0.0 compiled by GHC 7.10.3
I have now also tried adding random-1.1 to my global stack.yaml (trying to make a simple script here...) and installed via stack install random to no avail.
My file seems to run fine with runhaskell though.
When you type stack install random, and then run stack ghci or install with stack, the import succeeds
> import System.Random --succeeds
If you run ghc outside of stack, it won't necessarily use the same setup.

Whenever I try to load ghci via Homebrew, it crashes when it tries to load the integer-gmp package

This is the exact error I'm getting. Please note that I'm on OS X 10.9 (Mavericks) and using gcc version 4.9 installed via Homebrew.
shermmac:bin brandonsherman$ ghci
GHCi, version 7.6.3: http://www.haskell.org/ghc/ :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... <command line>: can't load .so/.DLL for: libgmp.dylib
(dlopen(libgmp.dylib, 9): image not found)
How should I go about fixing this? I uninstalled and reinstalled both ghc and haskell-platform already.
This ended up working for me. I think not uninstalling gmp was what was making the uninstall and reinstall glitch for me.
brew uninstall ghc
brew uninstall haskell-platform
brew uninstall gmp
brew update
brew upgrade
brew install ghc
brew install haskell-platform

Some haskell dynamic library missing

This error message failing my installation of haskell-src-exts-1.15.0.1
ld: library not found for -lHScpphs-1.18.5-ghc7.8.2
So I guess my cpphs is missing. When I tried to install cpphs, however
$ cabal install cpphs
Resolving dependencies...
All the requested packages are already installed:
cpphs-1.18.5
Use --reinstall if you want to reinstall anyway.
The similar error happens for text-1.1.1.3.
I have tried erasing everything and reinstalling haskell-platform but it doesnt work.
I use haskell-platform installed from homebrew, but I had already had the latest version of cabal and ghc
λ ~/cabal --version
cabal-install version 1.20.0.3
using version 1.20.0.1 of the Cabal library
λ ~/ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.8.2
find ing the *.dylib gives no result.

Using text-icu library in Haskell on Mac OS

I am trying to use the text-icu library as a dependency in a cabal package on Mac OS. I have icu installed but when I try to build my package cabal gives me this error:
Missing C libraries: icui18n, icudata, icuuc
I'm am unsure what debugging steps to use.
You can use either MacPorts or Homebrew to install the icu package, and have cabal refer to the custom header and library path:
MacPorts
sudo port install icu
cabal install text-icu --extra-include-dirs=/opt/local/include --extra-lib-dirs=/opt/local/lib
Homebrew
brew install icu4c
cabal install text-icu --extra-lib-dirs=/usr/local/opt/icu4c/lib --extra-include-dirs=/usr/local/opt/icu4c/include

Resources