精简版
我有需要在本地运行的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.!
长版
我有需要在本地运行的CUDA代码。因此,我正在尝试在the OpenMPI directions之后安装OpenMPI。我将tar存储为
~/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_log1和install_log_take1。当我尝试使用我的makefile makefile.ulfhednar
make
我的代码时,$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_log2和install_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,pastebin不接受它们,因为它们太大了。
我究竟做错了什么?请帮忙! S.O.S.!
最佳答案
我找到了解决方案!!!
我登录到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与Intel Composer编译器一起使用,这导致了权限问题。我按照找到的here安装说明进行操作,但是在尝试安装时遇到了同样的问题。问题是链接器
ld
“找不到”正确的库,因为调用$LD_LIBRARY_PATH
时sudo
变量中不再提供这些库。避免这种情况的唯一方法是登录到root
用户并将$LD_LIBRARY_PATH
变量设置为与普通用户相同。我已经坚持了好几天,而现在我已经为它跳出来而高兴了!我希望这对以后的人有所帮助。