2012-05-29 37 views
0

檢查帖子後:檢查相關帖子後,仍然無法在沒有root權限的Linux上安裝GCC 4.7?

Install gcc on linux with no root privilege

https://stackoverflow.com/questions/9316118/installing-gcc-as-non-root

我的問題仍不能得到解決,所以我在這裏發佈。

我試圖在Linux上安裝GCC 4.7.2版本,使用gcc 4.1.2版本20080704(Red Hat 4.1.2-52)。

我運行configure的前綴是我的主目錄。

./configure \ 
    --with-gmp=/remote/home/gcc_4_7_2012_5_28/gmp505 \ 
    --with-mpfr=/remote/home/gcc_4_7_2012_5_28/mpfr242 \ 
    --with-mpc=/remote/home/gcc_4_7_2012_5_28/mpc081 \ 
    --disable-libjava 

然後,make ok。但是,檢查並不好,我得到了錯誤:

make[1]: Entering directory `/remote/home/gcc_4_7_2012_5_28/trunk' 

make[2]: Entering directory `/remote/gcc_4_7_2012_5_28/trunk/host-x86_64-unknown-linux-gnu/fixincludes' 

autogen -T ../.././fixincludes/check.tpl ../.././fixincludes/inclhack.def 

make[2]: execvp: autogen: Permission denied 

make install is not ok. 

make[1]: Entering directory `/remote/home/gcc_4_7_2012_5_28/trunk' 
/bin/sh ./mkinstalldirs /usr/local /usr/local 

make[2]: Entering directory `/remote/home/gcc_4_7_2012_5_28/trunk/host-x86_64-unknown-linux-gnu/fixincludes' 

rm -rf /usr/local/libexec/gcc/x86_64-unknown-linux-gnu/4.8.0/install-tools 
/bin/sh ../.././fixincludes/../mkinstalldirs /usr/local/libexec/gcc/x86_64-unknown-linux-gnu/4.8.0/install-tools 

mkdir -p -- /usr/local/libexec/gcc/x86_64-unknown-linux-gnu/4.8.0/install-tools 

mkdir: cannot create directory `/usr/local/libexec/gcc': Permission denied 

我無法獲得root權限。

任何幫助表示讚賞。

謝謝!

+1

運行configure時似乎沒有'--prefix'參數 – nos

回答

1

編譯GCC時,你應該永遠不要在源代碼樹中構建它

你忘了你的配置參數的前綴,也許像

mkdir $HOME/gcc-build 
cd $HOME/gcc-build 
/your/path/to-source-tree/gcc-4.7.0/configure --prefix $HOME/pref \ 
     --program-suffix -my4.7 \ 
# other configure arguments go here 
當然

,你會發現安裝在$HOME/pref/bin/gcc-my4.7你的編譯器,所以我建議增加$HOME/pref/bin$PATH$HOME/pref/lib$LD_LIBRARY_PATH

成功安裝GCC 4.7後,您可能會嘗試構建GCC MELT [meta-]插件4.7

[email protected]郵件列表是獲得此類幫助的好地方。

+1

謝謝!我收到了新錯誤:configure:error:構建出樹,但/ remote/mypath/gcc_4_7_2012_5_28/trunk包含host-x86_64-unknown-linux-gnu。在單獨的樹中構建時使用原始源樹。我必須刪除host-x86_64-unknown-linux-gnu?謝謝 ! – user1002288

+0

[email protected]即使訂閱了它也不起作用。因此,即使我將它構建在另一個帶有正確前綴的目錄中,我仍然會遇到構建錯誤:檢查對象文件的後綴... configure:error:in'/ remote/mypath/gcc_4_7_build_2012_5_28/x86_64-unknown-linux-gnu/libgcc ':configure:error:無法計算目標文件的後綴:無法編譯,請參閱'config.log'以獲取更多詳細信息。 make [2]:*** [configure-stage1-target-libgcc]錯誤1,謝謝 – user1002288

0

您需要檢查config.log文件,查找「檢查對象文件的後綴」。你應該會在附近的某個地方看到一條錯誤消息,這應該可以幫助你。

或者,使用EasyBuild構建GCC 4.7,它可以爲您做所有事情,請參閱http://hpcugent.github.com/easybuild

相關問題