編譯Imagemagick出錯

  1. 編譯ImageMagick-6.6.9-1 出錯
  2.  
  3. -L/usr/lib utilities/animate.o magick/libMagick.la wand/libWand.la
  4. magick/.libs/libMagick.so: undefined reference to `_intel_fast_memset'
  5. magick/.libs/libMagick.so: undefined reference to `_intel_fast_memcpy'
  6. collect2: ld returned 1 exit status
  7. make: *** [utilities/animate] Error 1

 

初期認爲是依賴lib庫沒有所致,用yum install ImageMagick查看,沒有依賴庫文件的安裝。php

但看其報錯,的確爲lib庫相似錯誤,期間和同事一塊兒搞,yum 安裝全部lib庫,結果仍是報錯。終於在谷歌大神的幫助下找到一個錯誤的記錄。(搜索intel_fast_memcpy出現的

  1. DBD-mysql Install Error: undefined symbol: _intel_fast_memcpy

  2. If you get undefined symbol: _intel_fast_memcpy when trying to install the perl mysql database driver, then your system is looking within your $PATH for a mysql that is linked against the Intel C Compiler. You will need to install the Intel ICC9 libraries from here (MySQL.com).

  3. First download intel-icc9-libs-9.0-i386.tar.gz (replace i386 with your architecture!). I put mine in /usr/local/intel and then linked them in from a /etc/ld.so.conf.d. After that you can compile the CPAN module by specifying the path to the icc libs. Here are the steps:


  4. mv intel-icc9-libs-9.0-i386.tar.gz /usr/local/
  5. cd /usr/local
  6. tar -zxvf intel-icc9-libs-9.0-i386.tar.gz
  7. ln -s intel-icc9-libs-9.0-i386 intel
  8. echo "/usr/local/intel" > /etc/ld.so.conf.d/intel.conf
  9. echo "/usr/local/lib" > /etc/ld.so.conf.d/local.conf (if it doesnt exist already!)
  10. ldconfig

  11. Then build the module:

  12. cd /path/to/DBD-mysql-foo.version
  13. perl Makefile.PL --cflags='-I/usr/local/mysql/include' --libs='-L/usr/local/mysql/lib -lmysqlclient -lz -lcrypt -lnsl -lm -L/usr/local/intel -lirc'
  14. make
  15. make install

按以上方法搞下,加載了intel_icc9_lib結果沒戲,該報錯,還報錯。
同時同事從另外方向想的換intel編譯器,結果成功。可有些服務器沒有intel編譯器,同樣能夠安裝。通過從新安裝一個服務器一樣centos 5.5 32位系統,安裝全部開發包都裝上。直接編譯安裝成功。此事件持續3天,教訓爲安裝系統必定把開發包都裝上,不用的軟件就別裝。後來聽研發說是機器在他們使用時RPM安裝了Imagemagick的,當時沒用給卸了,到現在裝不上了, - -!!!css

 

以下是我同事的記錄,思路比我清晰,BLOG寫得比我好,嫉妒羨慕恨!!!mysql

  1. 編譯ImageMagick-6.2.8 出錯
  2.  
  3. -L/usr/lib utilities/animate.o magick/libMagick.la wand/libWand.la
  4. magick/.libs/libMagick.so: undefined reference to `_intel_fast_memset'
  5. magick/.libs/libMagick.so: undefined reference to `_intel_fast_memcpy'
  6. collect2: ld returned 1 exit status
  7. make: *** [utilities/animate] Error 1
  8.  
  9. 更換ImageMagick-6.6.9.1版本也是相同問題
  10. 1.首先想到的是動態庫的連接問題
  11.   試着加載庫
  12.  
  13. #ldconfig
  14. ldconfig: /usr/lib/libmysqlclient_r.so.16 is not a symbolic link
  15. ldconfig: /usr/lib/libirc.so is not a symbolic link
  16. ldconfig: /usr/lib/libmysqlclient.so.16 is not a symbolic link
  17.  
  18. 解決:
  19.   這事由於動態連接庫沒有鏈接
  20. 作個鏈接就好了
  21. 如:
  22. ldconfig -v | grep libmysqlclient.so.16
  23.  
  24.  libmysqlclient.so.16 -> libmysqlclient.so.16
  25.  ldconfig: /usr/lib/libmysqlclient.so.16 is not a symbolic link
  26.  libmysqlclient.so.16 -> libmysqlclient.so.16.0.0
  27.  
  28. 作鏈接
  29.   ln -s /usr/lib/libmysqlclient.so.16 /usr/lib/libmysqlclient.so.16.0.0
  30.  
  31. 在運行ldconfig 就行了
  32.  
  33. 可是make 仍是報錯
  34.  
  35. 進行下一步
  36.  
  37. 2.查看so 文件信息
  38. #file /usr/lib/libMagick.so
  39. /usr/lib/libMagick.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), not stripped
  40.  
  41. intel 官方解釋:由於系統的問題
  42.  
  43. When linked against the static library ( as opposed to the shared library), the example ran fine.
  44. The .o files that make up the .so were all compiled -fPIC
  45. The 'file' command for .so shows
  46.  
  47. ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), not stripped
  48. Clearly I am missing some when using a 32 shared library on 64 bit Linux.
  49.  
  50. 可是我自己就是32位的系統啊
  51.  
  52. 3.還有一種說法

  53. The symbol intel_fast_memcpy is defined in Intel support library : libirc.lib and libircmt.lib.
  54. 原文:
  55. http://software.intel.com/zh-cn/forums/showthread.php?t=79868&p=1&wapkw=%28_intel_fast_memcpy%29
  56.      編譯器自動將memcpy替換成了_intel_fast_memcpy,咱們在生成動態連接庫的時候,若是使用icc、icpc或xild連接,a.so會依賴於一些intel的庫,其中的/opt/intel/composerxe-2011.2.137/compiler/lib /intel64/libintlc.so.5就包含這個函數的定義。而gcc是不知道a.o是依賴於icc的庫的,若是用gcc生成.so,在使用該 so的時候,天然會報undefined symbol _intel_fast_memcpy。
  57.  
  58. 4.查看gcc庫安裝路徑
  59.  
  60. g++ -print-search-dirs
  61.  
  62. 5.暫時找不到其餘解決方法了,只能試試咯
  63.  
  64. 下載一個G的icc 軟件包吧,將系統環境改成intel支持的icc試試。
  65. 下載icc 軟件包l_cproc_p_11.1.073.tgz
  66. 網址:http://registrationcenter-download.intel.com/akdlm/irc_nas/1924/l_cproc_p_11.1.073.tgz
  67.  
  68. 5.1安裝
  69. 在intel網站 http://software.intel.com/en-us/articles/non-commercial-software-download/ 能夠申請到非商用版的序列號.
  70. #安裝須要的庫
  71. yum -y install man which gcc gcc-c++ compat-libstdc++-33
  72. 安裝icc包
  73. tar zxvf ./l_cproc_p_11.1.073.tgz
  74. cd ./l_cproc_p_11.1.073
  75. ./install.sh
  76. #而後就是按照嚮導一步步進行安裝了,默認安裝到opt下。
  77. 安裝的時候須要註冊,或是直接用免費30天。
  78. 本身看着選項慢慢選吧。
  79. 設置selinux
  80. #selinux 設置爲disabled 至少也要設置爲 permissive 通常centos默認設置爲SELINUX=enforcing
  81. #設置SELINUX爲premissive
  82. #sed -i 's/^SELINUX=.*$/SELINUX=permissive/' /etc/selinux/config
  83. #直接關閉 SELINUX 最後須要重啓
  84. #sed -i 's/^SELINUX=.*$/SELINUX=disabled/' /etc/selinux/config
  85. #不重啓對selinux 進行設置 保證安裝順利
  86.  
  87. 設置支持系統編譯環境
  88. /opt/intel/Compiler/11.1/073/bin/iccvars.sh -help
  89. ERROR: Unknown switch '-help'. Accepted values: ia32, intel64, ia64
  90. 支持ia32, intel64, ia64 位數
  91. 假如你的系統是64位,那麼就執行下面的命令
  92. source /opt/intel/Compiler/11.1/073/bin/iccvars.sh intel64
  93. 個人系統是32位的,因此我執行下面的命令
  94. source /opt/intel/Compiler/11.1/073/bin/iccvars.sh ia32
  95. #添加環境變量
  96. cat >> ~/.bash_profile <<EOF
  97. #set the ICC environment variables
  98. source /opt/intel/Compiler/11.1/073/bin/iccvars.sh ia32
  99. EOF
  100.  
  101. #馬上啓用這些環境變量
  102. source /opt/intel/Compiler/11.1/073/bin/iccvars.sh ia32
  103. 設置環境變量
  104. 將系統默認的gcc編譯器改成intel的icc,在shell下執行下面的命令
  105.  export CC=icc
  106.  export FC=ifort
  107.  
  108. 而後再從新安裝ImageMagick-6.6.9-1
  109. ./configure --prefix=/usr/local/ImageMagick
  110.  
  111. 出現上面 花圈的地方說明如今的編譯器位icc
  112. 而後安裝
  113. make && make install
  114. 測試
  115. bin]# ./convert --version
  116. Version: ImageMagick 6.6.9-1 2011-04-02 Q16 http://www.p_w_picpathmagick.org
  117. Copyright: Copyright (C) 1999-2011 ImageMagick Studio LLC
  118. Features: OpenMP
  119.  
  120. 出現上面的紅色部分,說明安裝成功。
  121. 同事給的一個鏈接也是出現相同的問題,可是我這就不行,我也列這方便查找吧。

  122. 找了一個別人裝db時一個錯誤記錄或許有幫助,那就繼續吧
  123. DBD-mysql Install Error: undefined symbol: _intel_fast_memcpy
  124.  
  125. If you get undefined symbol: _intel_fast_memcpy when trying to install the perl mysql database driver, then your system is looking within your $PATH for a mysql that is linked against the Intel C Compiler. You will need to install the Intel ICC9 libraries from here (MySQL.com).
  126.  
  127. First download intel-icc9-libs-9.0-i386.tar.gz (replace i386 with your architecture!). I put mine in /usr/local/intel and then linked them in from a /etc/ld.so.conf.d. After that you can compile the CPAN module by specifying the path to the icc libs. Here are the steps:
  128.  
  129.  
  130. mv intel-icc9-libs-9.0-i386.tar.gz /usr/local/
  131. cd /usr/local
  132. tar -zxvf intel-icc9-libs-9.0-i386.tar.gz
  133. ln -s intel-icc9-libs-9.0-i386 intel
  134. echo "/usr/local/intel" > /etc/ld.so.conf.d/intel.conf
  135. echo "/usr/local/lib" > /etc/ld.so.conf.d/local.conf (if it doesnt exist already!)
  136. ldconfig
  137.  
  138. Then build the module:
  139.  
  140. cd /path/to/DBD-mysql-foo.version
  141. perl Makefile.PL --cflags='-I/usr/local/mysql/include' --libs='-L/usr/local/mysql/lib -lmysqlclient -lz -lcrypt -lnsl -lm -L/usr/local/intel -lirc'
  142. make
  143. make install
相關文章
相關標籤/搜索