Page 1 of 1

Problem With Compiling External Routine

Posted: Thu Jun 28, 2007 11:38 am
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

Posted: Thu Jun 28, 2007 3:42 pm
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.

Posted: Fri Jun 29, 2007 7:58 am
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