Hello and thank you for the responses. I'm happy to say that I have made progress on this...
For a future reference if somebody wants to compile the code from the IBM artcile mentioned in the first post, here is what needs to be done:
1) the following code needs to be removed from src/myhelloworld.c
because it causes the wrong file to be included later on and the following compilation error raises:
Code: Select all
/opt/IBM/InformationServer/Server/PXEngine/include/unicode/umachine.h:47:30: error: unicode/pnutc.h: No such file or directory
2) The source code compilation can be done like this (the params are like the APT_COMPILEOPT as Arnd said above):
Code: Select all
g++ -c -O -fPIC -Wno-deprecated -m64 -mtune=generic -mcmodel=small -I/opt/IBM/InformationServer/Server/PXEngine/include src/myhelloworld.c
3) The link step is:
Code: Select all
g++ -shared -m64 -L/opt/IBM/InformationServer/Server/PXEngine/lib -lorchgeneralx86_64 -lorchx86_64 -lorchmonitorx86_64 -lorchcorex86_64 -lorchsortx86_64 myhelloworld.o
Now about integrationg this into the designer and running a job with the custom operator - it was a partial success...
I was following the Arnd's pdf and created an antry into the
/opt/IBM/InformationServer/Server/PXEngine/etc/operator.apt
Then I have create a new "Parallel Stage Type (Custom)" and introduced "hello" as an operator and moved the libhello.so library here: /opt/IBM/InformationServer/Server/DSComponents/bin
Unfortunatelly during runtime the job aborts with:
main_program: PATH search failure:
main_program: Could not locate operator definition, wrapper, or Unix command for "hello"; please check that all needed libraries are preloaded, and check the PATH for the wrappers
But the PATH has deployment directory:
PATH=/opt/IBM/InformationServer/Server/Projects/dstage1/wrapped:/opt/IBM/InformationServer/Server/Projects/dstage1/buildop
:/opt/IBM/InformationServer/Server/Projects/dstage1/RT_BP8.O
:/opt/IBM/InformationServer/Server/DSComponents/lib:/opt/IBM/InformationServer/Server/DSComponents/bin
:/opt/IBM/InformationServer/Server/DSParallel:/opt/IBM/InformationServer/Server/PXEngine/user_osh_wrappers
:/opt/IBM/InformationServer/Server/PXEngine/osh_wrappers
:/opt/IBM/InformationServer/Server/PXEngine/bin
:/opt/IBM/InformationServer/Server/PXEngine/grid:/opt/IBM/InformationServer/ASBNode/apps/jre/bin:/sbin
:/usr/sbin:/bin:/usr/bin:/usr/local/nz/bin64:/home/loadl/bin:/usr/kerberos/bin:/usr/local/bin:/usr/X11R6/bin:.
What I have tried as well is to copy the libhello.so under a folder referenced by LD_LIBRARY_PATH. No luck...
The libhello.so has permissions like this:
-rwxr-xr-x 1 root root 144264 Sep 15 22:01 libhello.so
So what could be the problem for the above???
The only way I was able to run the job was to introduce a wrapper script for the operator like this:
Code: Select all
#!/bin/sh
props=''
numtimes=''
uppercase=0
usage="hello [-u] [-n times] < input > output"
status=0
error () {
echo "select: $1" 1>&2 ;
if [ $# -eq 1 ] ; then status=1 ; else status=$2 ; fi
}
# Parse argument list
while [ $# -gt 0 ] ; do
case "$1" in
-n) # number of times
if [ $# -lt 2 ] ; then
error "no value specified for -n argument"
break
else
numtimes="$2"
shift; shift
fi
;;
-u) # print uppercase
uppercase=1
shift
;;
*) # otherwise
error "Unrecognized argument, $1"
shift # skip to next argument
;;
esac
done
# Check for properties
if [ ${status} -eq 0 ] ; then
if [ $uppercase -eq 1 ] ; then
props="${props:+$props,}uppercase"
fi
if [ -n "$numtimes" ] ; then
props="${props:+$props,}numtimes=$numtimes"
fi
fi
if [ ${status} -ne 0 ] ; then
echo "{
usage=\"$usage\"
}"
echo "{
class=HelloWorldOp,
initialization={${props}},
usage=\"$usage\",
library=\"hello\"
}"
fi
exit $status
Having this script in one of the PATH directories makes the job run without problems. Could we avoid running this script?