再纯净的Ubuntu中编译安装petsc

2020-09-11  本文已影响0人  马鹏飞_47c5
  1. docker pull ubuntu
  2. docker run -ti ubuntu bash
  3. 在新容器里执行命令
apt-get update
apt-get install vim
  1. 更换阿里云的源
    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
  2. 安装openmpi
sudo apt-get install openmpi-bin liblapack-dev
  1. 下载最新的petsc-3.13.5.zip并解压
unzip petsc-3.13.5.zip
  1. 在configure的过程中,我额外安装了make,wget和python3-pip才不会报错
apt-get install make wget python3-pip
python3 configure
  1. 最后将容器打包就好啦
docker commit 261314c94305 mypetsc
上一篇 下一篇

猜你喜欢

热点阅读