Repository: spack/spack

Issue:
Installation issue: cp2k and quantum-espresso build failure with the most recent ELPA
### Steps to reproduce the issue

```console
$ spack install cp2k +elpa
$ spack install quantum-espresso +elpa
```


### Error message

<details><summary>Error message</summary>

For `cp2k`
<pre>
     1031    F90-F-0004-Unable to open MODULE file elpa_constants.mod (/local/ningli12/spack-stage/spack-stage-cp2k-2023.1-3iudyyzaijhgqzkdizzh5sacb
             z4jznaq/spack-src/src/fm/cp_fm_elpa.F: 44)
     1032    F90/x86-64 Linux Flang - 1.5 2017-05-01: compilation aborted
</pre>

For `quantum-espresso`
<pre>
     7294    F90-F-0004-Unable to open MODULE file elpa.mod (/local/ningli12/spack-stage/spack-stage-quantum-espresso-7.3-ur5pdnsv3cokvw7cpfrypbt62q
             phsbxr/spack-src/EPW/src/qdabs.f90: 1814)
     7295    F90/x86-64 Linux Flang - 1.5 2017-05-01: compilation aborted
</pre></details>


### Information on your system

* **Spack:** 0.22.0.dev0 (f9e9fab2daa1f43b49f58425f50b6a7e66bd137b)
* **Python:** 3.9.13
* **Platform:** linux-rhel8-zen4
* **Concretizer:** clingo

### Additional information

This bug was introduced by https://github.com/spack/spack/pull/42539. Earlier ELPA versions before 2023.05.001 works fine.

As can be seen both applications suffered from the same error. The newly added ELPA version 2023.11.001-patched had the **patched** suffix as part of the version number - this is the problem.

When both application tried to locate the Fortran module files from ELPA, they expected to find the module files in `elpa-2023.11.001-patched-<hash_id>/include/elpa_openmp-2023.11.001-patched/modules`. But the ELPA build actually install the module files in  `elpa-2023.11.001-patched-<hash_id>/include/elpa_openmp-2023.11.001/modules/` (note the missing **patched** suffix).

I believe this is a packaging issue with ELPA and should be fixed in ELPA's recipe.

@naromero77 May I ask you to have a look at this as you authored https://github.com/spack/spack/pull/42539?  




### 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:
Thanks for reporting this issue and triaging the problem. This patched version has been a source of headaches.

This package does not have a maintainer at the moment. I would recommend that you just use the older version for now until this latest patch can get fixed. I am not able to fix this at the moment. I would prefer not to eliminate this version, but maybe that is something to consider if it is a show stopper for people.



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
@@ -35,11 +35,6 @@ class Elpa(AutotoolsPackage, CudaPackage, ROCmPackage):
     version(
         "2022.11.001", sha256="75db3ac146f9a6a1598e3418ddcab2be2f40a30ef9ec4c00a3b5d3808c99c430"
     )
-    version(
-        "2022.11.001.rc2",
-        sha256="13d67e7d69894c631b48e4fcac905b51c4e41554c7eb4731e98c4e205f0fab9f",
-        deprecated=True,
-    )
     version(
         "2021.11.001", sha256="fb361da6c59946661b73e51538d419028f763d7cb9dacf9d8cd5c9cd3fb7802f"
     )


Test patch: