"brew install osm2pgsql" failed - macos

I'm using mac and I want to install osm2pgsql to import OSM data into PostgreSQL.
I execute brew install osm2pgsql in the terminal. (I have already executed brew update).
Here is the output:
==> 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
And here is the output of executing 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
I don't know these dylibs and should I delete them?
What should I do to linstall osm2pgsql?
Or should I give up osm2pgsql and use some other tool to import OSM data into PostgreSQL?
[EDIT 1]
According to http://www.zlib.net/, zlib is already included as part of Mac OS X.
And when I search it in google, I found this https://github.com/josegonzalez/homebrew-php/issues/205 and this https://github.com/josegonzalez/homebrew-php/issues/538
So I execute the following two commands:
brew tap homebrew/dupes
brew install zlib
And the result output is:
==> 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
It seems that I don't have to install zlib.
Again I execute brew install osm2pgsql, but it still doesn't work.
[Edit 2]
I give up homebrew and install osm2pgsql via a binary installer.
FYI:
http://wiki.openstreetmap.org/wiki/Osm2pgsql#Binary_Installer
https://github.com/openstreetmap/osm2pgsql/issues/15

I don't know anything about brew but according to the error message you are missing the zlib library. Try to install it first.
And you should keep to osm2pgsql because it is the standard tool to import OSM data into a PostgreSQL database.

You have to edit the formula by using the following command:
brew edit <formula_name>
Then, you have to make the exports needed in the brew env, the best place to do this is in the install function just before the call of
system "./configure", *args
Here are the lines to append
ENV.append 'LDFLAGS', "-L/usr/local/opt/zlib/lib"
ENV.append 'CPPFLAGS', "-I/usr/local/opt/zlib/include"
When it is finished, you just have to run the brew installation again and it will works

I edited the formula, as it was not running on Mac OS X Mavericks either. See the gist which made it install successfully.
https://gist.github.com/christoph-buente/e18584e312bcadfe82e5
And i filed a pull request to the homebrew repository. Hopefully it will be merged:
https://github.com/Homebrew/homebrew/pull/29862

Related

Installing Homebrew + nginx + rtmp in macOS Movaje 10.14

I was able to install Homebrew + nginx + rtmp in macOS High Sierra 10.13. Now I want do the same on macOS Mojave 10.14.
So let's start ... istallation of Homebrew, first we need Xcode in terminal...
xcode-select –install
than. We need homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
than install nginx + rtmp
And here's the problem
I tried:
brew install nginx-full --with-rtmp-module
but it won't work
the result:
Updating Homebrew...
Usage: brew install [options] formula
Install formula. Additional options specific to formula may be appended to the command.
Unless HOMEBREW_NO_INSTALL_CLEANUP is set, brew cleanup will then be run for
the installed formulae or, every 30 days, for all formulae.
-d, --debug If brewing fails, open an interactive
debugging session with access to IRB or a
shell inside the temporary build directory.
--env If std is passed, use the standard build
environment instead of superenv. If super
is passed, use superenv even if the formula
specifies the standard build environment.
--ignore-dependencies An unsupported Homebrew development flag to
skip installing any dependencies of any
kind. If the dependencies are not already
present, the formula will have issues. If
you're not developing Homebrew, consider
adjusting your PATH rather than using this
flag.
--only-dependencies Install the dependencies with specified
options but do not install the formula
itself.
--cc Attempt to compile using the specified
compiler, which should be the name of the
compiler's executable, e.g. gcc-7 for GCC
7. In order to use LLVM's clang, specify
llvm_clang. To use the Apple-provided
clang, specify clang. This option will
only accept compilers that are provided by
Homebrew or bundled with macOS. Please do
not file issues if you encounter errors
while using this option.
-s, --build-from-source Compile formula from source even if a
bottle is provided. Dependencies will still
be installed from bottles if they are
available.
--force-bottle Install from a bottle if it exists for the
current or newest version of macOS, even if
it would not normally be used for
installation.
--include-test Install testing dependencies required to
run brew test formula.
--devel If formula defines it, install the
development version.
--HEAD If formula defines it, install the HEAD
version, aka. master, trunk, unstable.
--fetch-HEAD Fetch the upstream repository to detect if
the HEAD installation of the formula is
outdated. Otherwise, the repository's HEAD
will only be checked for updates when a new
stable or development version has been
released.
--keep-tmp Retain the temporary files created during
installation.
--build-bottle Prepare the formula for eventual bottling
during installation, skipping any
post-install steps.
--bottle-arch Optimise bottles for the specified
architecture rather than the oldest
architecture supported by the version of
macOS the bottles are built on.
-f, --force Install without checking for previously
installed keg-only or non-migrated
versions.
-v, --verbose Print the verification and postinstall
steps.
--display-times Print install times for each formula at the
end of the run.
-i, --interactive Download and patch formula, then open a
shell. This allows the user to run
./configure --help and otherwise
determine how to turn the software package
into a Homebrew package.
-g, --git Create a Git repository, useful for
creating patches to the software.
-h, --help Show this message.
Error: invalid option: --with-rtmp-module
so i tried:
brew install nginx --with-rtmp-module
but.....result:
Updating Homebrew...
Error: No available formula with the name "–with-rtmp-module"
==> Searching for a previously deleted formula (in the last month)...
Error: No previously deleted formula found.
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching taps...
==> Searching taps on GitHub...
Error: No formulae found in taps.
so I decided to try install nginx first and than rtmp module
brew install nginx
and than i tried:
brew install nginx libnginx-mod-rtmp (copying from Linux)
brew install rtmp-module
brew install module-rtmp
But none of the above worked. How do I resolve it?
You should tap a nginx formulae before try install nginx-full
Well you can try denji/nginx, since homebrew/nginx tap has been deprecated, That's:
brew tap denji/nginx
then
brew install nginx-full --with-rtmp-module
That works for me.

Unable to install OpenVPN on macOS - configure: error: lzo enabled but missing

I'm trying to install OpenVPN on macOS High Sierra
I have cloned the github repo:
git clone https://github.com/OpenVPN/openvpn
And switched to the latest stable branch:
git checkout origin release/2.4
But when I tried to build the project (following the INSTALL instructions):
autoreconf -i -v -f
./configure
I had this error during the configure step:
configure: error: lzo enabled but missing
Even after installing lzo dependency with macos ports, the problem persists.
The answer to this problem was easier than I thought...
I had just to define the env vars CFLAGS and LDFLAGS before running configure script:
export CFLAGS="-I/opt/local/include"
export LDFLAGS="-L/opt/local/lib"
./configure
make
sudo make install
UPDATE
If you had to install lzo:
using brew: brew install lzo or brew link lzo in case it already exists
using port: sudo port install lzo
I use a M1 MacBook Pro so freedev's answer did not work. I had to instead include the library from inside the homebrew directories so my final configure command was:
./configure LDFLAGS="-L/opt/homebrew/lib -L/opt/homebrew/opt/openssl#3/lib" CPPFLAGS="-I/opt/homebrew/include -I/opt/homebrew/opt/openssl#3/include"
The following resolved the issue for me:
sudo apt-get install libssl-dev liblzo2-dev libpam0g-dev
I got this fix from this askubuntu.com openvpn lzo enabled but missing question.
More details: I got each of the 3 error messages shown below separately. Each one was resolved, then I got the next. All 3 are resolved with the one command line above. Basically, 3 developer packages were missing.
configure: error: OpenSSL version too old (resolved with libssl-dev)
configure: error: lzo enabled but missing (resolved with liblzo2-dev)
configure: error: libpam required but missing (resolved with libpam0g-dev)
Thanks to all the other answers which helped to confirm things, triangulate to the answer I felt most confident about!

Installing gphoto2 on mac os x Yosemite - issue with ./configure

I am trying to install gphoto2 on my macbook pro. I installed the tar.gz from their website and from terminal I cd Downloads and run ./configure as the README file recommends doing. I keep receiving this error:
checking for pkg-config... false
configure: error:
*** Build requires pkg-config
***
*** Possible solutions:
*** - set PKG_CONFIG to where your pkg-config is located
*** - set PATH to include the directory where pkg-config is installed
*** - get it from http://freedesktop.org/software/pkgconfig/ and install it
I have Xcode 6 installed, as well as Command Line tools (tested it by running gcc in terminal). What am I doing wrong? What should I do?
Also, should I install gphoto2 or libgphoto2?
I wouldn't bother faffing around with building it yourself. I would install homebrew from here.
Then you can simply do
brew install gphoto2
and you will also have a decent package manager if you want to install other cool stuff later on - e.g. ImageMagick, gawk, GNU sed, swatch, youtube-downloader, wxWidgets, vips, redis, sox, ffmpeg. To find other cool stuff that can be managed with homebrew just do
brew search

Compiling Hadoop Examples in Mac

I am new to Unixlike operating systems.
After installing Hadoop as per the instructions below,
http://wiki.apache.org/hadoop/Running_Hadoop_On_OS_X_10.5_64-bit_(Single-Node_Cluster)
I am trying to build the examples as given in the same URL using
ant examples
This gives me an exception as below
compile-mapred-classes:
Trying to override old definition of task jsp-compile
[javac] /Users/hadoop/hadoop-1.2.1/build.xml:549: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
create-native-configure:
BUILD FAILED
/Users/hadoop/hadoop-1.2.1/build.xml:634: Execute failed: java.io.IOException: Cannot run program "autoreconf" (in directory "/Users/hadoop/hadoop-1.2.1/src/native"): error=2, No such file or directory
What exactly is needed for my Mac to get past this?
As the error says, you need to install autoreconf. The easiest way to do it is through Homebrew (brew install autoconf, after you install the Homebrew itself).
Incidentally, hadoop can be installed through Homebrew as well.
I had the same issue, and was able to resolve it by installing automake, autoconf and libtool:
brew install automake autoconf libtool
Running a couple of brew unlink {formula} && brew link {formula} on automake, autoconf and libtool did the trick for me

fontforge building in brew, terminal cant find gcc error

This is my first time trying to compile source code in terminal (I installed gimp using macPorts but this could be part of the problem...?)
I want to install fontforge and I was following these instructions how to install fontforge.
I got this warning while installing brew:
Warning: The following *evil* dylibs exist in /usr/local/lib
They may break builds or worse. You should consider deleting them:
/usr/local/lib/libssl.0.9.8.dylib
I could not find usr/local/lib and the only libssl file was in opt/local/lib called libssl.1.0.0.dylib which is supposed to be hidden apparently...
I made it to the "brew install cairo --use-clang" step, then when I try the "brew install fontforge --use-gcc" step I get the following warning:
Warning: It appears you have MacPorts or Fink installed.
Software installed with other package managers causes known problems for
Homebrew. If a formula fails to build, uninstall MacPorts/Fink and try again.
==> Installing fontforge dependency: gettext
Error: GCC could not be found
when I check gcc version I get:
:~ me$ gcc --V
i686-apple-darwin11-llvm-gcc-4.2: no input files
Do I need to uninstall macports (then re-install gimp?)
I read gcc comes with xcode, I have xcode 4.3 (upgraded after this issue but didn't fix it) so do I have gcc or not? is there another way to check etc.
Can anyone tell me what I am doing wrong (what I broke etc)?
NOTE I also have flashbuilder which has a program called gcc as well (I dont know if this broke the other gcc...)

Resources