At the moment, I'm having serious problems getting JZMQ to compile on Ubuntu (10.04.2 LTS Server, x86). I've installed 0MQ from source, but the debian package build for JZMQ is failing with:
dpkg-shlibdeps: error: no dependency information found for /usr/local/lib/libzmq.so.0 (used by debian/jzmq/usr/lib/libjzmq.so.0.0.0).
I've not had much experience building debian packages like this before, so the full stack trace is below in case that is able to help at all.
ubuntu@test-server:/tmp/jzmq$ dpkg-buildpackage -rfakeroot
dpkg-buildpackage: set CFLAGS to default value: -g -O2
dpkg-buildpackage: set CPPFLAGS to default value:
dpkg-buildpackage: set LDFLAGS to default value: -Wl,-Bsymbolic-functions
dpkg-buildpackage: set FFLAGS to default value: -g -O2
dpkg-buildpackage: set CXXFLAGS to default value: -g -O2
dpkg-buildpackage: source package jzmq
dpkg-buildpackage: source version 2.1.0-1
dpkg-buildpackage: source changed by Alois Bělaška <alois.belaska@gmail.com>
dpkg-buildpackage: host architecture i386
fakeroot debian/rules clean
dh_testdir
dh_testroot
rm -f build-stamp configure-stamp
if [ -e Makefile ]; then make distclean; fi
rm -rf config.log
dh_clean
dpkg-source -b jzmq
dpkg-source: info: using source format `1.0'
dpkg-source: warning: source directory 'jzmq' is not <sourcepackage>-<upstreamversion> 'jzmq-2.1.0'
dpkg-source: info: building jzmq in jzmq_2.1.0-1.tar.gz
dpkg-source: info: building jzmq in jzmq_2.1.0-1.dsc
debian/rules build
dh_testdir
./configure \
--prefix=/usr \
CFLAGS="-g -O2" \
LDFLAGS="-Wl,--as-needed -Wl,-z,defs" \
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking how to create a ustar tar archive... gnutar
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 805306365
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for ar... ar
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for gawk... (cached) mawk
checking whether gcc and cc understand -c and -o together... yes
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking whether we are using the GNU C++ compiler... (cached) yes
checking whether g++ accepts -g... (cached) yes
checking dependency style of g++... (cached) gcc3
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for ZeroMQ... yes
checking zmq.h usability... yes
checking zmq.h presence... yes
checking for zmq.h... yes
checking for zmq_init in -lzmq... yes
checking for javac... /usr/bin/javac
checking for javah... /usr/bin/javah
checking for jar... /usr/bin/jar
checking for jni.h in /usr/lib/jvm/java-6-openjdk/include... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating perf/Makefile
config.status: creating src/config.hpp
config.status: executing depfiles commands
config.status: executing libtool commands
touch configure-stamp
dh_testdir
/usr/bin/make
make[1]: Entering directory `/tmp/jzmq'
Making all in src
make[2]: Entering directory `/tmp/jzmq/src'
CLASSPATH=.:./.:$CLASSPATH /usr/bin/javac -d . org/zeromq/ZMQ.java org/zeromq/ZMQException.java org/zeromq/ZMQQueue.java org/zeromq/ZMQForwarder.java org/zeromq/ZMQStreamer.java
echo timestamp > classdist_noinst.stamp
CLASSPATH=.:./.:$CLASSPATH /usr/bin/javah -jni -classpath . org.zeromq.ZMQ
CLASSPATH=.:./.:$CLASSPATH /usr/bin/javah -jni -classpath . org.zeromq.ZMQ
CLASSPATH=.:./.:$CLASSPATH /usr/bin/javah -jni -classpath . org.zeromq.ZMQ
CLASSPATH=.:./.:$CLASSPATH /usr/bin/javah -jni -classpath . org.zeromq开发者_运维知识库.ZMQ
CLASSPATH=.:./.:$CLASSPATH /usr/bin/javah -jni -classpath . org.zeromq.ZMQ
/usr/bin/make all-am
make[3]: Entering directory `/tmp/jzmq/src'
/bin/bash ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -D_REENTRANT -D_THREAD_SAFE -I/usr/local/include -I/usr/lib/jvm/java-6-openjdk/include -I/usr/lib/jvm/java-6-openjdk/include/linux -Wall -g -O2 -MT libjzmq_la-ZMQ.lo -MD -MP -MF .deps/libjzmq_la-ZMQ.Tpo -c -o libjzmq_la-ZMQ.lo `test -f 'ZMQ.cpp' || echo './'`ZMQ.cpp
libtool: compile: g++ -DHAVE_CONFIG_H -I. -D_REENTRANT -D_THREAD_SAFE -I/usr/local/include -I/usr/lib/jvm/java-6-openjdk/include -I/usr/lib/jvm/java-6-openjdk/include/linux -Wall -g -O2 -MT libjzmq_la-ZMQ.lo -MD -MP -MF .deps/libjzmq_la-ZMQ.Tpo -c ZMQ.cpp -fPIC -DPIC -o .libs/libjzmq_la-ZMQ.o
libtool: compile: g++ -DHAVE_CONFIG_H -I. -D_REENTRANT -D_THREAD_SAFE -I/usr/local/include -I/usr/lib/jvm/java-6-openjdk/include -I/usr/lib/jvm/java-6-openjdk/include/linux -Wall -g -O2 -MT libjzmq_la-ZMQ.lo -MD -MP -MF .deps/libjzmq_la-ZMQ.Tpo -c ZMQ.cpp -o libjzmq_la-ZMQ.o >/dev/null 2>&1
mv -f .deps/libjzmq_la-ZMQ.Tpo .deps/libjzmq_la-ZMQ.Plo
/bin/bash ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -D_REENTRANT -D_THREAD_SAFE -I/usr/local/include -I/usr/lib/jvm/java-6-openjdk/include -I/usr/lib/jvm/java-6-openjdk/include/linux -Wall -g -O2 -MT libjzmq_la-Context.lo -MD -MP -MF .deps/libjzmq_la-Context.Tpo -c -o libjzmq_la-Context.lo `test -f 'Context.cpp' || echo './'`Context.cpp
libtool: compile: g++ -DHAVE_CONFIG_H -I. -D_REENTRANT -D_THREAD_SAFE -I/usr/local/include -I/usr/lib/jvm/java-6-openjdk/include -I/usr/lib/jvm/java-6-openjdk/include/linux -Wall -g -O2 -MT libjzmq_la-Context.lo -MD -MP -MF .deps/libjzmq_la-Context.Tpo -c Context.cpp -fPIC -DPIC -o .libs/libjzmq_la-Context.o
libtool: compile: g++ -DHAVE_CONFIG_H -I. -D_REENTRANT -D_THREAD_SAFE -I/usr/local/include -I/usr/lib/jvm/java-6-openjdk/include -I/usr/lib/jvm/java-6-openjdk/include/linux -Wall -g -O2 -MT libjzmq_la-Context.lo -MD -MP -MF .deps/libjzmq_la-Context.Tpo -c Context.cpp -o libjzmq_la-Context.o >/dev/null 2>&1
mv -f .deps/libjzmq_la-Context.Tpo .deps/libjzmq_la-Context.Plo
/bin/bash ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -D_REENTRANT -D_THREAD_SAFE -I/usr/local/include -I/usr/lib/jvm/java-6-openjdk/include -I/usr/lib/jvm/java-6-openjdk/include/linux -Wall -g -O2 -MT libjzmq_la-Socket.lo -MD -MP -MF .deps/libjzmq_la-Socket.Tpo -c -o libjzmq_la-Socket.lo `test -f 'Socket.cpp' || echo './'`Socket.cpp
libtool: compile: g++ -DHAVE_CONFIG_H -I. -D_REENTRANT -D_THREAD_SAFE -I/usr/local/include -I/usr/lib/jvm/java-6-openjdk/include -I/usr/lib/jvm/java-6-openjdk/include/linux -Wall -g -O2 -MT libjzmq_la-Socket.lo -MD -MP -MF .deps/libjzmq_la-Socket.Tpo -c Socket.cpp -fPIC -DPIC -o .libs/libjzmq_la-Socket.o
libtool: compile: g++ -DHAVE_CONFIG_H -I. -D_REENTRANT -D_THREAD_SAFE -I/usr/local/include -I/usr/lib/jvm/java-6-openjdk/include -I/usr/lib/jvm/java-6-openjdk/include/linux -Wall -g -O2 -MT libjzmq_la-Socket.lo -MD -MP -MF .deps/libjzmq_la-Socket.Tpo -c Socket.cpp -o libjzmq_la-Socket.o >/dev/null 2>&1
mv -f .deps/libjzmq_la-Socket.Tpo .deps/libjzmq_la-Socket.Plo
/bin/bash ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -D_REENTRANT -D_THREAD_SAFE -I/usr/local/include -I/usr/lib/jvm/java-6-openjdk/include -I/usr/lib/jvm/java-6-openjdk/include/linux -Wall -g -O2 -MT libjzmq_la-Poller.lo -MD -MP -MF .deps/libjzmq_la-Poller.Tpo -c -o libjzmq_la-Poller.lo `test -f 'Poller.cpp' || echo './'`Poller.cpp
libtool: compile: g++ -DHAVE_CONFIG_H -I. -D_REENTRANT -D_THREAD_SAFE -I/usr/local/include -I/usr/lib/jvm/java-6-openjdk/include -I/usr/lib/jvm/java-6-openjdk/include/linux -Wall -g -O2 -MT libjzmq_la-Poller.lo -MD -MP -MF .deps/libjzmq_la-Poller.Tpo -c Poller.cpp -fPIC -DPIC -o .libs/libjzmq_la-Poller.o
libtool: compile: g++ -DHAVE_CONFIG_H -I. -D_REENTRANT -D_THREAD_SAFE -I/usr/local/include -I/usr/lib/jvm/java-6-openjdk/include -I/usr/lib/jvm/java-6-openjdk/include/linux -Wall -g -O2 -MT libjzmq_la-Poller.lo -MD -MP -MF .deps/libjzmq_la-Poller.Tpo -c Poller.cpp -o libjzmq_la-Poller.o >/dev/null 2>&1
mv -f .deps/libjzmq_la-Poller.Tpo .deps/libjzmq_la-Poller.Plo
/bin/bash ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -D_REENTRANT -D_THREAD_SAFE -I/usr/local/include -I/usr/lib/jvm/java-6-openjdk/include -I/usr/lib/jvm/java-6-openjdk/include/linux -Wall -g -O2 -MT libjzmq_la-util.lo -MD -MP -MF .deps/libjzmq_la-util.Tpo -c -o libjzmq_la-util.lo `test -f 'util.cpp' || echo './'`util.cpp
libtool: compile: g++ -DHAVE_CONFIG_H -I. -D_REENTRANT -D_THREAD_SAFE -I/usr/local/include -I/usr/lib/jvm/java-6-openjdk/include -I/usr/lib/jvm/java-6-openjdk/include/linux -Wall -g -O2 -MT libjzmq_la-util.lo -MD -MP -MF .deps/libjzmq_la-util.Tpo -c util.cpp -fPIC -DPIC -o .libs/libjzmq_la-util.o
libtool: compile: g++ -DHAVE_CONFIG_H -I. -D_REENTRANT -D_THREAD_SAFE -I/usr/local/include -I/usr/lib/jvm/java-6-openjdk/include -I/usr/lib/jvm/java-6-openjdk/include/linux -Wall -g -O2 -MT libjzmq_la-util.lo -MD -MP -MF .deps/libjzmq_la-util.Tpo -c util.cpp -o libjzmq_la-util.o >/dev/null 2>&1
mv -f .deps/libjzmq_la-util.Tpo .deps/libjzmq_la-util.Plo
/bin/bash ../libtool --tag=CXX --mode=link g++ -Wall -g -O2 -version-info 0:0:0 -Wl,--as-needed -Wl,-z,defs -L/usr/local/lib -lzmq -o libjzmq.la -rpath /usr/lib libjzmq_la-ZMQ.lo libjzmq_la-Context.lo libjzmq_la-Socket.lo libjzmq_la-Poller.lo libjzmq_la-util.lo -lzmq
libtool: link: g++ -shared -nostdlib /usr/lib/gcc/i486-linux-gnu/4.4.3/../../../../lib/crti.o /usr/lib/gcc/i486-linux-gnu/4.4.3/crtbeginS.o .libs/libjzmq_la-ZMQ.o .libs/libjzmq_la-Context.o .libs/libjzmq_la-Socket.o .libs/libjzmq_la-Poller.o .libs/libjzmq_la-util.o -L/usr/local/lib /usr/local/lib/libzmq.so -L/usr/lib/gcc/i486-linux-gnu/4.4.3 -L/usr/lib/gcc/i486-linux-gnu/4.4.3/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/i486-linux-gnu/4.4.3/../../.. -lstdc++ -lm -lc -lgcc_s /usr/lib/gcc/i486-linux-gnu/4.4.3/crtendS.o /usr/lib/gcc/i486-linux-gnu/4.4.3/../../../../lib/crtn.o -Wl,--as-needed -Wl,-z -Wl,defs -Wl,-soname -Wl,libjzmq.so.0 -o .libs/libjzmq.so.0.0.0
libtool: link: (cd ".libs" && rm -f "libjzmq.so.0" && ln -s "libjzmq.so.0.0.0" "libjzmq.so.0")
libtool: link: (cd ".libs" && rm -f "libjzmq.so" && ln -s "libjzmq.so.0.0.0" "libjzmq.so")
libtool: link: ar cru .libs/libjzmq.a libjzmq_la-ZMQ.o libjzmq_la-Context.o libjzmq_la-Socket.o libjzmq_la-Poller.o libjzmq_la-util.o
libtool: link: ranlib .libs/libjzmq.a
libtool: link: ( cd ".libs" && rm -f "libjzmq.la" && ln -s "../libjzmq.la" "libjzmq.la" )
/usr/bin/jar cf zmq.jar org/zeromq/*.class
make[3]: Leaving directory `/tmp/jzmq/src'
make[2]: Leaving directory `/tmp/jzmq/src'
Making all in perf
make[2]: Entering directory `/tmp/jzmq/perf'
/usr/bin/make all-am
make[3]: Entering directory `/tmp/jzmq/perf'
CLASSPATH=.:./.:$CLASSPATH /usr/bin/javac -d . -classpath ../src local_lat.java local_thr.java remote_lat.java remote_thr.java
echo timestamp > classdist_noinst.stamp
/usr/bin/jar cf zmq-perf.jar *.class
make[3]: Leaving directory `/tmp/jzmq/perf'
make[2]: Leaving directory `/tmp/jzmq/perf'
make[2]: Entering directory `/tmp/jzmq'
make[2]: Nothing to be done for `all-am'.
make[2]: Leaving directory `/tmp/jzmq'
make[1]: Leaving directory `/tmp/jzmq'
touch build-stamp
fakeroot debian/rules binary
dh_testdir
dh_testroot
dh_prep
dh_installdirs
/usr/bin/make DESTDIR=/tmp/jzmq/debian/tmp install
make[1]: Entering directory `/tmp/jzmq'
Making install in src
make[2]: Entering directory `/tmp/jzmq/src'
/usr/bin/make install-am
make[3]: Entering directory `/tmp/jzmq/src'
make[4]: Entering directory `/tmp/jzmq/src'
test -z "/usr/lib" || /bin/mkdir -p "/tmp/jzmq/debian/tmp/usr/lib"
/bin/bash ../libtool --mode=install /usr/bin/install -c libjzmq.la '/tmp/jzmq/debian/tmp/usr/lib'
libtool: install: /usr/bin/install -c .libs/libjzmq.so.0.0.0 /tmp/jzmq/debian/tmp/usr/lib/libjzmq.so.0.0.0
libtool: install: (cd /tmp/jzmq/debian/tmp/usr/lib && { ln -s -f libjzmq.so.0.0.0 libjzmq.so.0 || { rm -f libjzmq.so.0 && ln -s libjzmq.so.0.0.0 libjzmq.so.0; }; })
libtool: install: (cd /tmp/jzmq/debian/tmp/usr/lib && { ln -s -f libjzmq.so.0.0.0 libjzmq.so || { rm -f libjzmq.so && ln -s libjzmq.so.0.0.0 libjzmq.so; }; })
libtool: install: /usr/bin/install -c .libs/libjzmq.lai /tmp/jzmq/debian/tmp/usr/lib/libjzmq.la
libtool: install: /usr/bin/install -c .libs/libjzmq.a /tmp/jzmq/debian/tmp/usr/lib/libjzmq.a
libtool: install: chmod 644 /tmp/jzmq/debian/tmp/usr/lib/libjzmq.a
libtool: install: ranlib /tmp/jzmq/debian/tmp/usr/lib/libjzmq.a
libtool: install: warning: remember to run `libtool --finish /usr/lib'
test -z "/usr/share/java" || /bin/mkdir -p "/tmp/jzmq/debian/tmp/usr/share/java"
/usr/bin/install -c -m 644 zmq.jar '/tmp/jzmq/debian/tmp/usr/share/java'
make[4]: Leaving directory `/tmp/jzmq/src'
make[3]: Leaving directory `/tmp/jzmq/src'
make[2]: Leaving directory `/tmp/jzmq/src'
Making install in perf
make[2]: Entering directory `/tmp/jzmq/perf'
/usr/bin/make install-am
make[3]: Entering directory `/tmp/jzmq/perf'
make[4]: Entering directory `/tmp/jzmq/perf'
make[4]: Nothing to be done for `install-exec-am'.
make[4]: Nothing to be done for `install-data-am'.
make[4]: Leaving directory `/tmp/jzmq/perf'
make[3]: Leaving directory `/tmp/jzmq/perf'
make[2]: Leaving directory `/tmp/jzmq/perf'
make[2]: Entering directory `/tmp/jzmq'
make[3]: Entering directory `/tmp/jzmq'
make[3]: Nothing to be done for `install-exec-am'.
make[3]: Nothing to be done for `install-data-am'.
make[3]: Leaving directory `/tmp/jzmq'
make[2]: Leaving directory `/tmp/jzmq'
make[1]: Leaving directory `/tmp/jzmq'
dh_testdir
dh_testroot
dh_install
dh_installchangelogs
dh_installdocs
dh_lintian
dh_link
dh_compress
dh_fixperms
dh_makeshlibs
dh_installdeb
dh_shlibdeps
dpkg-shlibdeps: error: no dependency information found for /usr/local/lib/libzmq.so.0 (used by debian/jzmq/usr/lib/libjzmq.so.0.0.0).
dh_shlibdeps: dpkg-shlibdeps -Tdebian/jzmq.substvars debian/jzmq/usr/lib/libjzmq.so.0.0.0 returned exit code 2
make: *** [binary-arch] Error 9
dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2
Any help at all would be appreciated so much before I lose my mind over this. ;]
Turned out the solution to this was simple enough: I had to build the underlying 0MQ library into a Debian package (not just from source) so that dpkg
could resolve the dependencies when the JZMQ was installed from the package. Amazing how easy things are in retrospect. ;]
精彩评论