开发者
资源
spack软件安装路径
spack软件安装路径
发表于2023/10/12
1.8k14

之前说了spack的简单使用和编译器的调整,这次说一下spack安装软件时,安装路径的调整。 没看之前帖子的同学可以进我主页查看。

默认安装路径

执行一个简单的安装命令,软件会默认安装在

<spack安装路径>/opt/spack/<架构>/<编译器名称>-<编译器版本>/<软件名称>-<软件版本>-<16位hash值>

软件安装结束之后可看到安装位置。如下图,绿色[+]号表示安装位置 true

软件安装位置较深

修改安装路径

软件安装路径的设置在<spack安装路径>/etc/spack/defaults/config.yaml文件中

config:
  # This is the path to the root of the Spack install tree.
  # You can use $spack here to refer to the root of the spack instance.
  install_tree:
    root: $spack/opt/spack
    projections:
      all: "{architecture}/{compiler.name}-{compiler.version}/{name}-{version}-{hash}"

可通过修改相关配置,设置自己的安装路径

示例:

config:
  # This is the path to the root of the Spack install tree.
  # You can use $spack here to refer to the root of the spack instance.
  install_tree:
    root: /home/install
    projections:
      all: "{compiler.name}-{compiler.version}/{name}-{version}-{hash:7}"

通过上面修改,软件将会安装到:

/home/install/<编译器名称>-<编译器版本>/<软件名称>-<软件版本>-<7位hash值>

可按自己要求修改软件安装位置。

注意:

1、修改安装位置之后,原位置安装的软件将不受spack管理。
2、上述示例/home/install目录下会生成bin目录,请不要删除
3、hash值由原先的16位改成7位不是一定的,可按自己想法修改,或者直接不要hash,删除-{hash}即可。但出现软件A编译安装依赖了B软件,和没有依赖B软件这两个变体都需要的时候,将无法共存。有hash就可以通过hash安装到两个位置。自己安装软件可能不会出现这种情况,但spack安装一些不同的软件可能需要的A软件是不一样的,这个时候就会报错。
收藏举报
Level 1
0
帖子
0
粉丝
0
获赞