Open Perfect-Web opened 10 years ago
Have you been following this: https://code.google.com/a/apache-extras.org/p/cassandra-pdo/ ?
sudo apt-get install libboost-all-dev php5-dev libpcre3-dev pkg-config g++
Add this to your /etc/apt/source.list
:
deb http://debian.datastax.com/community stable main
Run this:
wget -O - http://debian.datastax.com/debian/repo_key | sudo apt-key add -
sudo apt-get update
sudo apt-get install libthrift0 libthrift-dev thrift-compiler
sudo ln -s /usr/bin/thrift /usr/local/bin/thrift
phpize
./configure
make
sudo make install
of course, but im on centos.
I ran into the same error on fedora19. Turns out I needed to install thrift-devel as well as thrift (obvious in hindsight): sudo yum install thrift thrift-devel
Your thrift may not successfully compiled. You can check /usr/local/lib to see if thrift's libs are there.
I pulled all the recent changes after a while and I can no longer compile the library in Ubuntu 14.04 amd64.
$ dpkg -l | grep thrift
ii libthrift-dev 0.6.0-2~riptano1 amd64 Thrift C++ library (development headers)
ii libthrift0 0.6.0-2~riptano1 amd64 Thrift C++ library
ii thrift-compiler 0.9.0-3 amd64 code generator/compiler for Thrift definitions
$ which thrift
/usr/local/bin/thrift
~/src/YACassandraPDO$ phpize
Configuring for:
PHP Api Version: 20121113
Zend Module Api No: 20121212
Zend Extension Api No: 220121212
~/src/YACassandraPDO$ echo $?
0
~/src/YACassandraPDO$ ./configure
[ output omitted ]
~/src/YACassandraPDO$ echo $?
0
~/src/YACassandraPDO$ make
/bin/bash /home/lisandro/src/YACassandraPDO/libtool --mode=compile g++ -Wall -Wno-write-strings -I. -I/home/lisandro/src/YACassandraPDO -DPHP_ATOM_INC -I/home/lisandro/src/YACassandraPDO/include -I/home/lisandro/src/YACassandraPDO/main -I/home/lisandro/src/YACassandraPDO -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -I/usr/include/thrift -DHAVE_CONFIG_H -g -O2 -c /home/lisandro/src/YACassandraPDO/gen-cpp/Cassandra.cpp -o gen-cpp/Cassandra.lo
libtool: compile: g++ -Wall -Wno-write-strings -I. -I/home/lisandro/src/YACassandraPDO -DPHP_ATOM_INC -I/home/lisandro/src/YACassandraPDO/include -I/home/lisandro/src/YACassandraPDO/main -I/home/lisandro/src/YACassandraPDO -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -I/usr/include/thrift -DHAVE_CONFIG_H -g -O2 -c /home/lisandro/src/YACassandraPDO/gen-cpp/Cassandra.cpp -fPIC -DPIC -o gen-cpp/.libs/Cassandra.o
In file included from /home/lisandro/src/YACassandraPDO/gen-cpp/Cassandra.cpp:7:0:
/home/lisandro/src/YACassandraPDO/gen-cpp/Cassandra.h:10:39: fatal error: thrift/TDispatchProcessor.h: No such file or directory
#include <thrift/TDispatchProcessor.h>
^
compilation terminated.
make: *** [gen-cpp/Cassandra.lo] Error 1
lisandro@lichdesk:~/src/YACassandraPDO$ echo $?
2
Are my thrift libraries outdated? If not, anyone knows what is causing this?
It seems the code now requires thrift 0.9.1 or later to build. I cloned the Thrift git repo and built it from source (don't use the tarball download, it's broken) and I manage to compile the new library.
Any update on this? I'm running thrift 0.9.1 and still get this error:
root@9cff50badbe4:/var/www/raven/YACassandraPDO# make
/bin/bash /var/www/raven/YACassandraPDO/libtool --mode=compile g++ -Wall -Wno-write-strings -I/usr/local/include/php/ext -I. -I/var/www/raven/YACassandraPDO -DPHP_ATOM_INC -I/var/www/raven/YACassandraPDO/include -I/var/www/raven/YACassandraPDO/main -I/var/www/raven/YACassandraPDO -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/include/thrift -DHAVE_CONFIG_H -g -O2 -c /var/www/raven/YACassandraPDO/cassandra_driver.cpp -o cassandra_driver.lo
mkdir .libs
g++ -Wall -Wno-write-strings -I/usr/local/include/php/ext -I. -I/var/www/raven/YACassandraPDO -DPHP_ATOM_INC -I/var/www/raven/YACassandraPDO/include -I/var/www/raven/YACassandraPDO/main -I/var/www/raven/YACassandraPDO -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/include/thrift -DHAVE_CONFIG_H -g -O2 -c /var/www/raven/YACassandraPDO/cassandra_driver.cpp -fPIC -DPIC -o .libs/cassandra_driver.o
In file included from /var/www/raven/YACassandraPDO/php_pdo_cassandra_int.hpp:49:0,
from /var/www/raven/YACassandraPDO/cassandra_driver.cpp:18:
/var/www/raven/YACassandraPDO/gen-cpp/Cassandra.h:10:39: fatal error: thrift/TDispatchProcessor.h: No such file or directory
#include <thrift/TDispatchProcessor.h>
^
compilation terminated.
Makefile:181: recipe for target 'cassandra_driver.lo' failed
make: *** [cassandra_driver.lo] Error 1
Hi, old bug, but for the record:
That was because of the command pkg-config thrift --modversion (I debugged the configure script). (I am working on Debian 7.8)
pkg-config looks for a file named thrift.pc but the file now (at least with thift 0.9.3) uses a different name.
I solved it with :
ln -s /usr/local/thrift/lib/pkgconfig/thrift_c_glib.pc /usr/local/thrift/lib/pkgconfig/thrift.pc
if you try the above command it shall return a version number.
then configure works without the argument '--with-thrift-dir'
(my command line for thrift was:./configure --prefix=/usr/local/thrift --with-php --with-lua=no --with-java=no
)
@Danielss89 Your error comes from the fact that apparently this YACassandraPDO driver uses the fb variant of thrift: facebook/fbthrift: Facebook's branch of Apache Thrift.
https://github.com/facebook/fbthrift TDispatchProcessor.h is part of this package.
Unfortunately, on my side I have to abandon it, I can't build it on Debian 7 because of the gcc version: gcc (Debian 4.7.2-5) 4.7.2 (to be compared from C++ Standards Support in GCC https://gcc.gnu.org/projects/cxx-status.html#cxx11)
FYI, I managed to build the officiel php-driver on Debian 7/PHP 5.3
checking for pkg-config... /usr/bin/pkg-config checking thrift installation... configure: error: Unable to find thrift installation
what is wrong ? i tried to specify the dir too but doesnt work