Haskell Stack Resolver error just trying to run ghci - haskell

I'm a haskell newcomer, I've tried googling, IRC, and doing what the CLI tells me to do, but can't seem to get basic haskell ecosystem tools to play nice.
I installed ghc, stack, and cabal via the minimal installers OSX link on this page https://www.haskell.org/downloads and now I'm running into some strange resolver problems while trying to get started with stack. I run stack ghci it tells me that it wants 7.10.3 and to run stack setup. Setup then says it installed ghc#7.10.2. Any help would be much appreciated, thank you!

Apparently the version of stack in that package is 0.1.2.0 which is super old, and this bug is very dated. I don't know why the .org downloads page installs an ancient version of the tool, but my fix ended up being to download stack manually from here: https://github.com/commercialhaskell/stack/blob/master/doc/install_and_upgrade.md and then once I downloaded the zip I ran
mv ~/Downloads/stack-1.0.2-osx-x86_64/stack /Applications/ghc-7.10.2.app/Contents/bin/stack
That command puts the updated stack in place of the old one and things then seem to work!
As a note: Learning more about installing haskell, it seems everyone suggests that you never install haskell via haskell.org but instead install stack on it's own and use it to install haskell.

Related

Completely remove Stack from Windows 10

I am running Windows 10, VSCode, and have the Haskell Extension Pack installed.
I also have Stack installed, and would like to temporarily uninstall it to make sure I can document and explain use of Stack with Haskell in VSCode on Windows 10.
stack's command help states that the stack uninstall command is deprecated.
Q1: Do I even need to do this? Is stack automatically installed with the VSCode Haskell Extension Pack? My investigation does not indicate this.
Q2. To uninstall stack (JUST TEMPORARILY! I LIKE IT!) how is this done? Is there a new command? Do I need to use some other install manager? Do I simply delete an executable and helper files?
As far as I recall, on Windows, Stack is a program you install. I haven't tried to uninstall it, but it appears in Apps & features with an Uninstall button:
Have you tried clicking that button?
FWIW, the official Stack documentation also has a sentence about uninstalling:
Removing ~/.stack and /usr/local/bin/stack should be sufficient. You may want to delete .stack-work folders in any Haskell projects that you have built.
To remove stack you will need to manually delete the following:
C:\sr
%AppData%\Roaming\stack
Just running uninstall won't remove those folders from your system.

The program 'llvm-config' version ==9.0.* is required but it could not be found

I wanted to install llvm-hs with the command cabal install llvm-hs -fshared-llvm, according to the installation guide of Accelerate on the website: https://www.acceleratehs.org/get-started.html. But something errors. After that I tried cabal install llvm-hs and then I got the error message:
Linking C:\Users\.......\cabal-tmp-14364\llvm-hs-9.0.1\dist\setup\setup.exe ...
setup.exe: The program 'llvm-config' version ==9.0.* is required but it could
not be found.
cabal: Leaving directory 'C:\Users\.......\cabal-tmp-14364\llvm-hs-9.0.1'
cabal.exe: Error: some packages failed to install:
llvm-hs-9.0.1-IXEp6h558cdJJTwzKkubg0 failed during the configure step. The
exception was:
ExitFailure 1
So I tried to figure out how I can 'install' llvm-config, but I can't really find the solution to this problem. Does anyone know the solution?
It seems that you are trying to install Accelerate for Windows with an LLVM backend. As far as I know, this is not possible.
Basically, it comes down to the fact that Accelerate, actually the llvm-hs package, needs LLVM as a shared library. This was not possible on Windows, although I'm unsure if anything has changed in that regard in the last 2 years.
There are still two options to still use Accelerate on Windows.
Use it without a backend, this means you can still program in Accelerate and run it via the interpreter, although it will be slow in execution time.
Try to use Windows Subsystem for Linux. If you want to use the GPU backend (accelerate-llvm-ptx), I believe that is now possible since of WSL 2 (following the instructions here). Or if you want the multicore backend accelerate-llvm-native that should be possible. Although of course, you will need to install LLVM first, you can follow the normal install instructions for Linux.

How does haskell-platform use Stack?

The page: https://www.haskell.org/platform/ claims that haskell-platform comes with the Stack tool. However, on my Debian system after installing the haskell-platform package, I do not have the command stack available to me (which I would if I followed the instructions for installing Stack from the Stack website).
I can't find any information on how Stack is included in haskell-platform. It seems to be mentioned on the front page of the site, and no where else.
So, in what way is Stack "included" with the haskell-platform?
Haskell platform 2014.2.0 version doesn't come up with Stack. You can verify it from here: https://www.haskell.org/platform/contents.html
Haskell platform 8.0.1 is the first version which supports Stack. Also the versioning scheme of the platform seemed to change after 2014.2.0.
In my opinion, you should generally not try installing from Debian's package manager as it is usually quite old. Also, these days I would just recommend you to use Stack and install it from here.

Haskell Eclipse Linux and Buildwrapper

I am kind of new Eclipse user, and Haskell too. I keep trying to understand what is wrong and what to do, as my Eclipse after I installed Haskell platform keeps me saying following
Configuring Test1-0.1...
buildwrapper: Left over temporary directory not removed: /tmp/dynamic-cabal.23
<command line>: cannot satisfy -package Cabal-1.22.0.0
I tried it on Ubuntu and Archlinux. Same behaviour. I have also read a lot of forums, and there is kind of information about GHC versions, cabal versions, and buildwrapper versions issues, but I could not figure how to fix that thing...
For example like here https://github.com/JPMoresmau/BuildWrapper/issues/18
I tried cabal install cabal-install Eclipse started to behave a little different, cycling this over and over and over...
configuring because setup_config not present
Resolving dependencies...
Configuring Test1-0.1...
Any help please...
I do not know if it qualify for answer, I hope so.
The problem was that when I install GHC from standard ubuntu and arch repository, it installs Cabal-1.18.1.5 and Cabal-Install-1.22.0.0 system wide. And this causing EclipseFP plugin to install buidwrapper version which was supposed to work with 1.22 Cabal, while I actually had 1.18. Eclipse setting for Haskell said I had Cabal 1.22 (which was wrong).
What I did is added ArchHaskell repository, and installed everything from there, which got me 1.18 combo of Cabal and Cabal-install. EclipseFP worked it OK, finally.
I think there was a way to move local install up in hierarchy so EclipseFP would pick it up. But I understood it may be too late.

What is the "officially" recommended way of installing Haskell from source?

How does one install Haskell from source (on Red Hat) now?
The current page has broken links and conflicting advice.
From http://www.haskell.org/platform/linux.html
Get and install GHC 7.6.3 prior to building the platform
From http://www.haskell.org/ghc/download_ghc_7_6_3
For most users, we recommend installing the Haskell Platform instead of GHC. The current Haskell Platform release includes a recent GHC release as well as some other tools (such as cabal), and a larger set of libraries that are known to work together.
(the link to cabal-install is broken).
The broken link should be pointing to http://www.haskell.org/haskellwiki/Cabal-Install instead. If you want to install from source, you're first going to have to compile and install GHC from source, then you can install the Haskell Platform from its source.
I'm not really sure what conflicting information you're seeing, if you want to build from source you have to install GHC first. Alternatively, you can just install the Haskell Platform from the distributable (might not be possible on Red Hat) and it'll install GHC for you. Both are pretty straightforward.

Resources