* COMPILER_PATH question
@ 2012-05-25 23:09 Chih Wang
2012-05-25 23:22 ` Ian Lance Taylor
2012-05-25 23:55 ` Jonathan Wakely
0 siblings, 2 replies; 4+ messages in thread
From: Chih Wang @ 2012-05-25 23:09 UTC (permalink / raw)
To: gcc-help
Hi all,
I'm experiencing a weird behavior and would appreciate some guidance.
We are using gcc v 4.4.6 (plus necessary packages to support c++
compilation) installed in a non-standard location due to company
policy. When I first logged into the test box, I can compile and link
a test c++ program without any problem. However, as soon as I source
our project specific resource file, the same code fails to compile
with the following error:
> gcc test.cc -o myout -lstdc++
gcc: error trying to exec 'cc1plus': execvp: No such file or directory
After some digging around, it appears that the issue is caused by a
different value in COMPILER_PATH as returned by running echo "" | gcc
- -xc -v -E.
Before sourcing our environment file, I got:
COMPILER_PATH=/swdepot/2012-Q2/37178099/SDK/usr/bin/../libexec/gcc/x86_64-redhat-linux/4.4.6/:/swdepot/2012-Q2/37178099/SDK/usr/bin/../libexec/gcc/:/usr/libexec/gcc/x86_64-redhat-linux/4.4.6/:/usr/libexec/gcc/x86_64-redhat-linux/
After sourcing:
COMPILER_PATH=/usr/libexec/gcc/x86_64-redhat-linux/4.4.6/:/usr/libexec/gcc/x86_64-redhat-linux/
After sourcing out environment file, somehow gcc would no longer look
for compilers under /swdepot/.... location where gcc toolchains are
installed. But interestingly, the same is not true for for either
LIBRARY_PATH or include path, where before/after both still include
locations where gcc is installed.
Our environment file does not set anything for COMPILER_PATH, and the
only major differences I can see when comparing the before/after
environments is some difference in PATH and LD_LIBRARY_PATH.
My questions:
1. What would affect gcc's ability to deduce COMPILER_PATH?
2. If it's something in my PATH or LD_LIBRARY_PATH value, what could
be the culprit?
3. Any other environment variable I should look out for?
Thanks,
Chih
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: COMPILER_PATH question
2012-05-25 23:09 COMPILER_PATH question Chih Wang
@ 2012-05-25 23:22 ` Ian Lance Taylor
2012-05-25 23:55 ` Jonathan Wakely
1 sibling, 0 replies; 4+ messages in thread
From: Ian Lance Taylor @ 2012-05-25 23:22 UTC (permalink / raw)
To: Chih Wang; +Cc: gcc-help
Chih Wang <wangcyc@gmail.com> writes:
> 1. What would affect gcc's ability to deduce COMPILER_PATH?
It's set based on the name used to run gcc and on the environment
variable GCC_EXEC_PREFIX.
> 2. If it's something in my PATH or LD_LIBRARY_PATH value, what could
> be the culprit?
> 3. Any other environment variable I should look out for?
See above.
Ian
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: COMPILER_PATH question
2012-05-25 23:09 COMPILER_PATH question Chih Wang
2012-05-25 23:22 ` Ian Lance Taylor
@ 2012-05-25 23:55 ` Jonathan Wakely
2012-05-29 18:00 ` Chih Wang
1 sibling, 1 reply; 4+ messages in thread
From: Jonathan Wakely @ 2012-05-25 23:55 UTC (permalink / raw)
To: Chih Wang; +Cc: gcc-help
On 26 May 2012 00:08, Chih Wang wrote:
>
>> gcc test.cc -o myout -lstdc++
In case it's not obvious, a simpler form of that command is:
g++ test.cc -o myout
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: COMPILER_PATH question
2012-05-25 23:55 ` Jonathan Wakely
@ 2012-05-29 18:00 ` Chih Wang
0 siblings, 0 replies; 4+ messages in thread
From: Chih Wang @ 2012-05-29 18:00 UTC (permalink / raw)
To: Jonathan Wakely; +Cc: gcc-help
Thanks guys.
I found the problem and thought I'd share this info.
In my environment I used a variable to indicate where the GCC
toolchain is installed. The name I picked was GCC_ROOT which I thought
was random. But somehow, setting GCC_ROOT resulted in shortened
COMPILER_PATH and it no longer included the path where gcc was
located. Strangely, this behavior only happens for COMPILER_PATH but
not include or library path which still show the location where gcc is
installed.
Using a different name to indicate my local gcc location solved my problem.
Regards,
Chih
On Fri, May 25, 2012 at 4:54 PM, Jonathan Wakely <jwakely.gcc@gmail.com> wrote:
> On 26 May 2012 00:08, Chih Wang wrote:
>>
>>> gcc test.cc -o myout -lstdc++
>
> In case it's not obvious, a simpler form of that command is:
>
> g++ test.cc -o myout
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-05-29 18:00 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-25 23:09 COMPILER_PATH question Chih Wang
2012-05-25 23:22 ` Ian Lance Taylor
2012-05-25 23:55 ` Jonathan Wakely
2012-05-29 18:00 ` Chih Wang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).