- 编译ImageMagick-6.6.9-1 出错
-
- -L/usr/lib utilities/animate.o magick/libMagick.la wand/libWand.la
- magick/.libs/libMagick.so: undefined reference to `_intel_fast_memset'
- magick/.libs/libMagick.so: undefined reference to `_intel_fast_memcpy'
- collect2: ld returned 1 exit status
- make: *** [utilities/animate] Error 1
初期认为是依赖lib库没有所致,用yum install ImageMagick查看,没有依赖库文件的安装。
但看其报错,的确为lib库类似错误,期间和同事一起搞,yum 安装所有lib库,结果还是报错。终于在谷歌大神的帮助下找到一个错误的记录。(搜索intel_fast_memcpy出现的)- DBD-mysql Install Error: undefined symbol: _intel_fast_memcpy
-
- 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).
-
- 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:
-
-
- mv intel-icc9-libs-9.0-i386.tar.gz /usr/local/
- cd /usr/local
- tar -zxvf intel-icc9-libs-9.0-i386.tar.gz
- ln -s intel-icc9-libs-9.0-i386 intel
- echo "/usr/local/intel" > /etc/ld.so.conf.d/intel.conf
- echo "/usr/local/lib" > /etc/ld.so.conf.d/local.conf (if it doesnt exist already!)
- ldconfig
-
- Then build the module:
-
- cd /path/to/DBD-mysql-foo.version
- 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'
- make
- make install
按以上方法搞下,加载了intel_icc9_lib结果没戏,该报错,还报错。
同时同事从另外方向想的换intel编译器,结果成功。可有些服务器没有intel编译器,一样可以安装。经过重新安装一个服务器同样centos 5.5 32位系统,安装所有开发包都装上。直接编译安装成功。此事件持续3天,教训为安装系统一定把开发包都装上,不用的软件就别装。后来听研发说是机器在他们使用时RPM安装了Imagemagick的,当时没用给卸了,到如今装不上了, - -!!!
如下是我同事的记录,思路比我清晰,BLOG写得比我好,嫉妒羡慕恨!!!
- 编译ImageMagick-6.2.8 出错
- -L/usr/lib utilities/animate.o magick/libMagick.la wand/libWand.la
- magick/.libs/libMagick.so: undefined reference to `_intel_fast_memset'
- magick/.libs/libMagick.so: undefined reference to `_intel_fast_memcpy'
- collect2: ld returned 1 exit status
- make: *** [utilities/animate] Error 1
- 更换ImageMagick-6.6.9.1版本也是相同问题
- 1.首先想到的是动态库的链接问题
- 试着加载库
- #ldconfig
- ldconfig: /usr/lib/libmysqlclient_r.so.16 is not a symbolic link
- ldconfig: /usr/lib/libirc.so is not a symbolic link
- ldconfig: /usr/lib/libmysqlclient.so.16 is not a symbolic link
- 解决:
- 这事因为动态链接库没有连接
- 做个连接就行了
- 如:
- ldconfig -v | grep libmysqlclient.so.16
- libmysqlclient.so.16 -> libmysqlclient.so.16
- ldconfig: /usr/lib/libmysqlclient.so.16 is not a symbolic link
- libmysqlclient.so.16 -> libmysqlclient.so.16.0.0
- 做连接
- ln -s /usr/lib/libmysqlclient.so.16 /usr/lib/libmysqlclient.so.16.0.0
- 在运行ldconfig 就好了
- 但是make 还是报错
- 进行下一步
- 2.查看so 文件信息
- #file /usr/lib/libMagick.so
- /usr/lib/libMagick.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), not stripped
- intel 官方解释:因为系统的问题
- When linked against the static library ( as opposed to the shared library), the example ran fine.
- The .o files that make up the .so were all compiled -fPIC
- The 'file' command for .so shows
- ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), not stripped
- Clearly I am missing some when using a 32 shared library on 64 bit Linux.
- 但是我本身就是32位的系统啊
- 3.还有一种说法
- The symbol intel_fast_memcpy is defined in Intel support library : libirc.lib and libircmt.lib.
- 原文:
- http://software.intel.com/zh-cn/forums/showthread.php?t=79868&p=1&wapkw=%28_intel_fast_memcpy%29
- 编译器自动将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。
- 4.查看gcc库安装路径
- g++ -print-search-dirs
- 5.暂时找不到其他解决方法了,只能试试咯
- 下载一个G的icc 软件包吧,将系统环境改为intel支持的icc试试。
- 下载icc 软件包l_cproc_p_11.1.073.tgz
- 网址:http://registrationcenter-download.intel.com/akdlm/irc_nas/1924/l_cproc_p_11.1.073.tgz
- 5.1安装
- 在intel网站 http://software.intel.com/en-us/articles/non-commercial-software-download/ 可以申请到非商用版的序列号.
- #安装需要的库
- yum -y install man which gcc gcc-c++ compat-libstdc++-33
- 安装icc包
- tar zxvf ./l_cproc_p_11.1.073.tgz
- cd ./l_cproc_p_11.1.073
- ./install.sh
- #然后就是按照向导一步步进行安装了,默认安装到opt下。
- 安装的时候需要注册,或是直接用免费30天。
- 自己看着选项慢慢选吧。
- 设置selinux
- #selinux 设置为disabled 至少也要设置为 permissive 一般centos默认设置为SELINUX=enforcing
- #设置SELINUX为premissive
- #sed -i 's/^SELINUX=.*$/SELINUX=permissive/' /etc/selinux/config
- #直接关闭 SELINUX 最后需要重启
- #sed -i 's/^SELINUX=.*$/SELINUX=disabled/' /etc/selinux/config
- #不重启对selinux 进行设置 保证安装顺利
- 设置支持系统编译环境
- /opt/intel/Compiler/11.1/073/bin/iccvars.sh -help
- ERROR: Unknown switch '-help'. Accepted values: ia32, intel64, ia64
- 支持ia32, intel64, ia64 位数
- 假如你的系统是64位,那么就执行下面的命令
- source /opt/intel/Compiler/11.1/073/bin/iccvars.sh intel64
- 我的系统是32位的,所以我执行下面的命令
- source /opt/intel/Compiler/11.1/073/bin/iccvars.sh ia32
- #添加环境变量
- cat >> ~/.bash_profile <<EOF
- #set the ICC environment variables
- source /opt/intel/Compiler/11.1/073/bin/iccvars.sh ia32
- EOF
- #立刻启用这些环境变量
- source /opt/intel/Compiler/11.1/073/bin/iccvars.sh ia32
- 设置环境变量
- 将系统默认的gcc编译器改为intel的icc,在shell下执行下面的命令
- export CC=icc
- export FC=ifort
- 然后再重新安装ImageMagick-6.6.9-1
- ./configure --prefix=/usr/local/ImageMagick
- 出现上面 花圈的地方说明现在的编译器位icc
- 然后安装
- make && make install
- 测试
- bin]# ./convert --version
- Version: ImageMagick 6.6.9-1 2011-04-02 Q16 http://www.p_w_picpathmagick.org
- Copyright: Copyright (C) 1999-2011 ImageMagick Studio LLC
- Features: OpenMP
- 出现上面的红色部分,说明安装成功。
- 同事给的一个连接也是出现相同的问题,但是我这就不行,我也列这方便查找吧。
- 找了一个别人装db时一个错误记录或许有帮助,那就继续吧
- DBD-mysql Install Error: undefined symbol: _intel_fast_memcpy
- 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).
- 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:
- mv intel-icc9-libs-9.0-i386.tar.gz /usr/local/
- cd /usr/local
- tar -zxvf intel-icc9-libs-9.0-i386.tar.gz
- ln -s intel-icc9-libs-9.0-i386 intel
- echo "/usr/local/intel" > /etc/ld.so.conf.d/intel.conf
- echo "/usr/local/lib" > /etc/ld.so.conf.d/local.conf (if it doesnt exist already!)
- ldconfig
- Then build the module:
- cd /path/to/DBD-mysql-foo.version
- 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'
- make
- make install
转载于:https://blog.51cto.com/2483526/533979