internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: spack/spack

Issue:
Standardized CMake Interprocedural Optimization Variant
Add standard `ipo` variant to CMakePackage.

### Rationale
CMake exposes the `CMAKE_INTERPROCEDURAL_OPTIMIZATION` variable to enable IPO/LTO on all targets in a project. Similar to the standard `build_type` variant for CMake, Spack should have a standard `ipo` variant (defaulting to `False`) that enables `CMAKE_INTERPROCEDURAL_OPTIMIZATION`.

### Description
```python
# lib/spack/spack/build_systems/cmake.py
variant('ipo', default=False, description='CMake interprocedural optimization')

def _std_args(pkg):
    ...
    try:
        ipo = pkg.spec.variants['ipo'].value
    except KeyError:
        ipo = False

    args = [
        '-G', generator,
        define('CMAKE_INSTALL_PREFIX', pkg.prefix),
        define('CMAKE_BUILD_TYPE', build_type),
        define_from_variant('CMAKE_INTERPROCEDURAL_OPTIMIZATION', ipo),
    ]
```

### Additional information
Spack 0.15.4-710-125191931

### General information
- [x] I have run `spack --version` and reported the version of Spack
- [x] I have searched the issues of this repo and believe this is not a duplicate


Discussion:

Resolving patch:
diff --git a/lib/spack/spack/build_systems/cmake.py b/lib/spack/spack/build_systems/cmake.py
--- a/lib/spack/spack/build_systems/cmake.py
+++ b/lib/spack/spack/build_systems/cmake.py
@@ -12,7 +12,7 @@
 import spack.build_environment
 from llnl.util.filesystem import working_dir
 from spack.util.environment import filter_system_paths
-from spack.directives import depends_on, variant
+from spack.directives import depends_on, variant, conflicts
 from spack.package import PackageBase, InstallError, run_after
 
 # Regex to extract the primary generator from the CMake generator
@@ -94,6 +94,13 @@ class CMakePackage(PackageBase):
             description='CMake build type',
             values=('Debug', 'Release', 'RelWithDebInfo', 'MinSizeRel'))
 
+    # https://cmake.org/cmake/help/latest/variable/CMAKE_INTERPROCEDURAL_OPTIMIZATION.html
+    variant('ipo', default=False,
+            description='CMake interprocedural optimization')
+    # CMAKE_INTERPROCEDURAL_OPTIMIZATION only exists for CMake >= 3.9
+    conflicts('+ipo', when='^cmake@:3.8',
+              msg='+ipo is not supported by CMake < 3.9')
+
     depends_on('cmake', type='build')
 
     @property
@@ -147,6 +154,11 @@ def _std_args(pkg):
         except KeyError:
             build_type = 'RelWithDebInfo'
 
+        try:
+            ipo = pkg.spec.variants['ipo'].value
+        except KeyError:
+            ipo = False
+
         define = CMakePackage.define
         args = [
             '-G', generator,
@@ -154,6 +166,10 @@ def _std_args(pkg):
             define('CMAKE_BUILD_TYPE', build_type),
         ]
 
+        # CMAKE_INTERPROCEDURAL_OPTIMIZATION only exists for CMake >= 3.9
+        if pkg.spec.satisfies('^cmake@3.9:'):
+            args.append(define('CMAKE_INTERPROCEDURAL_OPTIMIZATION', ipo))
+
         if primary_generator == 'Unix Makefiles':
             args.append(define('CMAKE_VERBOSE_MAKEFILE', True))
 


Test patch:
Repository: spack/spack

Issue:
Installation issue: py-torchvision
<!-- 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
$ module load cuda/10.2.89
$ spack external find cuda --not-buildable
$ module load cuda/10.1.243
$ spack install py-torchvision^py-torch+cuda
```

### Information on your system

* **Spack:** 0.15.4-807-44f244ace
* **Python:** 3.7.8
* **Platform:** linux-rhel7-power9le

### Additional information

@adamjstewart

Problem occurs in `py-torchvision` using `CUDAExtension`, which in turn uses this code in the `py-torch` package, in this code here: https://pytorch.org/docs/stable/_modules/torch/utils/cpp_extension.html#CUDAExtension in `_find_cuda_home`

Fix should be to set the environment variable `CUDA_HOME` during build.

### General information

- [x] I have run `spack debug report` and reported the version of Spack/Python/Platform
- [ ] I have run `spack maintainers <name-of-the-package>` and @mentioned any maintainers
- [ ] 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/py-torchvision/package.py b/var/spack/repos/builtin/packages/py-torchvision/package.py
--- a/var/spack/repos/builtin/packages/py-torchvision/package.py
+++ b/var/spack/repos/builtin/packages/py-torchvision/package.py
@@ -86,5 +86,6 @@ def setup_build_environment(self, env):
 
         if '+cuda' in self.spec['py-torch']:
             env.set('FORCE_CUDA', 1)
+            env.set('CUDA_HOME', self.spec['cuda'].prefix)
         else:
             env.set('FORCE_CUDA', 0)


Test patch:
Repository: spack/spack

Issue:
nn-c uses invalid self.compiler.pic_flag?  (breaks nn-c build, via elmerfem build)
These lines fail, because there is no such member, and looking at other packages, it seems that flags like
```
self.compiler.cc_pic_flag
self.compiler.cxx_pic_flag
self.compiler.fc_pic_flag
#or ?
self.compiler.f77_pic_flag
```
would be appropriate.

https://github.com/spack/spack/blob/601f97d8a50b1840df9b056a34256b6dd2b54ce3/var/spack/repos/builtin/packages/nn-c/package.py#L29-L31

I triggered this on recent `devel` (today) by
```
spack install --test=root elmerfem@devel +mpi +hypre +lua +mumps +openmp +scatt2d +trilinos +zoltan
```


Discussion:
@michaelkarlcoleman good catch, want to submit a PR to fix this? If not I can also submit a PR.
Apologies, but I'm overrun right now. Thank you for jumping in. --Mike

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/nn-c/package.py b/var/spack/repos/builtin/packages/nn-c/package.py
--- a/var/spack/repos/builtin/packages/nn-c/package.py
+++ b/var/spack/repos/builtin/packages/nn-c/package.py
@@ -26,8 +26,8 @@ def configure_args(self):
         args = []
         if '+pic' in self.spec:
             args.extend([
-                'CFLAGS={0}'.format(self.compiler.pic_flag),
-                'CXXFLAGS={0}'.format(self.compiler.pic_flag),
-                'FFLAGS={0}'.format(self.compiler.pic_flag)
+                'CFLAGS={0}'.format(self.compiler.cc_pic_flag),
+                'CXXFLAGS={0}'.format(self.compiler.cxx_pic_flag),
+                'FFLAGS={0}'.format(self.compiler.fc_pic_flag)
             ])
         return args


Test patch:
Repository: spack/spack

Issue:
Py-pillow: New simd version can't be targetted in packages.yaml, doesn't automatically concretize to 7.0.0.post33
<!-- Explain, in a clear and concise way, the command you ran and the result you were trying to achieve.
Example: "I ran `spack find` to list all the installed packages and ..." -->

@adamjstewart This is on MacOS with the current spack develop branch. The only way I've found to properly set the new pillow version is to explicitly use ^py-pillow-simd in the spec.

### Steps to reproduce the issue

```console
$ spack spec paraview@5.8.1+python3
...
        ^py-pillow-simd@7.0.0%clang@10.0.1-apple~freetype~imagequant+jpeg~jpeg2000~lcms~tiff~webp~webpmux~xcb+zlib arch=darwin-mojave-haswell

$ spack config get packages
...
  pil:
    version: [7.0.0.post3]
  py-pillow:
    version: [7.0.0.post3]
  py-pillow-simd:
    version: [7.0.0.post3]

$ spack spec paraview@5.8.1+python3 ^py-pillow-simd@7.0.0.post3
...
        ^py-pillow-simd@7.0.0.post3%clang@10.0.1-apple~freetype~imagequant+jpeg~jpeg2000~lcms~tiff~webp~webpmux~xcb+zlib arch=darwin-mojave-haswell

```


### Additional 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
```console
$ spack debug report
* **Spack:** 0.15.4-846-fab2622a7
* **Python:** 3.6.10
* **Platform:** darwin-mojave-haswell
```
- [x] I have searched the issues of this repo and believe this is not a duplicate
- [ ] I have run the failing commands in debug mode and reported the output

<!-- 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!

If you want to ask a question about the tool (how to use it, what it can currently do, etc.), try the `#general` channel on our Slack first. We have a welcoming community and chances are you'll get your reply faster and without opening an issue.

Other than that, thanks for taking the time to contribute to Spack! -->



Discussion:

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/py-pillow-simd/package.py b/var/spack/repos/builtin/packages/py-pillow-simd/package.py
--- a/var/spack/repos/builtin/packages/py-pillow-simd/package.py
+++ b/var/spack/repos/builtin/packages/py-pillow-simd/package.py
@@ -18,4 +18,4 @@ class PyPillowSimd(PyPillowBase):
     version('7.0.0.post3', sha256='c27907af0e7ede1ceed281719e722e7dbf3e1dbfe561373978654a6b64896cb7')
 
     for ver in ['7.0.0.post3']:
-        provides('pil@' + ver, when='@' + str(Version(ver).up_to(3)))
+        provides('pil@' + ver, when='@' + ver)


Test patch:
Repository: spack/spack

Issue:
SpecList has instances of mutable types as default __init__ arguments
While debugging #18338 I stepped on this definition:

https://github.com/spack/spack/blob/3701633937a80c56ce212cd77c82c082f705e7ad/lib/spack/spack/spec_list.py#L26-L30

that might cause unwanted interactions between different instances of `SpecList` if they use defaults for `reference` (and is difficult to read if default for `yaml_list` is used). This issue is a reminder to refactor this part of the code.


Discussion:

Resolving patch:
diff --git a/lib/spack/spack/spec_list.py b/lib/spack/spack/spec_list.py
--- a/lib/spack/spack/spec_list.py
+++ b/lib/spack/spack/spec_list.py
@@ -25,7 +25,11 @@ def spec_ordering_key(s):
 
 class SpecList(object):
 
-    def __init__(self, name='specs', yaml_list=[], reference={}):
+    def __init__(self, name='specs', yaml_list=None, reference=None):
+        # Normalize input arguments
+        yaml_list = yaml_list or []
+        reference = reference or {}
+
         self.name = name
         self._reference = reference  # TODO: Do we need defensive copy here?
 


Test patch:
Repository: spack/spack

Issue:
lustre: Needs `spack external find` support
<!--*Please add a concise summary of your suggestion here.*-->

Someone needs to add spack external find support to lustre

### Rationale

Lustre is a dependency for some packages, but it /cannot/ be installed.  The current help text says that you need to modify your .yaml files manually.

With `spack external find` we don't need to do this anymore.

### General information

- [X] I have run `spack --version` and reported the version of Spack: 0.15.4-1006-e5cc37b71
- [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/lustre/package.py b/var/spack/repos/builtin/packages/lustre/package.py
--- a/var/spack/repos/builtin/packages/lustre/package.py
+++ b/var/spack/repos/builtin/packages/lustre/package.py
@@ -4,6 +4,7 @@
 # SPDX-License-Identifier: (Apache-2.0 OR MIT)
 
 from spack import *
+import re
 
 
 class Lustre(Package):
@@ -13,8 +14,16 @@ class Lustre(Package):
     homepage = 'http://lustre.org/'
     has_code = False
 
+    executables = [r'^lfs$']
+
     version('2.12')
 
+    @classmethod
+    def determine_version(cls, exe):
+        output = Executable(exe)('--version', output=str, error=str)
+        match = re.search(r'lfs (\d\S*)', output)
+        return match.group(1) if match else None
+
     # Lustre is filesystem and needs to be installed on system.
     # To have it as external package in SPACK, follow below:
     # config file packages.yaml needs to be adjusted:


Test patch:
Repository: spack/spack

Issue:
Installation issue: bedtools2 (missing python build dependency)
<!-- 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 bedtools2@2.27.1%gcc@8.4.0
```
fails with error
```console
     420    - Creating executables for old CLI.
     421    /bin/bash: python: command not found
```

### Information on your system

<!-- Please include the output of `spack debug report` -->
```console
$ spack debug report
* **Spack:** 0.14.2
* **Python:** 3.6.8
* **Platform:** linux-rhel8-ivybridge
```
<!-- If you have any relevant configuration detail (custom `packages.yaml` or `modules.yaml`, etc.) you can add that here as well. -->

### Additional information


* [spack-build-env.txt](https://github.com/spack/spack/files/5247776/spack-build-env.txt)
* [spack-build-out.txt](https://github.com/spack/spack/files/5247777/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
### 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/bedtools2/package.py b/var/spack/repos/builtin/packages/bedtools2/package.py
--- a/var/spack/repos/builtin/packages/bedtools2/package.py
+++ b/var/spack/repos/builtin/packages/bedtools2/package.py
@@ -22,6 +22,7 @@ class Bedtools2(Package):
     version('2.23.0', sha256='9dacaa561d11ce9835d1d51e5aeb092bcbe117b7119663ec9a671abac6a36056')
 
     depends_on('zlib')
+    depends_on('python', type='build')
 
     def install(self, spec, prefix):
         make("prefix=%s" % prefix, "install")


Test patch:
Repository: spack/spack

Issue:
UCX: add version 1.9.0



Discussion:
@hppritcha please review

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/ucx/package.py b/var/spack/repos/builtin/packages/ucx/package.py
--- a/var/spack/repos/builtin/packages/ucx/package.py
+++ b/var/spack/repos/builtin/packages/ucx/package.py
@@ -16,6 +16,7 @@ class Ucx(AutotoolsPackage, CudaPackage):
     maintainers = ['hppritcha']
 
     # Current
+    version('1.9.0', sha256='a7a2c8841dc0d5444088a4373dc9b9cc68dbffcd917c1eba92ca8ed8e5e635fb')
     version('1.8.1', sha256='a48820cb8d0761b5ccf3e7ba03a7c8c1dde6276017657178829e07ffc35b556a')
     version('1.8.0', sha256='e400f7aa5354971c8f5ac6b881dc2846143851df868088c37d432c076445628d')
     version('1.7.0', sha256='6ab81ee187bfd554fe7e549da93a11bfac420df87d99ee61ffab7bb19bdd3371')


Test patch:
Repository: spack/spack

Issue:
py-cffi@1.14.3: fix checksum
Correct checksum for `py-cffi@1.14.3` -- Fixes https://github.com/spack/spack/issues/19140

@scottwittenburg 


Discussion:

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/py-cffi/package.py b/var/spack/repos/builtin/packages/py-cffi/package.py
--- a/var/spack/repos/builtin/packages/py-cffi/package.py
+++ b/var/spack/repos/builtin/packages/py-cffi/package.py
@@ -15,7 +15,7 @@ class PyCffi(PythonPackage):
 
     import_modules = ['cffi']
 
-    version('1.14.3', sha256='18d82244ee114f543149c66a6e0c14e9c4f8a1044b5cdaadd0f82159d6a6ff59')
+    version('1.14.3', sha256='f92f789e4f9241cd262ad7a555ca2c648a98178a953af117ef7fad46aa1d5591')
     version('1.13.0', sha256='8fe230f612c18af1df6f348d02d682fe2c28ca0a6c3856c99599cdacae7cf226')
     version('1.12.2', sha256='e113878a446c6228669144ae8a56e268c91b7f1fafae927adc4879d9849e0ea7')
     version('1.11.5', sha256='e90f17980e6ab0f3c2f3730e56d1fe9bcba1891eeea58966e89d352492cc74f4')


Test patch:
Repository: spack/spack

Issue:
Installation issue: papi (software defined events only introduced in @6.0.0)
<!-- 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! -->

I ran into issues when attempting to build papi@5.7.0 +sde complaining about missing files pertaining to sde.  Looking at http://icl.utk.edu/papi/software/view.html?id=275, it appears that the Software Defined Events (SDE) component was only added in @6.0.0.

I would have expected spack to complain about trying to use +sde on papi versions <6.0.0.

### 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 papi@5.7.0 %gcc@8.4.0 +infiniband+lmsensors+powercap+rapl+sde+shared
```

results in an errors like
```console
  >> 109    checking for components to build... find: 'components/sde': No such
             file or directory
```

### Information on your system

<!-- Please include the output of `spack debug report` -->
```console
$> spack debug report
* **Spack:** 0.14.2
* **Python:** 3.6.8
* **Platform:** linux-rhel8-ivybridge
```

<!-- 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/5371958/spack-build-env.txt)
* [spack-build-out.txt](https://github.com/spack/spack/files/5371959/spack-build-out.txt)

@G-Ragghianti

### 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/papi/package.py b/var/spack/repos/builtin/packages/papi/package.py
--- a/var/spack/repos/builtin/packages/papi/package.py
+++ b/var/spack/repos/builtin/packages/papi/package.py
@@ -48,6 +48,7 @@ class Papi(AutotoolsPackage):
     depends_on('lm-sensors', when='+lmsensors')
 
     conflicts('%gcc@8:', when='@5.3.0', msg='Requires GCC version less than 8.0')
+    conflicts('+sde', when='@:5.9.99999', msg='Software defined events (SDE) added in 6.0.0')
 
     # This is the only way to match exactly version 6.0.0 without also
     # including version 6.0.0.1 due to spack version matching logic


Test patch:
Repository: spack/spack

Issue:
Installation issue: strelka
### Steps to reproduce the issue

```console
$ spack install strelka target=x86_64
==> Installing strelka
==> No binary for strelka found: installing from source
==> Using cached archive: /software/spack/var/spack/cache/_source-cache/archive/27/27415f7c14f92e0a6b80416283a0707daed121b8a3854196872981d132f1496b.tar.bz2
==> strelka: Executing phase: 'cmake'
==> Error: ProcessError: Command exited with status 1:
    'cmake' <options>

1 error found in build log:
     12    -- Detecting C compile features - done
     13    -- Detecting CXX compiler ABI info
     14    -- Detecting CXX compiler ABI info - done
     15    -- Check for working CXX compiler: /software/spack/lib/spack/env/gcc
           /g++ - skipped
     16    -- Detecting CXX compile features
     17    -- Detecting CXX compile features - done
  >> 18    CMake Error at CMakeLists.txt:134 (if):
     19      if given arguments:
     20    
     21        "VERSION_LESS" "2.4"
     22    
     23      Unknown arguments specified
     24
```

### Information on your system

```console
$ spack debug report
* **Spack:** 0.15.4-1213-d3d9807
* **Python:** 2.7.5
* **Platform:** linux-centos7-broadwell
```

### Additional information
Won't upload the files, as it takes a good amount of effort to extract them from an air gapped environment, and probably do not bring anything interesting here.

Checking which CMakeLists.txt file is the culprit leads to `spack-src/CMakeLists.txt`, and more especially the line:
`if (${PYTHON_VERSION_STRING} VERSION_LESS ${MINIMUM_PYTHON_VERSION})`
The error message seems to indicate that `${PYTHON_VERSION_STRING}` is empty.

Moreover, the [CMakeLists file](https://github.com/Illumina/strelka/blob/v2.9.x/CMakeLists.txt) refers to "# Find python2 interpreter", while `spack spec strelka%gcc@4.8.5 target=x86_64` refers to
`^python@3.8.5%gcc@10.1.0`

`spack install strelka^python@2.7.18` works as intended.

### 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
- [ ] 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

I'll submit the PR within the hour.


Discussion:

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/strelka/package.py b/var/spack/repos/builtin/packages/strelka/package.py
--- a/var/spack/repos/builtin/packages/strelka/package.py
+++ b/var/spack/repos/builtin/packages/strelka/package.py
@@ -15,7 +15,7 @@ class Strelka(CMakePackage):
 
     version('2.8.2', sha256='27415f7c14f92e0a6b80416283a0707daed121b8a3854196872981d132f1496b')
 
-    depends_on('python@2.4:')
+    depends_on('python@2.4:2.7')
     depends_on('zlib')
     depends_on('bzip2')
     depends_on('cmake@2.8.5:')


Test patch: