【问题标题】:"brew install osm2pgsql" failed“brew install osm2pgsql”失败
【发布时间】:2013-08-20 01:21:31
【问题描述】:

我正在使用mac,我想安装osm2pgsqlOSM 数据导入PostgreSQL

我在终端中执行brew install osm2pgsql。 (我已经执行了brew update)。

这是输出:

==> Downloading https://github.com/openstreetmap/osm2pgsql/archive/v0.82.0.zip
Already downloaded: /Library/Caches/Homebrew/osm2pgsql-0.82.0.zip
==> ./autogen.sh
==> ./configure --with-proj=/usr/local/opt/proj
checking for fork... yes
checking for xml2-config... /usr/bin/xml2-config
checking for xml2 libraries... yes
checking for zlib compression library... no
configure: error: required library not found

READ THIS: https://github.com/mxcl/homebrew/wiki/troubleshooting

这是执行brew doctor的输出:

Warning: Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected dylibs:
    /usr/local/lib/libMonoPosixHelper.dylib
    /usr/local/lib/libSFFileMonitor.32.dylib
    /usr/local/lib/libSFIPC.32.dylib
    /usr/local/lib/libSFIPC.I.dylib
    /usr/local/lib/libSFsqlite3.7.4.dylib
    /usr/local/lib/libSFSyncEngine.I.dylib

我不知道这些 dylib,我应该删除它们吗?

我应该怎么做才能安装osm2pgsql

还是应该放弃osm2pgsql,使用其他工具将OSM数据导入PostgreSQL

[编辑 1]

根据http://www.zlib.net/,zlib 已经包含在 Mac OS X 中。

当我在谷歌搜索时,我发现了这个https://github.com/josegonzalez/homebrew-php/issues/205 和这个https://github.com/josegonzalez/homebrew-php/issues/538

于是我执行以下两条命令:

brew tap homebrew/dupes
brew install zlib

结果输出为:

==> Downloading http://zlib.net/zlib-1.2.8.tar.gz
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/zlib/1.2.8
==> make install
==> Caveats
This formula is keg-only: so it was not symlinked into /usr/local.

Mac OS X already provides this software and installing another version in
parallel can cause all kinds of trouble.

Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:

    LDFLAGS:  -L/usr/local/opt/zlib/lib
    CPPFLAGS: -I/usr/local/opt/zlib/include

==> Summary

看来我不用安装zlib了。

我再次执行brew install osm2pgsql,但还是不行。

[编辑 2]

我放弃自制软件,通过二进制安装程序安装 osm2pgsql。

仅供参考:
http://wiki.openstreetmap.org/wiki/Osm2pgsql#Binary_Installer https://github.com/openstreetmap/osm2pgsql/issues/15

【问题讨论】:

标签: macos postgresql homebrew openstreetmap


【解决方案1】:

我对@9​​87654321@ 一无所知,但根据错误消息,您缺少zlib 库。尝试先安装它。

您应该保留osm2pgsql,因为它是将 OSM 数据导入 PostgreSQL 数据库的标准工具。

【讨论】:

    【解决方案2】:

    您必须使用以下命令编辑公式:

    brew edit <formula_name>
    

    然后,您必须在 brew env 中进行所需的导出,最好的地方是在调用之前的 install 函数中

    system "./configure", *args
    

    这是要附加的行

    ENV.append 'LDFLAGS', "-L/usr/local/opt/zlib/lib"
    ENV.append 'CPPFLAGS', "-I/usr/local/opt/zlib/include"
    

    完成后,您只需再次运行 brew 安装,它就可以工作了

    【讨论】:

      【解决方案3】:

      我编辑了公式,因为它也没有在 Mac OS X Mavericks 上运行。查看成功安装的要点。

      https://gist.github.com/christoph-buente/e18584e312bcadfe82e5

      我向自制软件存储库提交了拉取请求。希望它会被合并:

      https://github.com/Homebrew/homebrew/pull/29862

      【讨论】:

        猜你喜欢
        • 2012-01-29
        • 2013-04-03
        • 1970-01-01
        • 2023-03-14
        • 2016-07-31
        • 1970-01-01
        • 1970-01-01
        • 2019-05-08
        • 1970-01-01
        相关资源
        最近更新 更多