1753518 Members
5087 Online
108795 Solutions
New Discussion юеВ

C compliers Sun vs.HP

 
SOLVED
Go to solution
Mike Blatsos
Advisor

C compliers Sun vs.HP

Are there any known problems converting Sun C programs to HP C ? We have 8 systems we are converting from Sun to HP...
3 REPLIES 3
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: C compliers Sun vs.HP

As with any C program, the answer is that it depends. If you resisted the temptation to use
non-standard library functions then the port should be very easy. You have a little decision making to do as to whether you want to run in 32-bit or 64-bit worlds. The 32-bit code will run anywhare as long as you add the +DAportable flag.

You should also be aware that the standard (bundled) compiler with HP-UX is very limited. It speaks only K & R. For anything serious, you will need to purchase ANSI/C or aCC - the C++ compiler. You could also install Gnu C.

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

Re: C compliers Sun vs.HP


We are publishing all our products on various platforms, HP-UX and Solaris among them. From my experience, the actual C code porting work is a small part of the business (as long as the developers have sticked to ANSI, as has been said before).

However, sorting out the last 10 % of the remaining problems is a task that should not be underestimated. The problems are

- sorting out linking problems (esp. with larger projects),
- finding out all the necessary patches needed to get everything to work the way it should (this is a hard one),
- propagating these necessary modifications to all the machines in your testing / development / operations cluster (esp. challenging if they are not under your control)
- finding out why this one nasty coredump appears on HP but not on any other platform (often, this is a bug that existed but just did not break anything on the other OSes)

From my experience, these problems cover more than 50% of the time until your app runs on the new platform.

All in all, we found that once an application has been ported to any ONE platform, porting it to the second, third etc. is relatively easy. The FIRST port is the hardest one.

Some hints from our experience:
- READ the compiler and linker flags documentation, ALL of it, several times. Most of the problems we gnawed on for weeks were buried in the compiler / linker peculiarities.
- If it runs on one HP-UX machine, don't take for granted that it will run on another one, even with the same OS level.
- Watch out for pthread.

Good luck

Martin
Roberto Arias
Valued Contributor

Re: C compliers Sun vs.HP

Hello:

Please install STK producto for Solairs in system Hp-UX. This product ask for compatibily of program's code.

best regards
The man is your friend