Operating System - HP-UX
1821547 Members
1830 Online
109633 Solutions
New Discussion юеВ

gcc OR HP CC ( read this please)

 
Mehdi_1
Regular Advisor

gcc OR HP CC ( read this please)

Hi

Some of you may or may not have used depot file from the HPUX Archive Centres before.

About two years ago we switch from using hp CC and aCC to gcc and g++.

I would like to know your opinions about switching back to HP cc and aCC.

Please can you be specific and try not to change the subject. Also points only is given one per person, and any extra posting will not get any points.


Any unrelated ideas will get zero point.

Thanks

Mehdi
14 REPLIES 14
Pete Randall
Outstanding Contributor

Re: gcc OR HP CC ( read this please)

Mehdi,

First off, I'd like to know why you're contemplating switching back. Are you unhappy with the Gnu versions? Do you perceive some advantage to the HP versions?


Pete


Pete
Stefan Farrelly
Honored Contributor

Re: gcc OR HP CC ( read this please)

I think its a good idea to switch back. We have. All development now done with full HP compilers. The HP compilers are optimized for PA-RISC HP chips and thus weve found performance much much better for intensive applications using HP's compilers - not Gnu. And HP offer lots of utilities to help with C programming using their compilers.

As long as you dont mind the cost go for it.
Im from Palmerston North, New Zealand, but somehow ended up in London...
Mehdi_1
Regular Advisor

Re: gcc OR HP CC ( read this please)

Hi Pete

From the personal point of view, I would prefer gcc. And I don't have any problem with Gnu tools at all. I personally prefer to stay on gcc!!.


Thanks

Mehdi
Robert-Jan Goossens
Honored Contributor

Re: gcc OR HP CC ( read this please)

Hi Mihdi,

Are you not allowed to use gcc anymore ?

Robert-Jan.
Pete Randall
Outstanding Contributor

Re: gcc OR HP CC ( read this please)

Mehdi,

As Stefan says, HP's compilers will be optimized for your platform. I don't have too much experience with the Gnu versions as we've always had the HP ANSI/C compiler and never had occasion to try gcc. I was as much curious about your reasoning as anything else.


Pete


Pete
Shannon Petry
Honored Contributor

Re: gcc OR HP CC ( read this please)

Both HP ACC and GNU-C have their places and reasons for use.

First, ANSI is not always ANSI. There are many instructions and methods that work in one format, I.E. Sun4U Compilers, then wont in HP-ACC. Both are supposed to be ANSI, yet neither conform 100% to the rules, or interpret the rules completely different from each other.

GNU-C is great as it's consistant across the board. Using a method on HP-UX will work the same on SunOS. There is little to no difference in how things work on any OS, unless the OS does not support the instruction or method.

Because of the annonymouty of GNU, it does not optimize nearly as well as proprietary compilers. Dont let the -O option fool you :)

By using proprietary compilers, you will see appliction performance increast 140% on average. (This is true with IBM AIX, SGI Irix, HP-UX, and Solaris/SunOS).

So if your not concerned about performance of the application, stick with gnu. If you want application speed, then proprietary compilers.

Sincerely,
Shannon Petry
Microsoft. When do you want a virus today?
Michael Kelly_5
Valued Contributor

Re: gcc OR HP CC ( read this please)

I can see one possible problem with this.
If you have to modify the source code to get it to compile cleanly with aCC you may find that it will not build with gcc.

This will only be a problem for people who like to download the source and build it themselves.
gcc is free, aCC is not.

Personally I would be happy to download code that would build using aCC (all our developers use aCC and we use gcc as a 'standards checker').
Of course, if you were to insist that the code can be built using aCC or gcc then the issue disappears.

Michael.
The nice thing about computers is that they do exactly what you tell them. The problem with computers is that they do EXACTLY what you tell them.
Steven E. Protter
Exalted Contributor

Re: gcc OR HP CC ( read this please)

I understand your question.

I would think off the top of my head that going with cc and the PA-RISC optimized compiler would be the way to go.

There are probably reasons to have both, especially when you are working with some gnu source code.

The best way to figure it out would be to do this though is to run a test.

Take a basic, functional program and compile it both ways under different names.

check the size of the binaries that come out, run the programs and drill into them with glance to see what resources they are using. You might find the results quite interesting, though I think you will find doing development with cc works out better, so long as you aren't working with gnu source code that has dependencies.

If you decide to run my suggested test, please post the results.

Regards,

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
A. Clay Stephenson
Acclaimed Contributor

Re: gcc OR HP CC ( read this please)

The majority of UNIX applications tend to be I/O bound rather than CPU bound so that the efficiency of the code is not terribly critical; howeverm, in those situations (like numerical analysis and simulation programs) the HP compilers typically outperform gcc generated code by 1.2x or so.

If you carefully craft your header files with #ifdef's and keep the compiler/linker options in include files for make then moving from one environemnt to the other is very easy.

My preference is to use the HP compilers because they are fully supported and I have never had any problems getting the Gnu (or other HP-UX Porting Centre) software to compile with aCC or ANSI C. Note: If you must also compile K&R c, you will need the ANSI C compiler as well as aCC because aCC does not speak K&R.
If it ain't broke, I can fix that.
benoit Bruckert
Honored Contributor

Re: gcc OR HP CC ( read this please)

Hi Mehdi,
On my side, i like download sources to build my own product. Why this ? I can choose location, config files, and some more specifics options (where are some specifics libraries). By this way you can more easily works with multi versions libraries (i have some samples of lib working better for some products on older versions).
I'm more Unix agnostic, then gcc is for me better as I need more and more to compile software on several OS. Most of the time, i used the tarball from the real sources. but when I need to go very fast, then the portal center is the good way.
aCC is good for performances, but is more specific, and you have to pay for it (I don't have it on all my hosts !). I already had troubles to compile using it, and less ones with gcc.
Then gcc is for me better.
ANd here's my question,
Why did the portal changed 2 years ago from aCC to gcc, anf why switch back to aCC now ?
Une application mal pans├йe aboutit ├а une usine ├а gaze (GHG)
H.Merijn Brand (procura
Honored Contributor

Re: gcc OR HP CC ( read this please)

1. For applications/utilities that do not need to propagate their environment to the rest of the world, please use HP C-ANSI-C or aCC, because it is more reliable, 25% faster, and better adaptive to the PA-RISC architecture.

2. For projects that need extending with the same environment later on (perl, python, automake, ...) please stick with gcc, because you cannot force people to buy an expensive compiler to use open source software and - for the majority - extending cc/aCC objects with gcc modules is not exactly the easiiest task on HP-UX.

That being said, I think their is one more very important reason to still use gcc for compiling stuff on HP-UX from the proting centers: testing gcc's parisc behaviour and your feedback to the GNU people. I've experienced that these people *do* listen, and that hp-ux pa-risc support has greatly improved since 3.0.3. It's worthwhile.

Anyway, thanks enormously for your effort!

Enjoy, have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
Lev Assinovsky
Frequent Advisor

Re: gcc OR HP CC ( read this please)

Don't forget that gcc supports ISO standard since
3.0 version.
Though I believe that aCC may optimize better
for pa-risc, then gcc (with it generic optimization).

We use gcc in our company for the reason of portability (we should provide the same big application on many different platforms), in spite of we are concerned about performance also.
The conclusion:
pa-risc only -> aCC
few platforms -> gcc 3.x.x



Sincerely,
Lev
Laurent Laperrousaz
Regular Advisor

Re: gcc OR HP CC ( read this please)

Hi,

We are developping C++ applications that can run on different OS/platforms:
IBM AIX, SUN Solaris, HP HPUX 11.00, INTEL LINUX, Etc...

We generally use the proprietary compilers on each platform because it is generally faster than gcc.
To maintain the same code for every OS/compiler we use ifdefs.

But we always use gcc as a starter because it is the best to quickly build a program and there is a great support of the community.

On HPUX we benched aCC/gcc and the result is as said before:
size of program increases of 10 % on gcc
performance is a bit slower with gcc

Still HPUX/PA-RISC is the slower compared to others systems but that is out of the scope of the question.

As a conclusion:
gcc to build any application
aCC to tune it and get the best performance

regards

Laurent

Mehdi_1
Regular Advisor

Re: gcc OR HP CC ( read this please)

Hi

Sorry about the delay. The holiday season is over now!

Thanks everyone who made the efford ( the points is been given as sign of appreciation ).

The reason for switching back to HP CC:
HP has asked us to consider switching back to HP 's CC instead of using gcc.

Why did we switch to gcc in a first place??
All the program on the Archive are free programs. Nearly all of them ( or at least most of them ) has been already tested with gcc by the original authors. Most of these program have been developed on linux platform. some of the authors didn't want to know the problem with HPUX never mind the problem that was caused by the HP CC on HPUX. specially the C++ programs was VERY hard to port to HPUX , using HP 's CC. In some cases needed to re-write of the whole/part of the program.!

I agree the code generated from HP CC are faster than the gcc, also in most cases they are even smaller than the code generated from gcc. But I think we should use something that is easily available to all HPUX users.

At the end of the day is not going to be my decision, but I just wanted to know the HPUX users opinion.


Thanks again

__Mehdi