安装无根的GCC-4.9 - 添加路径和二进制文件和额外的 [英] installing GCC-4.9 without root - adding paths and binaries and extra
问题描述
我刚刚使用链接安装了gcc 4.9 这里,它是一个非常好的链接。但我只有一个问题,我不想尝试不要搞乱 - >链接库和路径变量。
我们大学有一个集群,我将它安装在我的主目录中(没有root)。现在我的home /目录包含这个文件夹,其中包含所有gcc文件夹:
bin
include
lib
lib64
libexec
share
我要做什么做额外的链接指向bin文件夹中的g ++ / gcc二进制文件吗?例如,设置ld_library_path,设置二进制路径(export PATH = /home/asdf/gcc4.9/bin:$PATH)。等等。
任何人都可以提供关于使用gcc / g ++ 4.9(由我安装)绕过由root安装的旧版gcc所需做的所有事情的详细信息。
我还必须将lib和lib64添加到ld_library_paths吗?我将不得不使用而不是 >包含文件(例如#inlcudeset或#include,它包括来自gcc4.9而不是旧版本)或者使用-I
欢迎任何建议/讨论/评论。我知道这可能被标记为重复,但对于那些想要用c ++ 11尝试新的gcc-4.9而不搞乱环境变量的人来说真的很有用。
PS:我不问如何导出或设置环境变量。我在问什么所有环境变量需要使用我的非root版本的gcc,而不是root的旧版本,而不是弄乱 ld 路径和运行时路径。
谢谢!如果你用 - 前缀= / home / myname / gcc4.9来编译你的编译器 / code>(调整以匹配你的系统,显然),那么编译器应该知道包含路径等。
确保你的路径 /home/myname/gcc4.9/bin
在 / usr / bin
之前或你的任何地方其他的gcc已经安装好了,一切都应该像平常一样工作。在我的机器上,我已经从我自己的版本安装了gcc 4.8.2,并且从gcc的linux安装程序中安装了gcc 4.6.3(因为它是一个相当老的发行版)。只要我按照正确的顺序设置路径,它就会自动地运行。
您需要设置 LD_LIBRARY_PATH
,但include路径和静态库应该由gcc自己处理。
i just installed gcc 4.9 using the link here and it is a very good link. But I have only one problem which i dont want to try not to mess up --> linking the libraries and path variables.
we have a cluster in our college and i installed this in my home directory (without root). Now my home/ directory contains this folder where all the gcc folders are :
bin
include
lib
lib64
libexec
share
What all do i have to do to point to the g++/gcc binary in bin folder with additional linking ? For example, set ld_library_path, set binary paths (export PATH = /home/asdf/gcc4.9/bin:$PATH) . etc..
Can anyone provide details on what all needs to be done to use gcc/g++ 4.9 (installed by me) by bypassing the older version of gcc installed by root.
Do i have to add lib and lib64 to the ld_library_paths as well ? Will i have to use " " instead of < > to include files (e.g. # inlcude "set" or #include and it includes from gcc4.9 and not the old one ) Or explicitly provide the include path using -I
Any suggestions/discussions/comments are welcome. I am aware this may marked as duplicate, but it will really be useful to all the people out there who want to try the new gcc-4.9 with c++11 without messing up the environment variables.
PS: I am not asking how to export or set an environment variable. I am asking what all environment variables are required to use my non-root version of gcc and not the root's older version and not mess up the ld paths and so paths during runtime.
thanks !!
If you build your compiler with --prefix=/home/myname/gcc4.9
(adjust to match your system, obviously), then the compiler should "know" that the include paths etc.
All you need beyond that is to make sure your path has /home/myname/gcc4.9/bin
before /usr/bin
or wherever your other gcc is installed, and everything should work just like normal. On my machine, I have gcc 4.8.2 installed from my own build and gcc 4.6.3 from the linux installer for gcc (because it's a fairly old distro). And as long as I have the paths set in the right order, it works "automagically".
You will need to set LD_LIBRARY_PATH
, but include-paths and static libraries should be handled by gcc itself.
这篇关于安装无根的GCC-4.9 - 添加路径和二进制文件和额外的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!