spack: spack load error: unable to find modulefile

I have successfully installed several spack packages on my Linux Redhat HPC, and I can find the the installations using spack find, however the module system does not appear to be working. For example,

Steps to reproduce the issue

[sjenness@n2232 ~]$ spack find
==> 36 installed packages
-- linux-centos7-haswell / gcc@4.8.5 ----------------------------
autoconf@2.69              expat@2.2.5       isl@0.19         lmod@8.1.5                 mpfr@3.1.6      readline@7.0
automake@1.16.1            gcc@9.2.0         libbsd@0.9.1     lua@5.3.5                  ncurses@6.1     tar@1.31
bzip2@1.0.8                gdbm@1.18.1       libiconv@1.15    lua-luafilesystem@1_7_0_2  openssl@1.1.1c  tcl@8.6.8
curl@7.63.0                gettext@0.19.8.1  libsigsegv@2.11  lua-luaposix@33.4.0        pcre@8.42       unzip@6.0
diffutils@3.7              git@2.21.0        libtool@2.4.6    m4@1.4.18                  perl@5.26.2     xz@5.2.4
environment-modules@4.3.1  gmp@6.1.2         libxml2@2.9.9    mpc@1.1.0                  pkgconf@1.6.1   zlib@1.2.11
[sjenness@n2232 ~]$ spack find -p gcc
==> 1 installed package
-- linux-centos7-haswell / gcc@4.8.5 ----------------------------
gcc@9.2.0  /gscratch/csde/spack/spack/opt/spack/linux-centos7-haswell/gcc-4.8.5/gcc-9.2.0-2ljfzije77bz7bz3b6zwwzhdyulfhvqo

Error Message

But if I try to load any of the packages with spack load, I get the following error:

[sjenness@n2232 ~]$ spack load gcc
ERROR: Unable to locate a modulefile for 'gcc-9.2.0-gcc-4.8.5-2ljfzij'

Following some old issues here, I have tried spack module tcl refresh, but that does not seem to build the module file correctly either. I have not updated any yaml files from their defaults. Thank you!

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 25 (17 by maintainers)

Commits related to this issue

Most upvoted comments

I think the problem is related to a new naming scheme spack find now shows me two different sections for gcc@9.1.0:

-- linux-centos7-skylake_avx512 / gcc@9.1.0 ---------------------
autoconf@2.69    libiconv@1.15        mpich@3.3.1     readline@7.0
automake@1.16.1  libpciaccess@0.13.5  ncurses@6.1     texinfo@6.5
cmake@2.8.10.2   libsigsegv@2.11      openssl@1.0.2s  util-macros@1.19.1
cmake@3.15.3     libtool@2.4.6        openssl@1.1.1c  xz@5.2.4
findutils@4.6.0  libxml2@2.9.9        perl@5.26.2     zlib@1.2.11
gdbm@1.18.1      m4@1.4.18            pkgconf@1.6.1

-- linux-centos7-x86_64 / gcc@9.1.0 -----------------------------
autoconf@2.69    libsigsegv@2.11  ncurses@6.1    readline@7.0
automake@1.16.1  libtool@2.4.6    perl@5.26.2    texinfo@6.5
gdbm@1.18.1      m4@1.4.18        pkgconf@1.6.1

As you can see, we now have the same software for the same system installed twice.

Modulepath only contains the path to the skylake modules, not to the old ones /opt/apps/spack/share/spack/modules/linux-centos7-skylake_avx512

I confirm the problem.

Sure, no problem and thank you @alalazo

I indeed only see modules for the arch matching spack arch, even if I force build packages with another arch, e.g. x86_64 (just installed one for linux-centos7-zen)

So now I suspect spack module <> refresh is not generating modules at all for an arch differing from spack arch?

A quick workaround for me is just adding the old modulefile directory manually to the MODULEPATH

@oehlrich9

The problem is not only in loading the modules but also in building them

I guess you are using the develop branch and update it frequently. In that case the support for specific targets merged a few days ago (#3206) has the effect you mention if you have software already installed at some previous commit.

I wouldn’t consider building optimized software for your architecture as a default a bug though. If you are fine with building generic binaries that can run on any x86_64 machine you can add this:

packages:
  all:
    target: ['x86_64']

and that should make x86_64 the preferred target for the concretizer.