Problem With Compiling External Routine

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
Pavan_Yelugula
Premium Member
Premium Member
Posts: 133
Joined: Tue Nov 23, 2004 11:24 pm
Location: India

Problem With Compiling External Routine

Post by Pavan_Yelugula »

Hi All
I have a external Function which i am trying to compile. I have two make files which i got from different sources.

When i Compile with my first make file which is as follows
-------------------------------------------
TARGETLIB = libTrxFuncsTrial.so
CODESRC = TrxFuncsTrial.c
TARGETOBJ = TrxFuncsTrial.o

CC=/opt/Ascential/Datastage/main/Ascential/DataStage/PXEngine.752.1/bin/aCC
CCOPTIONS = -O +z
LIBCC = $(CC)
LDOPTIONS = -b

.SUFFIXES: .c .o

# ---------------------------------------------------------------------
# Rules
# ---------------------------------------------------------------------

all: $(TARGETLIB)

$(TARGETLIB): $(TARGETOBJ)
$(LIBCC) $(LDOPTIONS) $(TARGETOBJ) -o $(TARGETLIB)

$(TARGETOBJ): $(CODESRC)
$(CC) $(CCOPTIONS) -c $(CODESRC) -o $(TARGETOBJ)

clean:
@rm -f $(TARGETOBJ) $(TARGETLIB)

# ---------------------------------------------------------------------
# End of makefile
# ---------------------------------------------------------------------
It gives me the following error
----------------
/opt/Ascential/Datastage/main/Ascential/DataStage/DSEngine/bin/aCC -O +z -c TrxFuncsTrial.c -o TrxFuncsTrial.o
make: /opt/Ascential/Datastage/main/Ascential/DataStage/DSEngine/bin/aCC: Command not found
make: *** [TrxFuncsTrial.o] Error 127
Can someone help me with what exactly goes in CC Command

As for the Problem with the Other Make file which has the first few enteries as follows
---------------------------------------------------
CC = g++
CCOPTIONS = -O -fPIC
LIBCC = $(CC)
LDOPTIONS = -nostartfiles -Wl,-Bshareable,-Bsymbolic,--allow-shlib-undefined
------------------------

I could get my rotuine compiled but when i run any job using the routine it aborts with the following error
Transformer_1: Failed to load the library "V0S1_TrxFuncExampleStatic_Transformer_1.so"; either the directory containing the library file
is not on the library search path, or the library was compiled on a system
that is incompatible with this system: Could not load "V0S1_TrxFuncExampleStatic_Transformer_1": /opt/Ascential/Datastage/main/projects/fbr_test/RT_BP2096.O/V0S1_TrxFuncExampleStatic_Transformer_1.so: undefined symbol: _Z13TrxFuncsTrialv.
It would be really helpful if someone can help me to understand this better... and point me to what i am missing

Thanks
Pavan
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

/opt/Ascential/Datastage/main/Ascential/DataStage/DSEngine/bin/aCC: Command not found

You appear not to have an aCC command in the indicated location.

You appear to have a composite or double pathname happening! Are you using parameters to specify the location of the compiler? Check the value of APT_COMPILER environment variable.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Pavan_Yelugula
Premium Member
Premium Member
Posts: 133
Joined: Tue Nov 23, 2004 11:24 pm
Location: India

Post by Pavan_Yelugula »

Ray,
The APT_COMPILER variable is defined as g++. All the Paramaters follow what i have in my second Make File.
CC = g++
CCOPTIONS = -O -fPIC
LIBCC = $(CC)
LDOPTIONS = -nostartfiles -Wl,-Bshareable,-Bsymbolic,--allow-shlib-undefined
I can get my code compiled with this and create the .o and .so Files for my routine.

In my Routine definition i have picked the Object Option and Pointed it to the directory where i have my .o file for this routine.

The Jobs where i use this gets compiled but it gives me the following fatal Messages
Transformer_1: Failed to load the library "V0S1_TrxFuncExampleStatic_Transformer_1.so"; either the directory containing the library file
is not on the library search path, or the library was compiled on a system
that is incompatible with this system: Could not load "V0S1_TrxFuncExampleStatic_Transformer_1": /opt/Ascential/Datastage/main/projects/fbr_test/RT_BP2096.O/V0S1_TrxFuncExampleStatic_Transformer_1.so: undefined symbol: _Z13TrxFuncsTrialv.
I am Missing something here. And it is driving me crazy :(

Thanks
Pavan
Post Reply