OpenMPI学习日记2
2016-08-16 14:19
435 查看
1. OpenMPI环境搭建
(1)下载和解压
(3)配置环境变量(~/.bashrc)
--allow-run-as-root -np 8 hello_c即可。
2. mpic++命令
解析:
(1)mpic++ -showme:version
eg: mpic++: Open MPI 1.8.4 (Language: C++)
(2)mpic++ -showme
eg: g++ -I/usr/local/openmpi/include -pthread -Wl,-rpath -Wl,/usr/local/openmpi/lib -Wl,--enable-new-dtags -L/usr/local/openmpi/lib -lmpi_cxx -lmpi
(3)mpic++ -showme:libdirs
eg: /usr/local/openmpi/lib
(4)mpic++ -showme:libs
eg: mpi_cxx mpi
3. Nsight Eclipse Edition开发OpenMPI应用程序
主要是配置GCC C Linker中的Libraries。如下所示:
编译和链接程序的时候没有报错,但是执行程序的时候却报错error while loading shared libraries: libmpi_cxx.so.1: cannot open shared object file: No such file or directory。解决的方案是将/usr/local/openmpi/lib添加到/usr/local/openmpi/lib中,然后执行命令ldconfig,最后重新执行程序正常运行。
参考文献:
[1] ubuntu下安装openMPI:http://blog.csdn.net/swuteresa/article/details/9405383
(1)下载和解压
wget https://www.open-mpi.org/software/ompi/v1.10/downloads/openmpi-1.10.3.tar.gz tar -zxvf openmpi-1.10.3.tar.gz(2)配置,编译和安装
./configure --prefix=/usr/local/openmpi make make install说明:如果不指定--prefix,那么默认的安装路径是/usr/local/lib。
(3)配置环境变量(~/.bashrc)
export PATH=$PATH:/usr/local/openmpi/bin export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/openmpi/lib/ source ~/.bashrc sudo ldconfig(4)进行测试
cd openmpi-1.10.3/examples make mpirun -np 4 hello_c但是,在make的时候,却报错误,如下所示:
mpicc -g hello_c.c -o hello_c hello_c.c: In function ‘main’: hello_c.c:16:18: error: ‘MPI_MAX_LIBRARY_VERSION_STRING’ undeclared (first use in this function) char version[MPI_MAX_LIBRARY_VERSION_STRING]; ^ hello_c.c:16:18: note: each undeclared identifier is reported only once for each function it appears in make: *** [hello_c] Error 1说明:暂时还没有找到解决方案,换成openmpi-1.8.4后,便可以正常使用了。需要说明的是如果是以root账户运行程序,那么mpirun
--allow-run-as-root -np 8 hello_c即可。
2. mpic++命令
解析:
(1)mpic++ -showme:version
eg: mpic++: Open MPI 1.8.4 (Language: C++)
(2)mpic++ -showme
eg: g++ -I/usr/local/openmpi/include -pthread -Wl,-rpath -Wl,/usr/local/openmpi/lib -Wl,--enable-new-dtags -L/usr/local/openmpi/lib -lmpi_cxx -lmpi
(3)mpic++ -showme:libdirs
eg: /usr/local/openmpi/lib
(4)mpic++ -showme:libs
eg: mpi_cxx mpi
3. Nsight Eclipse Edition开发OpenMPI应用程序
主要是配置GCC C Linker中的Libraries。如下所示:
编译和链接程序的时候没有报错,但是执行程序的时候却报错error while loading shared libraries: libmpi_cxx.so.1: cannot open shared object file: No such file or directory。解决的方案是将/usr/local/openmpi/lib添加到/usr/local/openmpi/lib中,然后执行命令ldconfig,最后重新执行程序正常运行。
参考文献:
[1] ubuntu下安装openMPI:http://blog.csdn.net/swuteresa/article/details/9405383
相关文章推荐
- Ubuntu 默认壁纸历代记
- Ubuntu Remix Cinnamon 20.04 评测:Ubuntu 与 Cinnamon 的完美融合
- 关于Ubuntu 11.10启动提示waiting for the network configuration的问题
- 在 Ubuntu 桌面中使用文件和文件夹
- ubuntu下chrome无法同步问题解决
- Ubuntu Linux使用体验
- 使用 GNOME 优化工具自定义 Linux 桌面的 10 种方法
- 以Ubuntu 9.04为例 将工作环境迁移到 Linux
- VirtualBox虚拟机XP与宿主机Ubuntu互访共享文件夹
- 从USB安装Ubuntu Server 10.04.3 图文详解
- Ubuntu 15.04 正式版发布下载
- Linux-Ubuntu 10.04安装Cadence-ic610 方法总结图解
- MyEclipse Web Project转Eclipse Dynamic Web Project
- Windows Clang开发环境备忘
- Ubuntu 12.04和Windows 7双系统安装图解
- Ubuntu /home下中文目录如何修改成英文?
- 开机出现:grub rescue的修复方法
- Ubuntu连接Android真机调试
- 你应该选择 Ubuntu 还是 Fedora?
- 100 个最佳 Ubuntu 应用(中)