- 編譯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查看,沒有依賴庫文件的安裝。php
但看其報錯,的確爲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的,當時沒用給卸了,到現在裝不上了, - -!!!css
以下是我同事的記錄,思路比我清晰,BLOG寫得比我好,嫉妒羨慕恨!!!mysql
- 編譯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