Repository: spack/spack

Issue:
Installation issue: superlu-mt +openmp %intel (unresolved openmp symbols)
<!-- Thanks for taking the time to report this build failure. To proceed with the report please:

1. Title the issue "Installation issue: <name-of-the-package>".
2. Provide the information required below.

We encourage you to try, as much as possible, to reduce your problem to the minimal example that still reproduces the issue. That would help us a lot in fixing it quickly and effectively! -->

### Steps to reproduce the issue

<!-- Fill in the exact spec you are trying to build and the relevant part of the error message -->
```console
$ spack install superlu-mt@3.1%intel@20.0.1 +blas~int64+openmp+pic~pthread
```
fails with errors like
```console
dlamchtst.o: In function `main':
dlamchtst.c:(.text+0x36): undefined reference to `__kmpc_begin'
dlamchtst.c:(.text+0x1cf): undefined reference to `__kmpc_end'
```
Googling and other research suggests that this is due to the lack of providing the correct openmp flag during the link stage.

### Information on your system
```console
$ spack debug report
* **Spack:** 0.14.2
* **Python:** 3.6.8
* **Platform:** linux-rhel8-ivybridge
```
<!-- Please include the output of `spack debug report` -->

<!-- If you have any relevant configuration detail (custom `packages.yaml` or `modules.yaml`, etc.) you can add that here as well. -->

### Additional information

<!-- Please upload the following files. They should be present in the stage directory of the failing build. Also upload any config.log or similar file if one exists. -->

* [spack-build-env.txt](https://github.com/spack/spack/files/5312622/spack-build-env.txt)
* [spack-build-out.txt](https://github.com/spack/spack/files/5312623/spack-build-out.txt)

<!-- Some packages have maintainers who have volunteered to debug build failures. Run `spack maintainers <name-of-the-package>` and @mention them here if they exist. -->
No maintainers found for superlu-mt

### General information

<!-- These boxes can be checked by replacing [ ] with [x] or by clicking them after submitting the issue. -->
- [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/superlu-mt/package.py b/var/spack/repos/builtin/packages/superlu-mt/package.py
--- a/var/spack/repos/builtin/packages/superlu-mt/package.py
+++ b/var/spack/repos/builtin/packages/superlu-mt/package.py
@@ -57,7 +57,8 @@ def configure(self, spec):
                 'TMGLIB     = libtmglib.a',
                 'MPLIB      = {0}'.format(self.compiler.openmp_flag),
                 'CFLAGS     = {0}'.format(self.compiler.openmp_flag),
-                'FFLAGS     = {0}'.format(self.compiler.openmp_flag)
+                'FFLAGS     = {0}'.format(self.compiler.openmp_flag),
+                'LOADOPTS   += {0}'.format(self.compiler.openmp_flag)
             ])
         elif '+pthread' in spec:
             # POSIX threads


Test patch: