如何运行 PETSc 示例?

计算科学 宠物
2021-12-25 12:36:06

我刚刚安装了 PETSc 库。这是我从主目录所做的~

gunzip -c petsc-3.2-p6.tar.gz|tar -xof -
cd ~/petsc-3.2-p6
PETC_DIR=$PWD: export PETSC_DIR
./configure --download-f-blas-lapack=1
make all
make PETSC_DIR=/export/home/myusername/petsc-3.2-p6 PETSC_ARCH=arch-linux2-c-debug test

(注意:我没有安装 mpich,因为它已经安装在系统上)
然后,我尝试运行以下本教程中的示例,幻灯片 46 of 197,它要求我执行以下操作:

cd ~/petsc-3.2-p6/src/snes/examples/tutorials
make ex5

在此过程中,我收到以下错误:

makefile:24: /conf/variables: No such file or directory
makefile:24: /conf/rules: No such file or directory
makefile:24: /conf/test: No such file or directory

我设置 PETSc 的方式有问题吗?或者我需要在makefile中修改什么?

1个回答

您很可能没有正确设置 PETSC_DIR 和 PETSC_ARCH 环境变量。

例如,您在构建示例的第三行中将 PETSC_DIR 拼错为 PETC_DIR。