1752786 Members
5892 Online
108789 Solutions
New Discussion юеВ

AIX to HPUX porting

 
SOLVED
Go to solution
Gopal_2
Advisor

AIX to HPUX porting

Hi Guys

I have a huge porting job to do with a very small time frame. I have purchased the aCC compiler to run on HPUX 11.0. The C compiler I have came with HPUX11.0. As I started to port I am starting to get a lot of compatibility issues. Do I have to get any special C compiler for the job. I thought the C compiler that tags along with the OS is ANSI compliant. Can you guys help me with some resource or help on porting between the platforms or extra pointers that I may need. I am very new to HP and that is making things even more worse.

Thanks in advance for the help

Gopal
Senior Engineer
23 REPLIES 23
Brian Hackley
Honored Contributor

Re: AIX to HPUX porting

Gopal,

I've referred many questions just like yours to the HP Developer's Resource website. It contains useful, well-organized tips and forums that might actually help you with your Porting challenges:
http://devrsrc.external.hp.com/devresource/Docs/DocLibrary.html

Check it out!

-> Brian Hackley
Ask me about telecommuting!
Gopal_2
Advisor

Re: AIX to HPUX porting

Thanks Brian,

I went to those resource sites before but the compatibilities that I am facing may be because I may be really be stuck in something really basic. My code was written much on POSIX standards so as to easily port hence when I migrated I got a lot of discrepancies on the compilation. Is there anything I need to check wether I am running an ANSI based C compiler as I presume that the aCC uses a lot of C libraries I guess. I dont see a lot of structs or even some basic structures look completly different. As I told you I am pretty new in HP and it is all appearing Green to me. Any direction for some closure between the 2 platforms could really help.

Thanks again

Gopal
Senior Engineer
A. Clay Stephenson
Acclaimed Contributor

Re: AIX to HPUX porting

Gopal,

I think I would try compiling with the -D _INCLUDE_POSIX_SOURCE flag. I assume that you are using makefiles so I would add the define to your CFLAGS
If it ain't broke, I can fix that.
Gopal_2
Advisor

Re: AIX to HPUX porting

Hi Clay

Thanks
INSIGNIO_/u/quantum/aix42/clients/QFC46/QFC46% make
/u/quantum/aix42/include/GNU_rules_local:291: target `.buildAB.11.00/include/' given more than once in the same rule.
/opt/aCC/bin/aCC -D_INCLUDE_POSIX_SOURCE -D_QFC46 -DHPUX -I. -Iinclude -Ilicense -Iresource -Irpc_appmgr -Irpc_logdmn -Istdrpc -I/u/quantum/aix42/include -c -o .objAB.11.00/QFC46/c_util.o QFC46/c_util.c
Error (future) 129: "/usr/include/sys/stdsyms.h", line 49 # Redefinition of macro '_INCLUDE_POSIX_SOURCE' differs from
previous definition at [Exact position unknown; near ["QFC46/c_util.c", line 1].].
# define _INCLUDE_POSIX_SOURCE
^^^^^^^^^^^^^^^^^^^^^
Error 328: "QFC46/c_util.c", line 165 # Function 'inet_ntoa' has not been defined yet; cannot call.
sprintf(host_name, "%s", (h?h->h_name:(char *)inet_ntoa(IPAddr)));
^^^^^^^^^
Error 186: "QFC46/c_util.c", line 189 # Left side of '.' requires a class object; type found was 'char *'.
ipaddr2host(xprt->xp_raddr.sin_addr.s_addr), xprt_xid(xprt));
^^^^^^^^^^^^^^
Error 186: "QFC46/c_util.c", line 192 # Left side of '.' requires a class object; type found was 'char *'.
ipaddr2host(xprt->xp_raddr.sin_addr.s_addr));
^^^^^^^^^^^^^^

I get error on basic inet libraries errors. It starts with simple #include but cascades to structures used within there and all that

Thanks
gopal
Senior Engineer
Gopal_2
Advisor

Re: AIX to HPUX porting

With a little more analysis I did found out that my C is not ANSI and C++ is ANSI and while trying to compile with the aCC with -Ae for all my c programs I getting errors on the /usr/includes which is not ANSI compliant. I cannot use /bin/cc as it does not like many of the ANSI stuff and so I am stuck. Is there anywhere I can force the application to look within the ANSI C++ (aCC) where I can get this done or do I have to get HP ANSI C compiler too
Any suggestions please
Senior Engineer
Gopal_2
Advisor

Re: AIX to HPUX porting

Hi Guys

Back again...
I am reaching to bottomline.
In AIX the C++ compiler comes with enhanced c compiler which is ANSI compliant but also extends the cc to run on an extended mode by placing a flag, which facilitates usage of const char * and all other cool stuff to go thru on compilation which are usually c++ friendly ones. Now that I got the aCC I dont seem to go anywhere. I need to get something which will give me atleast a cc which is going to be as close I can get to what AIX gives me and since my app has a lot of mix I want to know which is the one I need to buy so as to atleast get somewhere on this porting job. I called HP they keep bouncing me around. I have nowhere to go HELP!!!!

Thanks in advance

Gopal
Senior Engineer
A. Clay Stephenson
Acclaimed Contributor

Re: AIX to HPUX porting

Hi Gopal,

I assume you have tried the '-Aa' and '-Ae' compiler options. I had not trouble in getting
aCC to handle the 'const char *' constructs.

I happen to have both aCC and HP ANSI/C products. If you can attach a SMALL piece of
code with your problems, I'll see if the ANSI/C compiler works.

Clay
If it ain't broke, I can fix that.
Alan Riggs
Honored Contributor

Re: AIX to HPUX porting

Gopal,
You say your compiler on HP "came with" 11.00. Does that mean you are using the minimal compiler that is a part of the OS release? If so, that is quite likely your problem. This compiler is required for kernel compilations, but it is not designed to be a development compiler.

The ANSI C/C++ compiler for HP-UX is a separate product which you will need to purchase and install.
Gopal_2
Advisor

Re: AIX to HPUX porting

Hi Clay

I do not have ANSI C compiler in the HP-End should I have to go ahead and Buy that is the question. Yes I did not have problems with aCC on const char * at all but for some especially the the c files I generate out of rpcgen the errors are thrown in /usr/include/rpc/rpcd_*.h files. Which forces me to think that I have to stop using the Bundled cc compiler and go ahead and bu y the ANSI C package.OK if at all I buy it do I still get rpcgen to generate code that is liked by the cc.

I have module which has c files and some C++ files. The c files when compiled with Bundled cc it always kicks me out so I started using the aCC to compile c files with -Ae -Aa option for which it complained on /usr libraries. So I could not consistently finish compiling the module. Now I thot it because that I do not use the ANSI C (cc) but even if I do purchase and use with the -Aa option will make it accept const char and other cplusplus commenting I have in them. If not what should I buy to get that enhanced C++

Thanks again

Gopal
Senior Engineer