Repository: spack/spack

Issue:
Installation issue: elpa +autotune (requires --enable-scalapack-tests flag to configure)
### Steps to reproduce the issue

```console
$ spack spec -II elpa +autotune
Input spec
--------------------------------
 -   elpa

Concretized
--------------------------------
 -   w4qexdy  elpa@2021.11.001%gcc@9.4.0+autotune~cuda+mpi+openmp~rocm build_system=autotools arch=linux-rhel8-zen2
 -   wbavabu      ^intel-mkl@2020.4.304%gcc@9.4.0~ilp64+shared build_system=generic threads=none arch=linux-rhel8-zen2
[+]  i7hy4l5          ^cpio@2.14%gcc@9.4.0 build_system=autotools arch=linux-rhel8-zen2
[+]  d3bx5oi      ^libtool@2.4.7%gcc@9.4.0 build_system=autotools arch=linux-rhel8-zen2
[+]  cjebbaj          ^m4@1.4.19%gcc@9.4.0+sigsegv build_system=autotools patches=9dc5fbd,bfdffa7 arch=linux-rhel8-zen2
[+]  uvi2god              ^diffutils@3.8%gcc@9.4.0 build_system=autotools arch=linux-rhel8-zen2
[+]  soukbeu              ^libsigsegv@2.13%gcc@9.4.0 build_system=autotools arch=linux-rhel8-zen2
[+]  lvj7wgx      ^openmpi@4.1.1%gcc@9.4.0+atomics~cuda+cxx+cxx_exceptions~gpfs~internal-hwloc~java+legacylaunchers~lustre~memchecker+orterunprefix+pmi+romio+rsh~singularity~static~vt+wrapper-rpath build_system=autotools fabrics=ucx schedulers=slurm arch=linux-rhel8-zen2
[+]  ctfnt3p          ^hwloc@2.6.0%gcc@9.4.0~cairo~cuda~gl+libudev+libxml2~netloc~nvml~oneapi-level-zero~opencl+pci~rocm build_system=autotools libs=shared,static arch=linux-rhel8-zen2
[+]  oktvvq3              ^libpciaccess@0.16%gcc@9.4.0 build_system=autotools arch=linux-rhel8-zen2
[+]  3nodp4k                  ^util-macros@1.19.3%gcc@9.4.0 build_system=autotools arch=linux-rhel8-zen2
[+]  zteihso              ^libxml2@2.9.12%gcc@9.4.0~python build_system=autotools patches=3e06d42 arch=linux-rhel8-zen2
[+]  6p53zmi          ^numactl@2.0.14%gcc@9.4.0 build_system=autotools patches=4e1d78c,62fc8a8,ff37630 arch=linux-rhel8-zen2
[+]  e5cktjy              ^autoconf@2.69%gcc@9.4.0 build_system=autotools patches=35c4492,7793209,a49dd5b arch=linux-rhel8-zen2
[+]  6mgpv7j              ^automake@1.16.3%gcc@9.4.0 build_system=autotools arch=linux-rhel8-zen2
[+]  qtcped7          ^openssh@9.0p1%gcc@9.4.0+gssapi build_system=autotools arch=linux-rhel8-zen2
[+]  ko25i4e              ^krb5@1.19.2%gcc@9.4.0+shared build_system=autotools arch=linux-rhel8-zen2
[+]  fxc4ppz                  ^bison@3.8.2%gcc@9.4.0 build_system=autotools arch=linux-rhel8-zen2
[+]  43xbx5l              ^libedit@3.1-20210216%gcc@9.4.0 build_system=autotools arch=linux-rhel8-zen2
[+]  4grunmz          ^perl@5.34.0%gcc@9.4.0+cpanm+open+shared+threads build_system=generic arch=linux-rhel8-zen2
[+]  nkkrcue              ^berkeley-db@18.1.40%gcc@9.4.0+cxx+docs+stl build_system=autotools patches=26090f4 arch=linux-rhel8-zen2
[+]  rxkfgbd          ^pkg-config@0.29.2%gcc@9.4.0+internal_glib build_system=autotools arch=linux-rhel8-zen2
[+]  xbiwwfl          ^pmix@3.2.3%gcc@9.4.0~docs+pmi_backwards_compatibility build_system=autotools arch=linux-rhel8-zen2
[+]  ug5dirg          ^slurm@system%gcc@9.4.0~gtk~hdf5~hwloc~mariadb~pmix+readline~restd build_system=autotools sysconfdir=/etc/slurm arch=linux-rhel8-zen2
[+]  oq3hlnb          ^ucx@1.15.0%gcc@9.4.0~assertions~backtrace_detail+cma~cuda~dc~debug~dm+examples~gdrcopy~gtest~ib_hw_tm~java+knem~logging~mlx5_dv+openmp+optimizations~parameter_checking+pic~rc+rdmacm~rocm+thread_multiple~ucg~ud~verbs~vfs+xpmem build_system=autotools libs=shared opt=3 simd=auto arch=linux-rhel8-zen2
[+]  jpm3doc          ^zlib@1.2.13%gcc@9.4.0+optimize+pic+shared build_system=makefile arch=linux-rhel8-zen2
[+]  t45xqwm      ^python@3.8.12%gcc@9.4.0+bz2+crypt+ctypes+dbm~debug+libxml2+lzma+nis+optimizations+pic+pyexpat+pythoncmd+readline+shared+sqlite3+ssl~tkinter+uuid+zlib build_system=generic patches=0d98e93,4c24573,f2fd060 arch=linux-rhel8-zen2
[+]  hjzedoe          ^bzip2@1.0.8%gcc@9.4.0~debug+pic+shared build_system=generic arch=linux-rhel8-zen2
[+]  lazftoc          ^expat@2.5.0%gcc@9.4.0+libbsd build_system=autotools arch=linux-rhel8-zen2
[+]  rs2ddq5              ^libbsd@0.11.5%gcc@9.4.0 build_system=autotools arch=linux-rhel8-zen2
[+]  hkztvet                  ^libmd@1.0.4%gcc@9.4.0 build_system=autotools arch=linux-rhel8-zen2
[+]  tsdsqho          ^gdbm@1.19%gcc@9.4.0 build_system=autotools arch=linux-rhel8-zen2
[+]  nwvzdt4          ^gettext@0.21.1%gcc@9.4.0+bzip2+curses+git+libunistring+libxml2+tar+xz build_system=autotools arch=linux-rhel8-zen2
[+]  jmrtao4              ^libiconv@1.16%gcc@9.4.0 build_system=autotools libs=shared,static arch=linux-rhel8-zen2
[+]  x3mkx4p              ^libunistring@0.9.10%gcc@9.4.0 build_system=autotools arch=linux-rhel8-zen2
[+]  6tl6au3              ^tar@1.34%gcc@9.4.0 build_system=autotools zip=pigz arch=linux-rhel8-zen2
[+]  onyctuz                  ^pigz@2.7%gcc@9.4.0 build_system=makefile arch=linux-rhel8-zen2
[+]  ogpntgf                  ^zstd@1.5.0%gcc@9.4.0+programs build_system=makefile compression=lz4,lzma,zlib libs=shared,static arch=linux-rhel8-zen2
[+]  s2yvnqh                      ^lz4@1.9.3%gcc@9.4.0 build_system=makefile libs=shared,static arch=linux-rhel8-zen2
[+]  kpsuuut          ^libffi@3.4.2%gcc@9.4.0 build_system=autotools arch=linux-rhel8-zen2
[+]  qna53es          ^libnsl@1.3.0%gcc@9.4.0 build_system=autotools arch=linux-rhel8-zen2
[+]  icy23ix              ^libtirpc@1.2.6%gcc@9.4.0 build_system=autotools arch=linux-rhel8-zen2
[+]  jbj5l5f              ^rpcsvc-proto@1.4.3%gcc@9.4.0 build_system=autotools arch=linux-rhel8-zen2
[+]  a2wysy5          ^libuuid@1.0.3%gcc@9.4.0 build_system=autotools arch=linux-rhel8-zen2
[+]  2tqklmb          ^libxcrypt@4.4.33%gcc@9.4.0~obsolete_api build_system=autotools arch=linux-rhel8-zen2
[+]  2nd5xjs          ^ncurses@6.2%gcc@9.4.0+symlinks+termlib abi=5 build_system=autotools arch=linux-rhel8-zen2
[+]  acpcwrk          ^openssl@1.1.1v%gcc@9.4.0~docs+shared build_system=generic certs=system arch=linux-rhel8-zen2
[+]  ryhrrvu          ^readline@8.1%gcc@9.4.0 build_system=autotools patches=682a465,e55be05 arch=linux-rhel8-zen2
[+]  hhwsw3i          ^sqlite@3.38.5%gcc@9.4.0+column_metadata+dynamic_extensions+fts+functions+rtree build_system=autotools arch=linux-rhel8-zen2
[+]  h5xayww          ^xz@5.2.5%gcc@9.4.0+pic build_system=autotools libs=shared,static arch=linux-rhel8-zen2
```


### Error message

<details><summary>Error message</summary>

<pre>
...
checking whether autotuning functionality should be enabled... yes
checking whether --enable-scalapack-tests is specified... no
checking whether matrix redistribution should be considered in autotuning... yes
configure: error: Please also set --enable_scalapack_tests in this case
</pre></details>


### Information on your system

```console
$ spack debug report
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
* **Spack:** 0.21.0.dev0 (84faf5a6cf342efddb976b7432e44aff12f1c985)
* **Python:** 3.6.8
* **Platform:** linux-rhel8-zen2
* **Concretizer:** clingo
```

### Additional information

[spack-build-env.txt](https://github.com/spack/spack/files/12487723/spack-build-env.txt)
[spack-build-out.txt](https://github.com/spack/spack/files/12487724/spack-build-out.txt)

No maintainers found.

It looks like spack recipe needs to add configuration flag --enable-scalapack-tests for +autotune variant

### General information

- [X] I have run `spack debug report` and reported the version of Spack/Python/Platform
- [X] I have run `spack maintainers <name-of-the-package>` and **@mentioned** any maintainers
- [X] I have uploaded the build log and environment files
- [X] I have searched the issues of this repo and believe this is not a duplicate


Discussion:

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/elpa/package.py b/var/spack/repos/builtin/packages/elpa/package.py
--- a/var/spack/repos/builtin/packages/elpa/package.py
+++ b/var/spack/repos/builtin/packages/elpa/package.py
@@ -185,6 +185,8 @@ def configure_args(self):
 
         if "+autotune" in self.spec:
             options.append("--enable-autotune-redistribute-matrix")
+            # --enable-autotune-redistribute-matrix requires --enable-scalapack-tests as well
+            options.append("--enable-scalapack-tests")
 
         options.append("--disable-silent-rules")
         options.append("--without-threading-support-check-during-build")


Test patch: