views:

1029

answers:

3

I've installed PostgreSQL using MacPorts on a couple of different computers, no problem, but when it comes to my own laptop, I cannot get it to build.

When I do this command:

sudo port install postgresql83

I get this error:

checking test program... failed
configure: error:
Could not execute a simple test program.  This may be a problem
related to locating shared libraries.  Check the file 'config.log'
for the exact reason.

Error: The following dependencies failed to build: postgresql83
Error: Status 1 encountered during processing.

The config.log file is 7000 lines long with no obvious problems that I can see (it says "exit 1" on the last line, though!).

I do have the developer tools and what not installed and I have updated to the latest version of MacPorts and sync'ed my ports tree. I can install other things via MacPorts.

I've Googled in vain for details on what this means. Any suggestions? Thanks!

UPDATE: I think this is what is causing it to fail (from config.log):

configure:8307: ./conftest
dyld: Library not loaded: /opt/local/lib/libxml2.2
  Referenced from: /opt/local/lib/libxslt.1.dylib
  Reason: image not found

I have libxml2 installed but maybe it's screwed up. I uninstalled libxml2 and libxslt and am re-installing them fresh, so we'll see what happens.

+1  A: 

This was the key:

configure:8307: ./conftest
dyld: Library not loaded: /opt/local/lib/libxml2.2
  Referenced from: /opt/local/lib/libxslt.1.dylib
  Reason: image not found

This was not near the bottom of the config.log, it was at about line 700.

Despite the fact that I'd already upgraded libxml to the appropriate version (which has been a problem I've had to address previously when installing postgresql) it was not working with libxslt.

I uninstalled libxml (both versions I had installed) and libxslt and then installed postgresql again, and this time it was able to build.

If you get an error like this building postgresql, check out libraries.

BTW, the config.log file can be found in a location like this:

/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_databases_postgresql83/work/postgresql-8.3.6/config.log
Luke Francl
"cd `port dir postgresql83`" will jump you most of the way through that nasty-long path.
Nerdling
A: 

postgresql83 is at version 8.3.6 in MacPorts. Is that the same version that your copy is working with? "port info postgresql83" If they are different, do "sudo port selfupdate && sudo port upgrade -u outdated && sudo port clean postgresql83" to bring everything up-to-date, then try again.

From what I can see, postgresql83 should depend on libxml2, not libxml. This should already be handled by MacPorts. You may want to do the above commands either way (make sure dependencies are updated and clean the directory to try again).

Nerdling
You're right, it does depend on libxml2. I was not being precise when I called it libxml. I had a previous version installed. I'd deactivated it to install the newest, but apparently that didn't work. Uninstalling it and reinstalling did.
Luke Francl
The -u in 'upgrade -u' will remove the old version (all inactive versions) during an upgrade.Does that mean you got it working?
Nerdling
Ah, cool, I did not know about upgrade -u. I did get Postgres working, though.
Luke Francl
A: 

I realize this is an answer which does not solve the problem, but as a mac user who isn't a fan of mac ports, I sought out another solution to installing postgres. And not to long ago, the postgres website downloads section started promoting EnterpriseDB's one-click installer.

I've tried to install it via mac ports in the past, and eventually settled on manually installing it from the source, and it was a pain. This installer is pretty nice. It puts executables in mac-appropriate places, puts its libraries in /Library and even includes a couple of extra programs to help work with postgres. Give it a shot, there's no need to be pulling your hair out with a flaky mac ports install when there's a good quality installer available.

dburke