Operating System - HP-UX
1837184 Members
2640 Online
110113 Solutions
New Discussion

Re: compile wiht zlib and DA2.0W option

 
seokgu
New Member

compile wiht zlib and DA2.0W option

Is it possible to compile zlib with DA2.0W option?

I encountered following error

cc -c -o wsf_res.o wsf_res.c -Ae -DSERVER -DHP - I/usr/local/mysql2/include +DA2.0W

cc -c -o util.o util.c -Ae -DSERVER -DHP - I/usr/local/mysql2/include +DA2.0W

cc -c -o sub_function.o sub_function.c -Ae -DSERVER -DHP - I/usr/local/mysql2/include +DA2.0W

cc -c -o socket_open.o socket_open.c -Ae -DSERVER -DHP - I/usr/local/mysql2/include +DA2.0W

cc -c -o process_error.o process_error.c -Ae -DSERVER -DHP - I/usr/local/mysql2/include +DA2.0W

cc -c -o server_function.o server_function.c -Ae -DSERVER -DHP - I/usr/local/mysql2/include +DA2.0W

cc -c -o queue_function.o queue_function.c -Ae -DSERVER -DHP - I/usr/local/mysql2/include +DA2.0W

cc -c -o systeminfo.o systeminfo.c -Ae -DSERVER -DHP - I/usr/local/mysql2/include +DA2.0W

cc -c -o sql_function.o sql_function.c -Ae -DSERVER -DHP - I/usr/local/mysql2/include +DA2.0W

cc wsf_res.o util.o sub_function.o socket_open.o process_error.o server_function.o queue_function.o systeminfo.o sql_function.o - L/usr/local/lib -L/usr/local/mysql2/lib -lnsl -lm -lmysqlclient -lz +DA2.0W -o wsf_res.hp

ld: Can't find library for -lz
8 REPLIES 8
Amit Agarwal_1
Trusted Contributor

Re: compile wiht zlib and DA2.0W option

Hi,

I believe the search path for libraries is incorrect. Usually 64-bit libraries reside in /lib/pa20_64/ directory. Search for libz.sl in your system.

$ whereis libz.sl
or
$ find /usr -name 'libz.sl'
$ find . -name 'libz.sl'

Add a -L option to the last cc line in your makefile.

having said that, going by the name the library seems to be local for zlib pack. It is possible that for reason the rule t build libz.sl may not be gettign executed.

Lots of possibilities exist.

-Amit
seokgu
New Member

Re: compile wiht zlib and DA2.0W option

My makefile script as bellow
% cat Makefile.hp
PROGRAM = wsf_res.hp

src=wsf_res.c util.c sub_function.c socket_open.c process_error.c server_funct
ion.c queue_function.c systeminfo.c sql_function.c
OBJS = $(SRC:.c=.o)

PROGRAM = wsf_res.hp

PROGRAM = wsf_res.hp

src=wsf_res.c util.c sub_function.c socket_open.c process_error.c server_funct
ion.c queue_function.c systeminfo.c sql_function.c
OBJS = $(SRC:.c=.o)

HEADER = wsf.h

CC = cc

INCLUDE = -I/usr/local/mysql2/include
LDLIBS = -L/usr/local/lib -L/usr/local/mysql2/lib
LIBS = -lnsl -lm -lmysqlclient -lz +DA2.0W
CFLAGS = -Ae -DSERVER -DHP
#CFLAGS = -Ae -DSERVER -DHP -D_LARGEFILE64_SOURCE
#CFLAGS = -DSERVER -DHP -D_LARGEFILE64_SOURCE
#CFLAGS = -Ae -DSERVER -DHP -D_LARGEFILE64_SOURCE -DD64
#CFLAGS = -Ae -DSERVER -DHP -D_LARGEFILE64_SOURCE -DPSTAT64
#CFLAGS = -Ae -DSERVER -DHP -DDF
#CFLAGS = -Ae -DSERVER -DHP -DDF -D_LARGEFILE64_SOURCE

$(PROGRAM) : $(OBJS)
$(CC) $(OBJS) $(TARGET_OBJS1) $(LDLIBS) $(LIBS) -o $@
\rm -f *.o
$(OBJS) : $(SRC) $(HEADER)
:q!
% cat Makefile.hp
PROGRAM = wsf_res.hp

src=wsf_res.c util.c sub_function.c socket_open.c process_error.c server_funct
ion.c queue_function.c systeminfo.c sql_function.c
OBJS = $(SRC:.c=.o)

HEADER = wsf.h

CC = cc

INCLUDE = -I/usr/local/mysql2/include
LDLIBS = -L/usr/local/lib -L/usr/local/mysql2/lib
LIBS = -lnsl -lm -lmysqlclient -lz +DA2.0W
CFLAGS = -Ae -DSERVER -DHP
#CFLAGS = -Ae -DSERVER -DHP -D_LARGEFILE64_SOURCE
#CFLAGS = -DSERVER -DHP -D_LARGEFILE64_SOURCE
#CFLAGS = -Ae -DSERVER -DHP -D_LARGEFILE64_SOURCE -DD64
#CFLAGS = -Ae -DSERVER -DHP -D_LARGEFILE64_SOURCE -DPSTAT64
#CFLAGS = -Ae -DSERVER -DHP -DDF
#CFLAGS = -Ae -DSERVER -DHP -DDF -D_LARGEFILE64_SOURCE

$(PROGRAM) : $(OBJS)
$(CC) $(OBJS) $(TARGET_OBJS1) $(LDLIBS) $(LIBS) -o $@
\rm -f *.o
$(OBJS) : $(SRC) $(HEADER)
$(CC) -c -o $@ $< $(CFLAGS) $(INCLUDE) +DA2.0W
clean :
\rm -f *.o $(PROGRAM)

libz.sl/libz.a file located following location

% pwd
/usr/local/lib
% file *
libz.a: archive file -PA-RISC1.1 relocatable library
libz.sl: PA-RISC1.1 shared library
%

finally is compiled succcessfully without DA2.0W option

thanks in advance.
Ermin Borovac
Honored Contributor

Re: compile wiht zlib and DA2.0W option

If you want to link your 64-bit program with zlib library then you need 64-bit version of zlib library (you have 32-bit).

zlib source is here

http://www.gzip.org/zlib/

Compile it with +DA2.0W +Z (set CCOPTS) and you will get 64-bit zlib shared library.
seokgu
New Member

Re: compile wiht zlib and DA2.0W option

I have been downloaded zlib kit from
following location

http://hpux.connect.org.uk/hppd/hpux/Misc/zlib-1.2.2/

and I found this link here at itrc, and this kit's commnet is PA-RISC(64bit)

Where can I find 64bit zlib for hp-ux 11.11

Should I recompile zlib source code with 64bit option?
Ermin Borovac
Honored Contributor

Re: compile wiht zlib and DA2.0W option

I think all software from HP-UX porting depot is still 32-bit (64-bit in the package description refers to system architecture), so you will need to recompile zlib yourself.
rick jones
Honored Contributor

Re: compile wiht zlib and DA2.0W option

Just a little note - unless folks are stuck on ancient revs of compilers, 64-bit compilation should be requested via the +DD64 directive rather than +DA2.0W. +DD64 requests a 64-bit compilation regardless of PA-RISC/IPF system
there is no rest for the wicked yet the virtuous have no pillows
Amit Agarwal_1
Trusted Contributor

Re: compile wiht zlib and DA2.0W option

I would suggest to keep 64-bit libraries at different path i.e. /usr/local/lib/pa20_64. And modify the library path to include -L/usr/local/lib/pa20_64.
Secondly use +DA2.0W in CFLAGS, and not LIBS. I would second Rick's suggestion, use +DD64 instead of +DA2.0W.

You can use branches in makefile to have a handle to either compile 32-bit or 64-bit. A sample makefile would be:

$ cat makefile
LIBS = libz.sl
LDLIB32 = -L/usr/local/lib
LDLIB64 = -L/usr/local/lib/pa20_64

target:
if [ $(ARCH) = 32 ]; \
then \
$(CC) ...... $(LDLIB32) $(LIB); \
else \
$(CC) ...... $(LDLIB64) $(LIB); \
fi

$ make ARCH=32
OR
$ make ARCH=64

I hope it helps.
seokgu
New Member

Re: compile wiht zlib and DA2.0W option

Thanks for kind reply.
It's very helpfull to me...

thanks and regards