Thread: Compiling
Howdy,
I'm new to Solaris, and to rollling my own PGSQL.
GCC & GMAKE installed in: /opt/sfw/bin
My path is in this order: (and I removed that /usr/ucs or whatever everyone recommends you remove :) ).
/opt/sfw/bin:/usr/ccs/bin:/usr/bin:/usr/local/bin:etc...
I did a gmake all. It came back with a "Postgres built successfully." message.
I did a gmake install. Everything is OK with the database. I can do everything with PostGres normal interfaces/clients.
I want to write a C++ app using the libpq++ library, but it was not built or installed.
I try to build it from the src/interfaces/libpq++ directory and I get the following errors:
# pwd
/usr/local/postgres-7.2.1/src/interfaces/libpq++
# gmake all
KPIC -I../../../src/interfaces/libpq -I../../../src/include -c -o pgconnection
.o pgconnection.cc
gmake: KPIC: Command not found
gmake: [pgconnection.o] Error 127 (ignored)
KPIC -I../../../src/interfaces/libpq -I../../../src/include -c -o pgdatabase.o
pgdatabase.cc
gmake: KPIC: Command not found
gmake: [pgdatabase.o] Error 127 (ignored)
KPIC -I../../../src/interfaces/libpq -I../../../src/include -c -o pgtransdb.o
pgtransdb.cc
gmake: KPIC: Command not found
gmake: [pgtransdb.o] Error 127 (ignored)
KPIC -I../../../src/interfaces/libpq -I../../../src/include -c -o pgcursordb.o
pgcursordb.cc
gmake: KPIC: Command not found
gmake: [pgcursordb.o] Error 127 (ignored)
KPIC -I../../../src/interfaces/libpq -I../../../src/include -c -o pglobject.o
pglobject.cc
gmake: KPIC: Command not found
gmake: [pglobject.o] Error 127 (ignored)
xar -o libpq++.a pgconnection.o pgdatabase.o pgtransdb.o pgcursordb.o pglobject.
o
gmake: xar: Command not found
gmake: [libpq++.a] Error 127 (ignored)
: libpq++.a
G -h libpq++.so.4 pgconnection.o pgdatabase.o pgtransdb.o pgcursordb.o pglobject
.o -L../../../src/interfaces/libpq -lpq -R/usr/local/pgsql/lib -o libpq++.so.4
.0
gmake: G: Command not found
gmake: [libpq++.so.4.0] Error 127 (ignored)
rm -f libpq++.so.4
ln -s libpq++.so.4.0 libpq++.so.4
rm -f libpq++.so
ln -s libpq++.so.4.0 libpq++.so
KPIC -I../../../src/interfaces/libpq -I../../../src/include -c -o pgconnection
.o pgconnection.cc
gmake: KPIC: Command not found
gmake: [pgconnection.o] Error 127 (ignored)
KPIC -I../../../src/interfaces/libpq -I../../../src/include -c -o pgdatabase.o
pgdatabase.cc
gmake: KPIC: Command not found
gmake: [pgdatabase.o] Error 127 (ignored)
KPIC -I../../../src/interfaces/libpq -I../../../src/include -c -o pgtransdb.o
pgtransdb.cc
gmake: KPIC: Command not found
gmake: [pgtransdb.o] Error 127 (ignored)
KPIC -I../../../src/interfaces/libpq -I../../../src/include -c -o pgcursordb.o
pgcursordb.cc
gmake: KPIC: Command not found
gmake: [pgcursordb.o] Error 127 (ignored)
KPIC -I../../../src/interfaces/libpq -I../../../src/include -c -o pglobject.o
pglobject.cc
gmake: KPIC: Command not found
gmake: [pglobject.o] Error 127 (ignored)
xar -o libpq++.a pgconnection.o pgdatabase.o pgtransdb.o pgcursordb.o pglobject.
o
gmake: xar: Command not found
gmake: [libpq++.a] Error 127 (ignored)
: libpq++.a
G -h libpq++.so.4 pgconnection.o pgdatabase.o pgtransdb.o pgcursordb.o pglobject
.o -L../../../src/interfaces/libpq -lpq -R/usr/local/pgsql/lib -o libpq++.so.4
.0
gmake: G: Command not found
gmake: [libpq++.so.4.0] Error 127 (ignored)
rm -f libpq++.so.4
ln -s libpq++.so.4.0 libpq++.so.4
rm -f libpq++.so
ln -s libpq++.so.4.0 libpq++.so
I can't find an xar application anywhere. Is this the 64bit version of Solaris ar program? If so, why is it calling that one?
Did I have to explicity tell ./configure that I wanted the libpq++ lib built?
I managed to stumble into a "building postgres on unix boxes" type tip page, where it mentioned that KPIC is the Sun C compiler directive for shared library creation. GCC should use the -fpic option instead. Why did some of the interfaces build, (libpq, java, odbc etc) and not libpq++?
Where is the KPIC option coming from? I've tried to do a grep on the Makefiles and come up empty. I may be looking in the wrong place as well. Can I do this by hand for the libpq++ lib?
Thanks in advance
RDB
rdb55@email.byu.edu
Randall Barber <rdb55@email.byu.edu> writes: > I want to write a C++ app using the libpq++ library, but it was not built = > or installed. Presumably because you didn't say --with-cxx (or however that option is spelled) so configure didn't go looking for a C++ compiler. You need to reconfigure. regards, tom lane