If you install the development packages of MonetDB (on Fedora that is MonetDB-devel MonetDB5-server-devel MonetDB-stream-devel) you can compile outside of the MonetDB source tree using a quite simple Makefile. Some key contents for the Makefile are (assuming there is a source file reverse.c and some .mal and .sql files that need to be installed): LIBDIR = `pkg-config --variable=libdir monetdb5` CFLAGS = `pkg-config --cflags monetdb5` LDFLAGS = `pkg-config --libs monetdb5` lib_reverse.so: reverse.o $(CC) -fPIC -DPIC -o lib_reverse.so -shared reverse.o $(LDFLAGS) -Wl,-soname -Wl,lib_reverse.so reverse.o: reverse.c $(CC) -fPIC -DPIC $(CFLAGS) -c reverse.c install: lib_reverse.so cp reverse.mal lib_reverse.so $(LIBDIR)/monetdb5 cp 80_reverse.sql $(LIBDIR)/monetdb5/createdb cp 80_reverse.mal $(LIBDIR)/monetdb5/autoload You should also be able to build MonetDB yourself and point to that for compilation of extra stuff. Just point the PKG_CONFIG_PATH environment variable to the directory where monetdb*.pc are installed before calling make in the directory with the above Makefile. You do need the program pkg-config somewhere in your search path. On 03/31/2015 06:24 PM, Alastair McKinley wrote:
If you can separate the usage of MonetDB provided includes and functions from your core UDF logic you could build a small wrapper in C that links to a shared lib built with C++ with your interfaces declared extern "C".
There is a chance that you could compile your UDF as a standalone shared lib with the C++ compiler with the top level interfaces declared extern "C" but I couldn't be sure it would work.
Best regards,
Alastair
The resulting shared library should be loadable.
On Tue, 2015-03-31 at 17:50 +0200, Jiří Nádvorník wrote:
Hi,
I’m trying to write a function in C++ and I thought I would just provide a makefile for it in my custom folder in MonetDB/sql/backends/monet5/CUSTOM. But it seems like all of the Makefiles in UDF sample are generated by the bootstrap.
How do I get over this? I need to use external C++ libraries in the makefile..
Thank you for help.
Best regards,
Jiri Nadvornik Astronomical Institute AV CR Stellar department Czech Republic nadvornik.ji@gmail.com
_______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list
_______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list
-- Sjoerd Mullender