How can I install libusb and libfprint from source code?
Hi,
I'm trying to install an application called fprint_demo without install any .deb package, and this application is dependent from three libs: (faster to install)libusb, (slow)imagemagick, (faster)libfprint.
I will put all the installed things in /opt/manual and the fonts in /opt/install, I don't have and I don't want install the package libusb-dev.
I started installing the libusb:
Code:
mkdir -r /opt/manual
cd /opt/install/libusb-1.0.2/
./configure --prefix=/opt/manual --enable-debug-log
.
.
.configure: creating ./config.status
config.status: creating libusb-1.0.pc
config.status: creating Makefile
config.status: creating libusb/Makefile
config.status: creating examples/Makefile
config.status: creating doc/Makefile
config.status: creating doc/doxygen.cfg
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
config.status: executing libtool commands
(no errors)
make
.
.
.
(no errors)
sudo checkinstall -D
.
.
.
**********************************************************************
Done. The new package has been installed and saved to
/opt/install/libusb-1.0.2/libusb_1.0.2-1_i386.deb
You can remove it from your system anytime using:
dpkg -r libusb
**********************************************************************
ls -lhR /opt/manual/
/opt/manual/:
total 8,0K
drwxr-xr-x 3 root root 4,0K 2009-08-27 11:48 include
drwxr-xr-x 3 root root 4,0K 2009-08-27 11:48 lib
/opt/manual/include:
total 4,0K
drwxr-xr-x 2 root root 4,0K 2009-08-27 11:48 libusb-1.0
/opt/manual/include/libusb-1.0:
total 44K
-rw-r--r-- 1 root root 41K 2009-08-27 11:48 libusb.h
/opt/manual/lib:
total 264K
-rw-r--r-- 1 root root 201K 2009-08-27 11:48 libusb-1.0.a
-rwxr-xr-x 1 root root 955 2009-08-27 11:48 libusb-1.0.la
lrwxrwxrwx 1 root root 19 2009-08-27 11:48 libusb-1.0.so -> libusb-1.0.so.0.0.0
lrwxrwxrwx 1 root root 19 2009-08-27 11:48 libusb-1.0.so.0 -> libusb-1.0.so.0.0.0
-rwxr-xr-x 1 root root 50K 2009-08-27 11:48 libusb-1.0.so.0.0.0
drwxr-xr-x 2 root root 4,0K 2009-08-27 11:48 pkgconfig
/opt/manual/lib/pkgconfig:
total 4,0K
-rw-r--r-- 1 root root 255 2009-08-27 11:48 libusb-1.0.pc
then I create the file manual.conf in /etc/ld.so.conf.d/
Code:
sudo gedit /etc/ld.so.conf.d/manual.conf
and put this line
/opt/manual/lib
Code:
cat /etc/ld.so.conf.d/manual.conf
/opt/manual/lib
Then I update the ldconfig
Code:
sudo ldconfig -v
.
.
.
/opt/manual/lib:
libusb-1.0.so.0 -> libusb-1.0.so.0.0.0
.
.
.
ok until here? next post I will show the Imagemagick install.
Re: How can I install libusb and libfprint form source code?
I found the solution to compile Libfprint.
Code:
export PKG_CONFIG_PATH=/opt/manual/lib/pkgconfig/:$PKG_CONFIG_PATH
echo $PKG_CONFIG_PATH
/opt/manual/lib/pkgconfig/:
then
Code:
pkg-config --cflags libusb-1.0 --libs libusb-1.0
-I/opt/manual/include/libusb-1.0 -L/opt/manual/lib -lusb-1.0
./configure --prefix=/opt/manual --enable-debug-log LIBUSB_CFLAGS=-I/opt/manual/include/libusb-1.0 LIBUSB_LIBS='-L/opt/manual/lib -lusb-1.0'
.
.
.
checking pkg-config is at least version 0.9.0... yes
checking for LIBUSB... yes
checking for CRYPTO... yes
checking for GLIB... yes
checking for IMAGEMAGICK... yes
configure: creating ./config.status
config.status: creating libfprint.pc
config.status: creating Makefile
config.status: creating libfprint/Makefile
config.status: creating examples/Makefile
config.status: creating doc/Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
(no errors)
Why ImageMagick is found and libusb isn't I never you know rsrs.
then more one critical error..
Code:
make
make all-recursive
make[1]: Entrando no diretório `/opt/install/libfprint-0.0.6'
Making all in libfprint
make[2]: Entrando no diretório `/opt/install/libfprint-0.0.6/libfprint'
/bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -fvisibility=hidden -I./nbis/include -I/opt/manual/include/libusb-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -fopenmp -I/opt/manual/include/ImageMagick -std=gnu99 -fgnu89-inline -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -Wno-pointer-sign -Wshadow -g -O2 -MT libfprint_la-core.lo -MD -MP -MF .deps/libfprint_la-core.Tpo -c -o libfprint_la-core.lo `test -f 'core.c' || echo './'`core.c
gcc -DHAVE_CONFIG_H -I. -I.. -fvisibility=hidden -I./nbis/include -I/opt/manual/include/libusb-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -fopenmp -I/opt/manual/include/ImageMagick -std=gnu99 -fgnu89-inline -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -Wno-pointer-sign -Wshadow -g -O2 -MT libfprint_la-core.lo -MD -MP -MF .deps/libfprint_la-core.Tpo -c core.c -fPIC -DPIC -o .libs/libfprint_la-core.o
core.c:25:17: error: usb.h: Arquivo ou diretório inexistente
In file included from core.c:27:
fp_internal.h:67: error: expected specifier-qualifier-list before ‘usb_dev_handle’
fp_internal.h:79: error: expected specifier-qualifier-list before ‘usb_dev_handle’
core.c: In function ‘find_supporting_driver’:
core.c:364: error: dereferencing pointer to incomplete type
core.c:365: error: dereferencing pointer to incomplete type
core.c: In function ‘fp_discover_devs’:
core.c:418: warning: implicit declaration of function ‘usb_find_busses’
core.c:419: warning: implicit declaration of function ‘usb_find_devices’
core.c:426: warning: implicit declaration of function ‘usb_get_busses’
core.c:426: warning: assignment makes pointer from integer without a cast
core.c:426: error: dereferencing pointer to incomplete type
core.c:427: error: dereferencing pointer to incomplete type
core.c:427: error: dereferencing pointer to incomplete type
core.c: In function ‘fp_dev_open’:
core.c:584: error: ‘usb_dev_handle’ undeclared (first use in this function)
core.c:584: error: (Each undeclared identifier is reported only once
core.c:584: error: for each function it appears in.)
core.c:584: error: ‘udevh’ undeclared (first use in this function)
core.c:584: warning: implicit declaration of function ‘usb_open’
core.c:592: error: ‘struct fp_dev’ has no member named ‘udev’
core.c:593: error: ‘struct fp_dev’ has no member named ‘__enroll_stage’
core.c:599: warning: implicit declaration of function ‘usb_close’
core.c: In function ‘do_close’:
core.c:615: error: ‘struct fp_dev’ has no member named ‘udev’
core.c: In function ‘fp_dev_get_nr_enroll_stages’:
core.c:655: error: ‘struct fp_dev’ has no member named ‘nr_enroll_stages’
core.c: In function ‘fp_dev_get_devtype’:
core.c:665: error: ‘struct fp_dev’ has no member named ‘devtype’
core.c: In function ‘fp_dev_supports_print_data’:
core.c:677: error: ‘struct fp_dev’ has no member named ‘devtype’
core.c: In function ‘fp_dev_supports_dscv_print’:
core.c:692: error: ‘struct fp_dev’ has no member named ‘devtype’
core.c: In function ‘dev_to_img_dev’:
core.c:730: error: ‘struct fp_dev’ has no member named ‘priv’
core.c: In function ‘fp_enroll_finger_img’:
core.c:889: error: ‘struct fp_dev’ has no member named ‘__enroll_stage’
core.c:892: error: ‘struct fp_dev’ has no member named ‘nr_enroll_stages’
core.c:900: error: ‘struct fp_dev’ has no member named ‘__enroll_stage’
core.c:903: error: ‘struct fp_dev’ has no member named ‘nr_enroll_stages’
core.c:904: error: ‘struct fp_dev’ has no member named ‘nr_enroll_stages’
core.c:906: error: ‘struct fp_dev’ has no member named ‘__enroll_stage’
core.c:909: error: ‘struct fp_dev’ has no member named ‘nr_enroll_stages’
core.c:915: error: ‘struct fp_dev’ has no member named ‘__enroll_stage’
core.c:927: error: ‘struct fp_dev’ has no member named ‘__enroll_stage’
core.c:931: error: ‘struct fp_dev’ has no member named ‘__enroll_stage’
core.c:947: error: ‘struct fp_dev’ has no member named ‘__enroll_stage’
core.c:951: error: ‘struct fp_dev’ has no member named ‘__enroll_stage’
core.c: In function ‘fp_init’:
core.c:1123: warning: implicit declaration of function ‘usb_init’
make[2]: ** [libfprint_la-core.lo] Erro 1
make[2]: Saindo do diretório `/opt/install/libfprint-0.0.6/libfprint'
make[1]: ** [all-recursive] Erro 1
make[1]: Saindo do diretório `/opt/install/libfprint-0.0.6'
make: ** [all] Erro 2
The make is looking for a header called usb.h
Code:
find /opt/install/libusb-1.0.2/ /opt/manual/include/ -iname "usb.h"
(nothing)
What I can do now?
Re: How can I install libusb and libfprint form source code?
I found the solution but isn't the best solution..
I downloaded all libusb-x.x.x from the site www.libusb.org, and anyone of them does not had the "usb.h" header. Then I got an ideia, I download the .deb package to see if it had the file "usb.h"
Code:
sudo apt-get install -d libusb-dev
sudo dpkg -x /var/cache/apt/archives/libusb-dev_2%3a0.1.12-13_i386.deb ~/libusb-dev
find /home/maiko/libusb-dev/ -iname "usb.h"
/home/maiko/libusb-dev/usr/include/usb.h
Omg! Why ?!?!??!?!
not even knowing why
Code:
sudo cp -a /home/maiko/libusb-dev/usr/include/usb.h /opt/manual/include/libusb-1.0/
make
.
.
.
Making all in doc
make[2]: Entrando no diretório `/opt/install/libfprint-0.0.6/doc'
make[2]: Nada a ser feito para `all'.
make[2]: Saindo do diretório `/opt/install/libfprint-0.0.6/doc'
make[2]: Entrando no diretório `/opt/install/libfprint-0.0.6'
make[2]: Saindo do diretório `/opt/install/libfprint-0.0.6'
make[1]: Saindo do diretório `/opt/install/libfprint-0.0.6'
(no errors)
sudo checkinstall -D
**********************************************************************
Done. The new package has been installed and saved to
/opt/install/libfprint-0.0.6/libfprint_0.0.6-1_i386.deb
You can remove it from your system anytime using:
dpkg -r libfprint
**********************************************************************
T_T