20

Hello all I'm attempting to follow the directions located at: https://github.com/nathanmarz/storm/wiki/Installing-native-dependencies for installing Zero MQ as a dependency for Storm on a Ubuntu 12.04 machine. However when trying to run the make command I get the following error

Making all in src
make[1]: Entering directory `/home/localadmin/jzmq/src'
make[1]: *** No rule to make target `classdist_noinst.stamp', needed by `org/zeromq/ZMQ.class'.  Stop.
make[1]: Leaving directory `/home/localadmin/jzmq/src'
make: *** [all-recursive] Error 1

Does anyone have any idea where this error stems from and how I would be able to correct it?

Chris Maness
  • 1,682
  • 3
  • 22
  • 40

5 Answers5

33

Apparently compiling JZMQ on Ubuntu 12.04 is a little bit more involved than I realized. However I took the time to write out the solution that I found. You can find it at: Installing Storm's Native Dependencies on Ubuntu 12.04. For time's sake here are the instructions:

  1. You’ll need to ensure that a few packages are installed first: build-essential, uuid-dev, libtool, git, autoconf, openjdk-6-jdk
  2. Create a JAVA_HOME variable that point the the jdk you just installed. Should be in the /usr/lib/jvm directory

    JAVA_HOME=/usr/lib/jvm/(your jdk folder); export JAVA_HOME

  3. Run the following commands for installing Zero MQ:

    wget http://download.zeromq.org/zeromq-2.1.7.tar.gz
    tar -xzf zeromq-2.1.7.tar.gz
    cd zeromq-2.1.7
    ./configure
    make
    sudo make install
    
  4. Download JZMQ and navigate to the the src directory

    git clone https://github.com/nathanmarz/jzmq.git
    cd jzmq
    cd src
    
  5. Once in the src directory run the touch command to create a file and then redefine the classpath.

    touch classdist_noinst.stamp
    CLASSPATH=.:./.:$CLASSPATH javac -d . org/zeromq/ZMQ.java org/zeromq/ZMQException.java org/zeromq/ZMQQueue.java org/zeromq/ZMQForwarder.java org/zeromq/ZMQStreamer.java
    

    6.Navigate back to the /jzmq and run make

    cd ..
    ./autogen.sh 
    If you get this error "autogen.sh: error: could not find pkg-config.pkg-config is required to run autogen.sh", then install pkg-config. In Ubuntu sudo apt-get install pkg-config and again run the above command.
    ./configure
    make
    sudo make install
    

Parts of this were stitched together from the Storm - Installing Native Dependencies and Tijun - How to build jzmq in Mac OS X Lion. Thanks guys for putting your pieces of the puzzle up I just stitched them together.

CME64
  • 1,673
  • 13
  • 24
Chris Maness
  • 1,682
  • 3
  • 22
  • 40
  • Thanks, this was super helpful for JZMQ on ubuntu 13.10. One thing that I couldn't get to work and had to edit 'jzmq-master/configure' is to add 'export JAVA_HOME=/usr/lib/jvm/java-6-openjdk-amd64' after installing openjdk-6-jdk and setting env variable. – Vishal Feb 01 '14 at 06:20
6

There is a fix for this now in the zeromq/jzmq repo that I added to the my frozen jzmq repo: https://github.com/halfaleague/jzmq

Now, you can just follow the directions (./autogen.sh, ./configure, make, make install).

Mat
  • 202,337
  • 40
  • 393
  • 406
user652549
  • 61
  • 1
  • 1
  • Hey thanks for doing this I'm sure users everywhere will really appreciate this. – Chris Maness Oct 26 '12 at 19:02
  • When using your repository to compile jzmq on Mac OS X 10.8.3 with Java 1.7.0_25 I saw errors like `error: jni_md.h: No such file or directory ... error: 'JNIEXPORT' does not name a type`. To fix that I had to add the following line after line 108 in `configure.in`: `CPPFLAGS="$CPPFLAGS -I${JAVA_HOME}/include/darwin"` . Only then I was able to compile the code. – asmaier Oct 16 '13 at 14:45
  • For compiling jzmq on Mac OS X use this repository https://github.com/asmaier/jzmq . It includes my fix mentioned above. – asmaier Oct 16 '13 at 15:07
4

Why not just use the package manager to install it?

sudo apt-get install libzmq0 libzmq-dev zeromq-bin
jdi
  • 90,542
  • 19
  • 167
  • 203
  • I am getting this: Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package libzmq0 E: Unable to locate package zeromq-bin – itsazzad Sep 24 '14 at 19:59
  • @SazzadHossainKhan - As this post was 2 years ago, you will probably need to use a newer lib: `apt-cache search libzmq` – jdi Sep 24 '14 at 23:14
  • This is a bad idea since Storm requires a specific version of ZeroMQ (2.1.7 at the time of writing), which may not be provided by the package manager. – Emaad Ahmed Manzoor Apr 25 '15 at 11:08
4

You need to replace classdist_noinst.stamp with classnoinst.stamp in jzmq/src/**Makefile.am**

marko
  • 9,029
  • 4
  • 30
  • 46
Robin
  • 41
  • 1
0

For Ubuntu 13.04 (Raring), I needed to run the following before the ./autogen.sh step:

sed -i 's/classdist_noinst.stamp/classnoinst.stamp/g' src/Makefile.am

I found this workaround here, and I think that this thread could be useful to anyone with that kind of problems: https://github.com/zeromq/jzmq/issues/114