Clarification on plugin location


#1

I’m trying to determine where to put my .cpp files so that SciDB can link to them. The SciDB User’s Guide says, in 16.2, that the example extensions (which I am assuming are plugins) go in [SciDB root]/examples.

That doesn’t appear to be the case in either of the installs I’m working with but perhaps I’m unclear on what the SciDB root is. Do you have an environment variable which I could use to find the root?

Where should I be storing my CPP work so that SciDB will find it?


#2

Hello!

Here’s what happens:
The examples are located in the SOURCE tarball distribution. And you do need the source in order to build the examples (so we figured we wouldn’t make them available separately).

So the general workflow is:

  1. build the plugin and turn the CPP into an libMyLibrary.so
  2. copy libMyLibrary.so where scidb can see it
  3. iquery -aq “load_library(‘MyLibrary’)”
  4. Now MyLibrary is usable: iquery -aq “my_library_operator(apply(A, my_library_function…))”

So, I have the source tree checked out and (after satisfying all the build dependencies, etc) I can say:

apoliakov@scalpel:~/scidb$ make more_math
Building CXX object examples/more_math/CMakeFiles/more_math.dir/more_math.cpp.o
Linking CXX shared library ../../bin/plugins/libmore_math.so
Built target more_math

So now that the plugin is built – I can load it into scidb. Where do I put the built .so file? If I am running from source (using runN.py) I can place the plugin into the directory scidb/bin/plugins and it will get loaded from there.

If I am running from a production-like environment, then there’s a config for where the plugins go. Here’s an example:

[scidb@bigboy ~]$ cat /opt/scidb/11.12/etc/config.ini
[mydb]
node-0=localhost,3
db_user=singleinstance
db_passwd=singleinstance
install_root=/opt/scidb/11.12
metadata=/opt/scidb/11.12/share/scidb/meta.sql
pluginsdir=/opt/scidb/11.12/lib/scidb/plugins           ###<-----pluginsdir
logconf=/opt/scidb/11.12/share/scidb/log4cxx.properties
base-path=/vraid/scidb_data
base-port=1239
interface=eth0
chunk-segment-size=250000000
io-log-threshold=-1
result-prefetch-threads=6
result-prefetch-queue-size=4
chunk-reserve=0
tmp-path=/vraid/tmp
merge-sort-buffer=512
smgr-cache-size=512
max-memory-limit=70000
rle-chunk-format=true
repart-use-sparse-algorithm=true

Note: plugins must be built on the same os that they’re executed on.
What’s the easiest way to create a custom plugin? I would probably grab the source tree. Look at more_math. Make a copy of the entire directory and add it to the right CMakeLists.txt files and go from there. Let us know how we can help…