I'm trying to install PostGIS 2.2.1 on Mac OS X 10.8. I've installed all of the prerequisites for PostGIS and am now running the configure command:
./configure CC=/usr/bin/clang CXX=/usr/bin/clang++ "CFLAGS=-arch x86_64 -arch i386" "LDFLAGS=-arch x86_64 -arch i386" "CXXFLAGS=-arch x86_64 -arch i386"
I'm getting the following error:
configure: error: could not find libpq
I have PostgreSQL 9.1.4 installed and I believe I see the libpq libraries which is owned by root:wheel:
/usr/local/pgsql/lib/libpq.5.4.dylib /usr/local/pgsql/lib/libpq.5.dylib /usr/local/pgsql/lib/libpq.a /usr/local/pgsql/lib/libpq.dylib
I did the following but it didn't help:
This too in case PostGIS just needs to know where Postgres is installed:
Finally, I ran this command with and without sudo:
./configure CC=/usr/bin/clang CXX=/usr/bin/clang++ "CFLAGS=-arch x86_64 -arch i386" "LDFLAGS=-arch x86_64 -arch i386" "CXXFLAGS=-arch x86_64 -arch i386" "LD_LIBRARY_PATH=/usr/local/pgsql/lib"
What am I doing wrong? I found another post here where someone else had the same problem but the solutions noted there didn't work for me.
UPDATE: I'm looking in the PostGIS config.log file and can at least see why the error is occurring. I just don't quite understand what to do to prevent it.
ld: warning: ignoring file /usr/local/pgsql/lib/libpq.dylib, file was built for unsupported file format ( 0xcf 0xfa 0xed 0xfe 0x 7 0x 0 0x 0 0x 1 0x 3 0x 0 0x 0 0x 0 0x 6 0x 0 0x 0 0x 0 ) which is not the architecture being linked (i386): /usr/local/pgsql/lib/libpq.dylib Undefined symbols for architecture i386: "_PQserverVersion", referenced from: _main in conftest-sxaGdF.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)