Wiki Wiki

Installation_Mac

Installation Tips on a Mac

Snow Leopard

I know almost nothing about 'building' but after some searching, time (& tears) I have been able to build plr (I think it's working) on Snow Leopard. I'm posting this to hopefully help those who are struggling to get it, so it is in one place.

Background

1. I installed

2. Get to the contrib directory

$ cd /usr/local/pgsql/share/contrib

3. get plr

# sudo curl -O [http://www.joeconway.com/plr/plr-8.3.0.10.tar.gz]
	Password:
  • Actually, using sudo the whole way can be tedious. You might prefer to su - I did this and it was much easier in the end, but you have to Edit > Enable Root User in Directory Utility (which is now at /System/Library/CoreServices/Directory Utility.app
  • You also have to be prepared to be careful, as you can do horrendous damage if you are not careful. You have been warned!

4. Extract package

sh-3.2# tar -xzf plr-8.3.0.10.tar.gz

5. look inside

sh-3.2# cd plr

6. set environment variables:

(actually, I've now put these into ~/.profile or /etc/profile)

sh-3.2# export USE_PGXS=1
sh-3.2# export R_HOME="/Library/Frameworks/R.framework/Resources"
sh-3.2# export CUSTOM_COPT="-arch x86_64"

7. Make & Install

sh-3.2# make
sh-3.2# make install

8. restart postmaster with the appropriate environment variables :

sh-3.2# su postgres
    Password:
sh-3.2$ pg_ctl -D /usr/local/pgsql/data stop
waiting for server to shut down.... done
server stopped
sh-3.2$ export R_HOME="/Library/Frameworks/R.framework/Resources"
sh-3.2$ pg_ctl -D /usr/local/pgsql/data start
server starting
sh-3.2$ exit

9. load database

From the command line:

$ psql -d mydatabase -U myowner -f /usr/local/pgsql/share/contrib/plr.sql

or reading the file into the database:

$ psql mydatabase
mydatabase=# \i /usr/local/pgsql/share/contrib/plr.sql
0 Attachments 0 Attachments
6115 Views

Average (0 Votes)
Copyright (c) 2010 Joseph E Conway. All rights reserved.