How do I compile jzmq for ZeroMQ on OSX? - macos

Trying to follow the directions from: http://github.com/zeromq/jzmq
I installed pkg-config using Homebrew and then I run the following commands:
./autogen.sh
./configure
The configure fails with:
checking how to hardcode library paths into programs... immediate
./configure: line 15263: syntax error near unexpected token `newline'
./configure: line 15263: ` PKG_CHECK_MODULES('

A better solution is:
eval `brew --config | grep HOMEBREW_PREFIX | sed 's/: /=/'`
sudo bash -c 'echo '$HOMEBREW_PREFIX/share/aclocal' >> `aclocal --print-ac-dir`/dirlist'
This will allow the version of aclocal that ships with OSX to find any macros installed by homebrew packages.

With homebrew, the key is the warning message:
~/code/foss/java/jzmq$ brew install pkg-config
==> Downloading http://pkg-config.freedesktop.org/releases/pkg-config-0.25.tar.gz
==> ./configure --disable-debug --prefix=/usr/local/Cellar/pkg-config/0.25 --with-pc-path=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig:/usr/X11/lib/pkgconfig
==> make install
Warning: m4 macros were installed to "share/aclocal".
Homebrew does not append "/usr/local/share/aclocal"
to "/usr/share/aclocal/dirlist". If an autoconf script you use
requires these m4 macros, you'll need to add this path manually.
==> Summary
/usr/local/Cellar/pkg-config/0.25: 8 files, 232K, built in 19 seconds
If you look at /usr/local/Cellar/pkg-config/0.25/share/aclocal/, you will see:
$ ls /usr/local/Cellar/pkg-config/0.25/share/aclocal/
pkg.m4
You need to append /usr/local/Cellar/pkg-config/0.25/share/aclocal/ to /usr/share/aclocal/dirlist,like this:
$ cat /usr/share/aclocal/dirlist
/usr/local/share/aclocal
/usr/local/Cellar/pkg-config/0.25/share/aclocal/
And then re-run autogen and the other steps.

I made a simple list about jzmq building for MacOS.
Install brew
https://brew.sh
Install tools for jzmq building
brew install autoconf
brew install automake
brew install libtool
brew install pkg-config
brew install zeromq#3.2
Download jzmq source
https://github.com/zeromq/jzmq source download to ~/somewhere/jzmq
Add symbolic link to /usr/local/include
cd /usr/local/include
ln -s /usr/local/Cellar/zeromq\#3.2/3.2.5/include/zmq.h
ln -s /usr/local/Cellar/zeromq\#3.2/3.2.5/include/zmq_utils.h
Add symbolic linke to /usr/local/lib
cd /usr/local/lib
ln -s /usr/local/Cellar/zeromq\#3.2/3.2.5/lib/libzmq.3.dylib
ln -s /usr/local/Cellar/zeromq\#3.2/3.2.5/lib/libzmq.a
ln -s /usr/local/Cellar/zeromq\#3.2/3.2.5/lib/libmq.dylib
ln -s /usr/local/Cellar/zeromq\#3.2/3.2.5/lib/pkgconfig/
Build jzmq-jni
cd ~/somewhere/jzmq
cd jzmq-jni
./autogen.sh
./configure
make
make install
Add option to VM options
VM options -Djava.library.path=/usr/local/lib

From the zeromq mailing list:
Building 0MQ from the development
trunk on a UNIX style OS (Linux, OS X)
requires that pkg-config
(http://pkg-config.freedesktop.org/wiki/)
be installed. A regular source build
of 0MQ does not require pkg-config.
On Mac OS X, pkg-config does not come
with the system, so when you try to do
./configure you may see errors like:
./configure: line 23913: syntax error near unexpected token `GLIB,'
./configure: line 23913: `PKG_CHECK_MODULES(GLIB, glib-2.0 gthread-2.0)'
To resolve this, you need to install
the latest pkg-config:
tar xzf pkg-config-0.25.tar.gz
cd pkg-config-0.25
./configure --prefix=/usr/local/pkg-config-0.25 --datarootdir=/usr/share
make
sudo make install
Then you will need to put
/usr/local/pkg-config-0.25/bin on your
$PATH. It is important to include the
"--datarootdir=/usr/share" option,
which will install the pkg.m4 file in
/usr/share/aclocal, where aclocal will
be able to find it.
Then you can build 0MQ:
cd zeromq2
./autogen.sh # must do this again after installing pkg-config
./configure # add other options here
make
sudo make install
Edited to reflect latest pkg-config version (0.25).

I came here with the same question, and I don't feel this is answered. I also installed ZeroMQ and pkg-config via Homebrew. /usr/local/share/aclocal/pkg.m4 exists and comes from pkg-config 0.25. It seems that Homebrew has satisfied the requirements listed but it still fails.

Trying to compile jzmq on Mac OS X, proved to be a bit of a headache. I followed the instructions above. I was still getting following error
syntax error near unexpected token
`PKG_CHECK_MODULES
The instructions above tell you to copy the pkgk.m4 file into /usr/share/aclocal, but your directory might be different. Basically you need the dir that automake searches for macro definitions.
The _PKG_CHECK_MODULES_ macro is defined in the pkg.m4 file. This file must be installed in the appropriate directory, which is searched by automake. Somehow automake is installed twice on my OS X, one in /usr and another in /Developer/usr. Make sure you know which one it's using. Just do which automake. If yours in is /Developer/usr, then copy the pkg.m4 file to /Developer/usr/share/aclocal.

For me, the problem was that I didn't have pkg-config installed.

On Osx Mountain Lion I don't have the dirlist file as Phil Calçado said, but a simple symlink from /usr/local/Cellar/pkg-config/[version]/share/aclocal/pkg.m4 to /usr/share/aclocal made the trick and now jzmq build fine.

Related

macOS "./configure: No such file or directory" problem

When I try to install Sphinx with this guide
./configure --with-pgsql --with-mysql #from guide
make #from guide
sudo make install #from guide
./configure
-bash: ./configure: No such file or directory
$ autoreconf --install
autoreconf: 'configure.ac' or 'configure.in' is required
Are you running the ./configure command within the Sphinx source code folder? These instructions are for compiling Sphinx.
It's worth noting that the latest (v3.x) Sphinx releases aren't available as source code, only as pre-compiled binaries. So if that's what you've downloaded, you'll want to copy the files in ./bin - which would include indexer and searchd - into a location within your PATH (I would suggest /usr/local/bin).
Not excellent solution (because without mysql), but working (as all in programming world).
1) brew remove mysql
2) brew install mysql#5.7 (I don't know why, but it is working only with this version)
3) download sphinxsearch.com/files/sphinx-2.2.11-release.tar.gz and extract and cd to it
4) ./configure --with-pgsql --without-mysql and make and sudo make install
It is working for me, because I need postgresql first of all

autoreconf: 'configure.ac' or 'configure.in' is required

I followed the instructions to install FB Machine Learning tools.
One of the libraries installation instructions are
cd ~/libraries
git clone https://github.com/facebook/folly.git
cd folly/folly/
autoreconf -ivf
./configure
cp -R ~/libraries/gtest-1.7/* ./test/gtest-1.7/
make
make check
sudo make install
sudo ldconfig # reload the lib paths after freshly installed folly. fbthrift needs it.
I have problem at autoreconf -ivf, the error is
autoreconf: 'configure.ac' or 'configure.in' is required
But when I install autoreconf, I have the newest version.
autoconf is already the newest version (2.69-9).
0 upgraded, 0 newly installed, 0 to remove and 26 not upgraded.
What could be wrong?
folly is not using the autotols anymore, but CMake (there is only a CMakeLists.txt file, not configure.*).
See here for the steps: https://github.com/facebook/folly#dependencies
Installing pkgconf package fixed it for me.
error: autoreconf: 'configure.ac' or 'configure.in' is required
Just don't try to install.
In most cases the autoreconf -i command helps, but it did not work for you due to an inappropriate package :\
In your case will be adequately to look at the documentation for installation from the terminal to your OS.

autoreconf: command not found in Cygwin on Windows

I'm trying to compile the nDPI library in using Cygwin on Windows. When I try to run autogen.sh file I get the following error
./autogen.sh: line 5: autoreconf: command not found
I've been looking around now for four days to compile this nDPI library on Windows, and I DO NEED to compile it on Windows.
How do I compile this library on Windows?, OR
Is there a link that actually works and I can follow their steps to compile this library?
Here is the autogen.sh
#!/bin/sh
/bin/rm -f configure config.h config.h.in src/lib/Makefile.in
autoreconf -ivf
./configure
Try install autoconf, automake and libtool. It's under Devel of the Cygwin setup program.
To build MSYS tools, you should use the autotools provided in the MSYS System Builder package:
http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=227249
autoconf-2.61-MSYS-1.0.11-1.tar.bz2
automake-1.10-MSYS-1.0.11-1.tar.bz2
libtool1.5-1.5.25a-20070701-MSYS-1.0.11-1.tar.bz2
Unpack them to the same location you extracted msys package.
I think you have to first solve the errors, since they indicate that you are lacking of some of the essential libraries. For example, the autoconf library...
If you are using Cygwin, you can get apt-cyg by:
lynx -source rawgit.com/transcode-open/apt-cyg/master/apt-cyg > apt-cyg
install apt-cyg /bin
After that, you can use apt-cyg install xxx to install the lacking libraries.

Installing Apache on a mac (Lion) : "Did not find prce-config script at" error

I am trying to install Apache (by compilation)on my mac Lion.
Every time, I try to compile pcre, I get these two errors :
configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/
or
"Did not find prce-config script at"
I know I have this pcre-config file.
(I put http-2.4.1 and pcre-8.30 in Documents / Tried another location in MyUsername/Test/ >> same result >> it didn't work either).
Any help would be greatly appreciated.
Thanks.
Edit :
I copied http-2.4.1 and pcre-8.30 in "/"
then I cded to /pcre-8.30
then I issued ./configure >> Got no error.
then I cded /http-2.4.1
then I issued ./configure --prefix=/usr/local/apache_2.2. --with-pcre=/pcre-8.30
Got 1 error configure: error: Did not find pcre-config script at /pcre-8.30
I do not understand what "Install prefix .................. : /usr/local" means (in the pcre-8.30 configuration summary). I can't see any pcre file in this directory.
I got apache 2.4.1 to configure by doing the following (note i am running lion v 10.7.3)
I downloaded pcre and ran (Note: by default pcre will install into /usr/local)
$ ./configure
$ make
$ make install
setup httpd-2.4.1 with the following command
$./configure --prefix=/usr/local --with-pcre=/usr/local
$ make
$ make install
Test
$ usr/local/bin/apachectl start
This appeared to work for me hopefully it works for you
You can also install Homebrew from http://mxcl.github.com/homebrew/, and then
brew install pcre
It does not need root access.
And then run the ./configure.
Maybe you not install PCRE correctly. Please try this:
Install PCRE
Nginx requires PCRE – Perl Compatible Regular Expressions to build, I used PCRE version 8.13. In a Terminal, run:
sudo curl -OL h ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.13.tar.gz > /usr/local/src/pcre-8.13.tar.gz
sudo mkdir -p /usr/local/src
cd /usr/local/src
tar xvzf pcre-8.13.tar.gz
cd pcre-8.13
./configure --prefix=/usr/local
make
sudo make install
cd ..
That is what I am trying...
I still couldn't get it to work using jfleong's answer. I came across fink, which you can download here http://www.finkproject.org/download/srcdist.php
After it was all installed, I ran:
$ fink install pcre
And then continued with installing apache and just using
$ ./configure
Without any flags. After I did all of that it finally was able to finish installing. Hope this helps!

Need help in compiling lighttpd on MacOSx

I try download lighttpd 1.4.23 source, and compile it on MacOSX 10.5.5.
This is the error I am getting:
$ ./autogen.sh
./autogen.sh: running `libtoolize --copy --force'
./autogen.sh: line 19: libtoolize: command not found
I tried ask the same question on lighttpd forum, but I can't get any help there.
Thanks in advance.
libtoolize is part of GNU libtool, a package for building libraries portably. On the Mac, one option for getting it is to use MacPorts, a package manager which works in a similar fashion as Gentoo and FreeBSD, in that it compiles packages on your machine. See http://www.macports.org/install.php.
Beware, though, that it will be installed as glibtoolize, i.e. with a 'g' prefixed. That is a standard way to make GNU tools live in parallel with UNIX tools of the same name, that might be present (even though there isn't one in this particular case).
The command for installing libtool from MacPorts is: sudo port install libtool
Add a '-d' flag after the 'port' command to see the build output.
Here's what I use to install lighttpd 1.4.25 on Mac OS X 10.6.2. If I remember correctly, the same thing worked for me in a recent version of Mac OS X 10.5.
Install Xcode Developer Tools
Either install them from the DVD that came with your Mac (under Optional Installs) or download them from Apple's developer page.
Install PCRE
curl -O http://softlayer.dl.sourceforge.net/project/pcre/pcre/7.9/pcre-7.9.tar.gz
tar xzf pcre-7.9.tar.gz
cd pcre-7.9
./configure
make && sudo make install
cd ../
Install lighttpd
curl -O http://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-1.4.25.tar.gz
tar xzf lighttpd-*.tar.gz
cd lighttpd-*
./configure
make && sudo make install
Note that the URLs above will quickly go out of date; you may need to download the latest versions of the .tar.gz packages from a different location.

Resources