[zeromq-dev] Quick JZMQ howto on Windows
Martin Sustrik
sustrik at 250bpm.com
Thu Oct 27 12:52:50 CEST 2011
Hi Steven,
Shouldn't we place this somewhere on the website? It seems to be rather
helpful.
Martin
On 10/26/2011 07:46 PM, Steven McCoy wrote:
> 1) Build ZeroMQ or install a prepared package. I built with SDK 7.1
> but I also have MSVC 2010 Express and Pro installed.
>
> http://www.microsoft.com/download/en/details.aspx?id=8279
>
> 2) Clone JZMQ from GitHub, might be easier with Cygwin.
>
> $ *git clone https://github.com/zeromq/jzmq.git
> <https://github.com/zeromq/jzmq.git>*
>
> http://cygwin.com/install.html
>
> 3) Insert attached CMakeLists.txt, you probably want to install /CMake
> /for Windows too.
>
> http://www.cmake.org/cmake/resources/software.html
>
> 4) With a suitable JDK installed prepare the build:
>
> http://www.oracle.com/technetwork/java/javase/downloads/jdk-6u25-download-346242.html
>
> c:\zeromq\jzmq\jzmq> *mkdir build64*
>
> c:\zeromq\jzmq\jzmq> *cd build64*
>
> c:\zeromq\jzmq\jzmq> *cmake .. -G "NMake Makefiles"*
> -- The C compiler identification is MSVC
> -- The CXX compiler identification is MSVC
> -- Check for CL compiler version
> -- Check for CL compiler version - 1600
> -- Check if this is a free VC compiler
> -- Check if this is a free VC compiler - no
> -- Check for working C compiler: c:/Program Files (x86)/Microsoft Visual
> Studio10.0/VC/bin/amd64/cl.exe
> -- Check for working C compiler: c:/Program Files (x86)/Microsoft Visual
> Studio10.0/VC/bin/amd64/cl.exe -- works
> -- Detecting C compiler ABI info
> -- Detecting C compiler ABI info - done
> -- Check for working CXX compiler: c:/Program Files (x86)/Microsoft
> Visual Studio 10.0/VC/bin/amd64/cl.exe
> -- Check for working CXX compiler: c:/Program Files (x86)/Microsoft
> Visual Studio 10.0/VC/bin/amd64/cl.exe -- works
> -- Detecting CXX compiler ABI info
> -- Detecting CXX compiler ABI info - done
> -- Java version 1.6.0.27 configured successfully!
> -- Found Java: C:/Program Files/Java/jdk1.6.0_27/bin/java.exe (found
> version "1.6.0.27")
> -- Found JNI: C:/Program Files/Java/jdk1.6.0_27/lib/jawt.lib
> -- Configuring done
> -- Generating done
> -- Build files have been written to: C:/zeromq/jzmq/jzmq/build64
>
> c:\zeromq\jzmq\jzmq> *cmake-gui .*
>
> Change "/Debug/" to "/Release/", hit "/Configure/" and "/Generate/".
>
> Java version 1.6.0.27 configured successfully!
>
> Configuring done
>
> Generating done
>
>
> 5) With NSIS installed you can jump to build the package or just build
> the libraries.
>
> http://nsis.sourceforge.net/Download
>
> c:\zeromq\jzmq\jzmq> *nmake package*
>
> or
>
> c:\zeromq\jzmq\jzmq> *nmake*
>
> Then output similar to as follows:
>
>
> Microsoft (R) Program Maintenance Utility Version 10.00.30319.01
> Copyright (C) Microsoft Corporation. All rights reserved.
>
> [ 11%] Generating config.hpp
> [ 22%] Generating org/zeromq/ZMQ.class, org/zeromq/ZMQ$$Context.class,
> org/zeromq/ZMQ$$Socket.class, org/zeromq/ZMQ$$Poller.class,
> org/zeromq/ZMQ$$Error.class, org/zeromq/ZMQException.class,
> org/zeromq/ZMQQueue.class, org/zeromq/ZMQForwarder.class,
> org/zeromq/ZMQStreamer.class, org/zeromq/EmbeddedLibraryTools.class,
> org/zeromq/App.class
> [ 33%] Generating org_zeromq_ZMQ.h, org_zeromq_ZMQ_Error.h,
> org_zeromq_ZMQ_Context.h, org_zeromq_ZMQ_Socket.h, org_zeromq_ZMQ_Poller.h
> [ 44%] Generating lib/zmq.jar
> Scanning dependencies of target jzmq
> [ 44%] Generating org/zeromq/ZMQ.class, org/zeromq/ZMQ$$Context.class,
> org/zeromq/ZMQ$$Socket.class, org/zeromq/ZMQ$$Poller.class,
> org/zeromq/ZMQ$$Error.class, org/zeromq/ZMQException.class,
> org/zeromq/ZMQQueue.class, org/zeromq/ZMQForwarder.class,
> org/zeromq/ZMQStreamer.class, org/zeromq/EmbeddedLibraryTools.class,
> org/zeromq/App.class
> [ 44%] Generating org_zeromq_ZMQ.h, org_zeromq_ZMQ_Error.h,
> org_zeromq_ZMQ_Context.h, org_zeromq_ZMQ_Socket.h, org_zeromq_ZMQ_Poller.h
> [ 55%] Building CXX object CMakeFiles/jzmq.dir/src/Context.cpp.obj
> Context.cpp
> [ 66%] Building CXX object CMakeFiles/jzmq.dir/src/Poller.cpp.obj
> Poller.cpp
> [ 77%] Building CXX object CMakeFiles/jzmq.dir/src/Socket.cpp.obj
> Socket.cpp
> C:\zeromq\jzmq\jzmq\src\Socket.cpp(176) : warning C4267: 'argument' :
> conversion from 'size_t' to 'jsize', possible loss of data
> C:\zeromq\jzmq\jzmq\src\Socket.cpp(182) : warning C4267: 'argument' :
> conversion from 'size_t' to 'jsize', possible loss of data
> C:\zeromq\jzmq\jzmq\src\Socket.cpp(476) : warning C4267: 'initializing'
> : conversion from 'size_t' to 'int', possible loss of data
> C:\zeromq\jzmq\jzmq\src\Socket.cpp(500) : warning C4267: 'initializing'
> : conversion from 'size_t' to 'int', possible loss of data
> [ 88%] Building CXX object CMakeFiles/jzmq.dir/src/util.cpp.obj
> util.cpp
> [100%] Building CXX object CMakeFiles/jzmq.dir/src/ZMQ.cpp.obj
> ZMQ.cpp
> Linking CXX shared library lib\jzmq.dll
> Creating library lib\jzmq.lib and object lib\jzmq.exp
> [100%] Built target jzmq
> Run CPack packaging tool...
> CPack: Create package using NSIS
> CPack: Install projects
> CPack: - Run preinstall target for: JZMQ
> CPack: - Install project: JZMQ
> CPack: Create package
> CPack: - package: C:/zeromq/jzmq/jzmq/build64/JZMQ-2.1.10-win64.exe
> generated.
>
>
> Then to test copy all the libraries into the perf directory from the
> /jzmq /package and build some examples.
>
> C:\zeromq\jzmq\jzmq\perf>*"\Program Files\Java\jdk1.6.0_27"\bin\javac
> -cp zmq.jar;. local_lat.java*
>
> C:\zeromq\jzmq\jzmq\perf>*"\Program Files\Java\jdk1.6.0_27"\bin\javac
> -cp zmq.jar;. remote_lat.java*
>
> Then test:
>
> C:\zeromq\jzmq\jzmq\perf>*"\Program Files\Java\jdk1.6.0_27\bin"\java
> -Xcheck:jni -verbose:jni,class -classpath .;zmq.jar local_lat
> tcp://127.0.0.1:5000 <http://127.0.0.1:5000> 1 100*
>
> C:\zeromq\jzmq\jzmq\perf>*"\Program Files\Java\jdk1.6.0_27"\bin\java
> -classpath .;zmq.jar remote_lat tcp://127.0.0.1:5000
> <http://127.0.0.1:5000> 1 100*
> message size: 1 [B]
> roundtrip count: 100
> mean latency: 85.0 [us]
>
> The perf directory looks like this:
>
> 10/26/2011 01:18 PM <DIR> .
> 10/26/2011 01:18 PM <DIR> ..
> 10/26/2011 01:09 PM 16,384 jzmq.dll
> 10/03/2011 12:47 PM 445,952 libzmq.dll
> 10/26/2011 12:53 PM 1,492 local_lat.class
> 10/05/2011 05:07 PM 1,723 local_lat.java
> 10/05/2011 05:07 PM 68 local_lat.sh
> 10/05/2011 05:07 PM 2,278 local_thr.java
> 10/05/2011 05:07 PM 68 local_thr.sh
> 10/05/2011 05:07 PM 512 Makefile.am
> 10/05/2011 05:07 PM 9,988 Makefile.in
> 10/26/2011 01:18 PM 1,853 remote_lat.class
> 10/05/2011 05:07 PM 2,049 remote_lat.java
> 10/05/2011 05:07 PM 69 remote_lat.sh
> 10/05/2011 05:07 PM 1,722 remote_thr.java
> 10/05/2011 05:07 PM 69 remote_thr.sh
> 10/26/2011 01:09 PM 15,350 zmq.jar
> 15 File(s) 499,577 bytes
>
> Example packages to download:
>
> http://miru.hk/archive/ZeroMQ-2.1.10-win64.exe
> http://miru.hk/archive/JZMQ-2.1.10-win64.exe
>
> Win32 didn't build as I think the installed JDK is 64-bit only.
>
> --
> Steve-o
>
>
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
More information about the zeromq-dev
mailing list