在本地安装OpenMPI以与CUDA一起使用时出现问题

问题描述 投票:0回答:1

Short Version

我有需要在本地运行的CUDA代码。因此,我试图在the OpenMPI directions之后安装OpenMPI。当我尝试make我的代码,我收到very long error output,类似于OpenMPI documentation描述。我尝试使用文档的建议修复程序重新安装OpenMPI,但现在我在安装过程中遇到了这些错误:

Making all in tools/ompi_info
make[2]: Entering directory '/home/hatfull/Downloads/openmpi-2.1.1/ompi/tools/ompi_info'
  CC       ompi_info.o
  CC       param.o
  CCLD     ompi_info
ld: warning: libimf.so, needed by ../../../ompi/.libs/libmpi.so, not found (try using -rpath or -rpath-link)
ld: warning: libsvml.so, needed by ../../../ompi/.libs/libmpi.so, not found (try using -rpath or -rpath-link)
ld: warning: libirng.so, needed by ../../../ompi/.libs/libmpi.so, not found (try using -rpath or -rpath-link)
ld: warning: libintlc.so.5, needed by ../../../ompi/.libs/libmpi.so, not found (try using -rpath or -rpath-link)
ld: .libs/ompi_info: hidden symbol `__intel_cpu_features_init_x' in /opt/intel/compilers_and_libraries_2017.4.196/linux/compiler/lib/intel64_lin/libirc.a(cpu_feature_disp.o) is referenced by DSO
ld: final link failed: Bad value
Makefile:1785: recipe for target 'ompi_info' failed
make[2]: *** [ompi_info] Error 1
make[2]: Leaving directory '/home/hatfull/Downloads/openmpi-2.1.1/ompi/tools/ompi_info'
Makefile:3353: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/hatfull/Downloads/openmpi-2.1.1/ompi'
Makefile:1806: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1

我究竟做错了什么?请帮忙! S.O.S.!

Long Version

我有需要在本地运行的CUDA代码。因此,我试图在the OpenMPI directions之后安装OpenMPI。我把焦油存储为~/Downloads/openmpi-2.1.1.tar.gz。好吧,我跑了

$gunzip -c openmpi-2.1.1.tar.gz | tar xf -
$cd openmpi-2.1.1
$./configure --prefix=/opt/openmpi-2.1.1 &> configure_log1
$sudo make all install &> install_log_take1

成功。请注意,我改变了--prefix=/usr/local--prefix=/opt/openmpi-2.1.1的方向。我加入了configure_log1install_log_take1

当我尝试使用我的makefile make makefile.ulfhednar我的代码时,

$make -f makefile.ulfhednar clean
$make -f makefile.ulfhednar &> make_log1

我在make_log1中收到一个非常长的错误输出,看起来类似于OpenMPI documentation所描述的。它说解决方案是使用配置选项“./configure CC=icc CXX=icpc F77=ifort FC=ifort ...”安装OpenMPI,所以我重新安装使用命令,

$cd ~/Downloads/openmpi-2.1.1
$sudo make uninstall
$sudo rm -r /opt/openmpi-2.1.1
$cd ..
$sudo rm -r openmpi-2.1.1

$gunzip -c openmpi-2.1.1.tar.gz | tar xf -
$cd openmpi-2.1.1

$which icc
/opt/intel/compilers_and_libraries_2017.4.196/linux/bin/intel64/icc
$which icpc
/opt/intel/compilers_and_libraries_2017.4.196/linux/bin/intel64/icpc
$which ifort
/opt/intel/compilers_and_libraries_2017.4.196/linux/bin/intel64/ifort

$./configure --prefix=/opt/openmpi-2.1.1 CC=/opt/intel/compilers_and_libraries_2017.4.196/linux/bin/intel64/icc CXX=/opt/intel/compilers_and_libraries_2017.4.196/linux/bin/intel64/icpc F77=/opt/intel/compilers_and_libraries_2017.4.196/linux/bin/intel64/ifort FC=/opt/intel/compilers_and_libraries_2017.4.196/linux/bin/intel64/ifort &> configure_log2
$sudo make all install &> install_log_take2

这是configure_log2install_log_take2。在install_log_take2中值得注意的是以下几行:

Making all in tools/ompi_info
make[2]: Entering directory '/home/hatfull/Downloads/openmpi-2.1.1/ompi/tools/ompi_info'
  CC       ompi_info.o
  CC       param.o
  CCLD     ompi_info
ld: warning: libimf.so, needed by ../../../ompi/.libs/libmpi.so, not found (try using -rpath or -rpath-link)
ld: warning: libsvml.so, needed by ../../../ompi/.libs/libmpi.so, not found (try using -rpath or -rpath-link)
ld: warning: libirng.so, needed by ../../../ompi/.libs/libmpi.so, not found (try using -rpath or -rpath-link)
ld: warning: libintlc.so.5, needed by ../../../ompi/.libs/libmpi.so, not found (try using -rpath or -rpath-link)
ld: .libs/ompi_info: hidden symbol `__intel_cpu_features_init_x' in /opt/intel/compilers_and_libraries_2017.4.196/linux/compiler/lib/intel64_lin/libirc.a(cpu_feature_disp.o) is referenced by DSO
ld: final link failed: Bad value
Makefile:1785: recipe for target 'ompi_info' failed
make[2]: *** [ompi_info] Error 1
make[2]: Leaving directory '/home/hatfull/Downloads/openmpi-2.1.1/ompi/tools/ompi_info'
Makefile:3353: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/hatfull/Downloads/openmpi-2.1.1/ompi'
Makefile:1806: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1

抱歉,我必须将所有日志文件上传到mediafire,因为它们太大,所以不接受它们。

我究竟做错了什么?请帮忙! S.O.S.!

c++ makefile ubuntu-16.04 openmpi
1个回答
1
投票

我找到了解决方案!

我登录root并在不使用sudo的情况下完成了安装步骤。

#gunzip -c openmpi-2.1.1.tar.gz | tar xf -
#cd openmpi-2.1.1
#./configure --prefix=/opt/openmpi-2.1.1 CC=icc CXX=icpc FC=ifort
#make all install

我试图将OpenMPI与英特尔Composer编译器一起使用,这导致了权限问题。我按照here发现的安装说明进行了操作,但是我在尝试安装时遇到了同样的问题。问题是链接器ld“找不到”正确的库,因为当调用$LD_LIBRARY_PATH时,sudo变量中不再提供这些库。避免这种情况的唯一方法是登录root用户并将$LD_LIBRARY_PATH变量设置为与普通用户相同。

我已经被困在这几天了,现在它已经整理好了!我希望将来可以帮助别人。

© www.soinside.com 2019 - 2024. All rights reserved.