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查看,没有依赖库文件的安装。

但看其报错,的确为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的,当时没用给卸了,到如今装不上了, - -!!!

 

如下是我同事的记录,思路比我清晰,BLOG写得比我好,嫉妒羡慕恨!!!

  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