I’m trying to install stack and build the following (github com davidsd hyperion, sorry wasn’t allowed to include the link as a new user but googling it should return it as first result).
Since curl -sSL https://get.haskellstack.org/ | sh required root priviliges which I don’t have I tried manual downloading stack. Unzipping stack immediately seemed functional, i.e. stack --help returned a normal output. I then checked out the repository with git clone ... and in the new directory I ran stack build returning:
/central/home/somename/haskell/stack-2.13.1-linux-x86_64/hyperion/hyperion.cabal was generated with a newer version of hpack,
please upgrade and try again.
Cabal file info not found for distributed-static-0.3.9@sha256:f5e781867eddec660cb3b39805c849e3f096b7da245d43a07d8529e3c92b3a27, updating
Selected mirror (…)
Downloading root
Selected mirror (…)
Downloading timestamp
Downloading snapshot
Downloading mirrors
Cannot update index (no local copy)
Downloading index
Updated package index downloaded
Calculating hashes to check for hackage-security rebases or filesystem changes
No old cache found, populating cache from scratch
Populating cache from file size 887122432, hash 21632abe2b849fe31a4cd1517d46f192cf507e6adda67f7c3a72e5319b880c44
Populating package index cache …
Package index cache populated
Cloning f45c9d986edfb79669c54c646501b9448fc800e8 from (…)
Cloning bab06c5989db8dc32765c9b6c1795c020fa0ecf9 from (…)
Cloning 2f65a2d472fccbd90636783c8a85ef553f8f9ea8 from (…)
Cloning 26d55bfa4c6019558ff05b97b29bff9990db31ca from (…)
Stack has not been tested with GHC versions above 8.6, and using 9.4.5, this may fail
Preparing to install GHC to an isolated location.
This will not interfere with any system-level installation.
Downloaded ghc-9.4.5.
Unpacking GHC into /central/home/somename/.stack/programs/x86_64-linux/ghc-9.4.5 Did not find executable at specified path: /central/home/somename/.stack/programs/x86_64-linux/ghc-9.4.5.temp/ghc-9.4.5/configure
Error: Error encountered while configuring GHC with
/central/home/somename/.stack/programs/x86_64-linux/ghc-9.4.5.temp/ghc-9.4.5/configure --prefix=/central/home/somename/.stack/programs/x86_64-linux/ghc-9.4.5/
run in /central/home/somename/.stack/programs/x86_64-linux/ghc-9.4.5.temp/ghc-9.4.5/
The following directories may now contain files, but won't be used by stack:
- /central/home/somename/.stack/programs/x86_64-linux/ghc-9.4.5.temp/
- /central/home/somename/.stack/programs/x86_64-linux/ghc-9.4.5/
For more information consider rerunning with --verbose flag
Configuring GHC …
P.S.: I had the following modules loaded, since I need these for other code cmake/3.10.2 gcc/9.2.0 openmpi/3.0.0 boost/1_68_0-gcc730 eigen/eigen . This should provide the required gcc. However, I might be missing other dependencies. Again I would have to install them without root access so it would be great to have instructions for this.
Also /central/home/somename/.stack/programs/x86_64-linux/ghc-9.4.5.temp/ghc-9.4.5/ contains ghc-9.4.5-x86_64-unknown-linux instead of ghc-9.4.5 so that seems to be why the appropriate files are not found. (But I’m not sure what to do about this.)
I think I can make the debug simpler by cutting out the software I’m trying to build. It does not seem to be relevant. Just running stack ghc produces the same error and I think this should be independent of whatever I am trying to build.
I’d advise to use ghcup to install the GHC version you want and the stack and/or cabal you want to use. It makes for cleaner installations and has the most guarantees it will work, since it is better maintained than stack's own GHC installing.
So:
uninstall your current stack installation (I think stack has it’s own command to do that)
install ghcup
use ghcup tui to install the things you want installed
After you’ve installed stack through ghcup, you might have to tell stack not to use it’s own installing method, by giving it the --system-ghc flag, but I think it should work fairly straight-forwardly.
I don’t know what version of Stack you have installed, but the message Stack has not been tested with GHC versions above 8.6, and using 9.4.5, this may fail suggests it is not a recent one. You can obtain Stack 2.13.1 binary distributions at Release v2.13.1 · commercialhaskell/stack · GitHub.
If something has gone wrong, or been corrupted, in the installation process, you can delete the Stack root without any adverse consequences. Stack will fetch again anything that it needs. The command stack uninstall will provide advice (but it does not itself uninstall anything).
That is odd, because that URL points to Stack 2.13.1 but you appear to me to be running some other version of Stack. Please can you post here what is the output of stack --version.
Unfortunately I can’t provide that anymore (but the file was called stack-2.13.1-linux-x86_64). I deleted the previous install because I’m trying with ghcup as suggested here. That seems to work.