# Installing stack and first build (on a Linux HPC without root access)

**URL:** <https://discourse.haskell.org/t/installing-stack-and-first-build-on-a-linux-hpc-without-root-access/8350>\
**Category:** Learn\
**Created:** [December 18, 2023, 2:20pm UTC](https://discourse.haskell.org/t/installing-stack-and-first-build-on-a-linux-hpc-without-root-access/8350 "2023-12-18T14:20:49Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marten](https://avatars.discourse-cdn.com/v4/letter/m/4af34b/32.png) [@Marten](https://discourse.haskell.org/u/Marten)\
**Post date:** [December 18, 2023, 2:20pm UTC](https://discourse.haskell.org/t/installing-stack-and-first-build-on-a-linux-hpc-without-root-access/8350/1 "2023-12-18T14:20:49Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Marten](https://avatars.discourse-cdn.com/v4/letter/m/4af34b/32.png) [@Marten](https://discourse.haskell.org/u/Marten)\
**Post date:** [December 18, 2023, 2:22pm UTC](https://discourse.haskell.org/t/installing-stack-and-first-build-on-a-linux-hpc-without-root-access/8350/2 "2023-12-18T14:22:43Z")

</div>

Since, I am allowed to include it here in a reply: the link was [GitHub - davidsd/hyperion: A Haskell framework for running concurrent computations on an HPC cluster.](https://github.com/davidsd/hyperion).

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.)

---

<div class="post-metadata">

**Author:** ![Marten](https://avatars.discourse-cdn.com/v4/letter/m/4af34b/32.png) [@Marten](https://discourse.haskell.org/u/Marten)\
**Post date:** [December 18, 2023, 2:33pm UTC](https://discourse.haskell.org/t/installing-stack-and-first-build-on-a-linux-hpc-without-root-access/8350/3 "2023-12-18T14:33:22Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Vlix](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/vlix/32/1551_2.png) [@Vlix](https://discourse.haskell.org/u/Vlix)\
**Post date:** [December 18, 2023, 4:27pm UTC](https://discourse.haskell.org/t/installing-stack-and-first-build-on-a-linux-hpc-without-root-access/8350/4 "2023-12-18T16:27:20Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![mpilgrem](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/mpilgrem/32/2529_2.png) [@mpilgrem](https://discourse.haskell.org/u/mpilgrem)\
**Post date:** [December 18, 2023, 8:12pm UTC](https://discourse.haskell.org/t/installing-stack-and-first-build-on-a-linux-hpc-without-root-access/8350/5 "2023-12-18T20:12:16Z")

</div>

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](https://github.com/commercialhaskell/stack/releases/tag/v2.13.1).

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).

---

<div class="post-metadata">

**Author:** ![Marten](https://avatars.discourse-cdn.com/v4/letter/m/4af34b/32.png) [@Marten](https://discourse.haskell.org/u/Marten)\
**Post date:** [December 18, 2023, 11:13pm UTC](https://discourse.haskell.org/t/installing-stack-and-first-build-on-a-linux-hpc-without-root-access/8350/6 "2023-12-18T23:13:39Z")

</div>

Will I be able to install ghcup without root access? Would it be possible to share a link to instructions for this?

---

<div class="post-metadata">

**Author:** ![Marten](https://avatars.discourse-cdn.com/v4/letter/m/4af34b/32.png) [@Marten](https://discourse.haskell.org/u/Marten)\
**Post date:** [December 18, 2023, 11:15pm UTC](https://discourse.haskell.org/t/installing-stack-and-first-build-on-a-linux-hpc-without-root-access/8350/7 "2023-12-18T23:15:24Z")

</div>

I installed the “Manual download” [https://get.haskellstack.org/stable/linux-x86\_64.tar.gz](https://get.haskellstack.org/stable/linux-x86_64.tar.gz) provided in the official documentation on [Install/upgrade - The Haskell Tool Stack](https://docs.haskellstack.org/en/stable/install_and_upgrade/) I would assume that this should be somewhat up to date.

---

<div class="post-metadata">

**Author:** ![Vlix](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/vlix/32/1551_2.png) [@Vlix](https://discourse.haskell.org/u/Vlix)\
**Post date:** [December 18, 2023, 11:46pm UTC](https://discourse.haskell.org/t/installing-stack-and-first-build-on-a-linux-hpc-without-root-access/8350/8 "2023-12-18T23:46:54Z")

</div>

Here it is:  
[https://www.haskell.org/ghcup/](https://www.haskell.org/ghcup/)

(it even says `run the following in a terminal (as a non-root user):` so you should be good)

---

<div class="post-metadata">

**Author:** ![mpilgrem](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/mpilgrem/32/2529_2.png) [@mpilgrem](https://discourse.haskell.org/u/mpilgrem)\
**Post date:** [December 19, 2023, 12:57am UTC](https://discourse.haskell.org/t/installing-stack-and-first-build-on-a-linux-hpc-without-root-access/8350/9 "2023-12-19T00:57:46Z")

</div>

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`.

---

<div class="post-metadata">

**Author:** ![Marten](https://avatars.discourse-cdn.com/v4/letter/m/4af34b/32.png) [@Marten](https://discourse.haskell.org/u/Marten)\
**Post date:** [December 19, 2023, 12:59am UTC](https://discourse.haskell.org/t/installing-stack-and-first-build-on-a-linux-hpc-without-root-access/8350/10 "2023-12-19T00:59:23Z")

</div>

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.
