检查帖子后:
Install gcc on linux with no root privilege
https://stackoverflow.com/questions/9316118/installing-gcc-as-non-root
我的问题还没有解决,所以我把它贴在这里。
我正在尝试在 Linux 上使用 gcc 版本 4.1.2 20080704 (Red Hat 4.1.2-52) 安装 GCC 4.7。
我运行带有前缀的配置作为我的主目录。
./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 check 不行,我得到了错误:
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 权限。
感谢任何帮助。
谢谢!
最佳答案
编译 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 MELT成功安装 GCC 4.7 后的 [meta-] 插件
gcc-help@gcc.gnu.org
邮件列表是获得此类帮助的好地方。
关于linux - 看了相关帖子,在没有root权限的Linux上还是无法安装GCC 4.7?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10805311/