1832487 Members
4147 Online
110043 Solutions
New Discussion

CC compiler for HPux11

 
SOLVED
Go to solution
Prashun Gupta
Advisor

CC compiler for HPux11

Dear All
I need a CC compiler for HPUX11. I have aCC but it is not helpful when there is need of soem preprocessing or translation has to be done.MOre clearly, I am porting a part of application of hp10.2 to hp11. Can anybody suggest how can I get CC on HPUX11.
Thanks
Prashun
17 REPLIES 17
Victor BERRIDGE
Honored Contributor

Re: CC compiler for HPux11

Hi,
Get gcc from your archive porting center
or you will have to buy HP's ansi c...

All the best
Victor
Victor BERRIDGE
Honored Contributor

Re: CC compiler for HPux11

Here the link at Utah for the latest release:
http://hpux.cs.utah.edu/hppd/hpux/Gnu/gcc-2.95.3/

Good luck
Victor
A. Clay Stephenson
Acclaimed Contributor

Re: CC compiler for HPux11

Hi Prashun,
I don't think I understand. You can invoke aCC with -P to preprocess. If you like, you can look at B3901BA (HP C/ANSI C Compiler).
I actually have both and have never had a situation that one would compile and the other would not - if we are talking about C and not C++. If you could tell us more about your problem, perhaps we could help.

Regards, Clay
If it ain't broke, I can fix that.
Prashun Gupta
Advisor

Re: CC compiler for HPux11

Hello All,
gcc can not be used for my application as GCC does not seem to support preprocessor translation as it is not part of the ANSI standard.
Now ansi c available with HPUX11 doesn't have compiler of C++. -P option with aCC is not working
The only alternate is to get CC compiler for HPUX11. Can anybody suggest me how to get it.
Regards
Prashun
A. Clay Stephenson
Acclaimed Contributor

Re: CC compiler for HPux11

Hi Prashun,
Again, I don't understand, I just did an aCC -P
myfile.c with some preprocessor directives (#define,#ifdef,etc.) and got an output file myfile.i that looked just as I expected. I did this on both an 11.0 box and an 11i and it worked fine. Can you give us some idea of what you are trying to do? As for as getting the HP ANSI C Compiler B3901BA, I would contact my HP representative and explain the problems you are having with aCC and ask for a trial copy.

Clay
If it ain't broke, I can fix that.
Prashun Gupta
Advisor

Re: CC compiler for HPux11

All
Using aCC with -P option, it generates a file with a suffix .i what is the utility of this file, because it still conatians the unresolved text
Prashun
A. Clay Stephenson
Acclaimed Contributor

Re: CC compiler for HPux11

Hi Prashun, I clearly am not smart enough to understand what you are asking.
Example (as simple as possible):
#define XXX "Hello, world!"

myfile.c
int main()
{
printf("%s\n",XXX);
return(0);
}

after aCC -P -> myfile.i
int main()
{
printf("%s\n","Hello, world!");
return(0);
}

This is exactly what a preprocessor is supposed to do. If you can give an equally simple example of the problem, I think that would help.

By the way, if I invoke aCC myfile.c the preprocessor is automatically invoked and the XXX macro is expanded to "Hello, world!".

I'm confiused, Clay

If it ain't broke, I can fix that.
Prashun Gupta
Advisor

Re: CC compiler for HPux11

Clay,
I am sorry that I couldn't convey the details.
DO we have to copy the intermediate file again before putting it infront of the compiler.
If i have a temp.i when I run aCC -P temp.C. Then I am using the makefile, how this .i file is picked automatically.
Moreover I have long code details which Ihave to give you but more or less there is something like
PT_names
SOme functions
..
...
..
PT_end
when I was running without the -P option this was giving the problem as PT_names is not defined. When I used -P option the error goes but the .i files it created still contains PT_names and PT_end. Now when I am using the option from the makefile how we will be able to use this .i file. Can you please elaborate a little bit more.
Regards
Prashun
Prashun Gupta
Advisor

Re: CC compiler for HPux11

Again
HOw will I get the object file
Prashun
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: CC compiler for HPux11

Hi Prashun,
I got bad news, ANSI C isn't going to help you either. Those PT_names ... PT_end are not c or cpp statements. Any definitions for the preprocessor must begin with '#'. Also, aCC does not include a translator like cfront (it was considered unnecessary). Without seeing your makefile and their includes I can only guess but here goes. I think your original port had a makefile rule that said call some translator program then invoke the c compiler.
Not the good news is that this translator which appears to define functions shouldn't be too difficult to create.

I think you indicated that the application runs on 10.20; if you can find the mystery translator program it should run on the 11.x box. One other method that I can think of is get the final processed .c files off the 10.20 box and compile them.

Hope some of this helps you, Clay
If it ain't broke, I can fix that.
Prashun Gupta
Advisor

Re: CC compiler for HPux11

Hay Clay
Thanks for your valauable advice, Can you just put some focus on last paragraph.
Thanks
Prashun
A. Clay Stephenson
Acclaimed Contributor

Re: CC compiler for HPux11

Hi Prashun,
I probably can but I would need to see some of your makefiles and a little bit of your code with the PT.. stuff. You can attach them. But before I do that I'm going to ask you a really dumg question - Have you tried to run your existing 10.20 binaries on 11.0? Usually they work just fine although you might have to set some SHLIB_PATH stuff.

Clay
If it ain't broke, I can fix that.
Prashun Gupta
Advisor

Re: CC compiler for HPux11

Clay,
I am attaching a header file. which has this stuff PT_names PT_define. Now you are right that we had a translator to take care of that on HP10.2 as it was using a cfront compiler now aCC has removed that, how can we take care of this stuff. DO you mean by your last one that we have to translate the code on 10.2 and then bring it to HP11 and then try to compile. As there is lot of stuff like that I don't know how much effort is needed in that.
You are also saying of some translator program, can pur some focus on this one
Bye
prashun
A. Clay Stephenson
Acclaimed Contributor

Re: CC compiler for HPux11

Ok Prashun,
This is not C; it's C++. You must have another
header file that is included before this header file. It's what defines PT_xxx.
You may have an include path problem in your makefile.

If it ain't broke, I can fix that.
A. Clay Stephenson
Acclaimed Contributor

Re: CC compiler for HPux11

Hi Prashun,

I looked at you C++ header file and I now see why you thought ANSI/C was the answer. In this case those "ANSI C Preprocessor" comments are simply the header file's way of determining which compiler version you are running. I think at this point if you are not comfortable in a UNIX C++ environment, I would attempt to find someone. I would still try my earlier suggestion and see if you can restore the old 10.20 binaries from backup and see if they will run on your 11.0 box (most will). That way you wouldn't need to port anything unless you are also required to do maintenance on the code.

Good luck, Clay
If it ain't broke, I can fix that.
Prashun Gupta
Advisor

Re: CC compiler for HPux11

Hay Clay
Thanks for your replies. I am of the thinking that if some how I can get a CC compiler same as on 10.2 for HP11 and then try to compile probably these things will go.
If you can emphasise on how to get that, till the time we are doing preprocessing on HP10.2 and bringing those files here and then compiling on HP11
thanks
Prashun
A. Clay Stephenson
Acclaimed Contributor

Re: CC compiler for HPux11

Hi,
I'll try to give one more hint. I really believe the key to this problem is not swapping the compiler but getting the makefiles just right. In many cases (and especially on complex systems) the makes have to be run in a certain order. Generally, header and include files are built (after setting some platform, OS, and compiler dependent options), then libraries are built, and finally the executables are compiled and linked. Most often, there is a master makefile that calls all the other makefiles to ensure that every thing in done in the proper sequence. My best guess is that the 10.20 version was compiled under the older cfront system which translated the c++ source to c source and then cc compiled that. If you can get all the makefile options right, I think you can make this work.

Clay
If it ain't broke, I can fix that.