[Postgres-xl-general] Fwd: Smartos and Postgresqlxl

Ernest Lee ernest.lee at chibifire.com
Wed Feb 11 01:27:27 PST 2015


Hello Group,

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.

```bash
# 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.
```json
{
 "brand": "joyent",
 "image_uuid": "62f148f8-6e84-11e4-82c5-efca60348b9f",
 "alias": "web01",
 "hostname": "web01",
 "max_physical_memory": 1750,
 "quota": 20,
 "resolvers": ["8.8.8.8", "208.67.220.220"],
 "nics": [
  {
    "nic_tag": "admin",
    "ip": "192.168.1.79",
    "netmask": "255.255.255.0",
    "gateway": "192.168.1.254"
  }
 ]
}
```

```bash
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
dsssl-docbook-modular
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
--with-system-tzdata=/usr/share/lib/zoneinfo
cd src/backend/pgxc/pool
nano poolcomm.c
#ifdef __sun
#define _XOPEN_SOURCE 500
#define _XOPEN_SOURCE_EXTENDED 1
#define uint uint32_t
#endif
nano pgxcnode.c
#ifdef __sun
#include "sys/filio.h"
#endif
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-general mailing list