Page 1 of 2

Compiling and linking a parallel routine

Posted: Wed Apr 05, 2006 4:47 am
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 :)

Posted: Wed Apr 05, 2006 5:13 am
by ArndW
On AIX you need to have Visual Age C++ 6.0, XL C/C++ v7 installed.

Posted: Wed Apr 05, 2006 5:13 am
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

Posted: Wed Apr 05, 2006 5:30 am
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!

Posted: Wed Apr 05, 2006 6:50 am
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

Posted: Wed Apr 05, 2006 7:45 am
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.

Posted: Wed Apr 05, 2006 7:49 am
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.

Posted: Wed Apr 05, 2006 9:04 pm
by Nripendra Chand
I have included the name of the object file in its path and selected an object type of 'Object'.

-Nripendra

Posted: Thu Apr 06, 2006 12:24 am
by piyu
Nope it doesnt work!

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

Thanks.

Posted: Thu Apr 06, 2006 4:23 am
by Eric
Try looking at the examples on your DataStage client install Disk
[ Samples\TrxExternalFunctions\AIX ]

Posted: Thu Apr 06, 2006 6:56 am
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?

Dynamic Routine compile time error

Posted: Thu Apr 06, 2006 10:42 am
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 ]

Posted: Thu Apr 06, 2006 10:29 pm
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.

Posted: Sun Apr 09, 2006 11:13 pm
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

Posted: Tue Apr 08, 2008 1:29 pm
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?