終於好了。搞到轉鍾3點都沒搞定,耽誤不少時間.
執行sudo port install dpkg
報錯如下
Error: org.macports.build for port gmp returned: command execution failed
Error: Failed to install gmp
Please see the log file for port gmp for details:
/opt/local/var/macports/logs/_opt_local_var_macports_sources_www.macports.org_files_ports_devel_gmp/gmp/main.log
Error: The following dependencies were not installed: coreutils gmp gnutar help2man p5.16-locale-gettext perl5.16 gdbm perl5 xz zlib
To report a bug, follow the instructions in the guide:
http://guide.macports.org/#project.tickets
Error: Processing of port dpkg failed
提示的gmp安裝失敗,dpkg缺少后面這么多依賴沒裝。於是我就准備手動安裝一個個依賴
查看dpkg包依賴
xiongwj:~ luojin$ sudo port deps dpkg
Full Name: dpkg @1.14.29_4
Build Dependencies: gmake
Library Dependencies: gettext, libiconv, perl5, coreutils, bzip2, zlib
Runtime Dependencies: gnutar, xz
使用安裝命令安裝各個依賴包
順利安裝完gnutar , xz,perl5之后
coreutils依賴需要gmp,結果gmp安裝失敗。
找到問題根源就是gmp安裝不了。
其實之前裝dpkg的時候就已經報了gmp安裝失敗的提示,蛋疼 又繞回來了。
Error: org.macports.build for port gmp returned: command execution failed
Please see the log file for port gmp for details:
/opt/local/var/macports/logs/_opt_local_var_macports_sources_distfiles.macports.org_ports_devel_gmp/gmp/main.log
To report a bug, follow the instructions in the guide:
http://guide.macports.org/#project.tickets
Error: Processing of port gmp failed
查看日志main.log
:info:build /Volumes/Xcode 5.1/Xcode.app/Contents/Developer/usr/bin/make all-recursive
:info:build make: /Volumes/Xcode: No such file or directory
:info:build make: *** [all] Error 1
:info:build make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_distfiles.macports.org_ports_devel_gmp/gmp/work/gmp-6.0.0'
:info:build Command failed: cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_distfiles.macports.org_ports_devel_gmp/gmp/work/gmp-6.0.0" && /usr/bin/make -j4 -w all
:info:build Exit code: 2
:error:build org.macports.build for port gmp returned: command execution failed
:debug:build Error code: CHILDSTATUS 43636 2
:debug:build Backtrace: command execution failed
安裝多個xcode的同學,選一個指定的xcode復制到Applications目錄下,然后重新指定以下。
xcode-select -switch /Applications/Xcode.app/Contents/Developer
export DEVELOPER_DIR="/Applications/Xcode.app/Contents/Developer"
再然后開始sudo port install gmp
還是失敗,
嘗試了很多方法還是安裝失敗,后來谷歌百度搜索“gmp安裝”找到如下安裝教程
http://www.cnblogs.com/math-mao/archive/2013/05/15/3080181.html
首先,去libgmp官網下載最新的gmp包。(我下的是gmp-6.0.0)
然后gmp-6.0.0.tar.bz2。使用命令,也可以直接解壓
進入gmp-6.0.0文件夾
接下來比較關鍵,在使用configure的時候要加上 --enable-cxx命令,否則不能使用c++庫gmpxx.h
然后
最后
就安裝完成了。
也就是下載代碼,自己make編譯,然后安裝。成功。接下來安裝dpkg
執行sudo port install dpkg
終於安裝成功了。以前裝的時候是那么的順利,這次比較曲折,記錄一下。