1

我继承了一个使用 boost mpi for python 的大型 python 系统。所以我从源代码构建了 boost 1.52,包括 mpi 和 python 组件。

我已经从http://mathema.tician.de/software/boostmpi为 python 1.38.0.1 构建了 boost mpi 。我意识到有更新的库(mpi4py),但我继承的软件使用了 boost mpi。

当我尝试使用它时,我得到...

$ python
Python 2.7.3 (default, Jan  4 2013, 14:54:17) 
[GCC 4.1.2 20080704 (Red Hat 4.1.2-50)] on linux2
Type "help", "copyright", "credits" or "license" for more information.

>>> import boostmpi
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/projects/nrel/cid/lada.2013/pkgi/lib/python2.7/site-packages/boostmpi-1.38.0.1-py2.7-linux-x86_64.egg/boostmpi/__init__.py", line 7, in <module>
    from boostmpi._internal import *
ImportError: /projects/nrel/cid/lada.2013/pkgi/lib/python2.7/site-packages/boostmpi-1.38.0.1-py2.7-linux-x86_64.egg/boostmpi/_internal.so: undefined symbol: _ZN5boost3mpi5timer14time_is_globalEv

>>> from boostmpi._internal import *
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/projects/nrel/cid/lada.2013/pkgi/lib/python2.7/site-packages/boostmpi-1.38.0.1-py2.7-linux-x86_64.egg/boostmpi/__init__.py", line 7, in <module>
    from boostmpi._internal import *
ImportError: /projects/nrel/cid/lada.2013/pkgi/lib/python2.7/site-packages/boostmpi-1.38.0.1-py2.7-linux-x86_64.egg/boostmpi/_internal.so: undefined symbol: _ZN5boost3mpi5timer14time_is_globalEv

我怎样才能解决这个问题?

使用 ldd 进行测试:

$ ldd /projects/nrel/cid/lada.2013/pkgi/lib/python2.7/site-packages/boostmpi-1.38.0.1-py2.7-linux-x86_64.egg/boostmpi/_internal.so  libboost_python.so.1.52.0 => /projects/nrel/cid/lada.2013/pkgi/lib/libboost_python.so.1.52.0 (0x00002b0e45542000)
    libmpi_cxx.so.0 => /apps/x86_64/mpi/openmpi/intel-11.1-f064-c064/openmpi-1.4.2_oobpr/lib/libmpi_cxx.so.0 (0x00002b0e45795000)
    libmpi.so.0 => /apps/x86_64/mpi/openmpi/intel-11.1-f064-c064/openmpi-1.4.2_oobpr/lib/libmpi.so.0 (0x00002b0e459bb000)
    libopen-rte.so.0 => /apps/x86_64/mpi/openmpi/intel-11.1-f064-c064/openmpi-1.4.2_oobpr/lib/libopen-rte.so.0 (0x00002b0e45e94000)
    libopen-pal.so.0 => /apps/x86_64/mpi/openmpi/intel-11.1-f064-c064/openmpi-1.4.2_oobpr/lib/libopen-pal.so.0 (0x00002b0e46162000)
    librdmacm.so.1 => /usr/lib64/librdmacm.so.1 (0x00002b0e463ef000)
    libibverbs.so.1 => /usr/lib64/libibverbs.so.1 (0x00002b0e465f5000)
    libpsm_infinipath.so.1 => /usr/lib64/libpsm_infinipath.so.1 (0x00002b0e46802000)
    libnuma.so.1 => /usr/lib64/libnuma.so.1 (0x00002b0e46a4c000)
    libdl.so.2 => /lib64/libdl.so.2 (0x00002b0e46c6a000)
    libnsl.so.1 => /lib64/libnsl.so.1 (0x00002b0e46e6e000)
    libutil.so.1 => /lib64/libutil.so.1 (0x00002b0e47086000)
    libmpi_f77.so.0 => /apps/x86_64/mpi/openmpi/intel-11.1-f064-c064/openmpi-1.4.2_oobpr/lib/libmpi_f77.so.0 (0x00002b0e4728a000)
    libimf.so => /projects/global/x86_64/compilers/intel/intel-11.1-cproc-064/lib/intel64/libimf.so (0x00002b0e474cb000)
    libm.so.6 => /lib64/libm.so.6 (0x00002b0e4785d000)
    libsvml.so => /projects/global/x86_64/compilers/intel/intel-11.1-cproc-064/lib/intel64/libsvml.so (0x00002b0e47ae1000)
    libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00002b0e47cf7000)
    libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00002b0e47ff7000)
    libintlc.so.5 => /projects/global/x86_64/compilers/intel/intel-11.1-cproc-064/lib/intel64/libintlc.so.5 (0x00002b0e48206000)
    libpthread.so.0 => /lib64/libpthread.so.0 (0x00002b0e48343000)
    libc.so.6 => /lib64/libc.so.6 (0x00002b0e4855e000)
    librt.so.1 => /lib64/librt.so.1 (0x00002b0e488b7000)
    libinfinipath.so.4 => /usr/lib64/libinfinipath.so.4 (0x00002b0e48ac0000)
    /lib64/ld-linux-x86-64.so.2 (0x00002b0e45021000)
4

2 回答 2

1

您错误地构建了您的库。您的 boostmpi/_internal.so 要么未链接到某些 boost-mpi 库,要么期望与您拥有的版本不同。您可以使用

ldd /projects/nrel/cid/lada.2013/pkgi/lib/python2.7/site-packages/boostmpi-1.38.0.1-py2.7-linux-x86_64.egg/boostmpi/_internal.so

检查正在加载的库(如果有的话)。

于 2013-01-11T01:24:07.343 回答
1

这是你的问题

boostmpi-1.38.0.1-py2.7-linux-x86_64.egg/boostmpi/_internal.so  libboost_python.so.1.52.0 => /projects/nrel/cid/lada.2013/pkgi/lib/libboost_python.so.1.52.0 

boostmpi-1.38.0

libboost_python.1.52.0

你必须修复你的路径它拾取两个不同版本的提升,

于 2013-01-11T05:57:13.570 回答