Some haskell dynamic library missing - haskell

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.

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.

VSCode editor got errors, while using Haskell installed using Stackage

Recently Installed VS Code in my Ubuntu14.04 . Installed Haskell using Stack.
Getting these errors. Kindly help.
Error: Couldn't start ghc-mod process Error: Command failed: ghc-mod version
Error: Cannot hlint the haskell file. The hlint program was not found. Use the 'haskell.hlint.executablePath' setting to configure the location of 'hlint'
It looks like you've installed 2 extensions for vscode, one for linting and one for running ghc-mod, but you don't have hlint or ghc-mod installed.
If you are using this ghc-mod extension, make sure you have ghc-mod installed through cabal or through stack.
IF you are using this linter extension, make sure you have hlint installed through cabal or through stack.
To install with cabal, run:
cabal install hlint
and
cabal install ghc-mod
To install via stack, see the stack documentation.

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.

Could not find module ‘Control.Monad.State’ even though mtl is installed

When I tried loading a module containing import Control.Monad.State
I got
Could not find module ‘Control.Monad.State’
Perhaps you meant
Control.Monad.ST (from base-4.8.2.0)
Control.Monad.ST.Safe (from base-4.8.2.0)
Control.Monad.Fix (from base-4.8.2.0)
Use -v to see a list of the files searched for.
Failed, modules loaded: none.
I installed the Haskell Platform, which has cabal and mtl installed.
When I run cabal update and then cabal install mtl:
Resolving dependencies...
All the requested packages are already installed:
mtl-2.2.1
Use --reinstall if you want to reinstall anyway.
I tried the reinstall flag but it just keeps giving me warnings that I will break other packages so I didn't continue.
My ghc --version is version 7.10.3. cabal --version is 1.22.5.0
This is what I got when I ran ghc-pkg list mtl:
WARNING: cache is out of date: Library/Frameworks/GHC.framework/Versions/7.10.3-x86_64/usr/lib/ghc-7.10.3/package.conf.d/package.cache
ghc will see an old view of this package db. Use 'ghc-pkg recache' to fix.
/Library/Frameworks/GHC.framework/Versions/7.10.3-x86_64/usr/lib/ghc-7.10.3/package.conf.d
mtl-2.2.1
And when I ran ghc-pkg check :
WARNING: cache is out of date: /Library/Frameworks/GHC.framework/Versions/7.10.3-x86_64/usr/lib/ghc-7.10.3/package.conf.d/package.cache
ghc will see an old view of this package db. Use 'ghc-pkg recache' to fix.
And when I ran ghc-pkg recache
ghc-pkg: /Library/Frameworks/GHC.framework/Versions/7.10.3-x86_64/usr/lib/ghc-7.10.3/package.conf.d/package.cache: you don't have permission to modify this file

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