簡體   English   中英

當GMP,MPC和MPFR的庫文件與其頭文件分開時,如何安裝GCC?

[英]How do install GCC when the library files for GMP, MPC, and MPFR are separate from their header files?

我認為這是我安裝GCC的問題。 我一直在

checking for the correct version of gmp.h... yes
checking for the correct version of mpfr.h... yes
checking for the correct version of mpc.h... yes
checking for the correct version of the gmp/mpfr/mpc libraries... no

當我輸入

/Users/[username]/Documents/gcc-4.8.3/configure --with-gmp=/usr/local
--with-mpc=/usr/local --with-mpfr=/usr/local

[username]是我的實際用戶名。

我安裝了GMP,MPC和MPFR,但這三個文件分布在/ usr / local中的不同文件夾中。 所有頭文件都在/ usr / local / include中,但庫文件位於/ usr / local / lib中。

你應該能夠從中找到答案:

$ ~/src/gcc/gcc/configure --help | fgrep gmp
  --with-gmp-dir=PATH     this option has been REMOVED
  --with-gmp=PATH         specify prefix directory for the installed GMP
                          --with-gmp-include=PATH/include plus
                          --with-gmp-lib=PATH/lib
  --with-gmp-include=PATH specify directory for installed GMP include files
  --with-gmp-lib=PATH     specify directory for the installed GMP library

此外, https//gcc.gnu.org/install/prerequisites.html

或者,如果已安裝GMP但它不在庫搜索路徑中,則必須使用--with-gmp configure選項進行配置。 另請參閱--with-gmp-lib--with-gmp-include

當然, https//gcc.gnu.org/install/configure.html

--with-gmp= pathname
--with-gmp-include= pathname
--with-gmp-lib= pathname
--with-mpfr= pathname
--with-mpfr-include= pathname
--with-mpfr-lib= pathname
--with-mpc= pathname
--with-mpc-include= pathname
--with-mpc-lib= 路徑名
如果您想構建GCC但沒有GMP庫,MPFR庫和/或MPC庫安裝在標准位置並且沒有它們的源存在於GCC源代碼樹中,那么您可以顯式指定它們所在的目錄安裝(' - --with-gmp= gmpinstalldir ',' - --with-mpfr = mpfrinstalldir ',' - --with-mpc= mpcinstalldir ')。 --with-gmp= gmpinstalldir選項是--with-gmp-lib= gmpinstalldir /lib--with-gmp-include= gmpinstalldir /include 簡寫 同樣, - --with-mpfr= mpfrinstalldir選項是--with-mpfr-lib= mpfrinstalldir /lib--with-mpfr-include= mpfrinstalldir /include簡寫, --with-mpc= mpcinstalldir選項也是簡寫--with-mpc-lib= mpcinstalldir /lib--with-mpc-include= mpcinstalldir / include。 如果這些簡寫假設不正確,您可以直接使用顯式include和lib選項。 在構建和使用GCC時,您可能還需要確保動態鏈接器可以找到共享庫,例如通過設置運行時共享庫​​路徑變量(GNU / Linux和Solaris系統上的LD_LIBRARY_PATH )。

這應該很明顯,文件不會全部放在一個目錄中是完全正常的,甚至是預期的。 幾乎所有UNIX軟件都在不同的目錄中安裝頭文件和庫。

http://gcc.gnu.org/wiki/InstallingGCC所述,通常更容易在樹中構建這些庫並將GCC靜態鏈接到它們。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM