0

I now have pljava building on the Mac. pljava uses maven and the maven nar plugin for building. This maven nar build is currently creating a dylib instead of a .so. It looks like that postgres wants an .so instead. This is the output from turning postgres trace on:

2014-09-26 10:12:59 EDT STATEMENT:  CREATE FUNCTION sqlj.java_call_handler() RETURNS language_handler AS 'pljava' LANGUAGE C
2014-09-26 10:12:59 EDT DEBUG:  bind <unnamed> to <unnamed>
2014-09-26 10:12:59 EDT LOG:  execute <unnamed>: CREATE FUNCTION sqlj.java_call_handler() RETURNS language_handler AS 'pljava' LANGUAGE C
2014-09-26 10:12:59 EDT DEBUG:  ProcessUtility
2014-09-26 10:12:59 EDT DEBUG:  find_in_dynamic_libpath: trying "/Library/PostgreSQL/9.1/lib/postgresql/pljava"
2014-09-26 10:12:59 EDT DEBUG:  find_in_dynamic_libpath: trying "/Library/PostgreSQL/9.1/lib/pljava"
2014-09-26 10:12:59 EDT DEBUG:  find_in_dynamic_libpath: trying "/Library/PostgreSQL/9.1/share/pljava/pljava"
2014-09-26 10:12:59 EDT DEBUG:  find_in_dynamic_libpath: trying "/Library/Java/JavaVirtualMachines/jdk1.7.0_60.jdk/Contents/Home/jre/lib/pljava"
2014-09-26 10:12:59 EDT DEBUG:  find_in_dynamic_libpath: trying "/Library/Java/JavaVirtualMachines/jdk1.7.0_60.jdk/Contents/Home/jre/lib/server/pljava"
2014-09-26 10:12:59 EDT DEBUG:  find_in_dynamic_libpath: trying "/Library/PostgreSQL/9.1/lib/postgresql/pljava.so"
2014-09-26 10:12:59 EDT DEBUG:  find_in_dynamic_libpath: trying "/Library/PostgreSQL/9.1/lib/pljava.so"
2014-09-26 10:12:59 EDT DEBUG:  find_in_dynamic_libpath: trying "/Library/PostgreSQL/9.1/share/pljava/pljava.so"
2014-09-26 10:12:59 EDT DEBUG:  find_in_dynamic_libpath: trying "/Library/Java/JavaVirtualMachines/jdk1.7.0_60.jdk/Contents/Home/jre/lib/pljava.so"
2014-09-26 10:12:59 EDT DEBUG:  find_in_dynamic_libpath: trying "/Library/Java/JavaVirtualMachines/jdk1.7.0_60.jdk/Contents/Home/jre/lib/server/pljava.so"
2014-09-26 10:12:59 EDT ERROR:  could not access file "pljava": No such file or directory

So my question is - how can I make maven nar output a .so file instead of a .dylib? If I use type "shared" a dylib is created, if I use type "plugin" a .bundle is created and if I use type "static" the link fails.

Gareth
  • 936
  • 6
  • 14

1 Answers1

1

I solved my problem. Using type "plugin" creates the right type of file. Miles answer to this question helped me figure it out:

What are the differences between .so and .dylib on osx?

Mac OS recommends .bundle extension for loadable modules but ported applications (like PostgreSQL) still want to use .so. After I changed the file name to pljava.so, PostgreSQL was successfully able to load the module.

Community
  • 1
  • 1
Gareth
  • 936
  • 6
  • 14
  • You didn't write down most/every step you had to take in order to compile pljava on a mac somewhere, did you? If you did I would love to get a link. – Darsstar Oct 04 '14 at 20:41
  • I did write up the steps to build and install pljava for Mac OS X Maverick for Postgres 9.1. Currently these instructions are only posted on my employer's internal network as I didn't believe there was any external interest (the pljava project itself looks almost "dead"). I can post the steps given a relevant location (e.g. a "How can I build and install pljava for Mac" question on stack overflow). – Gareth Oct 05 '14 at 07:21