Jasper make: *** [install-recursive] Error 1 - raspberry-pi

I want to install Jasper on my rpi. It is currently running Raspbian. I am following instructions on the Jasper installation page, but when I try to install openfst and run sudo make install I get an error:
Making install in src
make[1]: Entering directory `/home/pi/openfst-1.3.3/src'
Making install in include
make[2]: Entering directory `/home/pi/openfst-1.3.3/src/include'
make[3]: Entering directory `/home/pi/openfst-1.3.3/src/include'
make[3]: Nothing to be done for `install-exec-am'.
test -z "/usr/local/include" || /bin/mkdir -p "/usr/local/include"
/bin/mkdir -p '/usr/local/include/fst'
/usr/bin/install -c -m 644 fst/arc.h fst/determinize.h fst/intersect.h fst/queue.h fst/statesort.h fst/arcfilter.h fst/dfs-visit.h fst/invert.h fst/randequivalent.h fst/string-weight.h fst/difference.h fst/lexicographic-weight.h fst/randgen.h fst/symbol-table.h fst/arcsort.h fst/encode.h fst/lock.h fst/random-weight.h fst/synchronize.h fst/epsnormalize.h fst/log.h fst/rational.h fst/test-properties.h fst/cache.h fst/equal.h fst/arc-map.h fst/map.h fst/register.h fst/topsort.h fst/closure.h fst/equivalent.h fst/matcher.h fst/matcher-fst.h fst/relabel.h fst/union-find.h fst/compact-fst.h fst/expanded-fst.h fst/minimize.h fst/replace.h fst/union.h '/usr/local/include/fst'
/bin/mkdir -p '/usr/local/include/fst'
/usr/bin/install -c -m 644 fst/compat.h fst/factor-weight.h fst/state-map.h fst/mutable-fst.h fst/reverse.h fst/util.h fst/complement.h fst/flags.h fst/partition.h fst/reweight.h fst/vector-fst.h fst/compose-filter.h fst/float-weight.h fst/product-weight.h fst/rmepsilon.h fst/verify.h fst/compose.h fst/fst-decl.h fst/project.h fst/rmfinalepsilon.h fst/visit.h fst/concat.h fst/fst.h fst/properties.h fst/shortest-distance.h fst/weight.h fst/connect.h fst/fstlib.h fst/prune.h fst/shortest-path.h fst/const-fst.h fst/heap.h fst/push.h fst/state-table.h fst/slist.h fst/pair-weight.h fst/config.h fst/tuple-weight.h fst/power-weight.h fst/lookahead-matcher.h '/usr/local/include/fst'
/bin/mkdir -p '/usr/local/include/fst/script'
/usr/bin/install -c -m 644 fst/script/arcsort.h fst/script/arg-packs.h fst/script/closure.h fst/script/compile-impl.h fst/script/compile.h fst/script/compose.h fst/script/concat.h fst/script/connect.h fst/script/convert.h fst/script/decode.h fst/script/determinize.h fst/script/difference.h fst/script/disambiguate.h fst/script/draw-impl.h fst/script/draw.h fst/script/encode.h fst/script/epsnormalize.h fst/script/equal.h fst/script/equivalent.h fst/script/fst-class.h fst/script/fstscript.h fst/script/info-impl.h fst/script/info.h fst/script/intersect.h fst/script/invert.h fst/script/map.h fst/script/minimize.h fst/script/print-impl.h fst/script/print.h fst/script/project.h fst/script/prune.h fst/script/push.h fst/script/randequivalent.h fst/script/randgen.h fst/script/register.h fst/script/relabel.h fst/script/replace.h fst/script/reverse.h fst/script/reweight.h fst/script/rmepsilon.h '/usr/local/include/fst/script'
/bin/mkdir -p '/usr/local/include/fst'
/usr/bin/install -c -m 644 fst/types.h fst/add-on.h fst/label-reachable.h fst/accumulator.h fst/interval-set.h fst/state-reachable.h fst/lookahead-filter.h fst/generic-register.h fst/edit-fst.h fst/replace-util.h fst/icu.h fst/string.h fst/signed-log-weight.h fst/sparse-tuple-weight.h fst/sparse-power-weight.h fst/expectation-weight.h fst/symbol-table-ops.h fst/bi-table.h fst/mapped-file.h '/usr/local/include/fst'
/bin/mkdir -p '/usr/local/include/fst/extensions/pdt'
/usr/bin/install -c -m 644 fst/extensions/pdt/collection.h fst/extensions/pdt/compose.h fst/extensions/pdt/expand.h fst/extensions/pdt/info.h fst/extensions/pdt/paren.h fst/extensions/pdt/pdt.h fst/extensions/pdt/pdtlib.h fst/extensions/pdt/pdtscript.h fst/extensions/pdt/replace.h fst/extensions/pdt/reverse.h fst/extensions/pdt/shortest-path.h '/usr/local/include/fst/extensions/pdt'
/bin/mkdir -p '/usr/local/include/fst/extensions/far'
/usr/bin/install -c -m 644 fst/extensions/far/compile-strings.h fst/extensions/far/create.h fst/extensions/far/equal.h fst/extensions/far/extract.h fst/extensions/far/far.h fst/extensions/far/farlib.h fst/extensions/far/farscript.h fst/extensions/far/info.h fst/extensions/far/main.h fst/extensions/far/print-strings.h fst/extensions/far/stlist.h fst/extensions/far/sttable.h '/usr/local/include/fst/extensions/far'
/bin/mkdir -p '/usr/local/include/fst/script'
/usr/bin/install -c -m 644 fst/script/script-impl.h fst/script/shortest-distance.h fst/script/shortest-path.h fst/script/symbols.h fst/script/synchronize.h fst/script/text-io.h fst/script/topsort.h fst/script/union.h fst/script/weight-class.h fst/script/fstscript-decl.h fst/script/verify.h '/usr/local/include/fst/script'
make[3]: Leaving directory `/home/pi/openfst-1.3.3/src/include'
make[2]: Leaving directory `/home/pi/openfst-1.3.3/src/include'
Making install in lib
make[2]: Entering directory `/home/pi/openfst-1.3.3/src/lib'
make[3]: Entering directory `/home/pi/openfst-1.3.3/src/lib'
test -z "/usr/local/lib" || /bin/mkdir -p "/usr/local/lib"
/bin/bash ../../libtool --mode=install /usr/bin/install -c libfst.la '/usr/local/lib'
libtool: install: /usr/bin/install -c .libs/libfst.so.1.0.0 /usr/local/lib/libfst.so.1.0.0
libtool: install: (cd /usr/local/lib && { ln -s -f libfst.so.1.0.0 libfst.so.1 || { rm -f libfst.so.1 && ln -s libfst.so.1.0.0 libfst.so.1; }; })
libtool: install: (cd /usr/local/lib && { ln -s -f libfst.so.1.0.0 libfst.so || { rm -f libfst.so && ln -s libfst.so.1.0.0 libfst.so; }; })
libtool: install: /usr/bin/install -c .libs/libfst.lai /usr/local/lib/libfst.la
libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin" ldconfig -n /usr/local/lib
----------------------------------------------------------------------
Libraries have been installed in:
/usr/local/lib
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,-rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
make[3]: Nothing to be done for `install-data-am'.
make[3]: Leaving directory `/home/pi/openfst-1.3.3/src/lib'
make[2]: Leaving directory `/home/pi/openfst-1.3.3/src/lib'
Making install in script
make[2]: Entering directory `/home/pi/openfst-1.3.3/src/script'
/bin/bash ../../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I./../include -g -O2 -MT push.lo -MD -MP -MF .deps/push.Tpo -c -o push.lo push.cc
libtool: compile: g++ -DHAVE_CONFIG_H -I./../include -g -O2 -MT push.lo -MD -MP -MF .deps/push.Tpo -c push.cc -fPIC -DPIC -o .libs/push.o
g++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.6/README.Bugs> for instructions.
make[2]: *** [push.lo] Error 1
make[2]: Leaving directory `/home/pi/openfst-1.3.3/src/script'
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory `/home/pi/openfst-1.3.3/src'
make: *** [install-recursive] Error 1
Can anyone help?
Thanks for all suggestions!

I found the solution to the problem! I changed my swap size to 500 and it worked! I thought I had already changed it, but apparently you need to restart the rpi (of course) and I forgot to.

Related

Buildroot problem with libicudata. What's this?

When I try to build system with buildroot I have problem with makin libicudata.
make[2]: Entering directory '/home/ser-builder2/buildroot/output/build/icu-64-2/source/data'
/bin/bash ../mkinstalldirs /home/ser-builder2/buildroot/output/host/x86_64-buildroot-linux-gnu/sysroot/usr/lib
LD_LIBRARY_PATH=/home/ser-builder2/buildroot/output/build/host-icu-64-2/source/stubdata:/home/ser-builder2/buildroot/output/build/host-icu-64-2/source/tools/ctestfw:/home/ser-builder2/buildroot/output/build/host-icu-64-2/source/lib:$LD_LIBRARY_PATH /home/ser-builder2/buildroot/output/build/host-icu-64-2/source/bin/pkgdata -O ../data/icupkg.inc -q -c -s /home/ser-builder2/buildroot/output/build/icu-64-2/source/data/out/build/icudt64l -d ../lib -m dll -r 64.2 -e icudt64 -T ./out/tmp -s ./out/build/icudt64l -p icudt64l -L icudata ./out/tmp/icudata.lst -I /home/ser-builder2/buildroot/output/host/x86_64-buildroot-linux-gnu/sysroot/usr/lib
pkgdata: cd ../lib/ && /usr/bin/install -c libicudata.so.64.2 /home/ser-builder2/buildroot/output/host/x86_64-buildroot-linux-gnu/sysroot/usr/lib/libicudata.so.64.2
pkgdata: cd /home/ser-builder2/buildroot/output/host/x86_64-buildroot-linux-gnu/sysroot/usr/lib && rm -f libicudata.so.64 && ln -s libicudata.so.64.2 libicudata.so.64
Segmentation fault (core dumped)
-- return status = 35584
Error creating symbolic links. Failed command: cd /home/ser-builder2/buildroot/output/host/x86_64-buildroot-linux-gnu/sysroot/usr/lib && rm -f libicudata.so.64 && ln -s libicudata.so.64.2 libicudata.so.64
Makefile:180: recipe for target 'install-local' failed
make[2]: *** [install-local] Error 1
make[2]: Leaving directory '/home/ser-builder2/buildroot/output/build/icu-64-2/source/data'
Makefile:153: recipe for target 'install-recursive' failed
make[1]: *** [install-recursive] Error 2
make[1]: Leaving directory '/home/ser-builder2/buildroot/output/build/icu-64-2/source'
package/pkg-generic.mk:278: recipe for target '/home/ser-builder2/buildroot/output/build/icu-64-2/.stamp_staging_installed' failed
make: *** [/home/ser-builder2/buildroot/output/build/icu-64-2/.stamp_staging_installed] Error 2
I don't know what to do with this. I tried to build this on another computer and everything works fine.
I run into this problem too and tracked it down to the execution of pkgdata. Somehow LD_LIBRARY_PATH got screwed which causes '/usr/bin/rm' to fail. To solve it, I've modified Makefile.in and removed LD_LIBRARY_PATH=... from the invocation line.
diff -r -u a/source/Makefile.in b/source/Makefile.in
--- a/source/Makefile.in 2022-06-02 10:48:31.493046292 +0200
+++ b/source/Makefile.in 2022-06-02 11:25:57.303758900 +0200
## -258,7 +258,7 ##
#(echo 'TOOLBINDIR=$$(cross_buildroot)/bin' ;\
echo 'TOOLLIBDIR=$$(cross_buildroot)/lib' ;\
echo "INVOKE=$(LDLIBRARYPATH_ENVVAR)=$(LIBRARY_PATH_PREFIX)"'$$(TOOLLIBDIR):$$(cross_buildroot)/stubdata:$$(cross_buildroot)/tools/ctestfw:$$$$'"$(LDLIBRARYPATH_ENVVAR)" ;\
- echo "PKGDATA_INVOKE=$(LDLIBRARYPATH_ENVVAR)=$(LIBRARY_PATH_PREFIX)"'$$(cross_buildroot)/stubdata:$$(cross_buildroot)/tools/ctestfw:$$(TOOLLIBDIR):$$$$'"$(LDLIBRARYPATH_ENVVAR) " ;\
+ echo "PKGDATA_INVOKE= " ;\
echo ) >> $#
config/icucross.inc: $(top_builddir)/icudefs.mk $(top_builddir)/Makefile #platform_make_fragment#
I know that this question is quite old now, but I want to mention it if someone else will run into this.

Libtool - Mismatch version

I try to install USBIP on Centos 5.11 (Kernel 2.6.18-409.el5) but I always have this error when I type "make" :
make[1]: Entering directory "/root/Downloads/usbip-0.1.7/src"
Making all in lib
make[2]: Entering directory "/root/Downloads/usbip-0.1.7/src/lib"
if /bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -Wall -W -Wstrict-prototypes -std=gnu99 -DUSBIDS_FILE='"/usr/local/share/usbip/usb.ids"' -g -O2 -MT libusbip_la-names.lo -MD -MP -MF ".deps/libusbip_la-names.Tpo" -c -o libusbip_la-names.lo "test -f "names.c" || echo './'"names.c; \
then mv -f ".deps/libusbip_la-names.Tpo" ".deps/libusbip_la-names.Plo"; else rm -f ".deps/libusbip_la-names.Tpo"; exit 1; fi
libtool: Version mismatch error. This is libtool 1.9b, but the
libtool: definition of this LT_INIT comes from an older release.
libtool: You should recreate aclocal.m4 with macros from libtool 1.9b
libtool: and run autoconf again.
make[2]: [libusbip_la-names.lo] Error 1
make[2]: Leaving directory "/root/Downloads/usbip-0.1.7/src/lib"
make[1]: [all-recursive] Error 1
make[1]: Leaving directory "/root/Downloads/usbip-0.1.7/src"
make: *** [all] Error 2
I saw several solution on forums, like "autoreconf -vfi" but it does not work for me.
I currently try to reinstall libtool to have the last version but I can't. When I type "yum remove libtool", I'm always able to type "libtool --version" :
[tuk#VM01 Downloads]# libtool --version
ltmain.sh (GNU libtool) 1.9b
Written by Gordon Matzigkeit <gord#gnu.ai.mit.edu>, 1996
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
And binaries are always here :
[tuk#VM01 Downloads]# find / -name "libtool*"
/opt/share/man/man1/libtoolize.1
/opt/share/man/man1/libtool.1
/opt/share/aclocal/libtool.m4
/opt/share/info/libtool.info-1
/opt/share/info/libtool.info-2
/opt/share/info/libtool.info
/opt/share/libtool
/opt/bin/libtool
/opt/bin/libtoolize
/usr/local/share/man/man1/libtoolize.1
/usr/local/share/man/man1/libtool.1
/usr/local/share/aclocal/libtool.m4
/usr/local/share/info/libtool.info-1
/usr/local/share/info/libtool.info-2
/usr/local/share/info/libtool.info
/usr/local/share/libtool
/usr/local/bin/libtool
/usr/local/bin/libtoolize
/usr/share/automake-1.9/am/libtool.am
Is there any solution fro me to install USBIP ? Thanks you
Solved !
I haved several binaries for libtool :
[root#SVSLOFLEX2 ~]# which -a libtool
/usr/local/bin/libtool
/usr/bin/libtool
The version of /usr/local/bin is the 1.9b (and it don't work)
I added this line to use another version of libtool (by default) :
export PATH=/usr/bin:$PATH
The version of /usr/bin is the 1.5.22, and it work, USBIP is now installed.

Installing Neovim through Linuxbrew on AWS

I'm trying to install neovim with linuxbrew on AWS, but I keep getting the following messages, and I can't figure it out :/.
/home/ec2-user/.linuxbrew/bin/libtool: line 10548: /usr/bin/gcc-4.8: No such file or directory
~/dotfiles$ brew install neovim
==> Installing neovim from neovim/neovim
==> Downloading https://github.com/neovim/neovim/archive/v0.1.4.tar.gz
Already downloaded: /home/ec2-user/.cache/Homebrew/neovim-0.1.4.tar.gz
==> Downloading https://github.com/libuv/libuv/archive/v1.8.0.tar.gz
Already downloaded: /home/ec2-user/.cache/Homebrew/neovim--libuv-1.8.0.tar.gz
==> Downloading https://github.com/msgpack/msgpack-c/archive/cpp-1.0.0.tar.gz
Already downloaded: /home/ec2-user/.cache/Homebrew/neovim--msgpack-1.0.0.tar.gz
==> Downloading https://raw.githubusercontent.com/neovim/deps/master/opt/LuaJIT-2.0.4.tar.gz
Already downloaded: /home/ec2-user/.cache/Homebrew/neovim--luajit-2.0.4.tar.gz
==> Downloading https://github.com/keplerproject/luarocks/archive/5d8a16526573b36d5b22aa74866120c998466697.tar.gz
Already downloaded: /home/ec2-user/.cache/Homebrew/neovim--luarocks-998466697.tar.gz
==> Downloading https://github.com/mauke/unibilium/archive/v1.2.0.tar.gz
Already downloaded: /home/ec2-user/.cache/Homebrew/neovim--unibilium-1.2.0.tar.gz
==> Downloading http://www.leonerd.org.uk/code/libtermkey/libtermkey-0.18.tar.gz
Already downloaded: /home/ec2-user/.cache/Homebrew/neovim--libtermkey-0.18.tar.gz
==> Downloading https://github.com/neovim/libvterm/archive/1b745d29d45623aa8d22a7b9288c7b0e331c7088.tar.gz
Already downloaded: /home/ec2-user/.cache/Homebrew/neovim--libvterm-7088.tar.gz
==> Downloading https://github.com/jemalloc/jemalloc/releases/download/4.0.2/jemalloc-4.0.2.tar.bz2
Already downloaded: /home/ec2-user/.cache/Homebrew/neovim--jemalloc-4.0.2.tar.bz2
==> Building third-party dependencies.
==> cmake ../third-party -DUSE_BUNDLED_BUSTED=OFF -DUSE_BUNDLED_LUV=OFF -DUSE_EXISTING_SRC_DIR=ON -DCMAKE_C_FLAGS_RELEASE=-DNDEBUG -DCMAKE_CXX_FLAGS_RELEASE=-DNDEBUG -DCMAKE_INSTALL_PREFIX=/home/ec2-user/
==> make VERBOSE=1
Last 15 lines from /home/ec2-user/.cache/Homebrew/Logs/neovim/02.make:
libtool: compile: /home/ec2-user/.linuxbrew/bin/gcc-5 -I. -Wall -std=c99 -fPIC -c uninames.c -fPIC -DPIC -o .libs/uninames.o
libtool: compile: /home/ec2-user/.linuxbrew/bin/gcc-5 -I. -Wall -std=c99 -fPIC -c uninames.c -o uninames.o >/dev/null 2>&1
libtool --mode=compile --tag=CC /home/ec2-user/.linuxbrew/bin/gcc-5 -I. -DTERMINFO_DIRS='"/etc/terminfo:/lib/terminfo:/usr/share/terminfo:/usr/lib/terminfo:/usr/local/share/terminfo:/usr/local/lib/terminfo"' -Wall -std=c99 -fPIC -o uniutil.lo -c uniutil.c
libtool: compile: /home/ec2-user/.linuxbrew/bin/gcc-5 -I. -DTERMINFO_DIRS=\"/etc/terminfo:/lib/terminfo:/usr/share/terminfo:/usr/lib/terminfo:/usr/local/share/terminfo:/usr/local/lib/terminfo\" -Wall -std=c99 -fPIC -c uniutil.c -fPIC -DPIC -o .libs/uniutil.o
libtool: compile: /home/ec2-user/.linuxbrew/bin/gcc-5 -I. -DTERMINFO_DIRS=\"/etc/terminfo:/lib/terminfo:/usr/share/terminfo:/usr/lib/terminfo:/usr/local/share/terminfo:/usr/local/lib/terminfo\" -Wall -std=c99 -fPIC -c uniutil.c -o uniutil.o >/dev/null 2>&1
libtool --mode=link --tag=CC /home/ec2-user/.linuxbrew/bin/gcc-5 -L/home/ec2-user/.linuxbrew/lib -Wl,--dynamic-linker=/home/ec2-user/.linuxbrew/lib/ld.so -Wl,-rpath,/home/ec2-user/.linuxbrew/lib -rpath '/tmp/neovim-20160518-12137-13p0ite/neovim-0.1.4/deps-build/usr/lib' -version-info 3:0:3 -o libunibilium.la unibilium.lo uninames.lo uniutil.lo
libtool: link: /usr/bin/gcc-4.8 -shared -fPIC -DPIC .libs/unibilium.o .libs/uninames.o .libs/uniutil.o -L/home/ec2-user/.linuxbrew/lib -Wl,--dynamic-linker=/home/ec2-user/.linuxbrew/lib/ld.so -Wl,-rpath -Wl,/home/ec2-user/.linuxbrew/lib -Wl,-soname -Wl,libunibilium.so.0 -o .libs/libunibilium.so.0.3.0
/home/ec2-user/.linuxbrew/bin/libtool: line 10548: /usr/bin/gcc-4.8: No such file or directory
make[3]: *** [libunibilium.la] Error 127
make[3]: Leaving directory `/tmp/neovim-20160518-12137-13p0ite/neovim-0.1.4/deps-build/build/src/unibilium'
make[2]: *** [build/src/unibilium-stamp/unibilium-build] Error 2
make[2]: Leaving directory `/tmp/neovim-20160518-12137-13p0ite/neovim-0.1.4/deps-build'
make[1]: *** [CMakeFiles/unibilium.dir/all] Error 2
make[1]: Leaving directory `/tmp/neovim-20160518-12137-13p0ite/neovim-0.1.4/deps-build'
make: *** [all] Error 2
READ THIS: https://github.com/Linuxbrew/brew/blob/master/share/doc/homebrew/Troubleshooting.md#troubleshooting
If reporting this issue please do so at (not Homebrew/brew):
https://github.com/neovim/homebrew-neovim/issues
These open issues may also help:
Neovim Fails to Install on Standalone Linuxbrew: libmsgpack.so Error https://github.com/neovim/homebrew-neovim/issues/156
Neovim failing to build with homebrew on OS X 10.9.5 https://github.com/neovim/homebrew-neovim/issues/153
Can't install via homebrew-neovim if luarocks path is set explicitly https://github.com/neovim/homebrew-neovim/issues/149
Error when trying to install neovim in my Ubuntu 14.04 virtual machine. https://github.com/neovim/homebrew-neovim/issues/134
I had the same issue. It is a problem of the libtool formula
https://github.com/Linuxbrew/homebrew-core/issues/376
I fixed by doing
brew update
brew reinstall -s libtool
brew install neovim/neovim/neovim

libapreq2: libtool: link: CURRENT `' must be a nonnegative integer

When I try to install libapreq2, I get the error:
libtool: link: CURRENT `' must be a nonnegative integer
libtool: link: `:0:8' is not valid version information
How do I resolve it?
bash-3.2$ wget http://search.cpan.org/CPAN/authors/id/I/IS/ISAAC/libapreq2-2.13.tar.gz
bash-3.2$ tar xvf libapreq2-2.13.tar.gz
bash-3.2$ ./configure --enable-perl-glue --with-apache2-apxs=/install/others/apache2/bin/apxs --prefix=/install/others --with-apache2-src=/install/others/httpd-2.2.25 --with-apache2-httpd=/install/others/apache2/bin/httpd --with-apr-config=/install/others/httpd-2.2.25/srclib/apr/apr-1-config --with-apu-config=/install/others/httpd-2.2.25/srclib/apr-util/apu-1-config
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... gawk
checking whether make sets $(MAKE)... yes
checking whether make sets $(MAKE)... (cached) yes
checking for gcc... gcc
........
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
(cached) (cached) checking how to hardcode library paths into programs... immediate
appending configuration tag "F77" to libtool
checking for ranlib... (cached) ranlib
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln -s works... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for /install/others/httpd-2.2.25/include/httpd.h... yes
checking for /install/others/httpd-2.2.25/srclib/apr/apr-1-config... yes
checking for /install/others/httpd-2.2.25/srclib/apr-util/apu-1-config... yes
checking for perl... perl
checking for ExtUtils::XSBuilder... yes
checking for mod_perl2... yes
checking for Apache::Test... yes
checking for ExtUtils::MakeMaker... yes
setting APR_INCLUDES to " -I/install/others/httpd-2.2.25/srclib/apr/include "
adding "-I/install/others/httpd-2.2.25/srclib/apr-util/include" to APR_INCLUDES
adding "-I/install/others/httpd-2.2.25/srclib/apr-util/xml/expat/lib" to APR_INCLUDES
setting APR_LTFLAGS to " /install/others/httpd-2.2.25/srclib/apr/libapr-1.la"
adding "/install/others/httpd-2.2.25/srclib/apr-util/libaprutil-1.la" to APR_LTFLAGS
setting APR_LIBS to " -luuid -lrt -lcrypt -lpthread -ldl"
adding "/install/others/httpd-2.2.25/srclib/apr-util/xml/expat/libexpat.la" to APR_LIBS
setting APR_LDFLAGS to " -L/install/others/httpd-2.2.25/srclib/apr-util -laprutil-1 "
adding "-L/install/others/httpd-2.2.25/srclib/apr" to APR_LDFLAGS
adding "-lapr-1" to APR_LDFLAGS
setting CPPFLAGS to " -DLINUX -D_REENTRANT -D_GNU_SOURCE"
expr: syntax error
libapreq2 Version: 2.8.0
configure: creating ./config.status
config.status: creating Makefile
config.status: creating include/Makefile
config.status: creating library/Makefile
config.status: creating library/t/Makefile
config.status: creating module/Makefile
config.status: creating module/apache2/Makefile
config.status: creating glue/Makefile
config.status: creating build/doxygen.conf
config.status: creating include/groups.dox
config.status: creating apreq2-config
config.status: creating include/apreq_config.h
config.status: executing depfiles commands
bash-3.2$
bash-3.2$
bash-3.2$
bash-3.2$ make
Making all in .
make[1]: Entering directory `/install/others/libapreq2-2.13'
make[1]: Nothing to be done for `all-am'.
make[1]: Leaving directory `/install/others/libapreq2-2.13'
Making all in include
make[1]: Entering directory `/install/others/libapreq2-2.13/include'
make all-am
make[2]: Entering directory `/install/others/libapreq2-2.13/include'
make[2]: Leaving directory `/install/others/libapreq2-2.13/include'
make[1]: Leaving directory `/install/others/libapreq2-2.13/include'
Making all in library
make[1]: Entering directory `/install/others/libapreq2-2.13/library'
make all-am
make[2]: Entering directory `/install/others/libapreq2-2.13/library'
/bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../include -I/install/others/httpd-2.2.25/srclib/apr/include -I/install/others/httpd-2.2.25/srclib/apr-util/include -I/install/others/httpd-2.2.25/srclib/apr-util/xml/expat/lib -DLINUX -D_REENTRANT -D_GNU_SOURCE -g -O2 -MT util.lo -MD -MP -MF .deps/util.Tpo -c -o util.lo util.c
mkdir .libs
gcc -DHAVE_CONFIG_H -I. -I../include -I/install/others/httpd-2.2.25/srclib/apr/include -I/install/others/httpd-2.2.25/srclib/apr-util/include -I/install/others/httpd-2.2.25/srclib/apr-util/xml/expat/lib -DLINUX -D_REENTRANT -D_GNU_SOURCE -g -O2 -MT util.lo -MD -MP -MF .deps/util.Tpo -c util.c -fPIC -DPIC -o .libs/util.o
gcc -DHAVE_CONFIG_H -I. -I../include -I/install/others/httpd-2.2.25/srclib/apr/include -I/install/others/httpd-2.2.25/srclib/apr-util/include -I/install/others/httpd-2.2.25/srclib/apr-util/xml/expat/lib -DLINUX -D_REENTRANT -D_GNU_SOURCE -g -O2 -MT util.lo -MD -MP -MF .deps/util.Tpo -c util.c -o util.o >/dev/null 2>&1
.........
mv -f .deps/module_cgi.Tpo .deps/module_cgi.Plo
/bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../include -I/install/others/httpd-2.2.25/srclib/apr/include -I/install/others/httpd-2.2.25/srclib/apr-util/include -I/install/others/httpd-2.2.25/srclib/apr-util/xml/expat/lib -DLINUX -D_REENTRANT -D_GNU_SOURCE -g -O2 -MT error.lo -MD -MP -MF .deps/error.Tpo -c -o error.lo error.c
gcc -DHAVE_CONFIG_H -I. -I../include -I/install/others/httpd-2.2.25/srclib/apr/include -I/install/others/httpd-2.2.25/srclib/apr-util/include -I/install/others/httpd-2.2.25/srclib/apr-util/xml/expat/lib -DLINUX -D_REENTRANT -D_GNU_SOURCE -g -O2 -MT error.lo -MD -MP -MF .deps/error.Tpo -c error.c -fPIC -DPIC -o .libs/error.o
gcc -DHAVE_CONFIG_H -I. -I../include -I/install/others/httpd-2.2.25/srclib/apr/include -I/install/others/httpd-2.2.25/srclib/apr-util/include -I/install/others/httpd-2.2.25/srclib/apr-util/xml/expat/lib -DLINUX -D_REENTRANT -D_GNU_SOURCE -g -O2 -MT error.lo -MD -MP -MF .deps/error.Tpo -c error.c -o error.o >/dev/null 2>&1
mv -f .deps/error.Tpo .deps/error.Plo
/bin/sh ../libtool --tag=CC --mode=link gcc -g -O2 -version-info :0:8 /install/others/httpd-2.2.25/srclib/apr/libapr-1.la /install/others/httpd-2.2.25/srclib/apr-util/libaprutil-1.la -luuid -lrt -lcrypt -lpthread -ldl /install/others/httpd-2.2.25/srclib/apr-util/xml/expat/libexpat.la -o libapreq2.la -rpath /install/others/lib util.lo version.lo cookie.lo param.lo parser.lo parser_urlencoded.lo parser_header.lo parser_multipart.lo module.lo module_custom.lo module_cgi.lo error.lo
libtool: link: CURRENT `' must be a nonnegative integer
libtool: link: `:0:8' is not valid version information
make[2]: *** [libapreq2.la] Error 1
make[2]: Leaving directory `/install/others/libapreq2-2.13/library'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/install/others/libapreq2-2.13/library'
make: *** [all-recursive] Error 1
bash-3.2$
bash-3.2$
bash-3.2$ make install
Making install in .
make[1]: Entering directory `/install/others/libapreq2-2.13'
make[2]: Entering directory `/install/others/libapreq2-2.13'
test -z "/install/others/bin" || /bin/mkdir -p "/install/others/bin"
/usr/bin/install -c 'apreq2-config' '/install/others/bin/apreq2-config'
cd /install/others/httpd-2.2.25; make install
make[3]: Entering directory `/install/others/httpd-2.2.25'
Making install in srclib
make[4]: Entering directory `/install/others/httpd-2.2.25/srclib'
Making install in apr
make[5]: Entering directory `/install/others/httpd-2.2.25/srclib/apr'
make[6]: Entering directory `/install/others/httpd-2.2.25/srclib/apr'
make[6]: Nothing to be done for `local-all'.
make[6]: Leaving directory `/install/others/httpd-2.2.25/srclib/apr'
/install/others/httpd-2.2.25/srclib/apr/build/mkdir.sh /install/others/apache2/lib /install/others/apache2/bin /install/others/apache2/build \
/install/others/apache2/lib/pkgconfig /install/others/apache2/include
/usr/bin/install -c -m 644 /install/others/httpd-2.2.25/srclib/apr/include/apr.h /install/others/apache2/include
for f in /install/others/httpd-2.2.25/srclib/apr/include/apr_*.h; do \
/usr/bin/install -c -m 644 ${f} /install/others/apache2/include; \
done
/bin/sh /install/others/httpd-2.2.25/srclib/apr/libtool --mode=install /usr/bin/install -c -m 755 libapr-1.la /install/others/apache2/lib
/usr/bin/install -c -m 755 .libs/libapr-1.so.0.4.8 /install/others/apache2/lib/libapr-1.so.0.4.8
(cd /install/others/apache2/lib && { ln -s -f libapr-1.so.0.4.8 libapr-1.so.0 || { rm -f libapr-1.so.0 && ln -s libapr-1.so.0.4.8 libapr-1.so.0; }; })
(cd /install/others/apache2/lib && { ln -s -f libapr-1.so.0.4.8 libapr-1.so || { rm -f libapr-1.so && ln -s libapr-1.so.0.4.8 libapr-1.so; }; })
/usr/bin/install -c -m 755 .libs/libapr-1.lai /install/others/apache2/lib/libapr-1.la
/usr/bin/install -c -m 755 .libs/libapr-1.a /install/others/apache2/lib/libapr-1.a
chmod 644 /install/others/apache2/lib/libapr-1.a
ranlib /install/others/apache2/lib/libapr-1.a
PATH="$PATH:/sbin" ldconfig -n /install/others/apache2/lib
----------------------------------------------------------------------
Libraries have been installed in:
/install/others/apache2/lib
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,--rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
/usr/bin/install -c -m 644 apr.exp /install/others/apache2/lib/apr.exp
/usr/bin/install -c -m 644 apr.pc /install/others/apache2/lib/pkgconfig/apr-1.pc
for f in libtool shlibtool; do \
if test -f ${f}; then /usr/bin/install -c -m 755 ${f} /install/others/apache2/build; fi; \
done
/usr/bin/install -c -m 755 /install/others/httpd-2.2.25/srclib/apr/build/mkdir.sh /install/others/apache2/build
for f in make_exports.awk make_var_export.awk; do \
/usr/bin/install -c -m 644 /install/others/httpd-2.2.25/srclib/apr/build/${f} /install/others/apache2/build; \
done
.............
/usr/bin/install -c .libs/libexpat.lai /install/others/apache2/lib/libexpat.la
/usr/bin/install -c .libs/libexpat.a /install/others/apache2/lib/libexpat.a
chmod 644 /install/others/apache2/lib/libexpat.a
ranlib /install/others/apache2/lib/libexpat.a
PATH="$PATH:/sbin" ldconfig -n /install/others/apache2/lib
----------------------------------------------------------------------
Libraries have been installed in:
/install/others/apache2/lib
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,--rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
/usr/bin/install -c -m 644 ./lib/expat.h /install/others/apache2/include
make[6]: Leaving directory `/install/others/httpd-2.2.25/srclib/apr-util/xml/expat'
/bin/sh /install/others/httpd-2.2.25/srclib/apr/libtool --mode=install /usr/bin/install -c -m 755 libaprutil-1.la /install/others/apache2/lib
libtool: install: warning: relinking `libaprutil-1.la'
(cd /install/others/httpd-2.2.25/srclib/apr-util; /bin/sh /install/others/httpd-2.2.25/srclib/apr/libtool --silent --mode=relink gcc -g -O2 -pthread -DHAVE_CONFIG_H -DLINUX -D_REENTRANT -D_GNU_SOURCE -I/install/others/httpd-2.2.25/srclib/apr-util/include -I/install/others/httpd-2.2.25/srclib/apr-util/include/private -I/install/others/httpd-2.2.25/srclib/apr/include -I/install/others/httpd-2.2.25/srclib/apr-util/xml/expat/lib -version-info 5:2:5 -o libaprutil-1.la -rpath /install/others/apache2/lib buckets/apr_brigade.lo buckets/apr_buckets.lo buckets/apr_buckets_alloc.lo buckets/apr_buckets_eos.lo buckets/apr_buckets_file.lo buckets/apr_buckets_flush.lo buckets/apr_buckets_heap.lo buckets/apr_buckets_mmap.lo buckets/apr_buckets_pipe.lo buckets/apr_buckets_pool.lo buckets/apr_buckets_refcount.lo buckets/apr_buckets_simple.lo buckets/apr_buckets_socket.lo crypto/apr_crypto.lo crypto/apr_md4.lo crypto/apr_md5.lo crypto/apr_passwd.lo crypto/apr_sha1.lo crypto/crypt_blowfish.lo crypto/getuuid.lo crypto/uuid.lo dbd/apr_dbd.lo dbm/apr_dbm.lo dbm/apr_dbm_sdbm.lo dbm/sdbm/sdbm.lo dbm/sdbm/sdbm_hash.lo dbm/sdbm/sdbm_lock.lo dbm/sdbm/sdbm_pair.lo encoding/apr_base64.lo hooks/apr_hooks.lo ldap/apr_ldap_stub.lo ldap/apr_ldap_url.lo memcache/apr_memcache.lo misc/apr_date.lo misc/apr_queue.lo misc/apr_reslist.lo misc/apr_rmm.lo misc/apr_thread_pool.lo misc/apu_dso.lo misc/apu_version.lo strmatch/apr_strmatch.lo uri/apr_uri.lo xlate/xlate.lo xml/apr_xml.lo -luuid -lrt -lcrypt -lpthread -ldl /install/others/httpd-2.2.25/srclib/apr-util/xml/expat/libexpat.la /install/others/httpd-2.2.25/srclib/apr/libapr-1.la -luuid -lrt -lcrypt -lpthread -ldl )
/usr/bin/install -c -m 755 .libs/libaprutil-1.so.0.5.2T /install/others/apache2/lib/libaprutil-1.so.0.5.2
(cd /install/others/apache2/lib && { ln -s -f libaprutil-1.so.0.5.2 libaprutil-1.so.0 || { rm -f libaprutil-1.so.0 && ln -s libaprutil-1.so.0.5.2 libaprutil-1.so.0; }; })
(cd /install/others/apache2/lib && { ln -s -f libaprutil-1.so.0.5.2 libaprutil-1.so || { rm -f libaprutil-1.so && ln -s libaprutil-1.so.0.5.2 libaprutil-1.so; }; })
/usr/bin/install -c -m 755 .libs/libaprutil-1.lai /install/others/apache2/lib/libaprutil-1.la
/usr/bin/install -c -m 755 .libs/libaprutil-1.a /install/others/apache2/lib/libaprutil-1.a
chmod 644 /install/others/apache2/lib/libaprutil-1.a
ranlib /install/others/apache2/lib/libaprutil-1.a
PATH="$PATH:/sbin" ldconfig -n /install/others/apache2/lib
----------------------------------------------------------------------
Libraries have been installed in:
/install/others/apache2/lib
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,--rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
/usr/bin/install -c -m 644 aprutil.exp /install/others/apache2/lib
/usr/bin/install -c -m 755 apu-config.out /install/others/apache2/bin/apu-1-config
make[5]: Leaving directory `/install/others/httpd-2.2.25/srclib/apr-util'
Making install in pcre
make[5]: Entering directory `/install/others/httpd-2.2.25/srclib/pcre'
make[6]: Entering directory `/install/others/httpd-2.2.25/srclib/pcre'
make[6]: Leaving directory `/install/others/httpd-2.2.25/srclib/pcre'
make[5]: Leaving directory `/install/others/httpd-2.2.25/srclib/pcre'
..................
Making install in support
make[4]: Entering directory `/install/others/httpd-2.2.25/support'
make[5]: Entering directory `/install/others/httpd-2.2.25/support'
make[5]: Leaving directory `/install/others/httpd-2.2.25/support'
make[4]: Leaving directory `/install/others/httpd-2.2.25/support'
make[4]: Entering directory `/install/others/httpd-2.2.25'
Installing configuration files
[PRESERVING EXISTING HTDOCS SUBDIR: /install/others/apache2/htdocs]
[PRESERVING EXISTING ERROR SUBDIR: /install/others/apache2/error]
[PRESERVING EXISTING ICONS SUBDIR: /install/others/apache2/icons]
[PRESERVING EXISTING CGI SUBDIR: /install/others/apache2/cgi-bin]
Installing header files
Installing build system files
Installing man pages and online manual
make[4]: Leaving directory `/install/others/httpd-2.2.25'
make[3]: Leaving directory `/install/others/httpd-2.2.25'
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/install/others/libapreq2-2.13'
make[1]: Leaving directory `/install/others/libapreq2-2.13'
Making install in include
make[1]: Entering directory `/install/others/libapreq2-2.13/include'
make[2]: Entering directory `/install/others/libapreq2-2.13/include'
make[2]: Nothing to be done for `install-exec-am'.
test -z "/install/others/include/apreq2" || /bin/mkdir -p "/install/others/include/apreq2"
/usr/bin/install -c -m 644 'apreq.h' '/install/others/include/apreq2/apreq.h'
/usr/bin/install -c -m 644 'apreq_cookie.h' '/install/others/include/apreq2/apreq_cookie.h'
/usr/bin/install -c -m 644 'apreq_error.h' '/install/others/include/apreq2/apreq_error.h'
/usr/bin/install -c -m 644 'apreq_module.h' '/install/others/include/apreq2/apreq_module.h'
/usr/bin/install -c -m 644 'apreq_param.h' '/install/others/include/apreq2/apreq_param.h'
/usr/bin/install -c -m 644 'apreq_parser.h' '/install/others/include/apreq2/apreq_parser.h'
/usr/bin/install -c -m 644 'apreq_util.h' '/install/others/include/apreq2/apreq_util.h'
/usr/bin/install -c -m 644 'apreq_version.h' '/install/others/include/apreq2/apreq_version.h'
make[2]: Leaving directory `/install/others/libapreq2-2.13/include'
make[1]: Leaving directory `/install/others/libapreq2-2.13/include'
Making install in library
make[1]: Entering directory `/install/others/libapreq2-2.13/library'
make install-am
make[2]: Entering directory `/install/others/libapreq2-2.13/library'
/bin/sh ../libtool --tag=CC --mode=link gcc -g -O2 -version-info :0:8 /install/others/httpd-2.2.25/srclib/apr/libapr-1.la /install/others/httpd-2.2.25/srclib/apr-util/libaprutil-1.la -luuid -lrt -lcrypt -lpthread -ldl /install/others/httpd-2.2.25/srclib/apr-util/xml/expat/libexpat.la -o libapreq2.la -rpath /install/others/lib util.lo version.lo cookie.lo param.lo parser.lo parser_urlencoded.lo parser_header.lo parser_multipart.lo module.lo module_custom.lo module_cgi.lo error.lo
libtool: link: CURRENT `' must be a nonnegative integer
libtool: link: `:0:8' is not valid version information
make[2]: *** [libapreq2.la] Error 1
make[2]: Leaving directory `/install/others/libapreq2-2.13/library'
make[1]: *** [install] Error 2
make[1]: Leaving directory `/install/others/libapreq2-2.13/library'
make: *** [install-recursive] Error 1
Note: I don't have root access. I am installing in home directory /install/others. The server is RedHat Linux.
Here is a success story: http://www.perlmonks.org/?node_id=660325
### change the path accordingly
./configure --enable-shared --with-gnu-ld --enable-perl-glue --with-perl=/usr/bin/perl --with-apache2-apxs=/usr/sbin/apxs --with-httpd=/usr/sbin/httpd
/sbin/ldconfig /usr/lib
Other solution is to use perlbrew or local::lib and install a local perl in you home, then you maybe able to install it with cpanm.

Keys for Net::SSH2

I have a simple perl test script which uses Net::SSH2, and I'm having trouble getting it to work with public key authentication.
Note: After reading a couple of replies, I realise that I should mention that I created the script to help narrow down a problem I was having with another application that uses Net::SSH2. It's therefore not possible for me to switch to an alternative package such as Net::OpenSSH or Net::OpenSSH::Compat::SSH2.
Note Update: As salva pointed out, Net::OpenSSH::Compat::SSH2 can be used without having to patch the original application.
Here's the code:
use strict;
use warnings;
use 5.10.0;
use Net::SSH2;
my $ssh2 = Net::SSH2->new();
my $auth;
if ( $ssh2->connect('hostname') ) {
$auth = $ssh2->auth_publickey(
'username',
'/home/mike/.ssh/id_rsa.pub',
'/home/mike/.ssh/id_rsa',
'password'
);
}
if ($auth && $ssh2->auth_ok) {
say 'Success';
} else {
say join ', ', $ssh2->error;
}
I have been generating key pairs using ssh-keygen on Ubuntu:
ssh-keygen -t rsa
ssh-copy-id user#server
ssh user#server
The above works correctly - I can SSH to the server.
When I run the Perl code, I get the following error when using a password protected key:
-16, LIBSSH2_ERROR_FILE, Unable to initialize private key from file
If I try with a non-password protected key, it works correctly.
I have the following libraries installed:
Net::SSH2 0.35
libssh2-1 1.2.2-1
libssh2-1-dev 1.2.2-1
ssh 1:5.3p1-3ubuntu6
openssh-server 1:5.3p1-3ubuntu6
openssh-client 1:5.3p1-3ubuntu6
openssl 0.9.8k-7ubuntu8.6
libssl-dev 0.9.8k-7ubuntu8.6
The plot thickens
If I remove libssh2-1 and libssh2-1-dev, I get an error, as expected:
Can't load '/usr/local/lib/perl/5.10.1/auto/Net/SSH2/SSH2.so'
If I then build libssh2 from source, I am unable to reinstall Net::SSH2, as it can't find the development headers. However, if I reinstall libssh2-1 and libssh2-1-dev and then build and install libssh2 from source, it works.
Does that mean that the build of libssh2-1-dev on Ubuntu 10.04 is at fault? If so, how do I install libssh2 from source and correctly install Net::SSH2, without requiring libssh2-1-dev. I presume that the build from source is overwriting or overriding the Ubuntu package.
UPDATE
As noted in Daniel Stenberg's reply, the Ubuntu 10.04 package is now a little out of date (version 1.2.2, compared with the latest stable build at 1.2.8). Installing libssh2 from source 'over the top' of the Ubuntu package solves the problem. However, this feels messy to me. How can I remove the Ubuntu package, install libssh2 from source, and still build Net::SSH2 — how do I tell Net::SSH2 where to find the libssh2 development headers?
UPDATE 2
salva came to the rescue again, and showed how the Net::SSH2 installer can be configured with lib and include directories, so that it may be used with the source install of libssh2. Thanks salva! Note that instead of patching Makefile.PL, it's possible to just override the $lib and $inc variables at the top of Makefile.PL. I wasn't aware of this until I looked at salva's patch.
I have been able to successfully log into a server using a pass-phrase protected key with Net::SSH2 from the the Ubuntu 11.04 libnet-ssh2-perl package.
Anyway, consider using Net::OpenSSH or Net::OpenSSH::Compat::SSH2 instead of Net::SSH2.
Update: Net::OpenSSH::Compat::SSH2 tries to be a replacement for Net::SSH2. There is no need to patch the application in order to try it:
perl -MNet::OpenSSH::Compat=Net::SSH2 yor_app.pl
When you install libssh2 from the source package it will by default install itself in /usr/local, while the default package installs in /usr which probably is why it only finds the "stock" installed version.
Unfortunately it seems your Ubuntu has a fairly old libssh2 version as it has been bugfixed a lot since then.
I recommend using the libssh2-devel mailing list for in-depth libssh2 questions. It's a small but friendly community.
I have created a patch for Net::SSH2 Makefile.PL that allows to set the location of libssh2 libs and headers from the command line.
Here is a capture of the full build process for libssh2 + Net::SSH2 using it:
salva#leon:/tmp/salva$ wget http://www.libssh2.org/download/libssh2-1.2.8.tar.gz
--2011-05-27 11:21:10-- http://www.libssh2.org/download/libssh2-1.2.8.tar.gz
Resolving www.libssh2.org... 80.67.6.50
Connecting to www.libssh2.org|80.67.6.50|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 637707 (623K) [application/x-gzip]
Saving to: `libssh2-1.2.8.tar.gz'
100%[================================================================================================================================================================================================>] 637,707 525K/s in 1.2s
2011-05-27 11:21:14 (525 KB/s) - `libssh2-1.2.8.tar.gz' saved [637707/637707]
salva#leon:/tmp/salva$ tar xzf libssh2-1.2.8.tar.gz
salva#leon:/tmp/salva$ cd libssh2-1.2.8
salva#leon:/tmp/salva/libssh2-1.2.8$ ./configure --prefix=/usr/local/libssh2
checking whether to enable maintainer-specific portions of Makefiles... no
checking for sed... /bin/sed
checking for a BSD-compatible install... /usr/bin/install -c
...
salva#leon:/tmp/salva/libssh2-1.2.8$ make
Making all in src
make[1]: Entering directory `/tmp/salva/libssh2-1.2.8/src'
make all-am
make[2]: Entering directory `/tmp/salva/libssh2-1.2.8/src'
if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I../include -I../src -g -O2 -MT channel.lo -MD -MP -MF ".deps/channel.Tpo" -c -o channel.lo channel.c; \
then mv -f ".deps/channel.Tpo" ".deps/channel.Plo"; else rm -f ".deps/channel.Tpo"; exit 1; fi
libtool: compile: gcc -DHAVE_CONFIG_H -I../include -I../src -g -O2 -MT channel.lo -MD -MP -MF .deps/channel.Tpo -c channel.c -fPIC -DPIC -o .libs/channel.o
...
salva#leon:/tmp/salva/libssh2-1.2.8$ sudo make install
Making install in src
make[1]: Entering directory `/tmp/salva/libssh2-1.2.8/src'
make[2]: Entering directory `/tmp/salva/libssh2-1.2.8/src'
test -z "/usr/local/libssh2/lib" || mkdir -p -- "/usr/local/libssh2/lib"
/bin/bash ../libtool --mode=install /usr/bin/install -c 'libssh2.la' '/usr/local/libssh2/lib/libssh2.la'
libtool: install: /usr/bin/install -c .libs/libssh2.so.1.0.1 /usr/local/libssh2/lib/libssh2.so.1.0.1
...
salva#leon:/tmp/salva/libssh2-1.2.8$ cd ..
salva#leon:/tmp/salva$ wget http://search.cpan.org/CPAN/authors/id/R/RK/RKITOVER/Net-SSH2-0.35.tar.gz
--2011-05-27 11:22:56-- http://search.cpan.org/CPAN/authors/id/R/RK/RKITOVER/Net-SSH2-0.35.tar.gz
Resolving search.cpan.org... 207.115.101.144
Connecting to search.cpan.org|207.115.101.144|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://osl.ugr.es/CPAN/authors/id/R/RK/RKITOVER/Net-SSH2-0.35.tar.gz [following]
--2011-05-27 11:22:59-- http://osl.ugr.es/CPAN/authors/id/R/RK/RKITOVER/Net-SSH2-0.35.tar.gz
Resolving osl.ugr.es... 150.214.21.7
Connecting to osl.ugr.es|150.214.21.7|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 92434 (90K) [application/x-gzip]
Saving to: `Net-SSH2-0.35.tar.gz'
100%[================================================================================================================================================================================================>] 92,434 328K/s in 0.3s
2011-05-27 11:22:59 (328 KB/s) - `Net-SSH2-0.35.tar.gz' saved [92434/92434]
salva#leon:/tmp/salva$ tar xzf Net-SSH2-0.35.tar.gz
salva#leon:/tmp/salva$ cd Net-SSH2-0.35
salva#leon:/tmp/salva/Net-SSH2-0.35$ wget -q --no-check-certificate -O - https://github.com/salva/net-ssh2/commit/3c7261f4584137f4240d204731e20f709f1addb1.patch|patch -p1
patching file Makefile.PL
salva#leon:/tmp/salva/Net-SSH2-0.35$ perl Makefile.PL lib=/usr/local/libssh2/lib/ inc=/usr/local/libssh2/include/
The libssh2 library is required by this module. If you don't have it, you can
download it from http://www.libssh2.org; you may also need OpenSSL, which can be
obtained from http://www.openssl.org.
Debian: sudo aptitude install libssh2-1-dev
OpenSUSE: sudo zypper in libssh2-1 libssh2-devel
Checking if your kit is complete...
Looks good
Writing Makefile for Net::SSH2
salva#leon:/tmp/salva/Net-SSH2-0.35$ make
cp lib/Net/SSH2/File.pm blib/lib/Net/SSH2/File.pm
cp lib/Net/SSH2/PublicKey.pm blib/lib/Net/SSH2/PublicKey.pm
cp lib/Net/SSH2/Dir.pm blib/lib/Net/SSH2/Dir.pm
cp lib/Net/SSH2/SFTP.pm blib/lib/Net/SSH2/SFTP.pm
cp lib/Net/SSH2/Listener.pm blib/lib/Net/SSH2/Listener.pm
cp lib/Net/SSH2/Channel.pm blib/lib/Net/SSH2/Channel.pm
cp lib/Net/SSH2.pm blib/lib/Net/SSH2.pm
AutoSplitting blib/lib/Net/SSH2.pm (blib/lib/auto/Net/SSH2)
/usr/bin/perl "-Iinc" /usr/local/share/perl/5.10.1/ExtUtils/xsubpp -typemap /usr/share/perl/5.10/ExtUtils/typemap -typemap typemap SSH2.xs > SSH2.xsc && mv SSH2.xsc SSH2.c
cc -c /usr/local/libssh2/include/ -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -DVERSION=\"0.35\" -DXS_VERSION=\"0.35\" -fPIC "-I/usr/lib/perl/5.10/CORE" SSH2.c
In file included from SSH2.xs:11:0:
ppport.h:3042:0: warning: "PERL_UNUSED_DECL" redefined
/usr/lib/perl/5.10/CORE/perl.h:330:0: note: this is the location of the previous definition
cc: /usr/local/libssh2/include/: linker input file unused because linking not done
Running Mkbootstrap for Net::SSH2 ()
chmod 644 SSH2.bs
rm -f blib/arch/auto/Net/SSH2/SSH2.so
LD_RUN_PATH="/usr/local/libssh2/lib:/lib/x86_64-linux-gnu" cc -shared -O2 -g -L/usr/local/lib -fstack-protector SSH2.o -o blib/arch/auto/Net/SSH2/SSH2.so \
-L/usr/local/libssh2/lib/ -lssh2 -lz -lssl -lcrypto \
chmod 755 blib/arch/auto/Net/SSH2/SSH2.so
cp SSH2.bs blib/arch/auto/Net/SSH2/SSH2.bs
chmod 644 blib/arch/auto/Net/SSH2/SSH2.bs
Manifying blib/man3/Net::SSH2::File.3pm
Manifying blib/man3/Net::SSH2::Dir.3pm
Manifying blib/man3/Net::SSH2::PublicKey.3pm
Manifying blib/man3/Net::SSH2::SFTP.3pm
Manifying blib/man3/Net::SSH2::Listener.3pm
Manifying blib/man3/Net::SSH2::Channel.3pm
Manifying blib/man3/Net::SSH2.3pm
salva#leon:/tmp/salva/Net-SSH2-0.35$ ldd ./blib/arch/auto/Net/SSH2/SSH2.so
linux-vdso.so.1 => (0x00007fff20abc000)
libssh2.so.1 => /usr/local/libssh2/lib/libssh2.so.1 (0x00007f464d52f000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f464d317000)
libssl.so.0.9.8 => /lib/libssl.so.0.9.8 (0x00007f464d09a000)
libcrypto.so.0.9.8 => /lib/libcrypto.so.0.9.8 (0x00007f464cd0b000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f464c977000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f464c772000)
/lib64/ld-linux-x86-64.so.2 (0x00007f464d97e000)
salva#leon:/tmp/salva/Net-SSH2-0.35$ sudo make install
...