title: "brew install osm2pgsql" failed
body: <p>I'm using mac and I want to install <code>osm2pgsql</code> to import <code>OSM</code> data into <code>PostgreSQL</code>.</p>
  
  <p>I execute <code>brew install osm2pgsql</code> in the terminal. (I have already executed <code>brew update</code>).</p>
  
  <p>Here is the output:</p>
  
  <pre><code>==&gt; Downloading https://github.com/openstreetmap/osm2pgsql/archive/v0.82.0.zip
  Already downloaded: /Library/Caches/Homebrew/osm2pgsql-0.82.0.zip
  ==&gt; ./autogen.sh
  ==&gt; ./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
  </code></pre>
  
  <p>And here is the output of executing <code>brew doctor</code>:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>I don't know these dylibs and should I delete them?</p>
  
  <p>What should I do to linstall <code>osm2pgsql</code>?</p>
  
  <p>Or should I give up <code>osm2pgsql</code> and use some other tool to import <code>OSM</code> data into <code>PostgreSQL</code>?</p>
  
  <p><strong>[EDIT 1]</strong></p>
  
  <p>According to <a href="http://www.zlib.net/" rel="nofollow">http://www.zlib.net/</a>, zlib is already included as part of Mac OS X. </p>
  
  <p>And when I search it in google, I found this <a href="https://github.com/josegonzalez/homebrew-php/issues/205" rel="nofollow">https://github.com/josegonzalez/homebrew-php/issues/205</a> and this <a href="https://github.com/josegonzalez/homebrew-php/issues/538" rel="nofollow">https://github.com/josegonzalez/homebrew-php/issues/538</a></p>
  
  <p>So I execute the following two commands:</p>
  
  <pre><code>brew tap homebrew/dupes
  brew install zlib
  </code></pre>
  
  <p>And the result output is:</p>
  
  <pre><code>==&gt; Downloading http://zlib.net/zlib-1.2.8.tar.gz
  ######################################################################## 100.0%
  ==&gt; ./configure --prefix=/usr/local/Cellar/zlib/1.2.8
  ==&gt; make install
  ==&gt; 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
  
  ==&gt; Summary
  </code></pre>
  
  <p>It seems that I don't have to install zlib.</p>
  
  <p>Again I execute <code>brew install osm2pgsql</code>, but it still doesn't work.</p>
  
  <p><strong>[Edit 2]</strong></p>
  
  <p>I give up homebrew and install osm2pgsql via a binary installer.</p>
  
  <p>FYI:<br>
  <a href="http://wiki.openstreetmap.org/wiki/Osm2pgsql#Binary_Installer" rel="nofollow">http://wiki.openstreetmap.org/wiki/Osm2pgsql#Binary_Installer</a>
  <a href="https://github.com/openstreetmap/osm2pgsql/issues/15" rel="nofollow">https://github.com/openstreetmap/osm2pgsql/issues/15</a></p>