Hi there,
Here are some updates.
1) I tried to set LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/home/SECDEV.LOCAL/akravchenko/anaconda2/lib
but it did not help.
2) I tried to link "by hand" with added "-L/home/SECDEV.LOCAL/akravchenko/anaconda2/lib" option:
[akravchenko@hnode1 pyapi]$ pwd
/home/SECDEV.LOCAL/akravchenko/MonetDB-Jul2017-SP1/BUILD/sql/backends/monet5/UDF/pyapi
[akravchenko@hnode1 pyapi]$ /bin/sh ../../../../../libtool --tag=CC --mode=link gcc -DLIBPYAPI -g -O2 -D_REENTRANT -module -avoid-version -o lib_pyapi.la -rpath /home/SECDEV.LOCAL/akravchenko/MonetDB-Jul2017-SP1/lib/monetdb5 lib_pyapi_la-pyapi.lo lib_pyapi_la-unicode.lo lib_pyapi_la-pytypes.lo lib_pyapi_la-type_conversion.lo lib_pyapi_la-formatinput.lo lib_pyapi_la-connection.lo lib_pyapi_la-pyloader.lo lib_pyapi_la-emit.lo lib_pyapi_la-conversion.lo ../../../../../monetdb5/tools/libmonetdb5.la ../../../../../gdk/libbat.la -L/home/SECDEV.LOCAL/akravchenko/anaconda2/lib -lpython2.7 -lpthread -ldl -lutil -lm -Xlinker -export-dynamic libtool: link: rm -fr .libs/lib_pyapi.la .libs/lib_pyapi.lai .libs/lib_pyapi.so .libs/lib_pyapi.soT libtool: link: gcc -shared -fPIC -DPIC .libs/lib_pyapi_la-pyapi.o .libs/lib_pyapi_la-unicode.o .libs/lib_pyapi_la-pytypes.o .libs/lib_pyapi_la-type_conversion.o .libs/lib_pyapi_la-formatinput.o .libs/lib_pyapi_la-connection.o .libs/lib_pyapi_la-pyloader.o .libs/lib_pyapi_la-emit.o .libs/lib_pyapi_la-conversion.o -Wl,-rpath -Wl,/home/SECDEV.LOCAL/akravchenko/MonetDB-Jul2017-SP1/BUILD/monetdb5/tools/.libs -Wl,-rpath -Wl,/home/SECDEV.LOCAL/akravchenko/MonetDB-Jul2017-SP1/BUILD/gdk/.libs -Wl,-rpath -Wl,/home/SECDEV.LOCAL/akravchenko/MonetDB-Jul2017-SP1/BUILD/clients/mapilib/.libs -Wl,-rpath -Wl,/home/SECDEV.LOCAL/akravchenko/MonetDB-Jul2017-SP1/BUILD/common/stream/.libs -Wl,-rpath -Wl,/home/SECDEV.LOCAL/akravchenko/MonetDB-Jul2017-SP1/lib -L/home/SECDEV.LOCAL/akravchenko/MonetDB-Jul2017-SP1/BUILD/gdk/.libs -L/home/SECDEV.LOCAL/akravchenko/MonetDB-Jul2017-SP1/BUILD/clients/mapilib/.libs -L/home/SECDEV.LOCAL/akravchenko/MonetDB-Jul2017-SP1/BUILD/common/stream/.libs ../../../../../monetdb5/tools/.libs/libmonetdb5.so /home/SECDEV.LOCAL/akravchenko/MonetDB-Jul2017-SP1/BUILD/gdk/.libs/libbat.so /home/SECDEV.LOCAL/akravchenko/MonetDB-Jul2017-SP1/BUILD/clients/mapilib/.libs/libmapi.so -lpcre -lxml2 ../../../../../gdk/.libs/libbat.so /home/SECDEV.LOCAL/akravchenko/MonetDB-Jul2017-SP1/BUILD/common/stream/.libs/libstream.so -lsnappy -lssl -lcrypto -lz -L/home/SECDEV.LOCAL/akravchenko/anaconda2/lib -lpython2.7 -lpthread -ldl -lutil -lm -g -O2 -Wl,-export-dynamic -pthread -Wl,-soname -Wl,lib_pyapi.so -o .libs/lib_pyapi.so
And it worked.
3) I added -L/home/SECDEV.LOCAL/akravchenko/anaconda2/lib into Makefile at /home/SECDEV.LOCAL/akravchenko/MonetDB-Jul2017-SP1/BUILD/sql/backends/monet5/UDF/pyapi
libpy_LIBS = -L/home/SECDEV.LOCAL/akravchenko/anaconda2/lib -lpython2.7 -lpthread -ldl -lutil -lm -Xlinker -export-dynamic #AK added -L
and make -j4 from the BUILD dir (/home/SECDEV.LOCAL/akravchenko/MonetDB-Jul2017-SP1/BUILD).
This one worked too.
4) I tested newly installed m5server:
[akravchenko@hnode1 ~]$ mserver5 --dbpath=/tmp/test --set embedded_py=2
# MonetDB 5 server v11.27.5 "Jul2017-SP1"
# Serving database 'test', using 4 threads
# Compiled for x86_64-unknown-linux-gnu/64bit with 128bit integers
# Found 31.485 GiB available main-memory.
# Copyright (c) 1993-July 2008 CWI.
# Copyright (c) August 2008-2017 MonetDB B.V., all rights reserved
# MonetDB/SQL module loaded
# MonetDB/Python2 module loaded
[akravchenko@hnode1 ~]$ mclient
Welcome to mclient, the MonetDB/SQL interactive terminal (Oct2014-SP2)
Database: MonetDB v11.27.5 (Jul2017-SP1), 'test'
Type \q to quit, \? for a list of available commands
auto commit mode: on
sql>create or replace function f1() returns table(v1 INT)
LANGUAGE PYTHON {
return [1,2,3]
};
operation successful (2.355ms)
sql>select * from f1();
| v1 |
+======+
| 1 |
| 2 |
| 3 |
+------+
3 tuples (2.390ms)
p.s. I still don't understand why
export LD_LIBRARY_PATH=/home/SECDEV.LOCAL/akravchenko/anaconda2/lib
did not work and had to pass -L/home/SECDEV.LOCAL/akravchenko/anaconda2/lib "by hand" into libtool linker
to satisfy -lpython2.7.
Thank you,
Anton