1

我已经在几台不同的计算机上使用 MacPorts 安装了 PostgreSQL,没问题,但是当涉及到我自己的笔记本电脑时,我无法构建它。

当我执行此命令时:

sudo port install postgresql83

我收到此错误:

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.

config.log 文件有 7000 行长,我看不到明显的问题(不过,它在最后一行显示“exit 1”!)。

我确实有开发者工具和没有安装的东西,我已经更新到最新版本的 MacPorts 并同步了我的端口树。我可以通过 MacPorts 安装其他东西。

我在 Google 上搜索了有关这意味着什么的详细信息,但徒劳无功。有什么建议么?谢谢!

更新:我认为这是导致它失败的原因(来自 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

我安装了 libxml2,但可能搞砸了。我卸载了 libxml2 和 libxslt 并重新安装它们,所以我们将看看会发生什么。

4

3 回答 3

2

这是关键:

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

这不在 config.log 的底部附近,大约在第 700 行。

尽管我已经将 libxml 升级到了适当的版本(这是我之前在安装 postgresql 时必须解决的一个问题),但它不能与 libxslt 一起使用。

我卸载了 libxml(我已经安装了两个版本)和 libxslt,然后再次安装了 postgresql,这一次它能够构建。

如果你在构建 postgresql 时遇到这样的错误,请查看库。

顺便说一句,config.log 文件可以在这样的位置找到:

/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_databases_postgresql83/work/postgresql-8.3.6/config.log
于 2009-02-24T16:55:15.497 回答
0

postgresql83 在 MacPorts 中的版本为 8.3.6。与您的副本正在使用的版本相同吗?“port info postgresql83” 如果它们不同,请执行“sudo port selfupdate && sudo port upgrade -u outdated && sudo port clean postgresql83”以更新所有内容,然后重试。

据我所知,postgresql83 应该依赖于 libxml2,而不是 libxml。这应该已经由 MacPorts 处理了。您可能希望以任何一种方式执行上述命令(确保更新依赖项并清理目录以重试)。

于 2009-02-24T21:21:06.560 回答
0

我意识到这是一个不能解决问题的答案,但是作为一个不喜欢 mac 端口的 mac 用户,我找到了另一种安装 postgres 的解决方案。不久前,postgres 网站下载部分开始宣传EnterpriseDB 的一键安装程序

我过去曾尝试通过mac端口安装它,最终决定从源头手动安装它,这很痛苦。这个安装程序很不错。它将可执行文件放在适合 mac 的位置,将其库放在 /Library 中,甚至包括一些额外的程序来帮助使用 postgres。试一试,当有高质量的安装程序可用时,无需安装易碎的 mac 端口。

于 2009-03-02T05:31:04.467 回答