Operating System - Linux
1827445 Members
6286 Online
109965 Solutions
New Discussion

Re: hardware platform name in HP-UX 11V2

 
SOLVED
Go to solution
sathis kumar
Frequent Advisor

hardware platform name in HP-UX 11V2

Could you please let us know what is the hardware platform name in HP-UX 11V2?

We tried to execute the following program in HP-UX 11i and 11V2.

Program:

#define _CMA__HPPA 4
# if defined(__hppa)
# define _CMA_HARDWARE_ _CMA__HPPA
# ifndef _CMA_HARDWARE_
#error "_CMA_HARDWARE_ not set"
# endif
# endif
#include
main()
{
if(_CMA_HARDWARE_==4)
printf("Hai \n");
}

In 11i,
Compilation goes through fine and we get the output as expected.

In 11V2,
It gives the compilation error
"Error 172: "test_cma.c", line 11 # Undeclared variable '_CMA_HARDWARE_'.
if(_CMA_HARDWARE_==4)"

We believe _hppa refers to HP-PA RISC architecture and so we need to change the "if defined(__hppa)" in 11V2. Could you please help us on this issue?

FYI, please find below the uname details of our 11i and 11v2 servers:

11i - HP-UX B.11.11 U 9000/899 1683481321 unlimited-user license

11V2 - HP-UX B.11.23 U ia64 2181415107 unlimited-user license

Thanks in advance for your help.



13 REPLIES 13
SANTOSH S. MHASKAR
Trusted Contributor
Solution

Re: hardware platform name in HP-UX 11V2

Hi,

HP-UX 11V2 comes for PA-RISC and ia64 platform.

U can check like following.

# getconf MACHINE_MODEL

sathis kumar
Frequent Advisor

Re: hardware platform name in HP-UX 11V2

In 11v2, getconf MACHINE_MODEL gives
ia64 hp server rx4640

In 11i, getconf MACHINE_MODEL gives
9000/899/K570
Jaime Bolanos Rojas.
Honored Contributor

Re: hardware platform name in HP-UX 11V2

Sathis,

I do not know if I understood your question, but also if you do a uname -a command and you get a "9000/800" the platform is pa-risc and if you get ia64 then the platform is integrity.

Regards,

Jaime.
Work hard when the need comes out.
Marcel Burggraeve
Trusted Contributor

Re: hardware platform name in HP-UX 11V2

The first version you mention B.11.11 ( 11i V1 ) running on a K570 is a HP-UX version which will only run on the pa-risc platform.
The second one B.11.23 ( 11i V2 ) in your case happens to run on a Itanium/Integrity system BUT can be installed on a pa-risc system ( starting with RP series so not your K570 )as well.
Andrew Merritt_2
Honored Contributor

Re: hardware platform name in HP-UX 11V2

First of all, what problem are you actually trying to solve, since I suspect this is just a test program?

As far as the code goes, it doesn't compile on your 11iV2 system because that is an IA64 (not HP-PA) system, so __hppa is not defined, which means that _CMA_HARDWARE_ doesn't get defined either. Looks like there may be a logic error; there's no point testing the value of _CMA_HARDWARE_ right after it has been defined - was that meant to go outside the '#if defined (__hppa)'? Anyway, you've got conditional definition of _CMA_HARDWARE_ and then the body of the code uses that variable assuming it is defined, which is a mistake.

What decision are you wanting to make in your code based on whether the system is PA or not? And is that what you're really testing for, or whether it is an HP-UX system?

As already pointed out, HP-UX 11iV2 (and 11iV3) runs on both HP-PA and IA64 platforms, there isn't a single answer.

Andrew
sathis kumar
Frequent Advisor

Re: hardware platform name in HP-UX 11V2

Below is the code we use in 11i and 11V2.

/*
* Name of the hardware platform
*/
#define _CMA__MIPS 1
#define _CMA__VAX 2
#define _CMA__M68K 3
#define _CMA__HPPA 4
#define _CMA__IBMR2 5
#define _CMA__ALPHA 6
#define _CMA__MX300I 7
#define _CMA__CPLMIPS 8
#define _CMA__I386 9

#ifndef _CMA_HARDWARE_
# if defined(vax) || defined (VAX) || defined(__vax) || defined(__VAX)
# define _CMA_HARDWARE_ _CMA__VAX
# endif
# if defined(mips) || defined(MIPS) || defined(__mips) || defined(__MIPS) || defined(__MIPSEL__) || defined(__mips__)
# if defined(SNI_DCOSX)
# define _CMA_HARDWARE_ _CMA__CPLMIPS
# else
# define _CMA_HARDWARE_ _CMA__MIPS
# endif
# endif
# if defined(m68k) || defined(m68000) || defined(_ISP__M68K) || defined(M68000) || defined(mc68000)
# define _CMA_HARDWARE_ _CMA__M68K
# endif
# if defined(hp9000s300) || defined(__hp9000s300)
# define _CMA_HARDWARE_ _CMA__M68K
# endif
# if defined(__hppa)
# define _CMA_HARDWARE_ _CMA__HPPA
# endif
# if defined(_IBMR2)
# define _CMA_HARDWARE_ _CMA__IBMR2
# endif
# if defined(__ALPHA) || defined(__alpha)
# define _CMA_HARDWARE_ _CMA__ALPHA
# endif
# if defined(SNI_MX300I)
# define _CMA_HARDWARE_ _CMA__MX300I
# endif
# if !defined(SNI_SVR4)
# ifdef __i386
# define _CMA_HARDWARE_ _CMA__I386
# endif
# endif
# ifndef _CMA_HARDWARE_
#error "_CMA_HARDWARE_ not set"
# endif
#endif

The code works fine in 11i version. But it gives compilation error "Error 119: "./cma_config.h", line 339 # #error "_CMA_HARDWARE_ not set"
#error "_CMA_HARDWARE_ not set"
" in 11V2. We believe, for 11i,

if defined(__hppa) condition gets satisfied and so "# define _CMA_HARDWARE_ _CMA__HPPA" gets executed..

But in 11V2, we believe the condition has to be changed instead checking as _hppa. We would like to know how to make this work in 11V2..

FYI, the dce version we have in 11i and 11V2 is : HP DCE/9000 1.8 PHSS_26394-96
Could you please confirm if we have to install DCE 1.9 version or we can keep 1.8 itself.

Thanks in advance for your help.
Andrew Merritt_2
Honored Contributor

Re: hardware platform name in HP-UX 11V2

Thanks for the extra information.

Is this code you have written, or from a third party?

Do you need to know whether you are compiling on HP-PA, or merely HP-UX? What is the value of _CMA_HARDWARE_ actually used for?

As explained, the code WILL compile on 11iV2 on a PA system. 11iV2 runs on HP-PA systems, and on IA64 (Itanium) systems. You are running it on an IA64 system, where it would not make sense for __hppa to be defined.

There is surely an equivalent value to '__hppa' for IA64 systems (I believe it is '__ia64'), but even if we know what it is, what will happen with your code when it is defined?

Is it only used to display the hardware platform name, or for some more technical reason such as setting word sizes or byte order?

Andrew
Sandman!
Honored Contributor

Re: hardware platform name in HP-UX 11V2

Simply extend the "if defined" test to include the IPF line of servers too:

replace...
# if defined(__hppa)
with...
# if defined(__hppa) || defined(__ia64)
Andrew Merritt_2
Honored Contributor

Re: hardware platform name in HP-UX 11V2

Yes, that's the sort of thing that needs to be done, but as proposed, you'd then be defining

# define _CMA_HARDWARE_ _CMA__HPPA

which is techically incorrect, since the HW is not HP-PA (though the code would compile). Which is why I'm trying to make the point that in order to know the correct change to make, you need to understand what use is being made of the information.

Andrew
Sandman!
Honored Contributor

Re: hardware platform name in HP-UX 11V2

Correct Andrew I was only demonstrating how to compile the source code as sathis hasn't stated the purpose behind writing this code snippet which does nothing except print the string "Hai".
Dennis Handly
Acclaimed Contributor

Re: hardware platform name on HP-UX 11.23

>Could you please let us know what is the hardware platform name in HP-UX 11.23?

Please mention Integrity, IPF or IA for any of your 11.23 requests. HP-UX 11V2 is not precise enough to answer your questions.

>We believe _hppa refers to HP-PA RISC architecture and so we need to change the "if defined(__hppa)" in 11V2. Could you please help us on this issue?

You need to add:
#if defined(__ia64)
_CMA_HARDWARE_ _CMA__IA64

As Andrew says, you then need to find all places where _CMA_HARDWARE_ is tested and seem if it needs to check _CMA__IA64

>#define _CMA__HPPA 4

You would need a new number for IA64.

>the DCE version we have in 11.11 and 11.23 is: HP DCE/9000 1.8

Is this a DCE header that HP supplies?

Raj D.
Honored Contributor

Re: hardware platform name in HP-UX 11V2

Btw, Satish, What is the purpose of this program, you can easily get the hardware details in 11.23 with 'machinfo' command.
And machinfo can be executed from nonroot user as well.

Cheers,
Raj.
" If u think u can , If u think u cannot , - You are always Right . "
Berd
Trusted Contributor

Re: hardware platform name in HP-UX 11V2

The model command will also show you machine details.

BErd