mxnet/mxnet/python/mxnet/../../lib/libmxnet.so: 未定义符号: cblas_ddot

mxnet/mxnet/python/mxnet/../../lib/libmxnet.so: undefined symbol: cblas_ddot

我试过如下安装mxnet: 操作系统: RHEL 6.9 (2.6.32-696.el6.x86_64) 编译器: gcc (GCC) 5.3.0 也尝试使用 6.2.0

一个。 OpenBLAS 构建为

 1. git clone https://github.com/xianyi/OpenBLAS.git
 2. cd OpenBLAS
 3. make DYNAMIC_ARCH=1 NO_AVX2=1
 4. make PREFIX=~/test/OpenBLAS-1.0 install

乙。 mxnet 安装

 1. git clone --recursive https://github.com/dmlc/mxnet
 2. cd mxnet
 3. modified make/config.mk as follows
    USE_OPENCV = 0  
    USE_BLAS = openblas (#Line no : 93) 
    ADD_LDFLAGS = -I/home_dir/test/OpenBLAS-1.0/lib
    ADD_CFLAGS =  -I/home_dir/test/OpenBLAS-1.0/include

 4. make -j4 #It successfully created lib dir  containing libmxnet.a and libmxnet.so

然后将 PYTHONPATH 导出为 export

`PYTHONPATH=~/test/mxnet/python/`

在交互模式下 运行 python 之后出现以下错误:

[c244728_lx@brainiac-login-0001 lib]$ python --version
Python 3.5.1
[c244728_lx@brainiac-login-0001 lib]$ python
Python 3.5.1 (default, Mar  2 2016, 08:58:17)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-11)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import mxnet
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/c244728_lx/test/mxnet/python/mxnet/__init__.py", line 25, in <module>
    from .base import MXNetError
  File "/home/c244728_lx/test/mxnet/python/mxnet/base.py", line 86, in <module>
    _LIB = _load_lib()
  File "/home/c244728_lx/test/mxnet/python/mxnet/base.py", line 78, in _load_lib
    lib = ctypes.CDLL(lib_path[0], ctypes.RTLD_LOCAL)
  File "/lrlhps/apps/python/python-3.5.1/lib/python3.5/ctypes/__init__.py", line 347, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: /home/c244728_lx/test/mxnet/python/mxnet/../../lib/libmxnet.so: undefined symbol: cblas_ddot
>>>

更多说明请关注: github issue

指定

make -j8 ADD_CFLAGS="-I/home_dir/OpenBLAS_build/include" ADD_LDFLAGS="-L/home_dir/OpenBLAS_build/lib -lopenblas"

和导出路径

LD_LIBRARY_PATH=/OpenBLAS_build/lib:$LD_LIBRARY_PATH

解决了问题。