1833159 Members
3222 Online
110051 Solutions
New Discussion

Re: 32bit / 64bit

 
SOLVED
Go to solution
Kalin Evtimov
Regular Advisor

32bit / 64bit

Hi!
This time I have more theoretical question:

If I compile a programm with gcc and want to compile it for using 64bit mode, should I always give an explicit flag, like -mlp64? Is there a "default" mode for gcc? How can I check whether my gcc-build 64bit is?

Thank you.
13 REPLIES 13
H.Merijn Brand (procura
Honored Contributor
Solution

Re: 32bit / 64bit

That depends on your architecture.

Gcc on Itanium is capable of generating both, and 32bit is the default.

Gcc on pa-risc can only generate one of the two, and you need two compilers and then you make a symbolic link to the one you want to be the default

Now that you mention -mlp64, I guess you are on Itanium (for pa-risc, this option would do nothing), and I don't know if you can set a default mode.

What you *could* do, is make a wrapper script that always adds your default options, but for the larger configure scripts (perl, gcc, ghostview), that is asking for trouble.

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
Kalin Evtimov
Regular Advisor

Re: 32bit / 64bit

And what if I installed the perl-depot from HP? Is it a 32 or a 64bit build?
H.Merijn Brand (procura
Honored Contributor

Re: 32bit / 64bit

On what architecture?

HP is also making more and more depots containing both.

Unless they state clearly in the description what is in it, you only can tell after downloading and swlist'ing the depot

Most defaults are 32bit, which is a sane choice, unless you happen to live in the world called Oracle, where 64bit seems to be the only legal value, and everything that needs to connect to it needs to be 64bit too (perl, openldap, ...)

My most recent depots for pa-risc, contain both 32bit and 64bit builds, which get installed both if you plainly swinstall, but you can choose either if you want. The installation instructions on my site tell you how.

Once you have it installed, use 'perl -v' to see what kind of perl it is:

You will get lines like:

This is perl, v5.8.6 built for i686-linux-64int
This is perl, v5.8.6 built for i586-linux-thread-multi
This is perl, v5.8.5 built for PA-RISC2.0
This is perl, v5.8.6 built for PA-RISC2.0-LP64
This is perl, v5.8.7 built for aix-64all
This is perl, v5.8.5 built for aix
This is perl, v5.9.3 built for IA64.ARCHREV_0-thread-multi-LP64-ld

If this line does not show 64, it's 32bit

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
Kalin Evtimov
Regular Advisor

Re: 32bit / 64bit

my perl says:
This is perl, v5.8.6 built for IA64.ARCHREV_0
Just for sure: is that 64 bit build?
H.Merijn Brand (procura
Honored Contributor

Re: 32bit / 64bit

No, it's not.

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
H.Merijn Brand (procura
Honored Contributor

Re: 32bit / 64bit

To be more verbose (sorry for the previous brevity), do perl -V (a capital V), and the last section will show something like

Characteristics of this binary (from libperl):
Compile-time options: DEBUGGING USE_64_BIT_INT USE_LARGE_FILES
Locally applied patches:
defined-or
Built under linux
Compiled at Apr 22 2005 13:22:58
%ENV:
PERL5_CPANPLUS_CONFIG="/home/merijn/.cpanplus/config"
@INC:
/pro/lib/perl5/5.8.6/i686-linux-64int
/pro/lib/perl5/5.8.6
/pro/lib/perl5/site_perl/5.8.6/i686-linux-64int
/pro/lib/perl5/site_perl/5.8.6
/pro/lib/perl5/site_perl
.

If there is 'USE_64_BIT_ALL' you have a 64bit perl.
You can also do

# file `which perl`
/pro/bin/perl: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.5, dynamically linked (uses shared libs), not stripped

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
Kalin Evtimov
Regular Advisor

Re: 32bit / 64bit

Thank you. At least I know it now.

$ file `which perl`
/bin/perl: ELF-32 executable object file - IA64

I have now a big problem, because I need 64bit build. Trying to compile it by myself bring me always to the same place:
n file included from /usr/include/sys/ipc.h:15,
from perl.h:4112,
from perlmain.c:36:
/usr/include/sys/sem.h:91: error: field `sem_perm' has incomplete type
/usr/include/sys/sem.h:212: error: field `sem_perm' has incomplete type
In file included from perl.h:4112,
from perlmain.c:36:
/usr/include/sys/ipc.h:51: error: parse error before "cid_t"
/usr/include/sys/ipc.h:56: error: parse error before '}' token
gmake[1]: *** [perlmain.o] Error 1

, I posted that in an earlier topic, but as I am not a C-guy, I could not fix this. Quite stupid situation.

Thank you anyway :)

H.Merijn Brand (procura
Honored Contributor

Re: 32bit / 64bit

My first hinch is that you are not up-to-date with your system patches
My second is that you are using a compiler that is not in sync with your system

Since you did not state either what C compiler you use and the exact version of your OS.

I have just checked the content of http://hpux.connect.org.uk/ftp/hpux/Languages/perl-5.8.6/perl-5.8.6-sd-11.23.depot.gz (the version available for Itanium by the Porting center) and it contains only a 32bit build

I have build a 64bit version on one of the Itanium testdrive machines, but I have no idea how you would be ably to get that. Do you have a testdrive account? the spe176 would do

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
Kalin Evtimov
Regular Advisor

Re: 32bit / 64bit

How do I connect the spe176? I am not familiar with the Testdrive Programm, so I will just have a look.
Kalin Evtimov
Regular Advisor

Re: 32bit / 64bit

Do You remember the options you compiled perl with?
H.Merijn Brand (procura
Honored Contributor

Re: 32bit / 64bit

http://www.testdrive.hp.com/ is where you go to get an account. Wait for the mail, and have a wide variety of machines and architectures at your disposal to test on.
You will only have FTP and TELNET access (no outbound network at all), but it suffices to e.g. build perl, fetch the build tree and then install on your own machine.

http://www.testdrive.hp.com/current.shtml lists the currently available machines.

I can build *any* perl there for you, but that would be useless if you are unable to fetch it.

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
H.Merijn Brand (procura
Honored Contributor

Re: 32bit / 64bit

Compile option? sure!

# sh ./Configure -Duse64bitall -des

or if you're using gcc

# sh ./Configure -Dcc=gcc -Duse64bitall -des

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
Kalin Evtimov
Regular Advisor

Re: 32bit / 64bit

Thank You for your help. I want to try building perl and so on alone, because the point is to learn how to do it.I have time enough:) I may come to you later, if I have any biiig problem.