Repository: spack/spack

Issue:
Installation issue: suite-sparse@5.7.2
I get error when I try this
```console
spack install -j4 --only dependencies dealii
```
Here is the spec


```
$ spack spec dealii
dealii@9.1.1%clang@11.0.3-apple+adol-c+arpack+assimp build_type=DebugRelease ~cuda cuda_arch=none ~doc+ginkgo+gmsh+gsl+hdf5~int64+metis+mpi+muparser+nanoflann+netcdf+oce~optflags+p4est patches=6f876dc8eadafe2c4ec2a6673864fb451c6627ca80511b6e16f3c401946fdf33 +petsc~python+scalapack+slepc+sundials+symengine+threads+trilinos arch=darwin-catalina-x86_64
    ^adol-c@2.7.2%clang@11.0.3-apple~advanced_branching+atrig_erf~boost+doc+examples~openmp~sparse arch=darwin-catalina-x86_64
    ^arpack-ng@3.7.0%clang@11.0.3-apple+mpi+shared arch=darwin-catalina-x86_64
        ^cmake@3.17.1%clang@11.0.3-apple~doc+ncurses+openssl+ownlibs patches=1c540040c7e203dd8e27aa20345ecb07fe06570d56410a24a266ae570b1c4c39 ~qt arch=darwin-catalina-x86_64
            ^ncurses@6.2%clang@11.0.3-apple~symlinks+termlib arch=darwin-catalina-x86_64
                ^pkgconf@1.6.3%clang@11.0.3-apple arch=darwin-catalina-x86_64
            ^openssl@1.1.1g%clang@11.0.3-apple+systemcerts arch=darwin-catalina-x86_64
                ^perl@5.30.2%clang@11.0.3-apple+cpanm+shared+threads arch=darwin-catalina-x86_64
                    ^gdbm@1.18.1%clang@11.0.3-apple arch=darwin-catalina-x86_64
                        ^readline@8.0%clang@11.0.3-apple arch=darwin-catalina-x86_64
                ^zlib@1.2.11%clang@11.0.3-apple+optimize+pic+shared arch=darwin-catalina-x86_64
        ^openblas@0.3.9%clang@11.0.3-apple~consistent_fpcsr~ilp64 patches=69306db423ef49526ee13443915a174f45cd5de81b12df15457e3d8e8831b768 +pic+shared threads=none arch=darwin-catalina-x86_64
        ^openmpi@3.1.6%clang@11.0.3-apple~atomics~cuda~cxx~cxx_exceptions fabrics=none +gpfs~java~legacylaunchers~memchecker~pmi+runpath schedulers=none ~sqlite3+static~thread_multiple+vt arch=darwin-catalina-x86_64
            ^hwloc@1.11.11%clang@11.0.3-apple~cairo~cuda~gl+libxml2~netloc~nvml~pci+shared arch=darwin-catalina-x86_64
                ^libxml2@2.9.10%clang@11.0.3-apple~python arch=darwin-catalina-x86_64
                    ^libiconv@1.16%clang@11.0.3-apple arch=darwin-catalina-x86_64
                    ^xz@5.2.5%clang@11.0.3-apple arch=darwin-catalina-x86_64
    ^assimp@4.0.1%clang@11.0.3-apple build_type=RelWithDebInfo +shared arch=darwin-catalina-x86_64
        ^boost@1.73.0%clang@11.0.3-apple+atomic+chrono~clanglibcpp~container~context~coroutine cxxstd=98 +date_time~debug+exception~fiber+filesystem+graph~icu+iostreams+locale+log+math~mpi+multithreaded~numpy patches=246508e052c44b6f4e8c2542a71c06cacaa72cd1447ab8d2a542b987bc35ace9,4dd507e1f5a29e3b87b15321a4d8c74afdc8331433edabf7aeab89b3c405d556 ~pic+program_options~python+random+regex+serialization+shared+signals~singlethreaded+system~taggedlayout+test+thread+timer~versionedlayout visibility=hidden +wave arch=darwin-catalina-x86_64
            ^bzip2@1.0.8%clang@11.0.3-apple+shared arch=darwin-catalina-x86_64
                ^diffutils@3.7%clang@11.0.3-apple arch=darwin-catalina-x86_64
    ^ginkgo@1.1.0%clang@11.0.3-apple build_type=Release ~cuda cuda_arch=none ~develtools~full_optimizations~openmp+shared arch=darwin-catalina-x86_64
    ^gmsh@4.5.4%clang@11.0.3-apple build_type=RelWithDebInfo +compression~fltk~hdf5~metis+mpi+netgen+oce~opencascade~openmp~petsc~privateapi+shared~slepc+tetgen arch=darwin-catalina-x86_64
        ^gmp@6.1.2%clang@11.0.3-apple arch=darwin-catalina-x86_64
            ^autoconf@2.69%clang@11.0.3-apple arch=darwin-catalina-x86_64
                ^m4@1.4.18%clang@11.0.3-apple patches=3877ab548f88597ab2327a2230ee048d2d07ace1062efe81fc92e91b7f39cd00,c0a408fbffb7255fcc75e26bd8edab116fc81d216bfd18b473668b7739a4158e,fc9b61654a3ba1a8d6cd78ce087e7c96366c290bc8d2c299f09828d793b853c8 +sigsegv arch=darwin-catalina-x86_64
                    ^libsigsegv@2.12%clang@11.0.3-apple arch=darwin-catalina-x86_64
            ^automake@1.16.2%clang@11.0.3-apple arch=darwin-catalina-x86_64
            ^libtool@2.4.6%clang@11.0.3-apple arch=darwin-catalina-x86_64
        ^netgen@5.3.1%clang@11.0.3-apple~gui~metis+mpi~oce arch=darwin-catalina-x86_64
        ^oce@0.18.3%clang@11.0.3-apple~X11+tbb arch=darwin-catalina-x86_64
            ^intel-tbb@2020.2%clang@11.0.3-apple cxxstd=default patches=62ba015ebd1819c45bef47411540b789b493e31ca668c4ff4cb2afcbc306b476,ce1fb16fb932ce86a82ca87cf0431d1a8c83652af9f552b264213b2ff2945d73 +shared+tm arch=darwin-catalina-x86_64
        ^tetgen@1.5.0%clang@11.0.3-apple~debug~except patches=250ee7a9c97fbef4ed8796c70233631559fd2f4663affe6c824896880a605a24 arch=darwin-catalina-x86_64
    ^gsl@2.5%clang@11.0.3-apple~external-cblas arch=darwin-catalina-x86_64
    ^hdf5@1.10.6%clang@11.0.3-apple api=none +cxx~debug+fortran+hl+mpi+pic+shared~szip~threadsafe arch=darwin-catalina-x86_64
    ^metis@5.1.0%clang@11.0.3-apple build_type=Release ~gdb~int64 patches=4991da938c1d3a1d3dea78e49bbebecba00273f98df2a656e38b83d55b281da1 ~real64+shared arch=darwin-catalina-x86_64
    ^muparser@2.2.6.1%clang@11.0.3-apple arch=darwin-catalina-x86_64
    ^nanoflann@1.2.3%clang@11.0.3-apple build_type=RelWithDebInfo arch=darwin-catalina-x86_64
    ^netcdf-c@4.7.3%clang@11.0.3-apple~dap~hdf4~jna+mpi~parallel-netcdf+pic+shared arch=darwin-catalina-x86_64
    ^netcdf-cxx@4.2%clang@11.0.3-apple+netcdf4 arch=darwin-catalina-x86_64
    ^netlib-scalapack@2.1.0%clang@11.0.3-apple build_type=RelWithDebInfo patches=f2baedde688ffe4c20943c334f580eb298e04d6f35c86b90a1f4e8cb7ae344a2 ~pic+shared arch=darwin-catalina-x86_64
    ^p4est@2.2%clang@11.0.3-apple+mpi~openmp arch=darwin-catalina-x86_64
    ^petsc@3.13.1%clang@11.0.3-apple~X~batch clanguage=C ~complex~cuda~debug+double~fftw+hdf5+hypre~int64~knl+metis+mpi+mumps+shared~suite-sparse+superlu-dist~trilinos~valgrind arch=darwin-catalina-x86_64
        ^hypre@2.18.2%clang@11.0.3-apple~complex~debug~int64~internal-superlu~mixedint+mpi~openmp~shared~superlu-dist arch=darwin-catalina-x86_64
        ^mumps@5.2.0%clang@11.0.3-apple+complex+double+float~int64~metis+mpi~parmetis~ptscotch~scotch+shared arch=darwin-catalina-x86_64
        ^parmetis@4.0.3%clang@11.0.3-apple build_type=RelWithDebInfo ~gdb patches=4f892531eb0a807eb1b82e683a416d3e35154a455274cf9b162fb02054d11a5b,50ed2081bc939269689789942067c58b3e522c269269a430d5d34c00edbc5870,704b84f7c7444d4372cb59cca6e1209df4ef3b033bc4ee3cf50f369bce972a9d +shared arch=darwin-catalina-x86_64
        ^python@3.7.7%clang@11.0.3-apple+bz2+ctypes+dbm~debug+libxml2+lzma~nis~optimizations patches=210df3f28cde02a8135b58cc4168e70ab91dbf9097359d05938f1e2843875e57 +pic+pyexpat+pythoncmd+readline+shared+sqlite3+ssl~tix~tkinter~ucs4~uuid+zlib arch=darwin-catalina-x86_64
            ^expat@2.2.9%clang@11.0.3-apple~libbsd arch=darwin-catalina-x86_64
            ^gettext@0.20.2%clang@11.0.3-apple+bzip2+curses+git~libunistring+libxml2+tar+xz arch=darwin-catalina-x86_64
                ^tar@1.32%clang@11.0.3-apple arch=darwin-catalina-x86_64
            ^libffi@3.3%clang@11.0.3-apple arch=darwin-catalina-x86_64
            ^sqlite@3.31.1%clang@11.0.3-apple+column_metadata+fts~functions~rtree arch=darwin-catalina-x86_64
        ^superlu-dist@6.3.0%clang@11.0.3-apple build_type=RelWithDebInfo ~int64~openmp+shared arch=darwin-catalina-x86_64
    ^slepc@3.13.1%clang@11.0.3-apple+arpack~blopex arch=darwin-catalina-x86_64
    ^suite-sparse@5.7.2%clang@11.0.3-apple~cuda~openmp+pic~tbb arch=darwin-catalina-x86_64
    ^sundials@3.2.1%clang@11.0.3-apple+ARKODE+CVODE+CVODES+IDA+IDAS+KINSOL build_type=RelWithDebInfo ~cuda+examples-c~examples-cuda~examples-cxx~examples-f2003+examples-f77~examples-f90+examples-install~f2003~fcmix+generic-math~hypre~int64~klu~lapack+mpi~openmp~petsc precision=double ~pthread~raja+shared+static~superlu-dist~superlu-mt~trilinos arch=darwin-catalina-x86_64
    ^symengine@0.6.0%clang@11.0.3-apple~boostmp build_type=Release ~flint~llvm+mpc+mpfr~openmp~piranha+shared+thread_safe arch=darwin-catalina-x86_64
        ^mpc@1.1.0%clang@11.0.3-apple arch=darwin-catalina-x86_64
            ^mpfr@4.0.2%clang@11.0.3-apple patches=8f15fd27ab65341a60d724d594897d32f4597ddf642d0dc121995e2150181b0c arch=darwin-catalina-x86_64
                ^autoconf-archive@2019.01.06%clang@11.0.3-apple arch=darwin-catalina-x86_64
    ^trilinos@12.18.1%clang@11.0.3-apple~adios2~alloptpkgs+amesos+amesos2+anasazi+aztec+belos+boost build_type=RelWithDebInfo ~cgns~chaco~complex~debug~dtk+epetra+epetraext+exodus+explicit_template_instantiation~float+fortran~fortrilinos+glm gotype=int +gtest+hdf5+hypre+ifpack+ifpack2~intrepid~intrepid2~isorropia+kokkos+matio~mesquite+metis~minitensor+ml+muelu+mumps+netcdf~nox~openmp patches=4cdedfb9619b0b585af588f75d18ab63212bbb9ff7a416823c15d17c00bd2092 ~phalanx~piro~pnetcdf~python+rol~rythmos+sacado~shards+shared~shylu~stk+suite-sparse~superlu~superlu-dist~teko~tempus+teuchos+tpetra~x11~xsdkflags~zlib+zoltan+zoltan2 arch=darwin-catalina-x86_64
        ^glm@0.9.7.1%clang@11.0.3-apple build_type=RelWithDebInfo arch=darwin-catalina-x86_64
        ^matio@1.5.13%clang@11.0.3-apple+hdf5+shared+zlib arch=darwin-catalina-x86_64
```

The error I see is like this
```
==> 1363: Installing suite-sparse
==> Warning: microarchitecture specific optimizations are not supported yet on mixed compiler toolchains [check clang@11.0.3-apple for further details]
==> Using cached archive: /Users/praveen/Applications/spack/var/spack/cache/_source-cache/archive/fe/fe3bc7c3bd1efdfa5cffffb5cebf021ff024c83b5daf0ab445429d3d741bd3ad.tar.gz
==> Staging archive: /var/folders/4b/kkb78yrd4dd7vl91fdng7m0w0000gn/T/praveen/spack-stage/spack-stage-suite-sparse-5.7.2-czqg53m6ivjbumluz53iybxkvm4p5h4u/v5.7.2.tar.gz
==> Created stage in /var/folders/4b/kkb78yrd4dd7vl91fdng7m0w0000gn/T/praveen/spack-stage/spack-stage-suite-sparse-5.7.2-czqg53m6ivjbumluz53iybxkvm4p5h4u
==> No patches needed for suite-sparse
==> 1363: suite-sparse: Building suite-sparse [Package]
==> 1363: suite-sparse: Executing phase: 'install'
==> Error: ProcessError: Command exited with status 2:
    'make' '-j4' 'default' 'AUTOCC=no' 'CUDA=no' 'CUDA_PATH=' 'CFOPENMP=' 'CFLAGS=-O3 -fPIC' 'FFLAGS=-fPIC' 'F77FLAGS=-fPIC' 'MY_METIS_LIB=-L/Users/praveen/Applications/spack/opt/spack/darwin-catalina-x86_64/clang-11.0.3-apple/metis-5.1.0-rfst34i3ua6lpci7tk2tztxm6tjcusxr/lib -lmetis' 'MY_METIS_INC=/Users/praveen/Applications/spack/opt/spack/darwin-catalina-x86_64/clang-11.0.3-apple/metis-5.1.0-rfst34i3ua6lpci7tk2tztxm6tjcusxr/include' 'BLAS=-L/Users/praveen/Applications/spack/opt/spack/darwin-catalina-x86_64/clang-11.0.3-apple/openblas-0.3.9-s2qde7jxz7sy4nyrbdiepk3cvfsmxoeo/lib -lopenblas' 'LAPACK=-L/Users/praveen/Applications/spack/opt/spack/darwin-catalina-x86_64/clang-11.0.3-apple/openblas-0.3.9-s2qde7jxz7sy4nyrbdiepk3cvfsmxoeo/lib -lopenblas' 'CFLAGS+=-std=c11' 'CFLAGS+=-fno-common -fexceptions' 'CMAKE_OPTIONS=-DCMAKE_INSTALL_PREFIX=/Users/praveen/Applications/spack/opt/spack/darwin-catalina-x86_64/clang-11.0.3-apple/suite-sparse-5.7.2-czqg53m6ivjbumluz53iybxkvm4p5h4u -DCMAKE_LIBRARY_PATH=/Users/praveen/Applications/spack/opt/spack/darwin-catalina-x86_64/clang-11.0.3-apple/suite-sparse-5.7.2-czqg53m6ivjbumluz53iybxkvm4p5h4u/lib'

2 errors found in build log:
     192    Copying libmongoose (dynamic) to root Lib directory
     193    [100%] Built target mongoose_dylib
     194    dyld: Library not loaded: libsuitesparseconfig.5.dylib
     195      Referenced from: /private/var/folders/4b/kkb78yrd4dd7vl91fdng7m0w0000gn/T/praveen/spack-stage/spack-stage-suite-sparse-5.7
            .2-czqg53m6ivjbumluz53iybxkvm4p5h4u/spack-src/Mongoose/build/./bin/demo
     196      Reason: image not found
     197    /bin/sh: line 1:  2298 Abort trap: 6           ./bin/demo
  >> 198    make[1]: *** [default] Error 134
  >> 199    make: *** [go] Error 2

```

### Information on your system

```
$ spack debug report
* **Spack:** 0.14.2-1066-80e7a6159
* **Python:** 3.7.7
* **Platform:** darwin-catalina-haswell
```

compilers.yaml file
```
compilers:
- compiler:
    spec: clang@11.0.3-apple
    paths:
      cc: /usr/bin/clang
      cxx: /usr/bin/clang++
      f77: /usr/local/bin/gfortran
      fc: /usr/local/bin/gfortran
    flags: {}
    operating_system: catalina
    target: x86_64
    modules: []
    environment:
      unset: []
    extra_rpaths: []
```

packages.yaml file
```
packages:
   hdf5:
      variants: +fortran +cxx +hl
   petsc:
      variants: +mumps
   trilinos:
      variants: +rol
   libmesh:
      variants: +boost +eigen +fparser +hdf5 +laspack +metis +perflog +petsc \
                +slepc +tetgen +triangle
   all:
      providers:
         mpi: [openmpi]
```

### Additional information

* [spack-build-out.txt](https://github.com/spack/spack/files/4625882/spack-build-out.txt)
* [spack-build-env.txt](https://github.com/spack/spack/files/4625890/spack-build-env.txt)

### 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
- [ ] I have searched the issues of this repo and believe this is not a duplicate



Discussion:
Older versions from 5.4.0 onwards also fail with this error
```
==> 10821: suite-sparse: Executing phase: 'install'
==> Error: ProcessError: Command exited with status 2:
    'make' '-j4' 'default' 'AUTOCC=no' 'CUDA=no' 'CUDA_PATH=' 'CFOPENMP=' 'CFLAGS=-O3 -fPIC' 'FFLAGS=-fPIC' 'F77FLAGS=-fPIC' 'MY_METIS_LIB=-L/Users/praveen/Applications/spack/opt/spack/darwin-catalina-x86_64/clang-11.0.3-apple/metis-5.1.0-rfst34i3ua6lpci7tk2tztxm6tjcusxr/lib -lmetis' 'MY_METIS_INC=/Users/praveen/Applications/spack/opt/spack/darwin-catalina-x86_64/clang-11.0.3-apple/metis-5.1.0-rfst34i3ua6lpci7tk2tztxm6tjcusxr/include' 'BLAS=-L/Users/praveen/Applications/spack/opt/spack/darwin-catalina-x86_64/clang-11.0.3-apple/openblas-0.3.9-s2qde7jxz7sy4nyrbdiepk3cvfsmxoeo/lib -lopenblas' 'LAPACK=-L/Users/praveen/Applications/spack/opt/spack/darwin-catalina-x86_64/clang-11.0.3-apple/openblas-0.3.9-s2qde7jxz7sy4nyrbdiepk3cvfsmxoeo/lib -lopenblas' 'CFLAGS+=-std=c11' 'CFLAGS+=-fno-common -fexceptions' 'CMAKE_OPTIONS=-DCMAKE_INSTALL_PREFIX=/Users/praveen/Applications/spack/opt/spack/darwin-catalina-x86_64/clang-11.0.3-apple/suite-sparse-5.4.0-bsofxhrpr5p24pcvqjw53hc36up244jo -DCMAKE_LIBRARY_PATH=/Users/praveen/Applications/spack/opt/spack/darwin-catalina-x86_64/clang-11.0.3-apple/suite-sparse-5.4.0-bsofxhrpr5p24pcvqjw53hc36up244jo/lib'

3 errors found in build log:
     3835    make[5]: Nothing to be done for `install'.
     3836    ./cholmod_demo < Matrix/bcsstk01.tri
     3837    dyld: Library not loaded: libmetis.dylib
     3838      Referenced from: /private/var/folders/4b/kkb78yrd4dd7vl91fdng7m0w0000gn/T/praveen/spack-stage/spack-stage-suite-sparse-5.
             4.0-bsofxhrpr5p24pcvqjw53hc36up244jo/spack-src/CHOLMOD/Demo/./cholmod_demo
     3839      Reason: image not found
     3840    /bin/sh: line 1: 23664 Abort trap: 6           ./cholmod_demo < Matrix/bcsstk01.tri
  >> 3841    make[2]: *** [all] Error 134
  >> 3842    make[1]: *** [all] Error 2
  >> 3843    make: *** [go] Error 2
```
I could install version 5.3.0
Can you try building the package in serial? `spack install -j1 suite-sparse`
I get the same error even with serial build.

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/suite-sparse/package.py b/var/spack/repos/builtin/packages/suite-sparse/package.py
--- a/var/spack/repos/builtin/packages/suite-sparse/package.py
+++ b/var/spack/repos/builtin/packages/suite-sparse/package.py
@@ -142,7 +142,7 @@ def install(self, spec, prefix):
         # not possible, mainly because of GraphBLAS.  Thus compile first and
         # install in a second run.
         if '@5.4.0:' in self.spec:
-            make('default', *make_args)
+            make('library', *make_args)
 
         make_args.append('INSTALL=%s' % prefix)
         make('install', *make_args)


Test patch: