2014-06-27 18 views
5
  1. Tôi đang cố gắng để tái tạo một ví dụ hướng dẫn trong tài liệu pyLearn2. Khi tôi chạy python make_dataset.py, trong ví dụ này, tôi đã nhận lỗi này:Compilation lỗi ld: thư viện không tìm thấy cho -lgcc_ext trong MacOSX

    11:17 $ python make_dataset.py 
    
    /Users/user/pylearn2/pylearn2/utils/image.py:16: UserWarning: Unable to import matplotlib. Some features unavailable. Original exception: dlopen(/Library/Python/2.7/site-packages/matplotlib-1.4.x-py2.7-macosx-10.9-intel.egg/matplotlib/backends/_macosx.so, 2): Symbol not found: __cg_jpeg_resync_to_restart 
    

    tham chiếu từ: /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO

    Dự kiến ​​trong: /usr/local/lib/libjpeg.8.dylib

    Tôi có thể nhập matplotlib và hình ảnh trong python trong dòng lệnh. Ai đó có thể giúp tôi hiểu những gì nó đang phàn nàn và cách sửa lỗi?

  2. Một vấn đề khác (mà có thể hoặc không thể liên quan đến vấn đề trên) là một lỗi liên kết

    Vấn đề xảy ra trong biên soạn với các dòng lệnh dưới đây:

    g++ -dynamiclib -g -O3 -fno-math-errno -Wno-unused-label -Wno-unused-variable -Wno-write-strings -march=core-avx-i -mmmx -mno-3dnow -msse -msse2 -msse3 -mssse3 -mno-sse4a -mcx16 -msahf -mno-movbe -maes -mpclmul -mpopcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mavx -mno-avx2 -msse4.2 -msse4.1 -mno-lzcnt -mno-rtm -mno-hle -mrdrnd -mf16c -mfsgsbase -mno-rdseed -mno-prfchw -mno-adx -mfxsr -mxsave -mxsaveopt -mno-avx512f -mno-avx512er -mno-avx512cd -mno-avx512pf --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=6144 -mtune=core-avx-i -D NPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -m64 -fPIC -undefined dynamic_lookup -I/Library/Python/2.7/site-packages/numpy-1.9.0.dev_297f54b-py2.7-macosx-10.9-intel.egg/numpy/core/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -o /Users/user/.theano/compiledir_Darwin-13.2.0-x86_64-i386-64bit-i386-2.7.5-64/tmpBdy9w9/49d70155ef39a124cbfa83c600416644.so /Users/user/.theano/compiledir_Darwin-13.2.0-x86_64-i386-64bit-i386-2.7.5-64/tmpBdy9w9/mod.cpp -L/System/Library/Frameworks/Python.framework/Versions/2.7/lib 
    
    ld: library not found for -lgcc_ext.10.5 
    
    collect2: error: ld returned 1 exit status 
    
    Exception: ('The following error happened while compiling the node', InplaceDimShuffle{x,0}(mean), '\n', 'Compilation failed (return status=1): ld: library not found for -lgcc_ext.10.5. collect2: error: ld returned 1 exit status. ', '[InplaceDimShuffle{x,0}(mean)]') 
    

    Tôi đang chạy pyLearn2 trên Mac OSX Mavericks. Tôi không chắc chắn làm thế nào để sửa lỗi: thư viện có vẻ là trong hệ thống của tôi ở một số nơi:

    /usr/local/Cellar/gcc47/4.7.3/lib/gcc/x86_64-apple-darwin13.0.0/4.7.3/libgcc_ext.10.5.dylib 
    /usr/local/Cellar/gfortran/4.8.2/gfortran/lib/libgcc_ext.10.5.dylib 
    /usr/local/lib/gcc/x86_64-apple-darwin13.0.0/4.7.3/libgcc_ext.10.5.dylib 
    

    Tôi không chắc chắn mà một trong những liên kết và làm thế nào tôi nên liên kết.

    Tôi đã thay đổi (thêm) đường dẫn đến DYLD_LIBRARY_PATH không khắc phục được sự cố.

    Mọi trợ giúp sẽ được đánh giá cao.

Trả lời

0

Dường như one possible solution là để tự tạo một liên kết đến tập tin .dylib:

sudo ln -sf /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib /opt/local/lib/libGL.dylib

sudo ln -sf /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libPng.dylib /opt/local/lib/libpng.dylib

sudo ln -sf /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libTIFF.dylib /opt/local/lib/libtiff.dylib

sudo ln -sf /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libJPEG.dylib /opt/local/lib/libjpeg.dylib

Why does this work? Because for whatever reason, when Apple requests libJPEG.dyld, whatever system searches for it finds /opt/local/lib/libjpeg.dyld because the search is case insensitive. For a Unix operating system. Go figure. The lines above will force any program looking for libjpeg.dyld to be redirected to Apple's libJPEG.dyld.

Một người dùng khác đề nghị setting DYLD_FALLBACK_LIBRARY_PATH:

You could also use DYLD_FALLBACK_LIBRARY_PATH. I had to use that to avoid Apple's libJPEG getting in the way of apps that expected the libjpeg port. See the man page for dlopen() for details.

Các vấn đề liên quan