0

I'm trying connect to PostgreSQL from C-code, and i have to build libpq from source, because i'm on AIX. I followed the steps in this comment Where do i get libpq source? but in result i got a 32-bit version of libpq.a, how build 64-bit version?

Community
  • 1
  • 1

2 Answers2

0

Compiling on AIX is harder than on other platforms... Always create a script which you gradually improve till you get a working version. Possible start:

#!/bin/sh

#assuming gcc
GCCLIB=$(dirname $(gcc -maix64 -pthread -print-file-name=libgcc_s.a))
export CFLAGS='-maix64 -mtune=native -pthread'
export CPPFLAGS='-D_GNU_SOURCE -D_XOPEN_SOURCE=500 -D_ALL_SOURCE'
export LDFLAGS="-maix64 -Wl,-brtl -Wl,-blibpath:/usr/local/lib64:${GCCLIB}:/usr/lib -L/usr/local/lib64 -pthread"
export OBJECT_MODE=64

./configure --prefix=/usr/local \
    --libdir=/usr/local/lib64   \
    --enable-shared             \
    --enable-static             \
    2>&1 | tee log.configure

make all 2>&1 | tee log.make.all
make install 2>&1 | tee log.make.install
Zsigmond Lőrinczy
  • 377
  • 1
  • 4
  • 9
0

The -q64 compiler option enables 64 bit (there is info in the compiler docs)

A quick google search of xlC 64 bit gives this link which you might find helpful.

http://northstar-www.dartmouth.edu/doc/ibmcxx/en_US/doc/complink/tasks/tubld64a.htm