How to change where spack installs package?

1.6k Views Asked by At

Is there a way to have spack install software at a location of my choosing?

For example, if I do:

spack install netcdf-c

Then spack will install netcdf-c in a directory like:

/home/ed/spack/opt/spack/linux-ubuntu21.04-broadwell/gcc-10.3.0/netcdf-c-4.8.0-4zwtnn73atpc5ojmpigo7utmwzds7qrq

Is it possible to have spack install netcdf-c at /usr/local instead?

1

There are 1 best solutions below

0
On

There are several ways to do this. The preferred way would be to make an environment and use a spack view to put the install (or symlink to the install binaries) where you want them.

If you wanted to hard code the install path this can be done as well through the spack config.yaml (documentation here; look at the install_tree:root ).