Parallel Routine Object File
Posted: Wed Jan 06, 2010 3:41 pm
Hello...i have written a parallel routine for the first time and i'm facing problem in running it. i want ur help in resolving the issue.
here are the details regarding the routine...
ObjectTesting.cpp:
#include <stdlib.h>
#include <stdio.h>
#include <iostream.h>
#include <stdcomp.h>
char * ObjectTestOne()
{
char * OutStr;
OutStr="Hello World - Object Testing";
return OutStr;
}
I compiled this C++ program with the compiler options from Administrator
compiler: /opt/SUNWspro/bin/CC
compileropt: -dalign -O -PIC -library=iostream -c
LD_LIBRARY_PATH: /usr/lib:/lib
Before compiling the program without main(), i tried it with main() and the program was running fine.after that i removed main() and compiled it.
command:
/opt/SUNWspro/bin/CC -dalign -O -PIC -library=iostream -c ObjectTesting.cpp
got the object file ObjectTesting.o
and linked the object file to the prallel routine as follows:
routine name: ObjectTesting
external subroutine name: ObjectTestOne
library path : /modl/apps/fold/dsdata/common/bin/ObjectTesting.o
object type : object
when i try to use this routine in a sample job i get the following error:
Transformer_3: Failed to load the library "V136S0_test_Transformer_3.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 "V136S0_test_Transformer_3": ld.so.1: osh: fatal: relocation error: file /modl/apps/fold/projects/nylim-GENEVA/RT_BP393.O/V136S0_test_Transformer_3.so: symbol __1cGObjOne6F_W_: referenced symbol not found. [transform/transform.C:1668]
do i have to place the object file in a specific folder or place it anywhere and provide the link in library path of routine.
I think the error has something to do with the object file linking, but don't know how to resolve it.
looked at similar posts but didn't get info regarding, where to place the object file? do we need to create any shared object? etc.
here are the details regarding the routine...
ObjectTesting.cpp:
#include <stdlib.h>
#include <stdio.h>
#include <iostream.h>
#include <stdcomp.h>
char * ObjectTestOne()
{
char * OutStr;
OutStr="Hello World - Object Testing";
return OutStr;
}
I compiled this C++ program with the compiler options from Administrator
compiler: /opt/SUNWspro/bin/CC
compileropt: -dalign -O -PIC -library=iostream -c
LD_LIBRARY_PATH: /usr/lib:/lib
Before compiling the program without main(), i tried it with main() and the program was running fine.after that i removed main() and compiled it.
command:
/opt/SUNWspro/bin/CC -dalign -O -PIC -library=iostream -c ObjectTesting.cpp
got the object file ObjectTesting.o
and linked the object file to the prallel routine as follows:
routine name: ObjectTesting
external subroutine name: ObjectTestOne
library path : /modl/apps/fold/dsdata/common/bin/ObjectTesting.o
object type : object
when i try to use this routine in a sample job i get the following error:
Transformer_3: Failed to load the library "V136S0_test_Transformer_3.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 "V136S0_test_Transformer_3": ld.so.1: osh: fatal: relocation error: file /modl/apps/fold/projects/nylim-GENEVA/RT_BP393.O/V136S0_test_Transformer_3.so: symbol __1cGObjOne6F_W_: referenced symbol not found. [transform/transform.C:1668]
do i have to place the object file in a specific folder or place it anywhere and provide the link in library path of routine.
I think the error has something to do with the object file linking, but don't know how to resolve it.
looked at similar posts but didn't get info regarding, where to place the object file? do we need to create any shared object? etc.