How to override compiler
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > How to override compiler




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    How to override compiler  
seema


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-20-06 07:50 AM

Hi all,

I am new to Unix programming. I am working in HP-UX B.11.23 ia 64 box.
I have
aCC 5.55 compiler installed in "/opt/aCC/bin/". But I want to use aCC
6.05, so
I installed aCC 6.05 in "/home/acc6/opt/aCC/bin". Now I want to use
6.05 for my
builds(make) but I dont know how to use 6.05 because if i type,

$which aCC
/opt/aCC/bin/aCC   -> it gives 5.55

And also if i build some thing it takes aCC 5.5 by default.
Is it possible to use 6.05 for the builds by setting some environment
variable?
Because it always common that you have two versions of compiler
installed on
your OS and you want to use them based on your requirement. Can some
body
explain how to do it.

Thanks in advance,
Seema Rao






[ Post a follow-up to this message ]



    Re: How to override compiler  
Logan Shaw


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-20-06 07:50 AM

seema wrote:

> I am new to Unix programming. I am working in HP-UX B.11.23 ia 64 box.
> I have
> aCC 5.55 compiler installed in "/opt/aCC/bin/". But I want to use aCC
> 6.05, so
> I installed aCC 6.05 in "/home/acc6/opt/aCC/bin". Now I want to use
> 6.05 for my
> builds(make) but I dont know how to use 6.05 because if i type,
>
> $which aCC
> /opt/aCC/bin/aCC   -> it gives 5.55
>
> And also if i build some thing it takes aCC 5.5 by default.
> Is it possible to use 6.05 for the builds by setting some environment
> variable?

That's what the PATH environment variable is for.

By the way, avoid using "which".  It will give wrong answers in certain
cases.  Try using "type" instead.  (If you are using csh, then which
might be useful.)

Try this:

type aCC
PATH="/home/acc6/opt/aCC/bin:$PATH"
export PATH
type aCC

Alternatively, you can just run the executable directly with its
full path.  Just type "/home/acc6/opt/aCC/bin/aCC" instead of "aCC".

- Logan





[ Post a follow-up to this message ]



    Re: How to override compiler  
Fletcher Glenn


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-20-06 11:03 PM

Logan Shaw wrote:
> seema wrote:
> 
>
>
> That's what the PATH environment variable is for.
>
> By the way, avoid using "which".  It will give wrong answers in certain
> cases.  Try using "type" instead.  (If you are using csh, then which
> might be useful.)
>
> Try this:
>
>     type aCC
>     PATH="/home/acc6/opt/aCC/bin:$PATH"
>     export PATH
>     type aCC
>
> Alternatively, you can just run the executable directly with its
> full path.  Just type "/home/acc6/opt/aCC/bin/aCC" instead of "aCC".
>
>   - Logan

Alternatively, you can specify in your makefile:

CCC=/home/acc6/opt/aCC/bin

Yes I did type CCC above.  This tells make to use
the indicated compiler.  See the file:
/usr/share/lib/make/make.rules which is loaded into
make before your makefile.

--

Fletcher Glenn






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 07:00 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register