# Spack stack setup meta modules error

**URL:** <https://forums.jcsda.org/t/spack-stack-setup-meta-modules-error/532>\
**Category:** JEDI\
**Created:** [September 22, 2023, 6:51pm UTC](https://forums.jcsda.org/t/spack-stack-setup-meta-modules-error/532 "2023-09-22T18:51:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![uzzaldash](https://avatars.discourse-cdn.com/v4/letter/u/82dd89/32.png) [@uzzaldash](https://forums.jcsda.org/u/uzzaldash)\
**Post date:** [September 22, 2023, 6:51pm UTC](https://forums.jcsda.org/t/spack-stack-setup-meta-modules-error/532/1 "2023-09-22T18:51:08Z")

</div>

I am trying to build JEDI-SKYLAB 5.0 in my institutes HPC which is not included in preconfigured sites. The OS in this HPC is CentOS Linux release 7.9.2009. Before build JEDI, I am trying to build spack-stack environment following the instruction below.

[https://spack-stack.readthedocs.io/en/latest/NewSiteConfigs.html#prerequisites-red-hat-centos-8-one-off](https://spack-stack.readthedocs.io/en/latest/NewSiteConfigs.html#prerequisites-red-hat-centos-8-one-off)

The modules I loaded for this task are:  
cmake/3.26.3 gcc/11.3.0  
ompi/4.1.5/gnu-11.3.0  
bzip2/1.0.6  
texlive  
tcltk/8.4.19  
python3/3.9.3\_anaconda2021.11\_mamba

I was able to installed it sucessfully but when I run command ‘spack stack setup-meta-modules’ then I got an error.

The error is :

> Error: local variable ‘package\_name’ referenced before assignment

I am copying the log output here:

> [skylab-5.0.0] ukumarda@ln0005 [~/spack-stack-1.4.0] % spack stack setup-meta-modules  
> Configuring basic directory information …  
> … script directory: /panfs/jay/groups/15/milletd/ukumarda/spack-stack-1.4.0/spack/lib/jcsda-emc/spack-stack/stack  
> … base directory: /panfs/jay/groups/15/milletd/ukumarda/spack-stack-1.4.0/spack/lib/jcsda-emc/spack-stack  
> … spack directory: /panfs/jay/groups/15/milletd/ukumarda/spack-stack-1.4.0/spack  
> Configuring active spack environment …  
> … environment directory: /panfs/jay/groups/15/milletd/ukumarda/spack-stack-1.4.0/envs/skylab-5.0.0  
> Parsing spack environment main config …  
> … install directory: /panfs/jay/groups/15/milletd/ukumarda/spack-stack-1.4.0/envs/skylab-5.0.0/install  
> Parsing spack environment modules config …  
> … configured to use tcl modules  
> … module directory: /panfs/jay/groups/15/milletd/ukumarda/spack-stack-1.4.0/envs/skylab-5.0.0/install/modulefiles  
> Parsing spack environment package config …  
> … list of possible compilers: ‘[‘gcc@11.3.0’, ‘gcc’, ‘intel’, ‘pgi’, ‘clang’, ‘xl’, ‘nag’, ‘fj’, ‘aocc’]’  
> … list of possible mpi providers: ‘[‘openmpi@4.1.5’, ‘openmpi’, ‘mpich’]’  
> [‘gcc’, ‘Core’, ‘module-index.yaml’]  
> … stack compilers: ‘{‘gcc’: [‘11.3.0’, ‘11.3.0’]}’  
> … stack mpi providers: ‘{}’  
> … core compilers: [‘gcc@4.6’]  
> Preparing meta module directory …  
> … meta module directory : /panfs/jay/groups/15/milletd/ukumarda/spack-stack-1.4.0/envs/skylab-5.0.0/install/modulefiles/Core  
> Creating compiler modules …  
> … configuring stack compiler gcc@11.3.0  
> … … CC : /common/software/install/migrated/gcc/11.3.0/bin/gcc  
> … … CXX : /common/software/install/migrated/gcc/11.3.0/bin/g++  
> … … F77 : /common/software/install/migrated/gcc/11.3.0/bin/gfortran  
> … … FC’ : /common/software/install/migrated/gcc/11.3.0/bin/gfortran  
> … … COMPFLAGS:  
> … … MODULELOADS:  
> … … MODULEPREREQS:  
> … … MODULEPATH : /panfs/jay/groups/15/milletd/ukumarda/spack-stack-1.4.0/envs/skylab-5.0.0/install/modulefiles/gcc/11.3.0  
> … … removing compiler prefices from tcl modulefiles in /panfs/jay/groups/15/milletd/ukumarda/spack-stack-1.4.0/envs/skylab-5.0.0/install/modulefiles/gcc/11.3.0  
> … … … removing compiler prefices in /panfs/jay/groups/15/milletd/ukumarda/spack-stack-1.4.0/envs/skylab-5.0.0/install/modulefiles/gcc/11.3.0/antlr/2.7.7  
> … … … removing compiler prefices in /panfs/jay/groups/15/milletd/ukumarda/spack-stack-1.4.0/envs/skylab-5.0.0/install/modulefiles/gcc/11.3.0/bacio/2.4.1  
> … … … removing compiler prefices in /panfs/jay/groups/15/milletd/ukumarda/spack-stack-1.4.0/envs/skylab-5.0.0/install/modulefiles/gcc/11.3.0/ca-certificates-mozilla/2023-01-10  
> … … … removing compiler prefices in /panfs/jay/groups/15/milletd/ukumarda/spack-stack-1.4.0/envs/skylab-5.0.0/install/modulefiles/gcc/11.3.0/cmake/3.26.3  
> … … … removing compiler prefices in /panfs/jay/groups/15/milletd/ukumarda/spack-stack-1.4.0/envs/skylab-5.0.0/install/modulefiles/gcc/11.3.0/double-conversion/3.1.5  
> … … … removing compiler prefices in /panfs/jay/groups/15/milletd/ukumarda/spack-stack-1.4.0/envs/skylab-5.0.0/install/modulefiles/gcc/11.3.0/eigen/3.4.0  
> … … … removing compiler prefices in /panfs/jay/groups/15/milletd/ukumarda/spack-stack-1.4.0/envs/skylab-5.0.0/install/modulefiles/gcc/11.3.0/g2tmpl/1.10.2  
> … … … removing compiler prefices in /panfs/jay/groups/15/milletd/ukumarda/spack-stack-1.4.0/envs/skylab-5.0.0/install/modulefiles/gcc/11.3.0/git/1.8.3.1  
> … … … removing compiler prefices in /panfs/jay/groups/15/milletd/ukumarda/spack-stack-1.4.0/envs/skylab-5.0.0/install/modulefiles/gcc/11.3.0/gmake/3.82  
> … … … removing compiler prefices in /panfs/jay/groups/15/milletd/ukumarda/spack-stack-1.4.0/envs/skylab-5.0.0/install/modulefiles/gcc/11.3.0/gperf/3.1  
> … … … removing compiler prefices in /panfs/jay/groups/15/milletd/ukumarda/spack-stack-1.4.0/envs/skylab-5.0.0/install/modulefiles/gcc/11.3.0/gsl/2.7.1  
> … … … removing compiler prefices in /panfs/jay/groups/15/milletd/ukumarda/spack-stack-1.4.0/envs/skylab-5.0.0/install/modulefiles/gcc/11.3.0/gsl-lite/0.37.0  
> … … … removing compiler prefices in /panfs/jay/groups/15/milletd/ukumarda/spack-stack-1.4.0/envs/skylab-5.0.0/install/modulefiles/gcc/11.3.0/jedi-cmake/1.4.0  
> … … … removing compiler prefices in /panfs/jay/groups/15/milletd/ukumarda/spack-stack-1.4.0/envs/skylab-5.0.0/install/modulefiles/gcc/11.3.0/json-c/0.16  
> … … … removing compiler prefices in /panfs/jay/groups/15/milletd/ukumarda/spack-stack-1.4.0/envs/skylab-5.0.0/install/modulefiles/gcc/11.3.0/libmd/1.0.4  
> … … … removing compiler prefices in /panfs/jay/groups/15/milletd/ukumarda/spack-stack-1.4.0/envs/skylab-5.0.0/install/modulefiles/gcc/11.3.0/libxcrypt/4.4.33  
> … … … removing compiler prefices in /panfs/jay/groups/15/milletd/ukumarda/spack-stack-1.4.0/envs/skylab-5.0.0/install/modulefiles/gcc/11.3.0/libyaml/0.2.5  
> … … … removing compiler prefices in /panfs/jay/groups/15/milletd/ukumarda/spack-stack-1.4.0/envs/skylab-5.0.0/install/modulefiles/gcc/11.3.0/json/3.10.5  
> … … … removing compiler prefices in /panfs/jay/groups/15/milletd/ukumarda/spack-stack-1.4.0/envs/skylab-5.0.0/install/modulefiles/gcc/11.3.0/openjpeg/2.3.1  
> … … … removing compiler prefices in /panfs/jay/groups/15/milletd/ukumarda/spack-stack-1.4.0/envs/skylab-5.0.0/install/modulefiles/gcc/11.3.0/patchelf/0.17.2  
> … … … removing compiler prefices in /panfs/jay/groups/15/milletd/ukumarda/spack-stack-1.4.0/envs/skylab-5.0.0/install/modulefiles/gcc/11.3.0/pcre2/10.42  
> … … … removing compiler prefices in /panfs/jay/groups/15/milletd/ukumarda/spack-stack-1.4.0/envs/skylab-5.0.0/install/modulefiles/gcc/11.3.0/pkg-config/0.27.1  
> … … … removing compiler prefices in /panfs/jay/groups/15/milletd/ukumarda/spack-stack-1.4.0/envs/skylab-5.0.0/install/modulefiles/gcc/11.3.0/re2c/2.2  
> … … … removing compiler prefices in /panfs/jay/groups/15/milletd/ukumarda/spack-stack-1.4.0/envs/skylab-5.0.0/install/modulefiles/gcc/11.3.0/sigio/2.3.2  
> … … … removing compiler prefices in /panfs/jay/groups/15/milletd/ukumarda/spack-stack-1.4.0/envs/skylab-5.0.0/install/modulefiles/gcc/11.3.0/sp/2.3.3  
> … … … removing compiler prefices in /panfs/jay/groups/15/milletd/ukumarda/spack-stack-1.4.0/envs/skylab-5.0.0/install/modulefiles/gcc/11.3.0/tar/1.26  
> … … … removing compiler prefices in /panfs/jay/groups/15/milletd/ukumarda/spack-stack-1.4.0/envs/skylab-5.0.0/install/modulefiles/gcc/11.3.0/util-linux-uuid/2.38.1  
> … … … removing compiler prefices in /panfs/jay/groups/15/milletd/ukumarda/spack-stack-1.4.0/envs/skylab-5.0.0/install/modulefiles/gcc/11.3.0/util-macros/1.19.3  
> … … … removing compiler prefices in /panfs/jay/groups/15/milletd/ukumarda/spack-stack-1.4.0/envs/skylab-5.0.0/install/modulefiles/gcc/11.3.0/w3nco/2.4.1  
> … … … removing compiler prefices in /panfs/jay/groups/15/milletd/ukumarda/spack-stack-1.4.0/envs/skylab-5.0.0/install/modulefiles/gcc/11.3.0/wget/1.14  
> … … … removing compiler prefices in /panfs/jay/groups/15/milletd/ukumarda/spack-stack-1.4.0/envs/skylab-5.0.0/install/modulefiles/gcc/11.3.0/zlib/1.2.13  
> … … … removing compiler prefices in /panfs/jay/groups/15/milletd/ukumarda/spack-stack-1.4.0/envs/skylab-5.0.0/install/modulefiles/gcc/11.3.0/zstd/1.5.2  
> … writing /panfs/jay/groups/15/milletd/ukumarda/spack-stack-1.4.0/envs/skylab-5.0.0/install/modulefiles/Core/stack-gcc/11.3.0  
> ==\> Error: local variable ‘package\_name’ referenced before assignment

---

<div class="post-metadata">

**Author:** ![climbfuji](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.jcsda.org/climbfuji/32/154_2.png) [@climbfuji](https://forums.jcsda.org/u/climbfuji)\
**Post date:** [September 23, 2023, 1:45am UTC](https://forums.jcsda.org/t/spack-stack-setup-meta-modules-error/532/2 "2023-09-23T01:45:53Z")

</div>

It looks like you’ve hit a bug in the script! I noticed that you don’t have an MPI provider listed:

```auto
Parsing spack environment package config …
… list of possible compilers: ‘[‘gcc@11.3.0’, ‘gcc’, ‘intel’, ‘pgi’, ‘clang’, ‘xl’, ‘nag’, ‘fj’, ‘aocc’]’
… list of possible mpi providers: ‘[‘openmpi@4.1.5’, ‘openmpi’, ‘mpich’]’
[‘gcc’, ‘Core’, ‘module-index.yaml’]
… stack compilers: ‘{‘gcc’: [‘11.3.0’, ‘11.3.0’]}’
… stack mpi providers: ‘{}’
… core compilers: [‘gcc@4.6’]

```

That means the MPI provider listed in your packages.yaml (openmpi@4.1.5?) doesn’t match the one that spack-stack used. With the env activated, can you run `spack find` and look for what could be the MPI library?

Also, please head to [GitHub - JCSDA/spack-stack](https://github.com/jcsda/spack-stack) and create an issue there with the detailed description that you posted above.

Thanks!
