spack

Why spack isn't adding external packages to environment filesystem views?


Suppose I am in my_env:

spack activate my_env

Also suppose that I have external packages, e.g. a system-installed openmpi. And then I generate filesystem views:

spack env view regenerate

Then I get this warning:

Skipping external package: openmpi

And indeed the binaries of openmpi are not symlinked into my filesystem view. My question is: is there a particular reason it is done like that? And is there a way to tell spack that it should also put external packages in the filesystem view?

[Notice that contrary to the filesystem view, external packages are included when generating modules through spack env loads]


Solution

  • The external packages are skipped because there are 3 different types of views that are supported: symlink, hardlink and copy.

    When spack copies binaries it seeks to make them relocatable, but with system/external binaries it is a bit of the wild west. So externals are skipped to keep the behavior consistent, and to prevent potential problem binaries that spack did not create inside copy and hard link views. This could be changed in the future. If it is a big enough concern then please file an issue on github.

    As you've noticed, loads load system binaries automatically. This is because loads files are just loading modules and spack creates a module for every package in the environment including externals.