agora inbox for pljava-dev@postgresql.org  
help / color / mirror / Atom feed
[Pljava-dev] Building pl/java on OS/X (Mountain Lion)
7+ messages / 0 participants
[nested] [flat]

* [Pljava-dev] Building pl/java on OS/X (Mountain Lion)
@ 2012-10-13 17:39  
  0 siblings, 1 reply; 7+ messages in thread

From:  @ 2012-10-13 17:39 UTC (permalink / raw)

So, I've managed to get a clean build of this, but haven't actually gone through the process of verifying it.  Will do so later this weekend and post the results.  Here's what I had to do to get this to work.

First, make sure you're using Java 1.6.  PL/Java will compile with errors and die.

Make sure you have XCode 4.5.  However, for some reason I can't fathom, the build wants to use the 10.6 framework, which doesn't exist in XCode 4.5.  After much pain and suffering, I found this link http://www.jamesgeorge.org/uploads/MacOSX10.6.sdk.zip, which you can use to install the 10.6 framework for 4.5.  The contents of this file should be expanded into /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk 

Make sure that you have the postgres binaries in your path.  I used the enterprise DB installation for 9.2 and have PATH=/Library/Postgres/9.2/bin:$PATH.

Make sure that you have the PORTNAME environment variable set to "darwin".

Then everything should just work for the make.

As I said, I haven't validated this so I'll be doing that, but fingers crossed....




^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* [Pljava-dev] Building pl/java on OS/X (Mountain Lion)
@ 2012-10-14 00:01  
  parent: 
  0 siblings, 1 reply; 7+ messages in thread

From:  @ 2012-10-14 00:01 UTC (permalink / raw)

Sadly, I am not successful at having pl/java work from this binary build.  Perhaps some kind soul will know how to make this work, but here's what I've tried:

dynamic_library_path = $libdir:'/Library/PostgreSQL/9.2/pljava/'                                                                                                                     
log_min_messages = info                                                                                                                                                               
custom_variable_classes = 'pljava'                                                                                                                                                    
pljava.classpath = '/Library/PostgreSQL/9.2/pljava/pljava.jar'

I have put the pljava.so and *.jars in /Library/PostgreSQL/9.2/pljava

This results with the startup of the postmaster with :
10/13/12 4:52:01.866 PM com.apple.launchd[1]: (com.edb.launchd.postgresql-9.2[1778]) Exited with code: 1
10/13/12 4:52:01.866 PM com.apple.launchd[1]: (com.edb.launchd.postgresql-9.2) Throttling respawn: Will start in 10 seconds


I then tried to rename pljava.so to pljava.dynlib.  Same result.  I've chown'd the files to root and postgres, still the same result.  I moved pljava.dynlib to /Library/PostgreSQL/lib, with the same results (I commented out the dynamic_library_path, when I tried that).

So at this point, I'm out of ideas.  I haven't programmed in C for over a decade and never on the Mac so I'm not going to think up anything brilliant.

Hopefully someone out there has either done this or has some idea of what I'm doing wrong and can give a shout out...

-Hal                                                                                                                         

On Oct 13, 2012, at 10:39 AM, Hal Hildebrand <hal.hildebrand at me.com> wrote:

> So, I've managed to get a clean build of this, but haven't actually gone through the process of verifying it.  Will do so later this weekend and post the results.  Here's what I had to do to get this to work.
> 
> First, make sure you're using Java 1.6.  PL/Java will compile with errors and die.
> 
> Make sure you have XCode 4.5.  However, for some reason I can't fathom, the build wants to use the 10.6 framework, which doesn't exist in XCode 4.5.  After much pain and suffering, I found this link http://www.jamesgeorge.org/uploads/MacOSX10.6.sdk.zip, which you can use to install the 10.6 framework for 4.5.  The contents of this file should be expanded into /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk 
> 
> Make sure that you have the postgres binaries in your path.  I used the enterprise DB installation for 9.2 and have PATH=/Library/Postgres/9.2/bin:$PATH.
> 
> Make sure that you have the PORTNAME environment variable set to "darwin".
> 
> Then everything should just work for the make.
> 
> As I said, I haven't validated this so I'll be doing that, but fingers crossed....
> _______________________________________________
> Pljava-dev mailing list
> Pljava-dev at pgfoundry.org
> http://pgfoundry.org/mailman/listinfo/pljava-dev





^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* [Pljava-dev] Building pl/java on OS/X (Mountain Lion)
@ 2012-10-14 00:30  
  parent: 
  0 siblings, 1 reply; 7+ messages in thread

From:  @ 2012-10-14 00:30 UTC (permalink / raw)

On 10/13/12 5:01 PM, Hal Hildebrand wrote:
> dynamic_library_path = $libdir:'/Library/PostgreSQL/9.2/pljava/'

' in the wrong place.  s/b ...

dynamic_library_path = '$libdir:/Library/PostgreSQL/9.2/pljava/'



>                                                                                                                      
> log_min_messages = info
> custom_variable_classes = 'pljava'
> pljava.classpath = '/Library/PostgreSQL/9.2/pljava/pljava.jar'
>
> I have put the pljava.so and *.jars in /Library/PostgreSQL/9.2/pljava
>
> This results with the startup of the postmaster with :
> 10/13/12 4:52:01.866 PM com.apple.launchd[1]: (com.edb.launchd.postgresql-9.2[1778]) Exited with code: 1
> 10/13/12 4:52:01.866 PM com.apple.launchd[1]: (com.edb.launchd.postgresql-9.2) Throttling respawn: Will start in 10 seconds


those errors tell us nothing other than that postgres didn't start.   
find and read the postgres startup log, wherever thats kept.   its 
/probably/ got an error about that ' on the dynamic_library_path.

I believe the .so should be called a .dynlib on OSX but I've never used 
that platform so take this with a grain of salt.



-- 
john r pierce                            N 37, W 122
santa cruz ca                         mid-left coast





^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* [Pljava-dev] Building pl/java on OS/X (Mountain Lion)
@ 2012-10-14 00:44  
  parent: 
  0 siblings, 1 reply; 7+ messages in thread

From:  @ 2012-10-14 00:44 UTC (permalink / raw)

On 10/13/12 5:30 PM, John R Pierce wrote:
> On 10/13/12 5:01 PM, Hal Hildebrand wrote:
>> dynamic_library_path = $libdir:'/Library/PostgreSQL/9.2/pljava/'
>
> ' in the wrong place.  s/b ...
>
> dynamic_library_path = '$libdir:/Library/PostgreSQL/9.2/pljava/' 

let me add, you MAY need to have the right paths for your libjvm.dynlib 
from your Java JRE 1.5 .... I have *NO* idea what Java looks like on OSX.

on IBM Java on AIX (which is a PPC64 environment), I had to use...
|
dynamic_library_path = 
||'$libdir:/opt/pljava:/usr/java5_64/jre/bin:/usr/java5_64/jre/bin/j9vm'|

these are completely different paths than the equivalent files on a 
Sun/Oracle java implementation.

-- 
john r pierce                            N 37, W 122
santa cruz ca                         mid-left coast





^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* [Pljava-dev] Building pl/java on OS/X (Mountain Lion)
@ 2012-10-14 02:38  
  parent: 
  0 siblings, 1 reply; 7+ messages in thread

From:  @ 2012-10-14 02:38 UTC (permalink / raw)

Thanks for the suggestions, but sadly neither seemed to do the trick.  I tried any number of variations of what I *think* is the correct value, but who knows :)

/Library/PostgreSQL/9.2/pljava/:/System/Library/Frameworks/JavaVM.framework/Libraries  

the /System/Library/Frameworks/JavaVM.framework/Libraries  is the place where all the native libraries and dynamic libraries for the JVM live.  So that should have done the trick.  Unfortunately, postgres still refuses to start up.

Was also wondering if there's a more verbose mode for postgres startup, as what I'm getting is just a non zero exit.  Would be nice if there was something that gave some idea of what went wrong ;)

Again, thanks for the help though.   Appreciated.

-Hal

On Oct 13, 2012, at 5:44 PM, John R Pierce <pierce at hogranch.com> wrote:

> On 10/13/12 5:30 PM, John R Pierce wrote:
>> On 10/13/12 5:01 PM, Hal Hildebrand wrote:
>>> dynamic_library_path = $libdir:'/Library/PostgreSQL/9.2/pljava/'
>> 
>> ' in the wrong place.  s/b ...
>> 
>> dynamic_library_path = '$libdir:/Library/PostgreSQL/9.2/pljava/' 
> 
> let me add, you MAY need to have the right paths for your libjvm.dynlib from your Java JRE 1.5 .... I have *NO* idea what Java looks like on OSX.
> 
> on IBM Java on AIX (which is a PPC64 environment), I had to use...
> |
> dynamic_library_path = ||'$libdir:/opt/pljava:/usr/java5_64/jre/bin:/usr/java5_64/jre/bin/j9vm'|
> 
> these are completely different paths than the equivalent files on a Sun/Oracle java implementation.
> 
> -- 
> john r pierce                            N 37, W 122
> santa cruz ca                         mid-left coast
> 
> _______________________________________________
> Pljava-dev mailing list
> Pljava-dev at pgfoundry.org
> http://pgfoundry.org/mailman/listinfo/pljava-dev





^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* [Pljava-dev] Building pl/java on OS/X (Mountain Lion)
@ 2012-10-14 03:07  
  parent: 
  0 siblings, 1 reply; 7+ messages in thread

From:  @ 2012-10-14 03:07 UTC (permalink / raw)

On 10/13/12 7:38 PM, Hal Hildebrand wrote:
> Was also wondering if there's a more verbose mode for postgres startup, as what I'm getting is just a non zero exit.  Would be nice if there was something that gave some idea of what went wrong ;)
>
> Again, thanks for the help though.   Appreciated.

it all should be written to the logfiles



-- 
john r pierce                            N 37, W 122
santa cruz ca                         mid-left coast





^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* [Pljava-dev] Building pl/java on OS/X (Mountain Lion)
@ 2012-10-14 03:26  
  parent: 
  0 siblings, 0 replies; 7+ messages in thread

From:  @ 2012-10-14 03:26 UTC (permalink / raw)

On 10/13/12 8:07 PM, John R Pierce wrote:
> On 10/13/12 7:38 PM, Hal Hildebrand wrote:
>> Was also wondering if there's a more verbose mode for postgres 
>> startup, as what I'm getting is just a non zero exit.  Would be nice 
>> if there was something that gave some idea of what went wrong ;)
>>
>> Again, thanks for the help though.   Appreciated.
>
> it all should be written to the logfiles 

oh. when you get to the stage I was at with AIX last week, my best 
friend was the unix `ldd` command, on OSX I know its something 
different, but there's an equvalent, you give it an executable or a 
shared library (.so aka .dynlib), and it tries to find all the dependent 
libraries and lists them.

postgres would complain it couldn't load such and such a .so, so I'd 
...   ok here's one of my many steps from another thread on this list...


> $ psql -c "SELECT sqlj.install_jar('file:///opt/pljava/examples.jar', 
> 'samples', true);"
> INFO:  JVMJ9VM011W Unable to load jclscar_23: No such file or directory
> ERROR:  Failed to create Java VM 

The error message was misleading, when I did an `ldd` on that 
libjclscar_32.so, it turned out the /real/ error was...

$ ldd /usr/java5_64/jre/bin/libjclscar_23.so
/usr/java5_64/jre/bin/libjclscar_23.so needs:
          ../lib/libc_r.a(shr_64.o)
          ../lib/libpthread.a(shr_xpg5_64.o)
          /usr/java5_64/jre/bin/libjsig.so
          /usr/java5_64/jre/bin/libj9zlib23.so
          /usr/java5_64/jre/bin/libj9thr23.so
Cannot find libjvm.so <<<=====
          /unix
          ../lib/libcrypt.a(shr_64.o)
          ../lib/libc.a(shr_64.o)

and that libjvm.so is in /usr/java5_64/jre/bin/j9vm

so adding /usr/java5_64/jre/bin/j9vm to the dynamic_library_path seems 
to have fixed this.



-- 
john r pierce                            N 37, W 122
santa cruz ca                         mid-left coast





^ permalink  raw  reply  [nested|flat] 7+ messages in thread


end of thread, other threads:[~2012-10-14 03:26 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2012-10-13 17:39 [Pljava-dev] Building pl/java on OS/X (Mountain Lion) 
2012-10-14 00:01 ` 
2012-10-14 00:30   ` 
2012-10-14 00:44     ` 
2012-10-14 02:38       ` 
2012-10-14 03:07         ` 
2012-10-14 03:26           ` 

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox