meelgroup / ganak

The first scalable probabilistic exact counter
MIT License
25 stars 6 forks source link

Master branch fails to build #6

Closed adrianherrera closed 3 years ago

adrianherrera commented 4 years ago

Steps to reproduce:

git clone https://github.com/meelgroup/ganak
mkdir ganak/build
cd ganak/build
cmake ..
make

Result:

/tmp/ganak/src/component_types/../clhash/clhash.h:68:63: error: invalid application of 'sizeof' to an incomplete type 'void'
        return clhash(random_data_, (const char *)data, len * sizeof(T));
                                                              ^~~~~~~~~
/tmp/ganak/src/component_types/difference_packed_component.h:254:22: note: in instantiation of function template specialization 'clhasher::operator()<void>' requested here
    clhashkey_[i] = h((void*)data_, sizeof(unsigned)*data_size);

This makes sense, given the clhasher::operator() prototype is

template<typename T>
uint64_t operator()(const T *data, const size_t len) const

and hence T in this case is void.

msoos commented 4 years ago

Nice great catch! This is indeed valid, I can reproduce with latest clang:

In file included from /home/soos/development/sat_solvers/sharpSAT/src/component_types/difference_packed_component.h:13:
/home/soos/development/sat_solvers/sharpSAT/src/component_types/../clhash/clhash.h:68:63: error: invalid application of 'sizeof' to an incomplete type 'void'
        return clhash(random_data_, (const char *)data, len * sizeof(T));
                                                              ^~~~~~~~~
/home/soos/development/sat_solvers/sharpSAT/src/component_types/difference_packed_component.h:254:22: note: in instantiation of function template specialization 'clhasher::operator()<void>' requested here
    clhashkey_[i] = h((void*)data_, sizeof(unsigned)*data_size);

Unfortunately, this is a bug in the original sharpSAT, I'll need to dig deeper to understand how to fix :)

msoos commented 4 years ago

Hi,

I created pull request here:

https://github.com/meelgroup/ganak/pull/7

Can you please check if this version seems OK?

Thanks again for the detailed report,

Mate

adrianherrera commented 4 years ago

Yup! Works for me 🚀