spack: Weird dependency resolution error

This command

spack install -j1 -v cactusext +funhpc +simulationio %gcc@6.1.0-spack

leads to this error from Spack:

==> Error: Multiple providers found for 'mpi': ['openmpi%gcc@6.1.0-spack~pmi+verbs', 'openmpi@1.10.2%gcc@6.1.0-spack~pmi~psm~tm+verbs=linux-x86_64^hwloc@1.11.3%gcc@6.1.0-spack=linux-x86_64^libpciaccess@0.13.4%gcc@6.1.0-spack=linux-x86_64^libsigsegv@2.10%gcc@6.1.0-spack=linux-x86_64^libtool@2.4.6%gcc@6.1.0-spack=linux-x86_64^m4@1.4.17%gcc@6.1.0-spack+sigsegv=linux-x86_64']

After adding some line breaks, this becomes

openmpi%gcc@6.1.0-spack~pmi+verbs

openmpi@1.10.2%gcc@6.1.0-spack~pmi~psm~tm+verbs=linux-x86_64
    ^hwloc@1.11.3%gcc@6.1.0-spack=linux-x86_64
    ^libpciaccess@0.13.4%gcc@6.1.0-spack=linux-x86_64
    ^libsigsegv@2.10%gcc@6.1.0-spack=linux-x86_64
    ^libtool@2.4.6%gcc@6.1.0-spack=linux-x86_64
    ^m4@1.4.17%gcc@6.1.0-spack+sigsegv=linux-x86_64

I see that the first (essentially openmpi +verbs) is what I specify, and the second is what one obtains naturally after adding all dependencies, versions, and architectures. I don’t see where the conflict comes from.

How do I debug this? I realize this involves some packages of mine that are only available in my branch of Spack (see https://github.com/eschnett/spack/tree/eschnett/cactusext). Is there a particular routine to look at, or some debug output that would trace Spack’s dependency resolution mechanism?

About this issue

  • Original URL
  • State: closed
  • Created 11 years ago
  • Comments: 31 (31 by maintainers)

Commits related to this issue

Most upvoted comments

@eschnett It appears that spack is incorrectly raising a MultipleProvidersError when it encounters multiple providers for a virtual dependency that could be concretized to the same value.

I don’t want to push directly to your repo, and the changes are tiny, so I will list them here. Try making the following code changes to the _find_provider() method on the Spec class in lib/spack/spack/spec.py. There are 5 lines to add, marked with the > symbol.

    if providers:
>       # Remove duplicate providers that can concretize to the same result.
>       for provider in providers:
>           for spec in providers:
>               if spec is not provider and spec.satisfies(provider):
>                   providers.remove(spec)
        # Can't have multiple providers for the same thing in one spec.
        if len(providers) > 1:
            raise MultipleProviderError(vdep, providers)
            return providers[0]

Can you confirm that this works for all of your needs and submit a PR to the mainline if so?