Cabal error for llvm-general - haskell

Trying to install llvm-general-3.3.5.
Have a local ghc-7.6.3 installation so used the following command to configure the llvm-general package after downloading the binary:
runhaskell Setup configure --user --/path/to/local --with-compiler=7.6.3
as is suggested in the haskell.org pages here.
That gets this error:
Setup.hs:42:13:
Couldn't match expected type `ProgramSearchPath
-> IO (Maybe FilePath)'
with actual type `IO (Maybe FilePath)'
In the return type of a call of `findJustBy'
Probable cause: `findJustBy' is applied to too many arguments
In the expression:
findJustBy (findProgramLocation v) llvmConfigNames
In the expression:
\ v -> findJustBy (findProgramLocation v) llvmConfigNames
Removing the configure options gets the same result.
Any ideas?
I'm on a Scientific linux machine.
Thank you!

Related

Haskell error with cabal: no instance for

I'm trying to follow the steps for installation for derivation of software product lines called hephaestus-pl. However, at the time of performing the installation steps, according to the tutorial, there is an error when executing the cabal install command on all cloned repositories. The erros is:
$ sudo cabal install
Resolving dependencies...
Notice: installing into a sandbox located at
/home/notebook/workspace/hephaestus/hephaestus-sb
Configuring funsat-0.6.2...
Building funsat-0.6.2...
Failed to install funsat-0.6.2
Build log ( /home/notebook/workspace/hephaestus/hephaestus-sb/logs/funsat-0.6.2.log ):
cabal: Entering directory '.'
Configuring funsat-0.6.2...
Building funsat-0.6.2...
Preprocessing library funsat-0.6.2...
[ 4 of 10] Compiling Funsat.Monad ( src/Funsat/Monad.hs, dist/dist-sandbox-cf02e0bc/build/Funsat/Monad.o )
src/Funsat/Monad.hs:64:10: error:
• No instance for (Applicative (SSTErrMonad e st s))
arising from the superclasses of an instance declaration
• In the instance declaration for ‘Monad (SSTErrMonad e st s)’
src/Funsat/Monad.hs:88:10: error:
• Could not deduce (GHC.Base.Alternative (SSTErrMonad e st s))
arising from the superclasses of an instance declaration
from the context: Error e
bound by the instance declaration at src/Funsat/Monad.hs:88:10-52
• In the instance declaration for ‘MonadPlus (SSTErrMonad e st s)’
cabal: Leaving directory '.'
cabal: Error: some packages failed to install:
funsat-0.6.2 failed during the building phase. The exception was:
ExitFailure 1
I'm using the following version of ghci, which came installed along with the haskell-platform:
$ ghci
GHCi, version 8.0.1: http://www.haskell.org/ghc/ :? for help
The cabal version is:
$ cabal --version
cabal-install version 1.24.0.1
compiled using version 1.24.1.0 of the Cabal library
My operating system is debian 9.2.
This is failing to compile due to the Functor/Applicative/Monad proposal implemented in more recent versions of GHC. The code would originally have compiled just fine, but in recent versions of GHC, you cannot declare something as Monad without first declaring it as Functor and Applicative. You used to be able to, but now you cannot.
The library authors need to update the library's code to fix this new restriction.

trying to install iHaskell - conflicting versions of hLint

According to the iHaskell page it should be possible to install from Hackage
cabal install ihaskell
However, when I do so it fails to install certain packages:
...
[ 7 of 44] Compiling HsColour ( src/HsColour.hs, dist/build/HsColour.o )
src/HsColour.hs:25:16:
Couldn't match type `Int' with `[Char]'
Expected type: String -> String
Actual type: Int -> String -> String
In the return type of a call of `CSS.hscolour'
Probable cause: `CSS.hscolour' is applied to too few arguments
In the expression: CSS.hscolour False
In an equation for `hsColourHTML':
hsColourHTML = CSS.hscolour False
Failed to install hlint-1.9.10
cabal: Error: some packages failed to install:
hlint-1.9.10 failed during the building phase. The exception was:
ExitFailure 1
ihaskell-0.5.0.0 depends on hlint-1.9.10 which failed to install.
Suggesting something about hlint-1.9.10. However, hlint-1.9.17 is in fact present.
ubuntu:~$ hlint -V
HLint v1.9.17, (C) Neil Mitchell 2006-2015

Snap: Params type error

I get this type error:
Couldn't match type `containers-0.5.0.0:Data.Map.Base.Map
ByteString [ByteString]'
with `M.Map ByteString [ByteString]'
Expected type: M.Map ByteString [ByteString]
Actual type: Params
But Params type is Map ByteString [ByteString]
type Params = Map ByteString [ByteString]
If it is of any help, this is the full function:
import qualified Data.Map as M
categoryDoc :: Params -> Document
categoryDoc params = map (\(k,[v]) -> T.decodeUtf8 k =: T.decodeUtf8 v) $ M.toList params
Thank you.
You have encountered cabal hell.
The problem is that there are multiple versions of the containers package installed. This means that there are two versions of the Map data type, one from containers-0.5.0.0 and one from the other version. Those two won't match, and that's why you get the error.
The easiest solution to that problem is to delete the ~/.ghc (on unix) directory and rebuilt everything. But that won't protect you from such problems in future, and there is also a chance that it won't work at all. So this is not a good solution.
If you have cabal-install of at least version 1.18, you can use the cabal sandboxes feature. This allows you to create an isolated package environment for each project, and thus avoid such conflicts. Just switch to your project and run:
cabal sandbox init # Create a new sandbox
cabal install --only-dependencies # Install dependencies
cabal build # Build your project
You can also use cabal install to install your project into the sandbox or cabal repl to start GHCi with the right settings for your project.
If you do not have a new-enough version of cabal-install and can't upgrade, you can use cabal-dev to create and manage sandboxes.

acid-state example error

I'm trying to start using acid-state for a project, but I'm running into trouble running the demos.
Running HelloWorld.hs from this example collection on my 64-bit box gives me the errors
acid-state.hs:26:7:
No instance for (MonadState
HelloWorldState (Update HelloWorldState))
arising from a use of `put'
Possible fix:
add an instance declaration for
(MonadState HelloWorldState (Update HelloWorldState))
In the expression: put (HelloWorldState newValue)
In an equation for `writeState':
writeState newValue = put (HelloWorldState newValue)
acid-state.hs:29:43:
No instance for (MonadReader
HelloWorldState (Query HelloWorldState))
arising from a use of `ask'
Possible fix:
add an instance declaration for
(MonadReader HelloWorldState (Query HelloWorldState))
In a stmt of a 'do' block: HelloWorldState string <- ask
In the expression:
do { HelloWorldState string <- ask;
return string }
In an equation for `queryState':
queryState
= do { HelloWorldState string <- ask;
return string }
The same thing happens with HelloWorldNoTH.hs as well. Neither error manifests on a 32-bit system. Any ideas what's going on here? Did I fail to install (or improperly install) some required component?
I'm running "The Glorious Glasgow Haskell Compilation System, version 7.4.1" on 64-bit Debian Wheezy (installed via the haskell-platform package), with Cabal 0.14.0. The machine itself is a 64-bit Core i3. The 32-bit machine (which ran the demo successfully) differs in no non-obvious way.
This has absolutely nothing to do with which architecture you're running on (sorry for jumping to conclusions).
Turns out that I had some misconfiguration, or possibly some conflicting cabal libraries installed. Clearing out my .ghc, followed by a re-install of the appropriate library did the trick. If you're on Debian or comparable:
rm -r ~/.ghc/*
cabal install acid-state

How to install generic haskell

after install hugs and then install ghc6 then install generic-haskell has the following message, How to do?
# make package
Creating generic-haskell package ...
ghc-pkg: cannot find package generic-haskell
Reading package info from "generic-haskell.cabal.pkg" ... done.
generic-haskell-1.80: missing id field
generic-haskell-1.80: dependency "base-4.2.0.0" doesn't exist (use --force to override)
generic-haskell-1.80: dependency "haskell98-1.0.1.1" doesn't exist (use --force to override)
generic-haskell-1.80: dependency "containers-0.3.0.0" doesn't exist (use --force to override)
make: *** [package] Error 1
in ubuntu i compile ghc-6.2.2 got the following error
/usr/bin/ghc -M -optdep-f -optdep.depend -osuf o -H16m -O HaskTags.hs
on the commandline:
Warning: -optdep-f is deprecated: Use -dep-makefile instead
------------------------------------------------------------------------
==fptools== make boot - --no-print-directory -r;
in /home/martin/ghc-6.2.2/ghc/utils/ghc-pkg
------------------------------------------------------------------------
/usr/bin/ghc -M -optdep-f -optdep.depend -osuf o -H16m -O -cpp -DPKG_TOOL -DWANT_PRETTY Main.hs Package.hs ParsePkgConfLite.hs Version.hs
on the commandline:
Warning: -optdep-f is deprecated: Use -dep-makefile instead
make all
/usr/bin/ghc -H16m -O -cpp -DPKG_TOOL -DWANT_PRETTY -c Main.hs -o Main.o -ohi Main.hi
Main.hs:496:11:
Ambiguous type variable `e' in the constraint:
`Exception.Exception e'
arising from a use of `Exception.throw' at Main.hs:496:11-25
Possible cause: the monomorphism restriction applied to the following:
my_catch :: forall a. IO a -> (e -> IO a) -> IO a
(bound at Main.hs:499:0)
my_throw :: forall a. e -> a (bound at Main.hs:496:0)
Probable fix: give these definition(s) an explicit type signature
or use -XNoMonomorphismRestriction
Main.hs:498:13:
Ambiguous type variable `e1' in the constraint:
`Exception.Exception e1'
arising from a use of `Exception.catch' at Main.hs:498:13-27
Possible cause: the monomorphism restriction applied to the following:
eval_catch :: forall a. a -> (e1 -> IO a) -> IO a
(bound at Main.hs:498:0)
Probable fix: give these definition(s) an explicit type signature
or use -XNoMonomorphismRestriction
make[4]: *** [Main.o] Error 1
make[3]: *** [boot] Error 2
make[2]: *** [boot] Error 1
make[1]: *** [boot] Error 1
Any one have installed old version of GHC and generic haskell in ubuntu 10?
There are many pairs of version , i tried ghc-6.2.2 got above error, will i need to uninstall ubuntu 10 to install older version ubuntu to get it work? which version of ubuntu for which version of ghc work?
http://www.cs.uu.nl/research/projects/generic-haskell/compiler.html
I tried installing generic-haskell myself from the source, I managed, and am able to describe how I fixed it. My installation platform is the Haskell Platform 2011.2.0.1-x86_64, but the following instruction are somewhat more general.
I met three problems, including the first one you describe (no. 3 below). For other users, I also describe the first two ones, which you probably solved as well.
1) Other users have first to fix an error depending on Data.Map.lookup type having changed, for containers >= 0.2.0.0: it used to return Monad m => m b (in containers-1.0.0.0), now it returns just Maybe b.
I added calls to Data.Maybe.maybeToList to fix a few call-sites needing to use a list type; I bet you fixed the same error in some way. You can find this fix at:
http://hpaste.org/47624.
2) Another error I had, with GHC 7, is that the configure script does not realize that it is newer than GHC 6.8, so it needs to also depend on containers. configure output included this line:
checking whether base package is split (GHC 6.8 or newer)... no
To fix this, you need to replace
if test $ghc_ma -ge 6 -a $ghc_mi -ge 8; then
with
if test $ghc_ma -eq 6 -a $ghc_mi -ge 8 -o $ghc_ma -ge 7; then
3) To fix your problem, you need to edit build/generic-haskell.cabal.pkg (assuming you are not doing an in-place installation with make in-place). You need to add an id: line and fix the depends line to use package-ids of packages present on your systems instead of package names. You can find out the ids using the following commands (output on my system included):
$ ghc-pkg field base id
id: base-4.3.1.0-f5c465200a37a65ca26c5c6c600f6c76
$ ghc-pkg field haskell98 id
id: haskell98-1.1.0.1-150131ea75216886448a7146c9e0526b
$ ghc-pkg field containers id
id: containers-0.4.0.0-b4885363abca642443ccd842502a3b7e
The change to build/generic-haskell.cabal.pkg would then be:
-depends: base-4.3.1.0
- haskell98-1.1.0.1
- containers-0.4.0.0
+depends: base-4.3.1.0-f5c465200a37a65ca26c5c6c600f6c76
+ haskell98-1.1.0.1-150131ea75216886448a7146c9e0526b
+ containers-0.4.0.0-b4885363abca642443ccd842502a3b7e
Furthermore, you need to add an id line to the same file - any id will do, as long as you change it if/when you reinstall the library. Here I've used:
id: generic-haskell-1.80-lib-md5sum-2a7ae9d60440627618ad0b0139ef090b
I've also aligned all fields with spaces, as in the existing files. The syntax reference for this file can be found in:
http://www.haskell.org/ghc/docs/6.12.2/html/users_guide/packages.html#installed-pkg-info
Apparently, the generic-haskell package depends on an old version of base.
The Haskell Platform specifies base-4.3.1.0, while generic-haskell needs an older version. Please contact the maintainers, or possibly, install an older version of GHC.

Resources