FALCONN
FALCONN copied to clipboard
falconn/src/examples/glove/makefile seems wrong
when I run
./make
it will say
../../include/falconn/wrapper/../core/flat_hash_table.h:13:23: fatal error: serialize.h: No such file or directory
so I need to run
g++ -std=c++11 -Wall -O3 -march=native glove.cc -o glove -I ../../include -I ../../../external/eigen -I ../../../external/simple-serializer -pthread
and it goes will
Thanks for catching this!
on current master even when adding simple-serializer to the includes path compilation fails with errors:
g++ -std=c++11 -Wall -O3 -march=native glove.cc -o glove -I ../../include -I ../../../external/eigen -I ../../../external/simple-serializer -pthread
In file included from glove.cc:29:
In file included from ../../include/falconn/lsh_nn_table.h:484:
In file included from ../../include/falconn/wrapper/cpp_wrapper_impl.h:16:
In file included from ../../include/falconn/wrapper/../core/flat_hash_table.h:13:
../../../external/simple-serializer/serialize.h:71:5: error: implicit instantiation of undefined template 'ir::Serializer<unsigned long, void>'
Serializer<size_t>::serialize(output, entity.size());
^
../../../external/simple-serializer/serialize.h:49:8: note: template is declared here
struct Serializer;
^
../../../external/simple-serializer/serialize.h:79:5: error: implicit instantiation of undefined template 'ir::Serializer<unsigned long, void>'
Serializer<size_t>::deserialize(input, &s);
^
../../../external/simple-serializer/serialize.h:49:8: note: template is declared here
struct Serializer;
^
../../../external/simple-serializer/serialize.h:79:25: error: use of undeclared identifier 'deserialize'
Serializer<size_t>::deserialize(input, &s);
^
../../../external/simple-serializer/serialize.h:77:15: note: must qualify identifier to find this declaration in dependent base class
static void deserialize(FILE *input, vector<S> *entity) {
^
../../../external/simple-serializer/serialize.h:111:5: error: implicit instantiation of undefined template 'ir::Serializer<unsigned long, void>'
Serializer<size_t>::serialize(output, entity.size());
^
../../../external/simple-serializer/serialize.h:49:8: note: template is declared here
struct Serializer;
^
../../../external/simple-serializer/serialize.h:119:5: error: implicit instantiation of undefined template 'ir::Serializer<unsigned long, void>'
Serializer<size_t>::deserialize(input, &s);
^
../../../external/simple-serializer/serialize.h:49:8: note: template is declared here
struct Serializer;
^
../../../external/simple-serializer/serialize.h:119:25: error: use of undeclared identifier 'deserialize'
Serializer<size_t>::deserialize(input, &s);
^
../../../external/simple-serializer/serialize.h:117:15: note: must qualify identifier to find this declaration in dependent base class
static void deserialize(FILE *input, vector<S> *entity) {
^
../../../external/simple-serializer/serialize.h:71:25: error: use of undeclared identifier 'serialize'
Serializer<size_t>::serialize(output, entity.size());
^
../../../external/simple-serializer/serialize.h:94:32: note: in instantiation of member function 'ir::Serializer<std::__1::vector<float, std::__1::allocator<float> >, void>::serialize' requested here
Serializer<vector<float>>::serialize(output, aux);
^
../../../external/simple-serializer/serialize.h:70:15: note: must qualify identifier to find this declaration in dependent base class
static void serialize(FILE *output, const vector<S> &entity) {
^
../../../external/simple-serializer/serialize.h:71:43: error: reference to type 'const vector<float>' could not bind to an rvalue of type 'size_type' (aka 'unsigned long')
Serializer<size_t>::serialize(output, entity.size());
^~~~~~~~~~~~~
../../../external/simple-serializer/serialize.h:70:56: note: passing argument to parameter 'entity' here
static void serialize(FILE *output, const vector<S> &entity) {
^
../../../external/simple-serializer/serialize.h:79:44: error: cannot initialize a parameter of type 'vector<float> *' with an rvalue of type 'size_t *' (aka 'unsigned long *')
Serializer<size_t>::deserialize(input, &s);
^~
../../../external/simple-serializer/serialize.h:99:32: note: in instantiation of member function 'ir::Serializer<std::__1::vector<float, std::__1::allocator<float> >, void>::deserialize' requested here
Serializer<vector<float>>::deserialize(input, &aux);
^
../../../external/simple-serializer/serialize.h:77:51: note: passing argument to parameter 'entity' here
static void deserialize(FILE *input, vector<S> *entity) {
^
9 errors generated.
make: *** [all] Error 1
It seems that "unsigned long" is not recognized by "IsElementary". I can compile after adding the following lines.
template <>
struct IsElementary
Copy and paste the code below to external/simple-serializer/serialize.h template <> struct IsElementary<. long unsigned int. > : std::true_type {};
I can compile the code.