LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 07-03-2012, 08:00 PM   #1
amandeepgautam
LQ Newbie
 
Registered: Jul 2012
Posts: 2

Rep: Reputation: Disabled
Question Setting enironment variables for custom build of compiler


I want to build and install a compiler at custom location in Red Hat v6 and I am facing a few problems with the environment variable setting. I have done installation on my Ubuntu 12.04 system successfully and want to do teh same on Red Hat. Please read the following for more information:

I have build gcc compiler (with cilk plus branch) in a custom location on my machine. The following environment variables are set before I compile any program in my system( Ubuntu 12.04 ):

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/aman/intern/compiler/gmp-4.3.2/lib:/home/aman/intern/compiler/mpfr-2.4.2/lib:/home/aman/intern/compiler/mpc-0.8.1/lib:/home/aman/intern/compiler/gcc-cilkplus-install/lib

I have build mpfr, gmp, mpc in folder /home/aman/intern/compiler/ and their paths have been added to LD_LIBRARY_PATH. My compiler installation directory is /home/aman/intern/compiler/gcc-cilkplus-install/

export C_INCLUDE_PATH=/usr/include/x86_64-linux-gnu && export CPLUS_INCLUDE_PATH=$C_INCLUDE_PATH && export OBJC_INCLUDE_PATH=$C_INCLUDE_PATH

export LIBRARY_PATH=/usr/lib/x86_64-linux-gnu

All the environment variables which are exported were empty before I exported them.

Now I need to build the compiler on redhat. LD_LIBRARY_PATH can be easily translated as it belongs to the directory I created but I know not of what the paths are.

Note 1: I know stuff like C_INCLUDE_PATH is the directory where gcc looks for header files but my question is how to locate this on an arbitrary system specifically redhat V6.

Note 2: If you see the all env. variables other than LD_LIBRARY_PATH all correspond to /usr directory but in my installation I have not done anything there. So I may have made mistake in the first place itself and program is running on my system coincidently, just a thing I wanted to mention, if someone didn't notice.

Thanks!
 
Old 07-04-2012, 01:07 PM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,804

Rep: Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306
see here: LD_LIBRARY_PATH should not be altered during build, it has no meaning. You need to set it on the target system depending on the actual environment.
The ...INCLUDE_PATH variables are not used on the target system, the compiler needs them to be able to build.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can you build a C Compiler without an existing C compiler? (Chicken and the egg?) chutsu Linux - Software 6 12-14-2010 08:57 PM
custom environment variables cad Linux - General 4 01-26-2007 06:00 AM
Compiler did not align stack variables. gbowden Linux - Software 2 12-15-2006 07:22 AM
Custom kernel image on custom slack build using CUSS nykey Slackware 2 07-15-2006 03:05 AM
C++ compiler handling of boolean variables R00ts Programming 2 02-16-2005 06:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 11:13 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration