Compilation error building intero - haskell-stack

I cannot use emacs on a new stack project because intero fails to build.
I've just installed stack 1.6.3 on ubuntu 16.04
I created a new (lts-10.2) stack project ('play') using: stack new play
When I try to open the source files in emacs it fails to build intero
Intero is not installed in the Stack environment.
Installing intero-0.1.24 automatically ...
intero-0.1.24: configure
intero-0.1.24: build
-- While building custom Setup.hs for package intero-0.1.24 using:
/home/wmorgan/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_2.0.1.0_ghc-8.2.2 --builddir=.stack-work/dist/x86_64-linux/Cabal-2.0.1.0 build --ghc-options " -ddump-hi -ddump-to-file"
Process exited with code: ExitFailure 1
Logs have been written to: /home/wmorgan/haskell/play/.stack-work/logs/intero-0.1.24.log
Configuring intero-0.1.24...
Preprocessing executable 'intero' for intero-0.1.24..
Building executable 'intero' for intero-0.1.24..
[1 of 8] Compiling GhciTypes ( src/GhciTypes.hs, .stack-work/dist/x86_64-linux/Cabal-2.0.1.0/build/intero/intero-tmp/GhciTypes.o )
[2 of 8] Compiling GhciMonad ( src/GhciMonad.hs, .stack-work/dist/x86_64-linux/Cabal-2.0.1.0/build/intero/intero-tmp/GhciMonad.o )
[3 of 8] Compiling GhciTags ( src/GhciTags.hs, .stack-work/dist/x86_64-linux/Cabal-2.0.1.0/build/intero/intero-tmp/GhciTags.o )
[4 of 8] Compiling GhciInfo ( src/GhciInfo.hs, .stack-work/dist/x86_64-linux/Cabal-2.0.1.0/build/intero/intero-tmp/GhciInfo.o )
[5 of 8] Compiling GhciFind ( src/GhciFind.hs, .stack-work/dist/x86_64-linux/Cabal-2.0.1.0/build/intero/intero-tmp/GhciFind.o )
[6 of 8] Compiling Paths_intero ( .stack-work/dist/x86_64-linux/Cabal-2.0.1.0/build/intero/autogen/Paths_intero.hs, .stack-work/dist/x86_64-linux/Cabal-2.0.1.0/build/intero/intero-tmp/Paths_intero.o )
[7 of 8] Compiling InteractiveUI ( src/InteractiveUI.hs, .stack-work/dist/x86_64-linux/Cabal-2.0.1.0/build/intero/intero-tmp/InteractiveUI.o )
[8 of 8] Compiling Main ( src/Main.hs, .stack-work/dist/x86_64-linux/Cabal-2.0.1.0/build/intero/intero-tmp/Main.o )
Linking .stack-work/dist/x86_64-linux/Cabal-2.0.1.0/build/intero/intero ...
/usr/bin/ld.gold: error: cannot find -ltinfo
collect2: error: ld returned 1 exit status
`gcc' failed in phase `Linker'. (Exit code: 1)
Could not install Intero!
(I've also tried building intero from the command-line with the same results.)
Edit: if I edit stack.yaml (in my project) to use lts-9.5 then intero builds OK - so this problem seems to be lts-10.2 specific.
Any ideas about how to fix this?

sudo apt-get install libncurses-dev
I found this information via this search https://github.com/commercialhaskell/intero/search?q=-ltinfo&type=Issues&utf8=%E2%9C%93 leading to https://github.com/commercialhaskell/intero/issues/456

I encountered this recently when installing intero for an lts-11.8 project on Kubuntu 18.04. The problem is the system is missing the tinfo library. The following command fixed the issue for me.
sudo apt-get install libtinfo-dev

Related

Unable to install agda via nix in macOS M1

Running
nix-shell -p agda
on macOS M1 (Monterey), compilation seems to run fine but linking fails with a segmentation error
clang-11: error: linker command failed with exit code 139 (use -v to see invocation)
`cc' failed in phase `Linker'. (Exit code: 139)
error: builder for '/nix/store/0zli7b0k7mdq3aj9yrfk546vr1a1mb34-Agda-2.6.2.2.drv' failed with exit code 1;
last 10 log lines:
> [399 of 401] Compiling Agda.Compiler.JS.Compiler ( src/full/Agda/Compiler/JS/Compiler.hs, dist/build/Agda/Compiler/JS/Compiler.o, dist/build/Agda/Compiler/JS/Compiler.dyn_o )
> [400 of 401] Compiling Agda.Compiler.Builtin ( src/full/Agda/Compiler/Builtin.hs, dist/build/Agda/Compiler/Builtin.o, dist/build/Agda/Compiler/Builtin.dyn_o )
> [401 of 401] Compiling Agda.Main ( src/full/Agda/Main.hs, dist/build/Agda/Main.o, dist/build/Agda/Main.dyn_o )
> Preprocessing executable 'agda' for Agda-2.6.2.2..
> Building executable 'agda' for Agda-2.6.2.2..
> [1 of 1] Compiling Main ( src/main/Main.hs, dist/build/agda/agda-tmp/Main.o )
> Linking dist/build/agda/agda ...
> /nix/store/l1vm9w0y2fdav63xk2nfrwgzrg30hm5x-clang-wrapper-11.1.0/bin/ld: line 256: 1241 Segmentation fault: 11 /nix/store/gwm9iadcyybh7gc4q6djvaz4fb40i90c-cctools-binutils-darwin-949.0.1/bin/ld ${extraBefore+"${extraBefore[#]}"} ${params+"${params[#]}"} ${extraAfter+"${extraAfter[#]}"}
> clang-11: error: linker command failed with exit code 139 (use -v to see invocation)
> `cc' failed in phase `Linker'. (Exit code: 139)
I did run into linking issues with other Haskell packages in recent versions of macOS, where ghc couldn't find libffi or zlib, and I had to set env variables, eg
export C_INCLUDE_PATH="`xcrun --show-sdk-path`/usr/include/ffi"¬
However, In the case of agda, from the error message it's not obvious to me what the issue is: is it caused by a C lib that the linker cannot locate, and if yes how can i discover which one? is it a problem with M1? is nix-shell -p agda suppose to work on M1?
I've finally managed to find a github issue tracking the problem (it wasn't that easy to find): https://github.com/NixOS/nixpkgs/issues/149692#issuecomment-1177684790
According to the ticket, the only available workaround at the moment is to compile for x86_64 and use Rosetta

Haskell Stack doesnt work correctly on OSX Sierra

I can't get haskell's stack to work on my Mac.
I installed haskell by:
brew cask install haskell-platform
Which is specified here: https://www.haskell.org/platform/mac.html#osx-homebrewcask
I've also tried installing via the downloadable package at the same site.
I do the following commands:
stack new my-project
cd my-project
stack setup
stack build
stack exec my-project-exe
Per the documentation here:
https://docs.haskellstack.org/en/stable/README/#quick-start-guide
And I immediately see this:
[1] 43017 killed stack exec my-project-exe
I've also tried many other ways of installing haskell. I've actually been able to get something compiled and executed just using cabal, but I can't then get hlint, hindent, or ghc-mod to work, they all return a similar message to the one above. I'd love to be able to work with HaskForce in IntelliJ on my Mac, but I've never had luck getting haskell to work.
System Specs
macOS 10.12.6 (16G29) (Sierra)
Fresh uninstall/reinstall of XCode (accepted terms)
brew as package manager
Here's a gif of what happens as well: https://imgur.com/gallery/afYym7m
UPDATE
I blew away all stuff related to ghc, stack, and cabal and then installed this way
https://haskell-lang.org/get-started
Writing the little HelloWorld.hs script worked fine and showed Hello, World
However, doing
stack new someproj
cd someproj
stack build
Resulted in this:
➜ someproj stack build
[1 of 2] Compiling Main ( /Users/trevord2/.stack/setup-exe-src/setup-mPHDZzAJ.hs, /Users/trevord2/.stack/setup-exe-src/setup-mPHDZzAJ.o )
[2 of 2] Compiling StackSetupShim ( /Users/trevord2/.stack/setup-exe-src/setup-shim-mPHDZzAJ.hs, /Users/trevord2/.stack/setup-exe-src/setup-shim-mPHDZzAJ.o )
Linking /Users/trevord2/.stack/setup-exe-cache/x86_64-osx/tmp-Cabal-simple_mPHDZzAJ_1.24.2.0_ghc-8.0.2 ...
someproj-0.1.0.0: configure (lib + exe)
Configuring someproj-0.1.0.0...
someproj-0.1.0.0: build (lib + exe)
Preprocessing library someproj-0.1.0.0...
[1 of 1] Compiling Lib ( src/Lib.hs, .stack-work/dist/x86_64-osx/Cabal-1.24.2.0/build/Lib.o )
Preprocessing executable 'someproj-exe' for someproj-0.1.0.0...
[1 of 1] Compiling Main ( app/Main.hs, .stack-work/dist/x86_64-osx/Cabal-1.24.2.0/build/someproj-exe/someproj-exe-tmp/Main.o )
Linking .stack-work/dist/x86_64-osx/Cabal-1.24.2.0/build/someproj-exe/someproj-exe ...
ld: warning: ignoring file /Users/trevord2/someproj/.stack-work/dist/x86_64-osx/Cabal-1.24.2.0/build/libHSsomeproj-0.1.0.0-6corWoTDCA69pE1sqNF8Id.a, file was built for archive which is not the architecture being linked (x86_64): /Users/trevord2/someproj/.stack-work/dist/x86_64-osx/Cabal-1.24.2.0/build/libHSsomeproj-0.1.0.0-6corWoTDCA69pE1sqNF8Id.a
Undefined symbols for architecture x86_64:
"_someprojzm0zi1zi0zi0zm6corWoTDCA69pE1sqNF8Id_Lib_someFunc1_closure", referenced from:
_Main_main1_info in Main.o
_S39Z_srt in Main.o
"_someprojzm0zi1zi0zi0zm6corWoTDCA69pE1sqNF8Id_Lib_someFunc1_info", referenced from:
_Main_main_info in Main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
`gcc' failed in phase `Linker'. (Exit code: 1)
-- While building package someproj-0.1.0.0 using:
/Users/trevord2/.stack/setup-exe-cache/x86_64-osx/Cabal-simple_mPHDZzAJ_1.24.2.0_ghc-8.0.2 --builddir=.stack-work/dist/x86_64-osx/Cabal-1.24.2.0 build lib:someproj exe:someproj-exe --ghc-options " -ddump-hi -ddump-to-file"
Process exited with code: ExitFailure 1
Which I've seen before and was actually one of my initial problems
UPDATE 2: Created GitHub Issue
Here's the issue: https://github.com/commercialhaskell/stack/issues/3487
After talking with folks on #haskell IRC they recommended I create an issue as this is very peculiar behaviour from what I understand. I'll try make sure whatever we find out here is pushed up there too.

Cabal missing packages

I try to install cabal with the command on terminal
cabal install cabal-install
Resolving dependencies...
Configuring hackage-security-0.5.2.2...
Building hackage-security-0.5.2.2...
Failed to install hackage-security-0.5.2.2
Build log ( /Users/developer/.cabal/logs/hackage-security-0.5.2.2.log ):
cabal: Entering directory '/var/folders/2x/t_2cl03x2092dkzvc702d7lc0000gn/T/cabal-tmp-586/hackage-security-0.5.2.2'
Configuring hackage-security-0.5.2.2...
Building hackage-security-0.5.2.2...
Preprocessing library hackage-security-0.5.2.2...
[ 1 of 42] Compiling Prelude ( src/Prelude.hs, dist/build/Prelude.o )
[ 2 of 42] Compiling Text.JSON.Canonical ( src/Text/JSON/Canonical.hs, dist/build/Text/JSON/Canonical.o )
Failed to load interface for ‘Data.Text’
There are files missing in the ‘text-1.2.2.1’ package,
try running 'ghc-pkg check'.
Use -v to see a list of the files searched for.
cabal: Leaving directory '/var/folders/2x/t_2cl03x2092dkzvc702d7lc0000gn/T/cabal-tmp-586/hackage-security-0.5.2.2'
cabal: Error: some packages failed to install:
cabal-install-1.24.0.2 depends on hackage-security-0.5.2.2 which failed to
install.
hackage-security-0.5.2.2 failed during the building phase. The exception was:
ExitFailure 1
I am using macOS Sierra Version 10.12.1. The Haskell installation package is from https://www.haskell.org/platform/mac.html. The installation was successful.
When I try to install cabal install ghc-mod I've got following error:
cabal install ghc-mod
Resolving dependencies...
Configuring haskell-src-exts-1.18.2...
Building haskell-src-exts-1.18.2...
Failed to install haskell-src-exts-1.18.2
Build log ( /Users/developer/.cabal/logs/haskell-src-exts-1.18.2.log ):
cabal: Entering directory '/var/folders/2x/t_2cl03x2092dkzvc702d7lc0000gn/T/cabal-tmp-713/haskell-src-exts-1.18.2'
Configuring haskell-src-exts-1.18.2...
Building haskell-src-exts-1.18.2...
Preprocessing library haskell-src-exts-1.18.2...
[ 1 of 17] Compiling Language.Haskell.Exts.Syntax ( src/Language/Haskell/Exts/Syntax.hs, dist/build/Language/Haskell/Exts/Syntax.o )
[ 2 of 17] Compiling Language.Haskell.Exts.SrcLoc ( src/Language/Haskell/Exts/SrcLoc.hs, dist/build/Language/Haskell/Exts/SrcLoc.o )
[ 3 of 17] Compiling Language.Haskell.Exts.ParseSyntax ( src/Language/Haskell/Exts/ParseSyntax.hs, dist/build/Language/Haskell/Exts/ParseSyntax.o )
[ 4 of 17] Compiling Language.Haskell.Exts.Pretty ( src/Language/Haskell/Exts/Pretty.hs, dist/build/Language/Haskell/Exts/Pretty.o )
[ 5 of 17] Compiling Language.Haskell.Exts.Fixity ( src/Language/Haskell/Exts/Fixity.hs, dist/build/Language/Haskell/Exts/Fixity.o )
[ 6 of 17] Compiling Language.Haskell.Exts.Extension ( src/Language/Haskell/Exts/Extension.hs, dist/build/Language/Haskell/Exts/Extension.o )
[ 7 of 17] Compiling Language.Haskell.Exts.ExtScheme ( src/Language/Haskell/Exts/ExtScheme.hs, dist/build/Language/Haskell/Exts/ExtScheme.o )
[ 8 of 17] Compiling Language.Haskell.Exts.Comments ( src/Language/Haskell/Exts/Comments.hs, dist/build/Language/Haskell/Exts/Comments.o )
[ 9 of 17] Compiling Language.Haskell.Exts.ExactPrint ( src/Language/Haskell/Exts/ExactPrint.hs, dist/build/Language/Haskell/Exts/ExactPrint.o )
[10 of 17] Compiling Language.Haskell.Exts.ParseMonad ( src/Language/Haskell/Exts/ParseMonad.hs, dist/build/Language/Haskell/Exts/ParseMonad.o )
[11 of 17] Compiling Language.Haskell.Exts.InternalLexer ( src/Language/Haskell/Exts/InternalLexer.hs, dist/build/Language/Haskell/Exts/InternalLexer.o )
[12 of 17] Compiling Language.Haskell.Exts.Lexer ( src/Language/Haskell/Exts/Lexer.hs, dist/build/Language/Haskell/Exts/Lexer.o )
[13 of 17] Compiling Language.Haskell.Exts.ParseUtils ( src/Language/Haskell/Exts/ParseUtils.hs, dist/build/Language/Haskell/Exts/ParseUtils.o )
[14 of 17] Compiling Language.Haskell.Exts.InternalParser ( dist/build/Language/Haskell/Exts/InternalParser.hs, dist/build/Language/Haskell/Exts/InternalParser.o )
[15 of 17] Compiling Language.Haskell.Exts.Parser ( src/Language/Haskell/Exts/Parser.hs, dist/build/Language/Haskell/Exts/Parser.o )
[16 of 17] Compiling Language.Haskell.Exts.Build ( src/Language/Haskell/Exts/Build.hs, dist/build/Language/Haskell/Exts/Build.o )
[17 of 17] Compiling Language.Haskell.Exts ( src/Language/Haskell/Exts.hs, dist/build/Language/Haskell/Exts.o )
src/Language/Haskell/Exts.hs:55:1: error:
Failed to load interface for ‘Language.Preprocessor.Unlit’
There are files missing in the ‘cpphs-1.20.2’ package,
try running 'ghc-pkg check'.
Use -v to see a list of the files searched for.
cabal: Leaving directory '/var/folders/2x/t_2cl03x2092dkzvc702d7lc0000gn/T/cabal-tmp-713/haskell-src-exts-1.18.2'
cabal: Error: some packages failed to install:
ghc-mod-5.7.0.0 depends on haskell-src-exts-1.18.2 which failed to install.
haskell-src-exts-1.18.2 failed during the building phase. The exception was:
ExitFailure 1
hlint-1.9.40 depends on haskell-src-exts-1.18.2 which failed to install.
The following cabal version is installed:
cabal --version
cabal-install version 1.24.0.2
compiled using version 1.24.2.0 of the Cabal library
I also tried to run ghc-pkg check and got a lot of package problems, few examples:
There are problems in package monad-journal-0.7.2:
Warning: library-dirs: /Users/developer/.cabal/lib/x86_64-osx-ghc-8.0.2/monad-journal-0.7.2-6mtwu36per6DTorptNDDzP doesn't exist or isn't a directory
Warning: dynamic-library-dirs: /Users/developer/.cabal/lib/x86_64-osx-ghc-8.0.2 doesn't exist or isn't a directory
Warning: haddock-interfaces: /Users/developer/.cabal/share/doc/x86_64-osx-ghc-8.0.2/monad-journal-0.7.2/html/monad-journal.haddock doesn't exist or isn't a file
Warning: haddock-html: /Users/developer/.cabal/share/doc/x86_64-osx-ghc-8.0.2/monad-journal-0.7.2/html doesn't exist or isn't a directory
import-dirs: /Users/developer/.cabal/lib/x86_64-osx-ghc-8.0.2/monad-journal-0.7.2-6mtwu36per6DTorptNDDzP doesn't exist or isn't a directory
cannot find any of ["Control/Monad/Journal.hi","Control/Monad/Journal.p_hi","Control/Monad/Journal.dyn_hi"]
cannot find any of ["Control/Monad/Journal/Class.hi","Control/Monad/Journal/Class.p_hi","Control/Monad/Journal/Class.dyn_hi"]
cannot find any of ["Control/Monad/Trans/Journal.hi","Control/Monad/Trans/Journal.p_hi","Control/Monad/Trans/Journal.dyn_hi"]
cannot find any of ["libHSmonad-journal-0.7.2-6mtwu36per6DTorptNDDzP.a","libHSmonad-journal-0.7.2-6mtwu36per6DTorptNDDzP.p_a","libHSmonad-journal-0.7.2-6mtwu36per6DTorptNDDzP-ghc8.0.2.so","libHSmonad-journal-0.7.2-6mtwu36per6DTorptNDDzP-ghc8.0.2.dylib","HSmonad-journal-0.7.2-6mtwu36per6DTorptNDDzP-ghc8.0.2.dll"] on library path
There are problems in package either-4.4.1.1:
Warning: library-dirs: /Users/developer/.cabal/lib/x86_64-osx-ghc-8.0.2/either-4.4.1.1-CrzaYJSOcIXAyUkEE7mRiL doesn't exist or isn't a directory
Warning: dynamic-library-dirs: /Users/developer/.cabal/lib/x86_64-osx-ghc-8.0.2 doesn't exist or isn't a directory
Warning: haddock-interfaces: /Users/developer/.cabal/share/doc/x86_64-osx-ghc-8.0.2/either-4.4.1.1/html/either.haddock doesn't exist or isn't a file
Warning: haddock-html: /Users/developer/.cabal/share/doc/x86_64-osx-ghc-8.0.2/either-4.4.1.1/html doesn't exist or isn't a directory
import-dirs: /Users/developer/.cabal/lib/x86_64-osx-ghc-8.0.2/either-4.4.1.1-CrzaYJSOcIXAyUkEE7mRiL doesn't exist or isn't a directory
cannot find any of ["Control/Monad/Trans/Either.hi","Control/Monad/Trans/Either.p_hi","Control/Monad/Trans/Either.dyn_hi"]
cannot find any of ["Data/Either/Combinators.hi","Data/Either/Combinators.p_hi","Data/Either/Combinators.dyn_hi"]
cannot find any of ["Data/Either/Validation.hi","Data/Either/Validation.p_hi","Data/Either/Validation.dyn_hi"]
cannot find any of ["libHSeither-4.4.1.1-CrzaYJSOcIXAyUkEE7mRiL.a","libHSeither-4.4.1.1-CrzaYJSOcIXAyUkEE7mRiL.p_a","libHSeither-4.4.1.1-CrzaYJSOcIXAyUkEE7mRiL-ghc8.0.2.so","libHSeither-4.4.1.1-CrzaYJSOcIXAyUkEE7mRiL-ghc8.0.2.dylib","HSeither-4.4.1.1-CrzaYJSOcIXAyUkEE7mRiL-ghc8.0.2.dll"] on library path
There are problems in package free-4.12.4:
Warning: library-dirs: /Users/developer/.cabal/lib/x86_64-osx-ghc-8.0.2/free-4.12.4-Hbi0FikbXDW7eNkrPW79mM doesn't exist or isn't a directory
Warning: dynamic-library-dirs: /Users/developer/.cabal/lib/x86_64-osx-ghc-8.0.2 doesn't exist or isn't a directory
Warning: haddock-interfaces: /Users/developer/.cabal/share/doc/x86_64-osx-ghc-8.0.2/free-4.12.4/html/free.haddock doesn't exist or isn't a file
Warning: haddock-html: /Users/developer/.cabal/share/doc/x86_64-osx-ghc-8.0.2/free-4.12.4/html doesn't exist or isn't a directory
import-dirs: /Users/developer/.cabal/lib/x86_64-osx-ghc-8.0.2/free-4.12.4-Hbi0FikbXDW7eNkrPW79mM doesn't exist or isn't a directory
cannot find any of ["Control/Applicative/Free.hi","Control/Applicative/Free.p_hi","Control/Applicative/Free.dyn_hi"]
cannot find any of ["Control/Applicative/Free/Final.hi","Control/Applicative/Free/Final.p_hi","Control/Applicative/Free/Final.dyn_hi"]
cannot find any of ["Control/Applicative/Trans/Free.hi","Control/Applicative/Trans/Free.p_hi","Control/Applicative/Trans/Free.dyn_hi"]
cannot find any of ["Control/Alternative/Free.hi","Control/Alternative/Free.p_hi","Control/Alternative/Free.dyn_hi"]
cannot find any of ["Control/Alternative/Free/Final.hi","Control/Alternative/Free/Final.p_hi","Control/Alternative/Free/Final.dyn_hi"]
cannot find any of ["Control/Comonad/Cofree.hi","Control/Comonad/Cofree.p_hi","Control/Comonad/Cofree.dyn_hi"]
cannot find any of ["Control/Comonad/Cofree/Class.hi","Control/Comonad/Cofree/Class.p_hi","Control/Comonad/Cofree/Class.dyn_hi"]
cannot find any of ["Control/Comonad/Trans/Cofree.hi","Control/Comonad/Trans/Cofree.p_hi","Control/Comonad/Trans/Cofree.dyn_hi"]
cannot find any of ["Control/Comonad/Trans/Coiter.hi","Control/Comonad/Trans/Coiter.p_hi","Control/Comonad/Trans/Coiter.dyn_hi"]
cannot find any of ["Control/Monad/Free.hi","Control/Monad/Free.p_hi","Control/Monad/Free.dyn_hi"]
cannot find any of ["Control/Monad/Free/Church.hi","Control/Monad/Free/Church.p_hi","Control/Monad/Free/Church.dyn_hi"]
cannot find any of ["Control/Monad/Free/Class.hi","Control/Monad/Free/Class.p_hi","Control/Monad/Free/Class.dyn_hi"]
cannot find any of ["Control/Monad/Free/TH.hi","Control/Monad/Free/TH.p_hi","Control/Monad/Free/TH.dyn_hi"]
cannot find any of ["Control/Monad/Trans/Free.hi","Control/Monad/Trans/Free.p_hi","Control/Monad/Trans/Free.dyn_hi"]
cannot find any of ["Control/Monad/Trans/Free/Church.hi","Control/Monad/Trans/Free/Church.p_hi","Control/Monad/Trans/Free/Church.dyn_hi"]
cannot find any of ["Control/Monad/Trans/Iter.hi","Control/Monad/Trans/Iter.p_hi","Control/Monad/Trans/Iter.dyn_hi"]
cannot find any of ["libHSfree-4.12.4-Hbi0FikbXDW7eNkrPW79mM.a","libHSfree-4.12.4-Hbi0FikbXDW7eNkrPW79mM.p_a","libHSfree-4.12.4-Hbi0FikbXDW7eNkrPW79mM-ghc8.0.2.so","libHSfree-4.12.4-Hbi0FikbXDW7eNkrPW79mM-ghc8.0.2.dylib","HSfree-4.12.4-Hbi0FikbXDW7eNkrPW79mM-ghc8.0.2.dll"] on library path
What am I doing wrong?

installing cairo on Mac OS Lion

I've just got a new mac, and I'm struggling to install Cairo for use with Haskell (diagrams in particular). I remember having a lot of problems with my previous machine, but I'm at a dead end this time.
$ cabal install cairo
Resolving dependencies...
[1 of 2] Compiling SetupWrapper ( /var/folders/7s/6fn_d5px0hs2204xfztw88v40000gp/T/cairo-0.12.3.1-66116/cairo-0.12.3.1/SetupWrapper.hs, /var/folders/7s/6fn_d5px0hs2204xfztw88v40000gp/T/cairo-0.12.3.1-66116/cairo-0.12.3.1/dist/setup/SetupWrapper.o )
[2 of 2] Compiling Main ( /var/folders/7s/6fn_d5px0hs2204xfztw88v40000gp/T/cairo-0.12.3.1-66116/cairo-0.12.3.1/Setup.hs, /var/folders/7s/6fn_d5px0hs2204xfztw88v40000gp/T/cairo-0.12.3.1-66116/cairo-0.12.3.1/dist/setup/Main.o )
Linking /var/folders/7s/6fn_d5px0hs2204xfztw88v40000gp/T/cairo-0.12.3.1-66116/cairo-0.12.3.1/dist/setup/setup ...
[1 of 2] Compiling Gtk2HsSetup ( Gtk2HsSetup.hs, dist/setup-wrapper/Gtk2HsSetup.o )
[2 of 2] Compiling Main ( SetupMain.hs, dist/setup-wrapper/Main.o )
Linking dist/setup-wrapper/setup ...
Configuring cairo-0.12.3.1...
setup: The program pkg-config version >=0.9.0 is required but it could not be
found.
cabal: Error: some packages failed to install:
cairo-0.12.3.1 failed during the configure step. The exception was:
ExitFailure 1
The program pkg-config needs to be installed. There are various ways to do this (e.g. I imagine it's available as part of MacPorts and similar package managers) but in the event that you need to download and install it from source, this is the place:
http://www.freedesktop.org/wiki/Software/pkg-config/

Can't install gtk-mac-integration

I don't understand the error because it appears to be requiring a version of the same package that I'm trying to install.
$ cabal install gtk-mac-integration
Resolving dependencies...
[1 of 2] Compiling SetupWrapper ( /var/folders/cU/cUDMo9+9Gl817+j+h1DAvk+++TI/-Tmp-/gtk-mac-integration-0.1.0.46479/gtk-mac-integration-0.1.0.4/SetupWrapper.hs, /var/folders/cU/cUDMo9+9Gl817+j+h1DAvk+++TI/-Tmp-/gtk-mac-integration-0.1.0.46479/gtk-mac-integration-0.1.0.4/dist/setup/SetupWrapper.o )
[2 of 2] Compiling Main ( /var/folders/cU/cUDMo9+9Gl817+j+h1DAvk+++TI/-Tmp-/gtk-mac-integration-0.1.0.46479/gtk-mac-integration-0.1.0.4/Setup.hs, /var/folders/cU/cUDMo9+9Gl817+j+h1DAvk+++TI/-Tmp-/gtk-mac-integration-0.1.0.46479/gtk-mac-integration-0.1.0.4/dist/setup/Main.o )
Linking /var/folders/cU/cUDMo9+9Gl817+j+h1DAvk+++TI/-Tmp-/gtk-mac-integration-0.1.0.46479/gtk-mac-integration-0.1.0.4/dist/setup/setup ...
[1 of 2] Compiling Gtk2HsSetup ( Gtk2HsSetup.hs, dist/setup-wrapper/Gtk2HsSetup.o )
[2 of 2] Compiling Main ( SetupMain.hs, dist/setup-wrapper/Main.o )
Linking dist/setup-wrapper/setup ...
Configuring gtk-mac-integration-0.1.0.4...
setup: The pkg-config package gtk-mac-integration version >=0.9.6 is required
but it could not be found.
cabal: Error: some packages failed to install:
gtk-mac-integration-0.1.0.4 failed during the configure step. The exception
was:
ExitFailure 1
It doesn't want the Haskell package gtk-mac-integration, it wants the system package gtk-mac-integration. That is, the Haskell package you're trying to install is just a binding to the gtk-mac-integration library (which I think is bundled with GTK+); you'll have to install it separately before you can install the Haskell package.
If you already have GTK+ installed, then the problem is that the pkg-config tool Cabal uses to find external library dependencies can't find the corresponding .pc files for the library. I don't know how to fix that, though; at least not without more details.

Resources