boost安装

  1. 安装boost库
1
$ sudo apt-get install libboost-all-dev
  1. boost测试文件test.cpp
1
2
3
4
5
6
7
8
9
10
11
#include <boost/lexical_cast.hpp>
#include <iostream>
int main()
{
using boost::lexical_cast;
int a = lexical_cast<int>("123");
double b = lexical_cast<double>("123.12");
std::cout<<a<<std::endl;
std::cout<<b<<std::endl;
return 0;
}
  1. 运行test.cpp
1
$ g++ test.cpp -o test.out
  1. 执行test.out
1
$ ./test.out

openmpi和mpich安装

  1. openmpi安装
1
2
3
4
5
6
7
$ sudo apt-get install openmpi-bin openmpi-doc libopenmpi-dev

装好后查询版本
$ mpirun --version
mpirun (Open MPI) 1.10.2
$ mpiexec --version
mpiexec (OpenRTE) 1.10.2
  1. mpich安装
    请先确保下面三个软件已安装
    $ gcc --version
    $ g++ --version
    $ python --version
1
2
3
4
5
$ sudo apt-get install mpich

装好后查询版本
$ which mpicc
$ which mpiexec

cuda安装

官方网页,根据不同的操作系统下载.run文件,按官网操作进行。但请注意,只装cuda-toolkit就可以了,其他的都取消勾选。(注:如果是新系统没有装nvidia驱动,那么可以通过这种方式进行驱动的安装)