Repository: spack/spack

Issue:
Cannot download default scalapack provider
A fresh clone of spack

```
~/Src/spack (develop=) 
$ ./bin/spack install scalapack
==> Installing intel-mkl
==> Fetching file:///Users/barrysmith/Src/spack/l_mkl_2017.0.098.tgz
curl: (37) Couldn't open file /Users/barrysmith/Src/spack/l_mkl_2017.0.098.tgz
==> Fetching from file:///Users/barrysmith/Src/spack/l_mkl_2017.0.098.tgz failed.
==> Error: FetchError: All fetchers failed for intel-mkl-2017.0.098-hilljmo3obytjmooovysa6d7otigqjnc
/Users/barrysmith/Src/spack/lib/spack/spack/package.py:948, in do_fetch:
     921      def do_fetch(self, mirror_only=False):
     922          """
     923          Creates a stage directory and downloads the tarball for this package.
     924          Working directory will be set to the stage directory.
     925          """
     926          if not self.spec.concrete:
     927              raise ValueError("Can only fetch concrete packages.")
     928  
     929          start_time = time.time()
     930          if spack.do_checksum and self.version not in self.versions:
     931              tty.warn("There is no checksum on file to fetch %s safely." %
     932                       self.spec.format('$_$@'))
     933  
     934              # Ask the user whether to skip the checksum if we're
     935              # interactive, but just fail if non-interactive.
     936              ck_msg = "Add a checksum or use --no-checksum to skip this check."
     937              ignore_checksum = False
     938              if sys.stdout.isatty():
     939                  ignore_checksum = tty.get_yes_or_no("  Fetch anyway?",
     940                                                      default=False)
     941                  if ignore_checksum:
     942                      tty.msg("Fetching with no checksum.", ck_msg)
     943  
     944              if not ignore_checksum:
     945                  raise FetchError("Will not fetch %s" %
     946                                   self.spec.format('$_$@'), ck_msg)
     947  
  >> 948          self.stage.fetch(mirror_only)
     949  
     950          self._fetch_time = time.time() - start_time
     951  
     952          if spack.do_checksum and self.version in self.versions:
     953              self.stage.check()
     954  
     955          self.stage.cache_local()
```

```
$ cat ~/.spack/packages.yaml
#
#   Spack likes to build all of its packages. The file  ~/.spack/packages.yaml allows you to list
# packages already install on your system for Spack to use instead of compiling them itself.
#
#   In the example below I used the homebrew package manager; you could probably use the MacPorts
# package manager instead
#
packages:
    #  homebrew provided packages
    #  install with: brew install packagename
    autoconf:
        paths:
            autoconf@2.69: /usr/local/bin
        buildable: False
    libtool:  # note it installs it with the name glibtool to avoid conflict with Apple's completely different libtool
        paths:
            libtool@2.4.6: /usr/local/bin
        buildable: False
    cmake:
        paths:
            cmake@3.7.1: /usr/local/bin
        buildable: False
#    mpich:
#        paths:
#            mpich@3.2: /usr/local
#        buildable: False
#    openmpi:
#        paths:
#            openmpi@2.0.1: /usr/local
#        buildable: False
#    python:  # you should also be able to use the Apple provided python; see below
#        paths:
#            python@2.7.12: /usr/local
#        buildable: False
    boost:
        paths:
            boost@1.62.0: /usr/local
        buildable: False

    #  NVIDIA provided CUDA tools from Nvidia.com
    cuda:
        paths:
            cuda@8.0: /Developer/NVIDIA/CUDA-8.0
        buildable: False

    # Apple provided packages
    m4:
        paths:
            m4@1.4.6: /usr/bin
        buildable: False
    zlib:
        paths:
            zlib@1.2.8: /usr/
        buildable: False
    python:
        paths:
            python@2.7.1: /usr
        buildable: False        

    all:
        providers:
            # prefer OpenMPI over MPICH by default
            mpi: [mpich, openmpi]
            # Use Apple BLAS/LAPACK accelerator library instead of installing one
            blas: [veclibfort]
            lapack: [veclibfort]
```

```
$ cat ~/.spack/darwin/compilers.yaml
compilers:
- compiler:
    environment: {}
    extra_rpaths: []
    flags: {}
    modules: []
    operating_system: sierra
    paths:
      cc: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
      cxx: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++
      f77: /usr/local/bin/gfortran
      fc: /usr/local/bin/gfortran
    spec: clang@8.1.0-apple
    target: x86_64
```

I do not have MKL install on my apple laptop. 




Discussion:
A couple of observations:

You shouldn't use `/usr/local/bin` in your `packages.yaml`. The installation directory is `/usr/local`, this is the prefix you should use. `/usr/local/bin` is just where the executables are installed. Spack will always search for its dependencies in prefix.bin or prefix.lib, so this is important.

As to what is causing your actual problem, the problem is that for some reason Spack has chosen `intel-mkl` as your BLAS/LAPACK provider. I can't check right now (on the train) but do any of scalapack's dependencies specifically require MKL or is it just any BLAS/LAPACK? The problem with intel-mkl is that it has to be manually downloaded and added to a mirror for Spack to find it. I don't know of any download URLs for intel-mkl. You can try specifying a different BLAS/LAPACK provider. I'm not sure why you're settings in `packages.yaml` are being ignored. Perhaps something actually requires an MKL provider. 
Ah, I see what's going on here. There is no `scalapack` package, it's a virtual dependency. Since we don't specify a default virtual dependency, it chooses `intel-mkl`. We should probably default to something that can actually be downloaded, like `netlib-scalapack`. I'll submit a PR to do this shortly.

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/daal/package.py b/var/spack/repos/builtin/packages/intel-daal/package.py
similarity index 97%
rename from var/spack/repos/builtin/packages/daal/package.py
rename to var/spack/repos/builtin/packages/intel-daal/package.py
--- a/var/spack/repos/builtin/packages/daal/package.py
+++ b/var/spack/repos/builtin/packages/intel-daal/package.py
@@ -28,7 +28,7 @@
 from spack.pkg.builtin.intel import IntelInstaller
 
 
-class Daal(IntelInstaller):
+class IntelDaal(IntelInstaller):
     """Intel Data Analytics Acceleration Library.
 
     Note: You will have to add the download file to a
@@ -44,6 +44,8 @@ class Daal(IntelInstaller):
     version('2016.3.210', 'ad747c0dd97dace4cad03cf2266cad28',
             url="file://%s/l_daal_2016.3.210.tgz" % os.getcwd())
 
+    provides('daal')
+
     def install(self, spec, prefix):
 
         self.intel_prefix = os.path.join(prefix, "pkg")
diff --git a/var/spack/repos/builtin/packages/ipp/package.py b/var/spack/repos/builtin/packages/intel-ipp/package.py
similarity index 97%
rename from var/spack/repos/builtin/packages/ipp/package.py
rename to var/spack/repos/builtin/packages/intel-ipp/package.py
--- a/var/spack/repos/builtin/packages/ipp/package.py
+++ b/var/spack/repos/builtin/packages/intel-ipp/package.py
@@ -28,7 +28,7 @@
 from spack.pkg.builtin.intel import IntelInstaller
 
 
-class Ipp(IntelInstaller):
+class IntelIpp(IntelInstaller):
     """Intel Integrated Performance Primitives.
 
     Note: You will have to add the download file to a
@@ -42,6 +42,8 @@ class Ipp(IntelInstaller):
     version('9.0.3.210', '0e1520dd3de7f811a6ef6ebc7aa429a3',
             url="file://%s/l_ipp_9.0.3.210.tgz" % os.getcwd())
 
+    provides('ipp')
+
     def install(self, spec, prefix):
 
         self.intel_prefix = os.path.join(prefix, "pkg")


Test patch: