我试图复制pyLearn2文档中的教程示例。当我运行
python make_dataset.py
,在这个例子中,我得到这个错误:编译错误ld:在MacOSX中未找到-lgcc_ext库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
从引用:/System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
预计于:
/usr/local/lib/libjpeg.8.dylib
我可以在命令行中输入
matplotlib
和python中的图像。有人能帮我理解它在抱怨什么,以及如何解决错误?的另一个问题(其可以或可以不涉及到上面的问题)为连接错误编译期间发生与下面的命令行
问题:
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)]')
我上运行
pyLearn2
Mac OSX Mavericks。我不知道如何修复错误:库似乎是在我的系统在几个地方:/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
我不知道哪一个链接,以及如何我应该链接。
我已更改(添加)到
DYLD_LIBRARY_PATH
的路径,但未解决问题。任何帮助将不胜感激。
回答
看起来one possible solution是手动创建一个链接到名为.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.
另一个用户建议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.
- 1. LD:库找不到-lgcc_ext.10.5
- 2. 编译器错误(ld:找不到-lzbar的库)
- 3. XCode编译器错误:ld:库找不到-loauth
- 4. Xcode编译器错误:ld:库找不到-lPods
- 5. lfs glibc编译ld错误
- 6. Ubuntu中的编译错误:/ usr/bin/ld:找不到-llog
- 7. 在编译caffe时出现ld错误:找不到libpng和libgfortran,共享库
- 8. 静态库和cocoapods与Xcode 6.1.1 - ld:库未找到错误
- 9. 编译R包samr时出错:`ld:找不到-lgfortran的库
- 10. 编译时未找到库
- 11. CPP编译错误:包含未找到
- 12. WCF编译错误:未找到Microsoft.VisualStudio.ServiceModel.targets
- 13. gcc编译错误cv.h未找到Opencv
- 14. OCaml编译错误:/ usr/bin/ld:找不到-lstr
- 15. GCC编译错误:/ usr/bin/ld:找不到-lsqlite3.lib
- 16. xcode 4错误:ld:库找不到-lSystem.B
- 17. 的Xcode错误:LD:库找不到-lgomp
- 18. Libhand库编译错误找不到-lNOTFOUND
- 19. 编译错误:找不到库
- 20. Xcode编译器错误:“未找到-lavutil库”
- 21. oprofile的二进制编译错误 - (未找到自由库)
- 22. ld:解压缩后未找到库
- 23. ld:找不到库
- 24. 在MacOSX上编译coverage.py时出错
- 25. 错误:库“libGL”未找到
- 26. CMake:编译OpenCV时未找到CUDA库
- 27. 编译zabbix-server时未找到z库
- 28. 玩!框架编译错误 - 未找到:值编号
- 29. 如何处理符号未找到java中的编译错误?
- 30. 得到错误在编译的ffmpeg库