Wednesday, 7 August 2013

PCL - Glib Compiling from source, FFI linking

PCL - Glib Compiling from source, FFI linking

I googled a lot but I couldn't get rid of this issue...
I need to install PCL (point cloud library) on a linux server without root
access. Then I downloaded the source and check for dependences. And here
we go...
These are the dependencies I've found:
PCL
--BOOST
----ZLIB
----BZIP
--EIGEN
--FLANN
----HDF5
----LIBUSB
------UDEV
--------GLIB
----------LIBFFI
----------ZLIB
--VTKI need to compile glib from source. Glib requires FFI libraries so I
downloaded them, compiled and installed them in
/home/franz/Downloads/libffi-3.0.13/installedthen I set these variables:
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"
then ./configure and make. I got these errors:
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'
then I saw the libraries I wanted to include and setted with
LIBFFI_CFLAGS/LIBS in configure are not present in make, so I changed my
CC variable to force my compiler to use my libraries:
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
and make
In this way instead of gcc in the make process, we'll get gcc -I... -lffi
-L... And this worked so far. But now I get the same error in another
location:
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'the
problem is that in this case the libraries are present (you can see -lffi
-L but the error look the same as before).
Any Idea how to get this work ? I repeat I cannot install libraries
because I cannot have root access. Any suggestion would be appreciated.
Thanks in advance.

No comments:

Post a Comment