ubuntu18.04安裝petsc

準備:
mpich3.3.1.tar.gz、petsc3.12.5.tar.gz

1.安裝mpich

預備條件

從MPICH官網下載最新的源碼包mpich-3.3.1(後綴爲.tar.gz)

gcc編譯器(C語言編譯器)

yum -y install gcc

gcc-c++編譯器(C++編譯器)

yum -y install gcc-c++

gfortran編譯器(C++編譯器)

yum -y install gfortran


編譯安裝mpich

tar mpich3.3.1.tar.gz
cd mpich3.3.1
#檢查配置軟件
./configure --prefix=/usr/local/mpich3.3.1
#編譯安裝
make
make intall
#寫入環境變量
vim /etc/profile
PATH=/usr/local/mpich3.3.1/bin:$PATH ; export PATH
#修改之後重新執行初始化文件,使之生效
source /etc/profile

2.安裝petsc
預備條件:

安裝lapack和BLAS:

apt-get install libblas-dev liblapack-dev

安裝petsc:

#檢查軟件環境配置
./configure --with-blaslapack-dir=/usr/lib/x86_64-linux-gnu/ --with-mpi-dir=/usr/local/mpich3.3.1
#編譯
make all test
#配置環境
export PETSC_DIR=/home/hipeson/petsc-3.12.5/
export PETSC_ARCH=arch-linux2-c-debug

安裝成功示意圖

petsc環境變量提示



參考文章:https://www.phpfans.net/ask/linux1/4145310087.html

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章