# Random spack errors/tips/fixes

**URL:** <https://forum.access-hive.org.au/t/random-spack-errors-tips-fixes/162>\
**Category:** spack\
**Tags:** spack\
**Created:** [21 November 2022 00:21 UTC](https://forum.access-hive.org.au/t/random-spack-errors-tips-fixes/162 "2022-11-21T00:21:29Z")\
**Posts on this page:** 5\
**Page:** 3

<div class="post-metadata">

**Author:** ![clairecarouge](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.access-hive.org.au/clairecarouge/32/380_2.png) [@clairecarouge](https://forum.access-hive.org.au/u/clairecarouge)\
**Post date:** [17 December 2024 23:14 UTC](https://forum.access-hive.org.au/t/random-spack-errors-tips-fixes/162/41 "2024-12-17T23:14:00Z")

</div>

3 posts were split to a new topic: [Detached head error when using spack to build ESM1.6](https://forum.access-hive.org.au/t/detached-head-error-when-using-spack-to-build-esm1-6/4009)

---

<div class="post-metadata">

**Author:** ![clairecarouge](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.access-hive.org.au/clairecarouge/32/380_2.png) [@clairecarouge](https://forum.access-hive.org.au/u/clairecarouge)\
**Post date:** [17 December 2024 23:11 UTC](https://forum.access-hive.org.au/t/random-spack-errors-tips-fixes/162/44 "2024-12-17T23:11:56Z")

</div>

@inh599 @TommyGatti I’m moving your conversation to [its own topic](https://forum.access-hive.org.au/t/detached-head-error-when-using-spack-to-build-esm1-6/4009) because this isn’t about a spack issue. It’s a help request about using our tools and user guides around spack and should come in as its own topic. And then we can monitor it using our user support process, otherwise we can’t.

---

<div class="post-metadata">

**Author:** ![Aidan](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.access-hive.org.au/aidan/32/42_2.png) [@Aidan](https://forum.access-hive.org.au/u/Aidan)\
**Post date:** [4 June 2025 03:51 UTC](https://forum.access-hive.org.au/t/random-spack-errors-tips-fixes/162/45 "2025-06-04T03:51:03Z")

</div>

If you’re re-building a package repeatedly `spack` should find and re-use dependencies that were build before. In some cases `spack` might decide it wants to rebuild a dependency, this could be due to a change in the spack package, maybe a change in dependency lower down the hierarchy, or it may just be a [bug](https://github.com/spack/spack/issues/50712).

You can tell `spack` to use an installed version of the package by specify the spack package hash instead of the package dependency. e.g. the environment below is building the `tar` package and specifying `bzip@1.0.8` as a dependency:

```yaml
spack:
  specs:
  - tar
  packages:
    tar:
      require:
        - "@1.34"
        - "%gcc@14.1.0"
    bzip2:
      require:
        -"'@1.0.8"

```

To enforce re-use of the compiled `bzip2` package the requirement has been commented out and the `spack hash` of the package specified in the `spec`:

```yaml
spack:
  specs:
  - tar ^/kpv36ze
  packages:
    tar:
      require:
        - "@1.34"
        - "%gcc@14.1.0"
    # bzip2:
    # require:
    # -"'@1.0.8" # /kpv36ze

```

---

<div class="post-metadata">

**Author:** ![harshula](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.access-hive.org.au/harshula/32/256_2.png) [@harshula](https://forum.access-hive.org.au/u/harshula)\
**Post date:** [5 September 2025 04:20 UTC](https://forum.access-hive.org.au/t/random-spack-errors-tips-fixes/162/46 "2025-09-05T04:20:24Z")

</div>

The way to specify a compiler has changed in Spack v1. Now a specific compiler can be specified for different programming languages.

### Spack v0.22

```auto
     all:
       require:
         - '%intel@2021.10.0'
         - 'target=x86_64'

```

### Spack v1

```auto
    fortran:
      require:
        - 'intel-oneapi-compilers-classic@2021.10.0'

```

```auto
    fortran:
      require:
        - 'intel-oneapi-compilers@2025.2.0'

```

---

<div class="post-metadata">

**Author:** ![Aidan](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.access-hive.org.au/aidan/32/42_2.png) [@Aidan](https://forum.access-hive.org.au/u/Aidan)\
**Post date:** [30 June 2026 06:34 UTC](https://forum.access-hive.org.au/t/random-spack-errors-tips-fixes/162/47 "2026-06-30T06:34:53Z")

</div>



[Previous page](https://forum.access-hive.org.au/t/random-spack-errors-tips-fixes/162.md?page=2)
