Article 12685 of comp.lang.perl: Newsgroups: comp.lang.perl Path: ig.co.uk!demon!pipex!howland.reston.ans.net!wupost!waikato!comp.vuw.ac.nz!newshost!news From: mikew@gopher.dosli.govt.nz (Mike Williams) Subject: Re: Compiling Oraperl on Alpha OSF/1??? In-Reply-To: hurtado@ash.sps.mot.com's message of Tue, 29 Mar 1994 17:29:03 GMT To: hurtado@ash.sps.mot.com Message-ID: Lines: 112 Sender: news@gopher.dosli.govt.nz (USENET News System) Organization: Dept. of Survey & Land Information, NZ. References: <1994Mar29.172903.13179@newsgate.sps.mot.com> Date: Wed, 6 Apr 1994 01:28:27 GMT >>> On Tue, 29 Mar 1994 17:29:03 GMT, >>> "George" == hurtado@ash.sps.mot.com (George Hurtado) wrote: George> I need help compiling Oraperl 2.v4 on the Alpha OSF/1 v1.3 using George> Oracle 7.0.15.4.2. I've been meaning to post on this topic for a couple of weeks. I recently got oraperl (mostly) working under Oracle 7 on an Alpha box. To do this, I had to (1) Modify orafns.h, adding the correct definition for "struct csrdef". This structure is platform-dependant, and the correct definition for the Alpha can be found in $ORACLE_HOME/proc/demo/sample.c. (2) Create a libperl.a. For some reason, I couldn't link with uperl.o, a mega-object created when perl is built (I can't recall the error message). uperl.o is created with "ld -r", and seems to act much like a library, containing all the objects needed to link perl in with user-provided subroutines. I'm not sure why Larry doesn't just use an object library instead ... that's exactly what I ended up doing, creating a libperl.a (containing all the objects that went into uperl.o). (3) Modify the Makefile. The major differences were - Addition of a definition for CC, with -DMALLOC_PTR_TYPE=void (there is a make variable definition for MALLOC_PTR_TYPE, but is not referenced anywhere). - Correction of the list of Oracle libraries to link with. - Link with libperl.a rather than uperl.o. I'll append my diffs to the Makefile below. The resulting oraperl binary still exhibits one problem: when a SELECT statement contains more than 16 columns, columns start "dropping off" the front. By "dropping off" I mean that oraperl detects cannot determine the type or size of these columns, and fetched rows contain NULL values in these columns. I haven't had time to track this down yet, but I suspect that it's something to do with the different integer sizes on the Alpha. I anyone has seen problems like this before in programs using the OCI, I'd be grateful for any pointers. George> my compiled Oraperl does not process the SELECT statements George> correctly. You might need to be more specific. What does "not ... correctly" mean? Here are my diffs from the v2.4 Makefile: --- /cadsys/mikew/Src/Build/oraperl-v2.4/Makefile.orig Thu Nov 11 12:18:45 1993 +++ /cadsys/mikew/Tmp/oraperl-Makefile.jedi Wed Apr 6 13:03:30 1994 @@ -1,22 +1,21 @@ # Makefile for Oraperl and Coraperl +CC = cc -std -g -DMALLOC_PTR_TYPE=void + # Change these to your ORACLE installation directory and Perl source directory # -ORACLE_HOME = /usr/soft/oracle -SRC = /usr/soft/public/perl +ORACLE_HOME = /usr3/oracle +SRC = ../perl-4.0 # Oracle Definitions, copied from $(ORACLE_HOME)/c/demo/proc.mk # ALL_ORA_LIBS is the only entry that the Makefile actually uses; # change it to whatever you need to link Pro*C programs # -OTHERLIBS = `cat $(ORACLE_HOME)/rdbms/lib/sysliblist` -CLIBS = $(OTHERLIBS) -OCILIB = $(ORACLE_HOME)/rdbms/lib/libocic.a -NETLIBS = $(ORACLE_HOME)/rdbms/lib/osntab.o \ - $(ORACLE_HOME)/rdbms/lib/libsqlnet.a -ORALIBS = $(ORACLE_HOME)/rdbms/lib/libora.a +ORA7LIBS = -L$(ORACLE_HOME)/lib \ + -locic $(ORACLE_HOME)/lib/osntab.o \ + -lsqlnet -lora -lpls -lsqlnet -lcv6 -lcore -lmld -laio -ALL_ORA_LIBS = $(CLIBS) $(OCILIB) $(NETLIBS) $(ORALIBS) +ALL_ORA_LIBS = $(ORA7LIBS) # Perl Definitions, taken from $SRC/usub/Makefile # Don't include the curses libraries here - they go in CURSELIB @@ -62,7 +61,7 @@ # Database, username and password to use for testing # -TESTDATA = t scott tiger +TESTDATA = test scott tiger # @@ -83,9 +82,9 @@ CFLAGS = -Idbug -I$(SRC) $(GLOBINCS) $(LOCINCS) $(DEFS) -oraperl: $(SRC)/uperl.o $(OOBJS) - $(CC) -o oraperl $(SRC)/uperl.o $(OOBJS) \ - -lm $(ALL_ORA_LIBS) $(LIBS) +oraperl: $(SRC)/libperl.a $(OOBJS) + $(CC) -o oraperl $(SRC)/libperl.a $(OOBJS) \ + $(ALL_ORA_LIBS) $(LIBS) coraperl: $(SRC)/uperl.o $(COBJS) $(SRC)/usub/curses.o $(CC) -o coraperl $(SRC)/uperl.o $(COBJS) $(SRC)/usub/curses.o \ @@ -117,7 +116,7 @@ $(CC) -c $(CFLAGS) -DCURSES cusersub.c oracle.c: $(SRC)/usub/mus oracle.mus - $(SRC)/usub/mus oracle.mus >oracle.c + perl $(SRC)/usub/mus oracle.mus >oracle.c $(OOBJS) $(COBJS): $(HDRS) .