uninstalling packages with multiple specs

710 views
Skip to first unread message

a...@acm.org

unread,
Nov 12, 2020, 6:24:39 PM11/12/20
to Spack

Hello,

I have two packages built under the same OS that got installed and I need to uninstall one of them.

%spack uninstall platoengine@master%g...@6.4.0 arch=linux-centos7-skylake_avx512

==> Error: platoengine@master%g...@6.4.0 arch=linux-centos7-skylake_avx512 matches multiple packages:

    -- linux-centos7-skylake_avx512 / g...@6.4.0 ---------------------

    k6q7vdu platoengine@master  nsjvj3v platoengine@master

==> Error: You can either:

    a) use a more specific spec, or

    b) use `spack uninstall --all` to uninstall ALL matching specs.


Now it makes perfect sense to use a more specific spec, in this case the hash value. But I can not find how to add that to the spec. Any pointers?


Related question, I do not understand why spack decided to install two versions for the same OS. Here are my steps.

  1. spack dev-build --until cmake platoengine@master ...
  2. spack build-env platoengine@master ...
  3. make -j24 ; make install
I did the above so use my local source but then install into spack. Next I did the same for another package that depends on the platoengine. Here again because I wanted to use my local source but then install into spack.
  1. spack load platoengine@master%g...@6.4.0 arch=linux-centos7-skylake_avx512
  2. spack dev-build --until cmake platoanalyze@master ...
However, at this step spack does not see platoengine so it builds a second version.  I am not sure why it did not see the version I built. Seems like an entry is missing. 

It  is odd because in the past I did similar using the dev-build / build-dev and it worked fine platoanalyze but here I was just building it (not both platoengine and platoanalyze).

So why did my local version not get recognized???

Thanks for any insight. 



petr.h...@gmail.com

unread,
Nov 13, 2020, 4:27:35 AM11/13/20
to Spack
Hi,

Dne pátek 13. listopadu 2020 v 0:24:39 UTC+1 uživatel a...@acm.org napsal:

Hello,

I have two packages built under the same OS that got installed and I need to uninstall one of them.

%spack uninstall platoengine@master%g...@6.4.0 arch=linux-centos7-skylake_avx512

==> Error: platoengine@master%g...@6.4.0 arch=linux-centos7-skylake_avx512 matches multiple packages:

    -- linux-centos7-skylake_avx512 / g...@6.4.0 ---------------------

    k6q7vdu platoengine@master  nsjvj3v platoengine@master

==> Error: You can either:

    a) use a more specific spec, or

    b) use `spack uninstall --all` to uninstall ALL matching specs.

Now it makes perfect sense to use a more specific spec, in this case the hash value. But I can not find how to add that to the spec. Any pointers?

You can do this with slash. So if you want to uninstall platoengine with hash 'k6q7vdu', you do it this way:
spack uninstall /k6q7vdu

When you need to list all installed software of some kind with hashes, you do it like this:
spack find -lv platoengine@master
 

Related question, I do not understand why spack decided to install two versions for the same OS. Here are my steps.

  1. spack dev-build --until cmake platoengine@master ...
  2. spack build-env platoengine@master ...
  3. make -j24 ; make install
Spack decides to build it once more when it computes a different hash for the package. From my experience it's mainly because
  • you moved the recipe for the package to another repo
  • some dependency changes it's hash
    • which can be also because of moving to other repo
    • or just a new version of that
    • or because of other variant used
You can provide a specific dependency by hand using the "specs and dependencies" feature. Or you can try some automation with environments and the feature "concretization: together".

 
I did the above so use my local source but then install into spack. Next I did the same for another package that depends on the platoengine. Here again because I wanted to use my local source but then install into spack.
  1. spack load platoengine@master%g...@6.4.0 arch=linux-centos7-skylake_avx512
  2. spack dev-build --until cmake platoanalyze@master ...
However, at this step spack does not see platoengine so it builds a second version.  I am not sure why it did not see the version I built. Seems like an entry is missing. 

No, Spack should see the version but because of hashes it decided rather to build a new one. By the way, if it's already in spack database, you don't need to load it prior some compilation. So in your case I would try to use the exact hash of the platoengine package you want to use:
spack find -lv platoengine@master%g...@6.4.0 arch=linux-centos7-skylake_avx512 #get a hash from this step, eg: nsjvj3v
spack dev-build --until cmake platoanalyze@master ^/nsjvj3v

Hope this helps. 
Petr
Reply all
Reply to author
Forward
0 new messages