![](/img/trans.png)
[英]Installing Petsc from source, Specified destDir same as current PETSC_DIR/PETSC_ARCH
[英]Mac OSX 12.4 (Monterey). Trying to compile an old Python code. Configure: error: set PETSC_DIR to point at PETSc installation. Related to gfortran?
我一直在嘗試編譯舊的 Python 代碼。 幾天前,我發布了一個問題,描述了訪問 Python 和 gfortran 的問題。 我解決了 Python 問題,然后這個問題不再有意義。 它沒有答案,所以我刪除了它。 但是,現在當我運行“配置”腳本時,我收到了一個我不明白的錯誤:
configure: error: You need to set PETSC_DIR to point at your PETSc installation... exiting
在線搜索以找出 PETSc 出現了一個論壇帖子 ( https://github.com/firedrakeproject/firedrake/issues/1703 ),其中提到了“gfortran”,我想知道這就是我的問題所在。 我通過 Homebrew 安裝了 gcc 來獲取 gfortran,現在可以在/usr/local/bin/gfortran
看到它。 在我的.zshrc
文件中,我添加了:
export PATH=$PATH:/usr/local/bin
alias python=/usr/local/bin/gfortran
當我做:
gfortran --version
我得到(這看起來不錯):
GNU Fortran (Homebrew GCC 11.3.0_2) 11.3.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
當我做:
which gfortran
我得到以下。
aliased to gfortran -L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib
另一件似乎相關的事情是我剛剛做了:
brew install openmpi
克服與沒有 MPI 相關的錯誤。 我對在 Mac 上使用 MPI 一無所知,所以這很可能是我出錯的地方。
configure: error: no MPI support found on system
以下是“配置”腳本日志文件中的線索:
checking for malloc in -ltcmalloc... no
configure: WARNING: No tcmalloc support available.
checking for mpif90... no
checking for mpf90... no
checking for mpicc... no
checking for mpcc... no
checking for mpicxx... no
checking for mpiCC... no
checking for mpCC... no
checking if we can compile and link without using -lmpi... no
checking if we can compile and link using -lmpi... no
checking if we can compile and link using mpich libs... no
configure: error: no MPI support found on system
如果有人能指出我正確的方向,我將不勝感激。
您的錯誤消息表明 PETSc 庫丟失。 您可能會找到一個pip
安裝,它為您提供帶有 python 界面的 petsc。
但是,您對 Zoltan 的進一步問題表明(可能)您需要將 zoltan 作為可選包的 petsc 安裝。 我不確定您是否可以為此找到pip
安裝。 您可能需要完全手動安裝 petsc。
https://petsc.org/release/install/
並使用配置選項--with-zoltan --with-mpi4py
。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.