再纯净的Ubuntu中编译安装petsc
2020-09-11 本文已影响0人
马鹏飞_47c5
- docker pull ubuntu
- docker run -ti ubuntu bash
- 在新容器里执行命令
apt-get update
apt-get install vim
- 更换阿里云的源
deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse - 安装openmpi
sudo apt-get install openmpi-bin liblapack-dev
- 下载最新的petsc-3.13.5.zip并解压
unzip petsc-3.13.5.zip
- 在configure的过程中,我额外安装了make,wget和python3-pip才不会报错
apt-get install make wget python3-pip
python3 configure
- 最后将容器打包就好啦
docker commit 261314c94305 mypetsc