1829218 Members
2506 Online
109987 Solutions
New Discussion

GCC compiling

 
SOLVED
Go to solution
Joyce Suganthy
Advisor

GCC compiling

Hi,

I downloaded the gcc compiler from
http://hpux.cs.utah.edu/hppd/hpux/Gnu/gcc-3.3.2/

which was a tar file. So i untarred the file. How do i compile it now?

As i am running hpux ver11i with 64 bit, i wanted to install lsof which needs this gcc...

Please help

regards
Joyce
14 REPLIES 14
V.Tamilvanan
Honored Contributor
Solution

Re: GCC compiling

Hi,
You can download straight away the depot file from your link. So that u can install the depot file by
#swinstall -s
Joyce Suganthy
Advisor

Re: GCC compiling

Hi Tamil.

I did download , thus the file is in tar format, so i untar the file and managed to put the compiled version in the machine, but somehow when I install the lsof, it keep saying that the gcc is not compiled for 64 bit...

Any idea????
V.Tamilvanan
Honored Contributor

Re: GCC compiling

Hi Suganthi,
Why don't u try to install the pre-compiled Depot file which is 64 bit . I too installed the same version on 64 bit machine and lsof also running without any problem.
H.Merijn Brand (procura
Honored Contributor

Re: GCC compiling

The depots you download fron the porting center should never be untar'd by yourself. That the depot is in tar format is mere coincidence

# wget gcc-other-info.depot.gz
# gzip -d gcc-other-info.depot.gz
# swinstall -s `pwd`/gcc-other-info.depot

Now add the path to gcc (I think it is /usr/local/bin/gcc) to /etc/PATH

# perl -pi -e's/$/:/usr/local/bin' /etc/PATH

You don't have to compile anything yourself.

On HP-UX gcc comes in several flavours: HP-UX 10.20 (pa-risc-1.1, 32bit only), HP-UX 11.00 (pa-risc-1.1, 32 bit only or pa-risc-2.0, 32bit or 64bit, and HP-UX 11i, 32bit or 64bit).

You *should* use the compiler that meets the system you run on. For most utils, this does not matter, but for gcc it does. So if you want to compile for 64bit Oracle, on 11i, you *need* the 64bit gcc for 11i. An 32bit gcc compiler cannot generate 64bit code (ELF64) or vise versa.

If you want to install from tar, you should not use a depot. I've got precompiled gcc binaries (including GNU binutils and gdb) available for all above combinations on my ITRC website:

Singapore https://www.beepz.com/personal/merijn/
Rotterdam http://www.cmve.net/~merijn/
Seattle http://ww.hpux.ws/merijn/

There is also installation instructions for those tar packages (these are no depots)

Enjoy, have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
Joyce Suganthy
Advisor

Re: GCC compiling

Hi merijn,

I manage to download and install the gcc, the compilation of the lsof was fine, but when i run 'make', i got the below error

root@emerald: make
(cd lib; make DEBUG="-O" CFGF="-DHAS_CONST -DHPUXV=1100 -DHASVXFS -DHPUX
KERNBITS=64 -I/tmp/lsof_4.69/lsof_4.69_src/dialects/hpux/kmem/hpux11 -DHAS_IPC_S
_PATCH=2 -I/tmp/lsof_4.69/lsof_4.69_src/dialects/hpux/kmem -DHASONLINEJFS -DLSOF
_VSTR=\"B.11.00\"")
/usr/local/pa20_64/bin/gcc -DHAS_CONST -DHPUXV=1100 -DHASVXFS -DHPUXKER
NBITS=64 -I/tmp/lsof_4.69/lsof_4.69_src/dialects/hpux/kmem/hpux11 -DHAS_IPC_S_PA
TCH=2 -I/tmp/lsof_4.69/lsof_4.69_src/dialects/hpux/kmem -DHASONLINEJFS -DLSOF_VS
TR="B.11.00" -O -c ckkv.c
In file included from ../lsof.h:60,
from ckkv.c:43:
/usr/include/sys/stat.h:87: error: syntax error before "int"
/usr/include/sys/stat.h:88: error: syntax error before "int"
/usr/include/sys/stat.h:99: error: syntax error before "int"
In file included from /usr/include/sys/wait.h:83,
from ../lsof.h:61,
from ckkv.c:43:
/usr/include/sys/resource.h:135: error: syntax error before "int"
/usr/include/sys/resource.h:136: error: syntax error before "int"
In file included from /usr/include/fcntl.h:9,

/usr/include/sys/resource.h:135: error: syntax error before "int"
/usr/include/sys/resource.h:136: error: syntax error before "int"
In file included from /usr/include/fcntl.h:9,
from ../dlsof.h:42,
from ../lsof.h:172,
from ckkv.c:43:
/usr/include/sys/fcntl.h:208: error: syntax error before "int"
In file included from /tmp/lsof_4.69/lsof_4.69_src/dialects/hpux/kmem/hpux11/pro
c.h:18,
from ../dlsof.h:64,
from ../lsof.h:172,
from ckkv.c:43:
/usr/include/sys/user.h:144: error: parse error before "label_t"
/usr/include/sys/user.h:205: error: parse error before "u_ssave"
/usr/include/sys/user.h:287: error: parse error before ':' token
/usr/include/sys/user.h:306: error: parse error before '}' token
In file included from /usr/include/sys/vfs.h:31,
from /usr/include/sys/ki_calls.h:20,
from /usr/include/sys/mp.h:28,
from /usr/include/net/netmp.h:24,
*** Error exit code 1

Stop.
*** Error exit code 1

please help

Joyce


T G Manikandan
Honored Contributor

Re: GCC compiling

#which make

Also get the make from here

http://hpux.cs.utah.edu/hppd/hpux/Gnu/make-3.80/
T G Manikandan
Honored Contributor

Re: GCC compiling

Even make binary is not available for your system.

Get the lsof binary from

ftp://ftp.cerias.purdue.edu/pub/tools/unix/sysutils/lsof/binaries/hpux/B.11.11/
Joyce Suganthy
Advisor

Re: GCC compiling

manikandan,

When i download the lsof binary from the website how do i go about it?

Please help. I have downloaded the make and installed it
T G Manikandan
Honored Contributor

Re: GCC compiling

Just download the file lsof*.gz

gunzip on the file
move the lsof to /usr/bin

I think that should work

REvert
Joyce Suganthy
Advisor

Re: GCC compiling

Hi,

I have gunzip and moved the file over to /usr/bin.

Then i am suppose to go to the
/lsof_4.69/lsof_4.69_src directory and then run ./Configure hpuxgcc, this went on fine.

Then am i suppose to run
/make-3.80/make ?????

Please help
T G Manikandan
Honored Contributor

Re: GCC compiling

The file which you got from the ftp site is a executable.
There is no need to build one again.

Just use that executable to trace processes.

just check whether that file works fine

#/usr/bin/lsof -v

REvert
T G Manikandan
Honored Contributor

Re: GCC compiling

Joyce

If that exe downloaded from ftp server is not working then

Just do a

#./Configure hpuxgcc

if this is successful.

Make sure you did install the GNU version of make which I pointed before.

Open the make file from the lsof source dir,

then change the path of gcc to the absolute path like /usr/local/bin/gcc.Also change the path of the make to point to the gnu make currently installed.

Then do a
#gmake
(this make should be the GNU version one-give the full path)I think that should be gmake
#gmake install

check whether the lsof is now working

REvert
T G Manikandan
Honored Contributor
Joyce Suganthy
Advisor

Re: GCC compiling

Hi Manikandan.

Thanks for spending time with me, i manage to install the lsof.

Thanks again

rgds
Joyce