2017-08-09 60 views
0

我試圖如下安裝mxnet: 操作系統: RHEL 6.9(2.6.32-696.el6 .x86_64) 編譯: 海合會(GCC)5.3.0也試圖與6.2.0mxnet/mxnet /蟒/ mxnet /../../ LIB/libmxnet.so:未定義符號:cblas_ddot

A. 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 

B. 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作爲出口

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

在交互模式下,我得到了下面的錯誤運行蟒蛇後:

[[email protected] lib]$ python --version 
Python 3.5.1 
[[email protected] 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

回答

1

指定 使-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 解決了這個問題。