PCL - Glib Компилиране от източник, FFI свързване

Трябва да инсталирам PCL (библиотека за облачни точки) на Linux сървър без root достъп. След това изтеглих източника и проверих за зависимости. И ето ни...

Това са зависимостите, които открих:

PCL
--BOOST
----ZLIB
----BZIP
--EIGEN
--FLANN
----HDF5
----LIBUSB
------UDEV
--------GLIB
----------LIBFFI
----------ZLIB 
--VTK

Трябва да компилирам glib от източника. Glib изисква FFI библиотеки, така че ги изтеглих, компилирах и ги инсталирах

/home/franz/Downloads/libffi-3.0.13/installed

след това задавам тези променливи:

    LD_LIBRARY_PATH=/home/franz/Downloads/libffi-3.0.13/installed/lib
    LIBFFI_CFLAGS="-I/home/franz/Downloads/libffi-3.0.13/installed/lib/libffi-3.0.13/include" LIBFFI_LIBS="-lffi -L/home/franz/Downloads/libffi-3.0.13/installed/lib"

след това ./configure и make. Получих тези грешки:

make[4]: Entering directory `/home/franz/Downloads/glib-2.37.5/gobject'
/bin/bash ../libtool  --tag=CC   --mode=link gcc -Wall -Wstrict-prototypes -Werror=declaration-after-statement -Werror=missing-prototypes -Werror=implicit-function-declaration -Werror=pointer-arith -Werror=init-self -Werror=format-security -Werror=format=2 -Werror=missing-include-dirs -g -O2   -o gobject-query gobject-query.o ./libgobject-2.0.la ../glib/libglib-2.0.la 
libtool: link: gcc -Wall -Wstrict-prototypes -Werror=declaration-after-statement -Werror=missing-prototypes -Werror=implicit-function-declaration -Werror=pointer-arith -Werror=init-self -Werror=format-security -Werror=format=2 -Werror=missing-include-dirs -g -O2 -o .libs/gobject-query gobject-query.o  ./.libs/libgobject-2.0.so -L/home/franz/Downloads/libffi-3.0.13/installed/lib /home/franz/Downloads/glib-2.37.5/glib/.libs/libglib-2.0.so ../glib/.libs/libglib-2.0.so -lpthread -lrt -Wl,-rpath -Wl,/home/franz/Downloads/glib-2.37.5/installed/lib
./.libs/libgobject-2.0.so: undefined reference to `ffi_type_void'
./.libs/libgobject-2.0.so: undefined reference to `ffi_type_double'
./.libs/libgobject-2.0.so: undefined reference to `ffi_prep_cif'
./.libs/libgobject-2.0.so: undefined reference to `ffi_type_sint32'
./.libs/libgobject-2.0.so: undefined reference to `ffi_type_float'
./.libs/libgobject-2.0.so: undefined reference to `ffi_type_uint64'
./.libs/libgobject-2.0.so: undefined reference to `ffi_type_sint64'
./.libs/libgobject-2.0.so: undefined reference to `ffi_type_pointer'
./.libs/libgobject-2.0.so: undefined reference to `ffi_type_uint32'
./.libs/libgobject-2.0.so: undefined reference to `ffi_call'

след това видях библиотеките, които исках да включа и зададох с LIBFFI_CFLAGS/LIBS в configure, не присъстват в make, така че промених моята CC променлива, за да принудя моя компилатор да използва моите библиотеки:

LIBFFI_CFLAGS="-I/home/franz/Downloads/libffi-3.0.13/installed/lib/libffi-3.0.13/include" LIBFFI_LIBS="-lffi -L/home/franz/Downloads/libffi-3.0.13/installed/lib" ZLIB_CFLAGS="-I/home/franz/Downloads/zlib-1.2.8/installed/include" ZLIB_LIBS="-L/home/franz/Downloads/zlib-1.2.8/installed/lib" CC="gcc $LIBFFI_CFLAGS $LIBFFI_LIBS" CXX="/usr/bin/g++-4.4 $LIBFFI_CFLAGS $LIBFFI_LIBS" ./configure --prefix=`pwd`/installed

и направи

По този начин вместо gcc в процеса на създаване, ще получим gcc -I... -lffi -L... И това работеше досега. Но сега получавам същата грешка на друго място:

make[4]: Entering directory `/home/franz/Downloads/glib-2.37.5/gio'
/bin/bash ../libtool  --tag=CC   --mode=link gcc -I/home/franz/Downloads/libffi-3.0.13/installed/lib/libffi-3.0.13/include -lffi -L/home/franz/Downloads/libffi-3.0.13/installed/lib -Wall -Wstrict-prototypes -Werror=declaration-after-statement -Werror=missing-prototypes -Werror=implicit-function-declaration -Werror=pointer-arith -Werror=init-self -Werror=format-security -Werror=format=2 -Werror=missing-include-dirs -g -O2   -o gio-querymodules gio-querymodules.o ../glib/libglib-2.0.la ../gobject/libgobject-2.0.la ../gmodule/libgmodule-2.0.la libgio-2.0.la 

libtool: link: gcc -I/home/franz/Downloads/libffi-3.0.13/installed/lib/libffi-3.0.13/include -Wall -Wstrict-prototypes -Werror=declaration-after-statement -Werror=missing-prototypes -Werror=implicit-function-declaration -Werror=pointer-arith -Werror=init-self -Werror=format-security -Werror=format=2 -Werror=missing-include-dirs -g -O2 -o .libs/gio-querymodules gio-querymodules.o  -L/home/franz/Downloads/libffi-3.0.13/installed/lib ../glib/.libs/libglib-2.0.so ../gobject/.libs/libgobject-2.0.so ../gmodule/.libs/libgmodule-2.0.so ./.libs/libgio-2.0.so -L/home/franz/Downloads/zlib-1.2.8/installed/lib /home/franz/Downloads/glib-2.37.5/gobject/.libs/libgobject-2.0.so /home/franz/Downloads/glib-2.37.5/gmodule/.libs/libgmodule-2.0.so -ldl /home/franz/Downloads/glib-2.37.5/glib/.libs/libglib-2.0.so -lpthread -lrt /home/franz/Downloads/libffi-3.0.13/installed/lib/../lib/libffi.so -lresolv -Wl,-rpath -Wl,/home/franz/Downloads/glib-2.37.5/installed/lib -Wl,-rpath -Wl,/home/franz/Downloads/libffi-3.0.13/installed/lib/../lib
../gobject/.libs/libgobject-2.0.so: undefined reference to `ffi_type_void'
../gobject/.libs/libgobject-2.0.so: undefined reference to `ffi_type_double'
../gobject/.libs/libgobject-2.0.so: undefined reference to `ffi_prep_cif'
../gobject/.libs/libgobject-2.0.so: undefined reference to `ffi_type_sint32'
../gobject/.libs/libgobject-2.0.so: undefined reference to `ffi_type_float'
../gobject/.libs/libgobject-2.0.so: undefined reference to `ffi_type_uint64'
../gobject/.libs/libgobject-2.0.so: undefined reference to `ffi_type_sint64'
../gobject/.libs/libgobject-2.0.so: undefined reference to `ffi_type_pointer'
../gobject/.libs/libgobject-2.0.so: undefined reference to `ffi_type_uint32'
../gobject/.libs/libgobject-2.0.so: undefined reference to `ffi_call'

Проблемът е, че в този случай библиотеките присъстват (можете да видите -lffi -L<ffi_libs_path>, но грешката изглежда същата като преди).

Някаква идея как да накарам тази работа? Повтарям, че не мога да инсталирам библиотеки, защото нямам root достъп. Всяко предложение ще бъде оценено.


person Francesco    schedule 07.08.2013    source източник


Отговори (2)


използване

export LIBFFI_LIBS="-L/your/path/to-ffi libraries/ -lffi"

person nitin kumar    schedule 22.04.2015

след ./configure можете да редактирате вашия Makefile, намерете "LIBFFI_LIBS=..." и добавете "-lffi" в края. като "LIBFFI_LIBS=-L/work/opencv-static/libffi-3.2.1/output/lib -lffi"

person ElevenFlogs    schedule 30.03.2020