[Postgres-xl-developers] Smartos and Postgresqlxl

Ernest Lee ernest.lee at chibifire.com
Mon Feb 9 09:58:43 PST 2015

Hello Mason Sharp,

I was able to get postgresqlxl compiled on smartos.

Here's my log of the commands I used. They're not the actual solution,
but it gets the software compiled.

It appears that --with-system-tzdata=/usr/share/lib/zoneinfo breaks
postgresql-xl on the self-test, but otherwise it appears to work.

Converation with #smartos:

<jperkin> the best fix is to properly check for platform features in
configure and then append to CFLAGS/LDFLAGS as appropriate
<jperkin> hardcoding _XOPEN_* stuff in files usually ends up with
breakage as there may be conflicting flags set on a project-wide
basis, so checking for what spec you are targetting first and then
setting them globally helps avoid that
<jperkin> same for socket libs, add tests for the library calls you
need, unfortunately it's something a lot of software doesn't do right,
hence the many many LDFLAGS.SunOS+=-lsocket -lnsl in pkgsrc

Perhaps you can help me make a patch that allows postgresql to work on
this operating system.


Download joyent smartos image.

Configure vm to have bridged networking and promiscious mode.

# Find if of Smartos base64 image
imgadm avail | grep base64
# Copy id and import the image
imgadm import 62f148f8-6e84-11e4-82c5-efca60348b9f
# Create a container based on json information
vmadm create -f test.json
# Save uuid for next section

Copy of the json used in the vm creation.
 "brand": "joyent",
 "image_uuid": "62f148f8-6e84-11e4-82c5-efca60348b9f",
 "alias": "web01",
 "hostname": "web01",
 "max_physical_memory": 1750,
 "quota": 20,
 "resolvers": ["", ""],
 "nics": [
    "nic_tag": "admin",
    "ip": "",
    "netmask": "",
    "gateway": ""

zlogin <UUID>
pkgin update
pkgin -y upgrade
pkgin -y in  build-essential flex bison openssl xml2 libxslt ossp-uuid
git postgresql92-client nano openjade docbook docbook-xsl
sudo su - admin
git clone git://git.code.sf.net/p/postgres-xl/postgres-xl postgres-xl
cd postgres-xl
./configure --with-openssl --with-libxml --with-libxslt
--with-ossp-uuid --enable-nls
cd src/backend/pgxc/pool
nano poolcomm.c
#ifdef __sun
#define _XOPEN_SOURCE 500
#define uint uint32_t
nano pgxcnode.c
#ifdef __sun
#include "sys/filio.h"
cd -
make # Will fail
cd src/gtm
make LDFLAGS="-lnsl -lsocket" # Horrible hack
cd -
nano /home/admin/postgres-xl/doc-xc/src/sgml/Makefile # Remove : from
clean-sgml in ".PHONY: clean-sgml:"from 367~
cd -
sudo ln -s /opt/local/bin/openjade  /opt/local/bin/jade
#make check # Run self-test
sudo make install

More information about the Postgres-xl-developers mailing list