cabal installation failure for llvm-general - haskell

I am attempting to install the llvm-general Cabal package on OS X. When I do, I get the following error:
$ cabal install llvm-general
Resolving dependencies...
[1 of 1] Compiling Main ( /var/folders/PP/PP+wAuBcGWuqzt-Iekiipk+++TI/-Tmp-/llvm-general-3.4.4.2-38424/llvm-general-3.4.4.2/Setup.hs, /var/folders/PP/PP+wAuBcGWuqzt-Iekiipk+++TI/-Tmp-/llvm-general-3.4.4.2-38424/llvm-general-3.4.4.2/dist/setup/Main.o )
Linking /var/folders/PP/PP+wAuBcGWuqzt-Iekiipk+++TI/-Tmp-/llvm-general-3.4.4.2-38424/llvm-general-3.4.4.2/dist/setup/setup ...
setup: The program llvm-config version ==3.4.* is required but the version
found at /usr/local/bin/llvm-config is version 3.2
cabal: Error: some packages failed to install:
llvm-general-3.4.4.2 failed during the configure step. The exception was:
ExitFailure 1
What it's doing is running /usr/local/bin/llvm-config; this, I believe, is the version of LLVM installed by the OS X developer tools that I installed a while ago. I do have the current version of LLVM, but it's installed with Homebrew as a local (keg-only) installation. Is there any way I can point cabal to that version of LLVM for the purposes of this installation?

I believe that cabal simply looks in your PATH for llvm-config, so just adjust your path accordingly. Otherwise you can try:
modify the file llvm-general.cabal to reference an absolute path for llvm-config (line 52)
temporarily move aside /usr/local/bin/llvm-config and replace it with the llvm-config for the llvm installation you want to use
For reference, I found llvm-config for version 3.4 at /usr/local/Cellar/llvm34/3.4.2/lib/llvm-3.4/bin/llvm-config on my OSX system.

Related

Unable to Install glpk-hs

I've installed the Haskell Compiler and glpk-hs using the instructions here. Further, I've used cabal install glpk-hs to install required files in an attempt to compile a Haskell Program.
However, the cabal installation of glpk is not working. The following message keeps popping up:
Resolving dependencies...
Configuring glpk-hs-0.5...
Failed to install glpk-hs-0.5
Build log :
cabal: Entering directory '/var/folders/cr/9f1ltj7d4b31hmkfn03hjl_r0000gn/T/cabal-tmp-12521/glpk-hs-0.5'
Configuring glpk-hs-0.5...
cabal.real: Missing dependency on a foreign library:
Missing C library: glpk
This problem can usually be solved by installing the system package that
provides this library (you may need the "-dev" version). If the library is
already installed but in a non-standard location then you can use the flags
--extra-include-dirs= and --extra-lib-dirs= to specify where it is.
cabal:
Leaving directory '/var/folders/cr/9f1ltj7d4b31hmkfn03hjl_r0000gn/T/cabal-tmp-12521/glpk-hs-0.5'
cabal: Error: some packages failed to install:
glpk-hs-0.5 failed during the configure step. The exception was:
ExitFailure 1
As above, I have tried both installing glpk in a nonstandard location and the standard location, but in all cases, has been unable to find the glpk.
The glpsol solver, which uses GLPK is installed though, as it shows the version of which it is currently running: GLPSOL: GLPK LP/MIP Solver, v4.62
Figured it out! hmatrix-glpk had the extra directories for OS X in the .cabal file:
if os(OSX)
extra-lib-dirs: /usr/lib
extra-lib-dirs: /opt/local/lib/
include-dirs: /opt/local/include/
extra-lib-dirs: /usr/local/lib/
include-dirs: /usr/local/include/
if arch(i386)
cc-options: -arch i386
Copying this into the glpk-hs.cabal allows the installation to work.

Error when installing cabal package (cannot determine mingw version)

I would like to install a package using cabal, but I get this error:
Warning: cannot determine version of D:\Program Files\Haskell
Platform\8.0.2\mingw\bin\gcc.exe :
""
`gcc.exe' failed in phase `C Compiler'. (Exit code: -1073741502)
The package is stm:
cabal install stm
I've installed the full x64 version of Haskell Platform on my Windows 10 PC.
The error is almost the same as here: https://github.com/haskell/cabal/issues/4442
But that is not answered
Win10 Creators Update changed some APIs that ghc was affected by. You may be seeing the result of this. If you have Win 10 build 15019 or later replace your gcc.exe as detailed at the ghc-compat repo as see if that helps.

Problems installing gtk2hs on windows

I have decided to try to install gtk2hs on my Windows 8 (64 bit) machine. I am relying on the lastest Haskell Platform distribution.
So, I go on the wiki, and follow the instructions. I get gtk+ 32-bit distribution, version 2.24, in the all in one bundle. I unpack it correclty, set up PATH to point to gtk/bin, and create INCLUDE and LIB variables to point respectively to gtk/include and gtk/lib (this step does not seem necessary, but it can't hurt!)
I then verify all is in order by invoking
pkg-config --modversion gtk+-2.0
and the terminal happly chirps back
2.24.10
Great!
Then, I run cabal install
gtk2hs-buildtools
and that also goes well.
But then, when I run cabal install gtk, it complains that glib fails to install, because it can't find some C dependencies. I try to isolate the problem by running
cabal install glib
and get the following:
C:\Users\Federico>cabal install glib
Resolving dependencies...
Configuring glib-0.13.1.0...
Failed to install glib-0.13.1.0
Last 10 lines of the build log ( C:\Users\Federico\AppData\Roaming\cabal\logs\gl
ib-0.13.1.0.log ):
[1 of 2] Compiling Gtk2HsSetup ( Gtk2HsSetup.hs, dist\setup-wrapper\Gtk2HsS
etup.o )
[2 of 2] Compiling Main ( SetupMain.hs, dist\setup-wrapper\Main.o )
Linking dist/setup-wrapper\setup.exe ...
Configuring glib-0.13.1.0...
setup.exe: Missing dependencies on foreign libraries:
* Missing C libraries: gobject-2.0, gthread-2.0, glib-2.0, intl
This problem can usually be solved by installing the system packages that
provide these libraries (you may need the "-dev" versions). If the libraries
are already installed but in a non-standard location then you can use the
flags --extra-include-dirs= and --extra-lib-dirs= to specify where they are.
cabal: Error: some packages failed to install:
glib-0.13.1.0 failed during the configure step. The exception was:
ExitFailure 1
But this is utter crap! I KNOW the libraries are there. I can see them, in the gtk/bin folder! I re-check my path, and all is good. They are visible, in path. so is include, and lib. All of it. And yet, cabal complains it can't find them.
But this isn't the scariest bit yet...I download the 64-bit of the library, version 2.16...simply swap the two gtk folders...and now, cabal happly builds the whole thing! Of course, it's unsuable, because ghc on the plaftorm is 32-bit and the libraries are 64-bit, so ghc fails to link against it...but at least cabal was pleased.
I then remove glib, cairo, pango, gtk etc, and go about trying installing again, 2.16, 32-bit. And surely, cabal complains about C dependencies missing.
At this point, befuddled by this kafkian situation, I turn to the wisdom of stack overflow!
Is cabal trolling me? Are the error messages misleading? Or am I missing something obvious?
Thanks to all for the help!
If you are using 64 bit version of GHC, you want to use 64 bit version of gtk as well.
You can download it on this link. Scroll down a bit and download 2.x (not 3.x) all in one bundle, don't download 2.16:
http://www.gtk.org/download/win64.php
Above is no longer an option. You can try installing MSYS and than using MSYS console with pacman package manager to install gtk dev library on windows (I haven't tried it yet though). This pretty much sucks in my opinion.

Missing dependencies for chart-cairo on linux mint 17

I'm struggling to install GTK / gtk2hs binding on Linux Mint 17.
The first time I encountered this problem was when I tried to get glade support in Haskell.
There were the same problems but it was purely for fun so I let it be.
This time I was trying to visualize a graph with Haskell Chart.
The problem occured in the forth step cabal install chart-cairo
I'm using GHC version 7.6.3, cabal version 1.16.0.2, gtk2hs-buildtools version 0.12.4-2ubuntu1 (from the package manager), gtk2hsC2hs version 0.13.6 (this is where glade needs to have >=0.13.8, but I can't find a newer version)
Things I've tried so far:
After downloading the gtk2hs-buildtools from the package manager I updated cabal and installed the tools from the command line
Added the "$HOME/.cabal/bin" to the front of $PATH (after that gtk installed correctly)
cabal install chart-cairo gets me this error message
Resolving dependencies...
[1 of 2] Compiling SetupWrapper ( /tmp/cairo-0.13.0.2-19862/cairo-0.13.0.2/SetupWrapper.hs, /tmp/cairo-0.13.0.2-19862/cairo-0.13.0.2/dist/setup/SetupWrapper.o )
[2 of 2] Compiling Main ( /tmp/cairo-0.13.0.2-19862/cairo-0.13.0.2/dist/setup/setup.hs, /tmp/cairo-0.13.0.2-19862/cairo-0.13.0.2/dist/setup/Main.o )
Linking /tmp/cairo-0.13.0.2-19862/cairo-0.13.0.2/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.13.0.2...
Building cairo-0.13.0.2...
Preprocessing library cairo-0.13.0.2...
[ 1 of 18] Compiling Graphics.Rendering.Cairo.Matrix ( dist/build/Graphics/Rendering/Cairo/Matrix.hs, dist/build/Graphics/Rendering/Cairo/Matrix.o )
[ 2 of 18] Compiling Graphics.Rendering.Cairo.Types ( dist/build/Graphics/Rendering/Cairo/Types.hs, dist/build/Graphics/Rendering/Cairo/Types.o )
[ 3 of 18] Compiling Graphics.Rendering.Cairo.Internal.Utilities ( dist/build/Graphics/Rendering/Cairo/Internal/Utilities.hs, dist/build/Graphics/Rendering/Cairo/Internal/Utilities.o )
Graphics/Rendering/Cairo/Internal/Utilities.chs:24:42:
Module `Data.Text.Foreign' does not export `withCStringLen'
Failed to install cairo-0.13.0.2
cabal: Error: some packages failed to install:
Chart-cairo-1.3.2 depends on cairo-0.13.0.2 which failed to install.
cairo-0.13.0.2 failed during the building phase. The exception was:
ExitFailure 1
pkg-config cairo --modversion tells me I have the version 1.13.1 (which is newer than 0.13.0.2?)
I just tried it myself, and hit some snags that I was able to overcome.... Perhaps you are having the same problem.
For some reason, some dependencies would not automatically install. It is easy to install them by hand though. Try this:
cabal install alex
cabal install gtk2hs-buildtools
cabal install cairo
cabal install chart-cairo
In general, if you see an error message in your cabal output like the following line in your post
Failed to install cairo-0.13.0.2
it is a good idea to try the install manually. Although dependencies are supposed to be worked out, I've run into many cases where they don't (I think it might have to do with cabal installing command line tools, but have never looked into it fully). In this particular case, that is what I did, but I had to go up the chain 4 times....
An old version of text is being used (also causing cabal to choose the old version of cairo with bad build-deps). Try adding --constraint='cairo>=0.13.0.5' to your cabal install. That should also force cabal to choose a newer version of text.
pkg-config cairo --modversion gives the version of the actual cairo library. 0.13.0.2 is the version of the Gtk2Hs haskell package that wraps cairo (actual cairo version wrapped depends what is installed)
I encountered the same issue. This is a late reply but a good resource for this problem is found here. On my Debian system (Linux Mint) I found that doing:
sudo apt-get install libghc-gtk-dev
solved the problem. But the link provides installation advice for several Linux based systems as well as Windows, BSD and Mac.

How to install ThreadScope on GHC 6.12 in Ubuntu

I've try to install treadScope on my computer for Haskell parallel profiling, I'm using Ubuntu 10 and GHC 6.12. The problem it that I unfortunatlly came out with the following problem. I can't install glade, and the command pkg-config -modversion libglade2.2 return an error, which mean that the glade's .pc file is not found by the system. How can I fix this problem on ubuntu,
Thank you a lot for any answer
More details
here is the error message return by the command cabal install threadscope
Linking /tmp/glade-0.12.02992/glade-0.12.0/dist/setup/setup ...
Configuring glade-0.12.0...
setup: The pkg-config package libglade-2.0 version >=2.0.0 is required but it
could not be found.
cabal: Error: some packages failed to install:
glade-0.12.0 failed during the configure step. The exception was: ExitFailure 1
threadscope-0.1.2 depends on glade-0.12.0 which failed to install.
And here is the error message return by the command _pkg-config --modversion libglade-2.0
Package libglade-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libglade-2.0.pc' to the PKG_CONFIG_PATH environment variable
No package 'libglade-2.0' found
Thanks for your reply
Lot of thanks to TomMD,
I've install libglade2-dev and thinks goes well
thanks a lot for your reply

Resources