使用Spack安装PISM失败,所有安装操作均报错求助
问题:Spack安装PISM时re2c源码获取失败,clingo引导失败
错误详情
(base) MacBook-Pro-143:~ samchester$ spack install pism ^petsc~metis~hdf5~hypre~superlu-dist ==> Bootstrapping clingo from pre-built binaries ==> Bootstrapping clingo from pre-built binaries ==> Bootstrapping clingo from sources [+] /opt/local (external cmake-3.23.5-riwdvuounbgskxtvk3zvrdi4zlcrew3z) ==> Installing re2c-2.2-5r7oh4myb3qbamndzvesvnkjx52vv3dv ==> No binary for re2c-2.2-5r7oh4myb3qbamndzvesvnkjx52vv3dv found: installing from source ==> Error: FetchError: All fetchers failed for spack-stage-re2c-2.2-5r7oh4myb3qbamndzvesvnkjx52vv3dv /Users/samchester/spack/lib/spack/spack/package_base.py:1455, in do_fetch: 1452 1453 self.stage.create() 1454 err_msg = None if not self.manual_download else self.download_instr >>> 1455 start_time = time.time() 1456 self.stage.fetch(mirror_only, err_msg=err_msg) 1457 self._fetch_time = time.time() - start_time 1458 ==> Warning: Skipping build of clingo-bootstrap-spack-llpnrd4k7qc4s7eiqotk26iailqtmxzb since re2c-2.2-5r7oh4myb3qbamndzvesvnkjx52vv3dv failed ==> Error: cannot bootstrap the "clingo" Python module from spec "clingo-bootstrap@spack+python %apple-clang target=x86_64" due to the following failures: github-actions-v0.4 raised RuntimeError: The binary index is empty github-actions-v0.3 raised RuntimeError: The binary index is empty spack-install raised InstallError: Terminating after first install failure: FetchError: All fetchers failed for spack-stage-re2c-2.2-5r7oh4myb3qbamndzvesvnkjx52vv3dv Run `spack --debug ...` for more detailed errors
解决方案
检查网络与代理配置
确认网络能正常访问GitHub,若处于受限网络环境,设置代理环境变量:export HTTP_PROXY=http://your-proxy-address:port export HTTPS_PROXY=http://your-proxy-address:port更新Spack索引与镜像
先更新包索引,确保包信息是最新的:spack repo update添加Spack官方二进制镜像并导入信任密钥:
spack mirror add binary_mirror https://binaries.spack.io/v1 spack buildcache keys --install --trust手动下载re2c源码并导入Spack
- 下载re2c 2.2版本源码包(如
re2c-2.2.tar.xz) - 将下载的包导入Spack缓存:
spack fetch --path=/path/to/your/re2c-2.2.tar.xz re2c@2.2
- 下载re2c 2.2版本源码包(如
使用系统已安装的re2c(如果有)
- 检查系统是否已安装re2c:
re2c --version - 若已安装,编辑
~/.spack/packages.yaml,添加外部包配置:packages: re2c: externals: - spec: re2c@2.2 prefix: /usr/local # 根据实际安装路径调整 buildable: false
- 检查系统是否已安装re2c:
清理缓存并重新引导
清理之前失败的构建缓存:spack clean --all重新执行clingo引导:
spack bootstrap now之后再尝试安装PISM:
spack install pism ^petsc~metis~hdf5~hypre~superlu-dist
内容的提问来源于stack exchange,提问作者Sam C
相关产品推荐
相关产品推荐

