Compiling and linking a parallel 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

piyu
Participant
Posts: 52
Joined: Thu Jul 21, 2005 12:22 am
Location: Singapore

Compiling and linking a parallel routine

Post by piyu »

Hi again :)

I am not able to get a routine working.Its my first time and i have read thru all previous posts on parallel routines but haven't found a solution :(

PLease help. Here are the details :

The code is a very simple small function written as cpp. Have compiled using a lot of different compilers such as xlC_r, gxlc++, xlc++.The code compiles but am not able to create a shared library out of it from which the function can be called thru the datastage program. AIX uses Visual C++ compiler rgt?

Please tell me which compiler shud i use? and what are the commands for creating a shared library.

Reading thru guides also didnt help much.

Thanks in advance :)
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

On AIX you need to have Visual Age C++ 6.0, XL C/C++ v7 installed.
rmrama
Participant
Posts: 26
Joined: Wed Oct 15, 2003 1:39 am

Post by rmrama »

Hello piyu,

This worked for me when i needed an object file:

1 - Log into Administrator and go into the Environment Variables of your project.
2 - Select the Compilet option under Parallel and you will see values for environment variables APT_COMPILEOPT, APT_COMPILER, APT_LINKER AND APT_LINKOPT.
3 - Use the values to create your shared library.

I created a simple shell script to aid my compiling:
aCC +DD64 -O -c -ext -z +Z $1.c
aCC +DD64 -b -Wl,+s -Wl,+vnocompatwarnings $1.o

This worked for me in creating an object file. Try it out :)

Regards,
M. Rama
piyu
Participant
Posts: 52
Joined: Thu Jul 21, 2005 12:22 am
Location: Singapore

Post by piyu »

We have Visual Age C++ installed and xlC_r is also available.

The values for the env vars are :

APT_COMPILEOPT = -O -c -qspill=32704
APT_COMPILER = /usr/vacpp/bin/xlC_r
APT_LINKER = /usr/vacpp/bin/xlC_r
APT_LINKOPT = -G

I have the .o file. Dunno wat to do after that!
Nripendra Chand
Premium Member
Premium Member
Posts: 196
Joined: Tue Nov 23, 2004 11:50 pm
Location: Sydney (Australia)

Post by Nripendra Chand »

I'm facing similar problem. I created an 'object' type parallel routine. It compiled successfully. At library path of the create routine page, I provided the path of this compiled program. Job compiled successfully but aborted. The abort msg is as follows:

"Transformer_7: Failed to load the library "V0S7_TestRoutine_Transformer_7.o"; 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 "V0S7_TestRoutine_Transformer_7": rtld: 0712-001 Symbol Test__FiT1 was referenced
from module /data/ds/cl/projectlibs/dpr_cl_dev/RT_BP842.O/V0S7_TestRoutine_Transformer_7.o(), but a runtime definition
of the symbol was not found.."

Please give suggestions to solve this error.

-Nripendra
thompsonp
Premium Member
Premium Member
Posts: 205
Joined: Tue Mar 01, 2005 8:41 am

Post by thompsonp »

piyu - that's it - just use it in a transformer. Right click in the derivation and select Ds Routine. You should find your routine there.

Nripendra,
Have you included the name of the object file as well as its path and selected an object type of 'Object'.

If yes, then try creating a simple routine that just returns an integer value of 1. This way you can rule out problems with other libraries you might have included.
thompsonp
Premium Member
Premium Member
Posts: 205
Joined: Tue Mar 01, 2005 8:41 am

Post by thompsonp »

Nripendra

Just got a similar message myself.
Check that the definition of your routine in manager matches your C++ code in terms of parameters.
Nripendra Chand
Premium Member
Premium Member
Posts: 196
Joined: Tue Nov 23, 2004 11:50 pm
Location: Sydney (Australia)

Post by Nripendra Chand »

I have included the name of the object file in its path and selected an object type of 'Object'.

-Nripendra
piyu
Participant
Posts: 52
Joined: Thu Jul 21, 2005 12:22 am
Location: Singapore

Post by piyu »

Nope it doesnt work!

Can some one pls send me a step wise procedure to create and run a parallel routine?

Thanks.
Eric
Participant
Posts: 254
Joined: Mon Sep 29, 2003 4:35 am

Post by Eric »

Try looking at the examples on your DataStage client install Disk
[ Samples\TrxExternalFunctions\AIX ]
thompsonp
Premium Member
Premium Member
Posts: 205
Joined: Tue Mar 01, 2005 8:41 am

Post by thompsonp »

piyu,

You said you have created a .o file.

What did yu then do that doesn't work?

Can you see the routine in the transformer?
nivas
Participant
Posts: 117
Joined: Sun Mar 21, 2004 4:40 pm

Dynamic Routine compile time error

Post by nivas »

Hi Eric

My operating system is HPUNIX. So with Samples\TrxExternalFunctions\HPUX examples I was able to use Static Routine. When I try to compile job with Dynamic Routine I am getting the following error. So can you help me how to fix this. I followed the document help exactly.

ThankYou
Nivas

*** Internal Generated Transformer Code follows:
0001: //
0002: // Generated file to implement the V0S1_TrxFuncExampleDynamic_Transformer_1 transform operator.
0003: //
0004:
0005: // define external functions used
0006: extern int32 TrxFuncInt();
0007:
0008: // define our input/output link names
0009: inputname 0 DSLink3;
0010: outputname 0 DSLink4;
0011:
0012: initialize {
0013: // define our row rejected variable
0014: int8 RowRejected0;
0015:
0016: // define our null set variable
0017: int8 NullSetVar0;
0018:
0019: }
0020:
0021: mainloop {
0022: // initialise our row rejected variable
0023: RowRejected0 = 1;
0024:
0025: // evaluate columns (no constraints) for link: DSLink4
0026: DSLink4.col1 = TrxFuncInt();
0027: writerecord 0;
0028: RowRejected0 = 0;
0029: }
0030:
0031: finish {
0032: }
0033:
*** End of Internal Generated Transformer Code

Eric wrote:Try looking at the examples on your DataStage client install Disk
[ Samples\TrxExternalFunctions\AIX ]
piyu
Participant
Posts: 52
Joined: Thu Jul 21, 2005 12:22 am
Location: Singapore

Post by piyu »

The routine is available in transformer and the job compliles as well. But at run time,This is the error i am getting :

Transformer_2: Failed to load the library "V0S2_test_parallel_routine_Transformer_2.o"; 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 "V0S2_test_parallel_routine_Transformer_2": rtld: 0712-001 Symbol sumnos__FiT1 was referenced
from module /data/ds/riskmi/projectlibs/dpr_riskmi_dev/RT_BP966.O/V0S2_test_parallel_routine_Transformer_2.o(), but a runtime definition of the symbol was not found..

I dont undertsand wat i am missing. From online docs, the only thing i gathered is that a am not able to create a shared library .so file. The -G or -qmkshrobj options dont work. I have specified tyoe OBJECT and given the pathh of the .o file in LIBrARY.
piyu
Participant
Posts: 52
Joined: Thu Jul 21, 2005 12:22 am
Location: Singapore

Post by piyu »

Done it!

Used the "MAkefile" script which come with the installation cd to create shared object.

The option it uses on AIX are: -G -qmkshrobj=1000
venkatvelpula
Participant
Posts: 80
Joined: Sat Mar 18, 2006 10:27 pm

Post by venkatvelpula »

piyu wrote:Done it!

Used the "MAkefile" script which come with the installation cd to create shared object.

The option it uses on AIX are: -G -qmkshrobj=1000
Can you please explain clearly?
Post Reply