Ubuntu 配置科学计算环境

Ubuntu下的科学计算环境


本人在聚变等离子体方向做理论模拟。本文旨在提供在Ubuntu下搭建基本的c&python开发环境。Ubuntu系统版本18&20都可以(建议不要使用最新版的)。
(vim/gcc/g++/gdb/gfortran/make/cmake/ccmake/ipython/fftw/blas/lapack/mumps/petsc/eigen/openmpi/openmp)

whereURL
官方下载地址(不推荐)https://www.ubuntu.com/download
中国官网(推荐)https://cn.ubuntu.com/
中科大源http://mirrors.ustc.edu.cn/ubuntu-releases/16.04/
阿里云开源镜像站http://mirrors.aliyun.com/ubuntu-releases/16.04/
兰州大学开源镜像站http://mirror.lzu.edu.cn/ubuntu-releases/16.04/
北京理工大学开源http://mirror.bit.edu.cn/ubuntu-releases/16.04/
浙江大学http://mirrors.zju.edu.cn/ubuntu-releases/16.04/
  • 更换mirror

用国外源,安装软件极其费时,可能一天就安了几个软件。某个大佬写了一个脚本(quanweiGithub/Ubuntu-China-Source)用于切换Ubuntu的镜像到国内源。

  • 安装git
sudo apt install git
  • 安装neovim
sudo apt install neovim

Vim 之所以强大,一个很重要的原因是存在很多插件,在 Vim 漫长的发展过程中,无数开发者为 Vim 贡献了插件,这些插件可以实现各种各样的功能。如果安装插件很多,插件管理成为一个麻烦的问题。Neovim 和 Vim 一样,并没有自带插件管理器,我们需要自己安装插件管理器。经过搜索和比较,发现有两款比较有名的插件管理器在 Nvim 用户中流行,分别是 dein 和vim-plug. Vim-plug 的 user base 更大,最后我决定安装 vim-plug,以下为 vim-plug 安装以及简单的使用说明。插件配置可见bilibili视频和vimrc-example

Neovim 使用的配置文件和 Vim 不同,需要在 ~/.config/nvim/ 目录下创建文件 init.vim ,该文件就是 Neovim 的配置文件,Neovim 所有的配置都可以放入其中。由于 Neovim 是基于 Vim 开发的,所以 Neovim 和 Vim 的绝大多数配置都是相同的,如果之前使用过 Vim,可以把之前的配置的大部分拷贝过来使用。Vim-Plug的有效文件就是plug.vim!!!
vim

  1. 将plug.vim文件下载下来
  2. 复制到~/.vim/autoread/文件夹下
  3. 安装Vim-Plug插件管理器:编辑/home/username/.vimrc文件
    call plug#begin(’~/.vim/plugged’)
    Plug ‘itchyny/lightline.vim’
    call plug#end()

nvim

  1. 将plug.vim文件下载下来
  2. 复制到~/.local/share/nvim/site/autoread/文件夹下
  3. 安装Vim-Plug插件管理器:编辑 init.vim 文件
    call plug#begin(’~/.local/share/nvim/site/plugged/’)
    Plug ‘itchyny/lightline.vim’
    call plug#end()
  • Ubuntu的编译链接工具链
    cmake用于生成makefile,构建系统。学习cmake,你可能喜欢cmake-examples。cmake: A command line interface (CLI) 。ccmake: An ncurses (terminal) GUI. (only available on Unix-like systems)。cmake-gui: A Qt-based GUI。
sudo apt update
sudo apt install build-essential
sudo apt-get install gfortran
sudo apt-get install cmake
sudo apt-get install cmake-curses-gui
wget http://down.qq.com/qqweb/LinuxQQ/linuxqq_2.0.0-b2-1084_amd64.deb
sudo dpkg -i linuxqq_2.0.0-b2-1082_amd64.deb 
sudo dpkg -r linuxqq
wget https://repo.anaconda.com/archive/Anaconda3-2019.03-Linux-x86_64.sh

or

wget https://repo.anaconda.com/archive/Anaconda2-2019.10-Linux-x86_64.sh

and then

bash Anaconda3-2019.03-Linux-x86_64.sh

下行可以查看安装脚本的选项

bash Anaconda2-2019.10-Linux-x86_64.sh -h

MUMPS (MUltifrontal Massively Parallel sparse direct Solver) is a software application for the solution of large sparse systems of linear algebraic equations on distributed memory parallel computers. It was developed in European project PARASOL (1996–1999) by CERFACS, IRIT-ENSEEIHT and RAL. The software implements the multifrontal method, which is a version of Gaussian elimination for large sparse systems of equations, especially those arising from the finite element method. It is written in Fortran 90 with parallelism by MPI and it uses BLAS and ScaLAPACK kernels for dense matrix computations. Since 1999, MUMPS has been supported by CERFACS, IRIT-ENSEEIHT, and INRIA. The importance of MUMPS lies in the fact that it is a rare public domain implementation of the multifrontal method, if not the only professional and supported one.

wget https://code.visualstudio.com/sha/download?build=stable&os=linux-deb-x64
sudo dpkg -i code_1.38.1-1568209190_amd64.deb
sudo apt-get install codeblocks
sudo apt-get install codeblocks-contrib

使用VMware

如果你使用虚拟机啊其实挺好的。一旦你配置好环境,一般可以将虚拟机复制到若干其它计算机上。无需重复配置环境。当然,用docker也可以更好。我使用过的案例有:amd移植到Intel;amd移植到amd。

vmware Player 16 闪退+蓝屏:

  1. https://blog.csdn.net/qq_25777815/article/details/110385275
  2. https://blog.csdn.net/qq_42672132/article/details/118903457
  3. https://blog.csdn.net/csdn18740599042/article/details/114608442
  4. https://blog.csdn.net/hdjbdbfj/article/details/120402211

—更新中—

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Ubuntu配置深度学习环境可以分为以下几个步骤: 1. 安装 NVIDIA GPU 驱动程序 如果你的机器有 NVIDIA 显卡,建议安装官方的 NVIDIA 驱动程序,以获得更好的性能。可以通过以下命令安装: ``` sudo apt-get install nvidia-driver-<version> ``` 其中 `<version>` 是驱动版本号,可以通过 `apt-cache search nvidia-driver` 命令查看可用版本。 2. 安装 CUDA 和 cuDNN CUDA 是 NVIDIA 提供的用于 GPU 加速的计算平台,cuDNN 是用于深度学习的库。可以从 NVIDIA 官网下载对应版本的 CUDA 和 cuDNN,并按照官方文档进行安装。 3. 安装 Anaconda Anaconda 是一个常用的 Python 发行版,包含了很多常用的科学计算库。可以从 Anaconda 官网下载对应版本的 Anaconda,并按照官方文档进行安装。 4. 创建一个虚拟环境 创建一个虚拟环境可以避免与系统中其他 Python 应用程序产生冲突。可以使用以下命令创建一个名为 `myenv` 的虚拟环境: ``` conda create -n myenv python=<version> ``` 其中 `<version>` 是 Python 版本号。 5. 激活虚拟环境 创建虚拟环境后需要激活才能使用。可以使用以下命令激活名为 `myenv` 的虚拟环境: ``` conda activate myenv ``` 6. 安装深度学习库 可以使用 Anaconda 提供的 `conda` 命令安装常用的深度学习库。例如,可以使用以下命令安装 TensorFlow: ``` conda install tensorflow-gpu ``` 7. 测试深度学习环境 安装完成后,可以使用 Python 进行测试,确保深度学习库可以正常使用。可以创建一个 Python 脚本,导入所需的库并运行一些基本的深度学习代码进行测试。 以上是在 Ubuntu配置深度学习环境的基本步骤,具体的安装方法可以根据需要进行调整。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值