goatdb / llama

LLAMA Graph Analytics Engine
Other
41 stars 14 forks source link

benchmark-streaming build is broken #2

Open jmftrindade opened 5 years ago

jmftrindade commented 5 years ago

Hi there! Not sure if this project is still actively maintained, but heads up that benchmark-streaming build seems to be broken. This is on both clang++ v5.0 and g++ v5.4.0 and on both -std=gnu++11 and -std=c++14

Other benchmarks are not affected. Build error logs from gcc with -std=gnu++11:

In file included from ../llama/include/llama/ll_mlcsr_sp.h:48:0,
                 from ../llama/include/llama/ll_slcsr.h:40,
                 from ../llama/include/llama.h:45,
                 from benchmark.cc:54:
../llama/include/llama/ll_mlcsr_properties.h: In member function ‘bool ll_mlcsr_edge_property<T>::level_exists(int)’:
../llama/include/llama/ll_mlcsr_properties.h:960:60: error: there are no arguments to ‘ll_level_within_bounds’ that depend on a template parameter, so a declaration of ‘ll_level_within_bounds’ must be available [-fpermissive]
   if (!ll_level_within_bounds(level, _min_level, _max_level))
                                                            ^
../llama/include/llama/ll_mlcsr_properties.h:960:60: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
../llama/include/llama/ll_mlcsr_properties.h: In instantiation of ‘bool ll_mlcsr_edge_property<T>::level_exists(int) [with T = long int]’:
../llama/include/llama/ll_mlcsr_sp.h:1001:37:   required from ‘void ll_csr_base<VT_TABLE, VT_ELEMENT, T>::delete_level(size_t) [with VT_TABLE = ll_mem_array_swcow; VT_ELEMENT = ll_mlcsr_core__begin_t; T = long int; size_t = long unsigned int]’
../llama/include/llama/ll_mlcsr_graph.h:1845:35:   required from here
../llama/include/llama/ll_mlcsr_properties.h:960:30: error: ‘ll_level_within_bounds’ was not declared in this scope
   if (!ll_level_within_bounds(level, _min_level, _max_level))
                              ^
In file included from ../llama/include/llama/ll_mem_helper.h:45:0,
                 from ../llama/include/llama.h:42,
                 from benchmark.cc:54:
../llama/include/llama/ll_utils.h: In instantiation of ‘void ATOMIC_ADD(T*, T) [with T = long unsigned int]’:
../llama/include/llama/ll_mlcsr_sp.h:1086:22:   required from ‘void ll_csr_base<VT_TABLE, VT_ELEMENT, T>::create_sparse_representation(int) [with VT_TABLE = ll_mem_array_swcow; VT_ELEMENT = ll_mlcsr_core__begin_t; T = long int]’
../llama/include/llama/ll_mlcsr_sp.h:1023:4:   required from ‘void ll_csr_base<VT_TABLE, VT_ELEMENT, T>::keep_only_recent_versions(size_t) [with VT_TABLE = ll_mem_array_swcow; VT_ELEMENT = ll_mlcsr_core__begin_t; T = long int; size_t = long unsigned int]’
../llama/include/llama/ll_mlcsr_graph.h:1890:47:   required from here
../llama/include/llama/ll_utils.h:554:41: error: no matching function for call to ‘_ll_atomic_compare_and_swap(long unsigned int*, long unsigned int&, long unsigned int&)’
     } while (_ll_atomic_compare_and_swap((T*) target, oldValue, newValue) == false);
                                         ^
../llama/include/llama/ll_utils.h:525:20: note: candidate: bool _ll_atomic_compare_and_swap(long int*, long int, long int) <near match>
 static inline bool _ll_atomic_compare_and_swap(long *dest, long old_val,
                    ^
../llama/include/llama/ll_utils.h:525:20: note:   conversion of argument 1 would be ill-formed:
../llama/include/llama/ll_utils.h:554:41: error: invalid conversion from ‘long unsigned int*’ to ‘long int*’ [-fpermissive]
     } while (_ll_atomic_compare_and_swap((T*) target, oldValue, newValue) == false);
                                         ^
../llama/include/llama/ll_utils.h:530:20: note: candidate: bool _ll_atomic_compare_and_swap(long long int*, long long int, long long int) <near match>
 static inline bool _ll_atomic_compare_and_swap(long long* dest, long long old_val,
                    ^
../llama/include/llama/ll_utils.h:530:20: note:   conversion of argument 1 would be ill-formed:
../llama/include/llama/ll_utils.h:554:41: error: invalid conversion from ‘long unsigned int*’ to ‘long long int*’ [-fpermissive]
     } while (_ll_atomic_compare_and_swap((T*) target, oldValue, newValue) == false);
                                         ^
Makefile:146: recipe for target '../bin/benchmark-streaming' failed
make[1]: *** [../bin/benchmark-streaming] Error 1
make[1]: Leaving directory '/home/jfon/src/github.com/llama/benchmark'
Makefile:37: recipe for target 'all' failed
make: *** [all] Error 1
shang2014 commented 4 years ago

Hi, I face the same issue. Have you handled it successfully? error

biqar commented 3 years ago

I think the error is fixed in "streaming" branch. I still not able to pinpoint in which commit the author has fixed this. Also, it seems "streaming" branch is ahead of 53 commits. So, use it with caution! :)

biqar commented 3 years ago

You can find the definition of "ll_level_within_bounds" in "streaming" branch.

File: /llama/include/llama/ll_utils.h

/**
 * Check whether the given level number is within the bounds
 *
 * @param level the level
 * @param min the min level (inclusive)
 * @param max the max level (inclusive)
 * @return true if it is within the given bounds
 */
inline bool ll_level_within_bounds(int level, int min, int max) {
    if (min <= max)
        return min <= level && level <= max;
    else
        return (min <= level || level <= max) && max >= 0;
}

Also check the missing definition of "_ll_atomic_compare_and_swap" function in the same file. Here I have added all the 7 overloaded functions here,

File: /llama/include/llama/ll_utils.h

static inline bool _ll_atomic_compare_and_swap(int *dest, int old_val,
        int new_val) {
    return __sync_bool_compare_and_swap(dest, old_val, new_val);
}

static inline bool _ll_atomic_compare_and_swap(long *dest, long old_val,
        long new_val) {
    return __sync_bool_compare_and_swap(dest, old_val, new_val);
}

static inline bool _ll_atomic_compare_and_swap(unsigned long *dest,
        unsigned long old_val, unsigned long new_val) {
    return __sync_bool_compare_and_swap(dest, old_val, new_val);
}

static inline bool _ll_atomic_compare_and_swap(long long* dest, long long old_val,
        long long new_val) {
    return __sync_bool_compare_and_swap(dest, old_val, new_val);
}

static inline bool _ll_atomic_compare_and_swap(unsigned long long *dest,
        unsigned long long old_val, unsigned long long new_val) {
    return __sync_bool_compare_and_swap(dest, old_val, new_val);
}

static inline bool _ll_atomic_compare_and_swap(float *dest, float old_val,
        float new_val) {
    return _ll_cas_asm(dest, old_val, new_val);
}

static inline bool _ll_atomic_compare_and_swap(double *dest, double old_val,
        double new_val) {
    return _ll_cas_asm(dest, old_val, new_val);
}