ledatelescope / bifrost

A stream processing framework for high-throughput applications.
BSD 3-Clause "New" or "Revised" License
66 stars 29 forks source link

Error compiling 0.8.0 on Ubuntu 18.04 #113

Closed gijzelaerr closed 6 years ago

gijzelaerr commented 6 years ago
λ  make
make -C src all
make[1]: Entering directory '/packaging/kern/packaging/build/bifrost/src'
cuobjdump fatal   : Could not open input file '/usr/local/cuda/lib64/libcufft_static.a'
udp_capture.cpp: In member function ‘void
   AlignedBuffer<T>::swap(const AlignedBuffer<T>&)’:
udp_capture.cpp:179:36: error: no matching
   function for call to ‘swap(size_t&, const size_t&)’
   std::swap(_size,      other._size);
                                    ^
In file included from /usr/include/c++/7/bits/nested_exception.h:40:0,
                 from /usr/include/c++/7/exception:143,
                 from /usr/include/c++/7/stdexcept:38,
                 from assert.hpp:34,
                 from udp_capture.cpp:29:
/usr/include/c++/7/bits/move.h:187:5: note: candidate:
   template<class _Tp> typename
   std::enable_if<std::__and_<std::__not_<std::__is_tuple_like<_Tp> >,
   std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp>
   >::value>::type std::swap(_Tp&, _Tp&)
     swap(_Tp& __a, _Tp& __b)
     ^~~~

full log here https://gist.github.com/gijzelaerr/9aca21e9483cac9eb4731471c3e66662

gijzelaerr commented 6 years ago

o that is stupid, only now i see the missing cuda lib statement.

gijzelaerr commented 6 years ago

Ok, that didn't help, setting the cuda path correctly still yields the error: no matching function for call to swap etc etc error.

jaycedowell commented 6 years ago

What compiler are you using? I've only ever built/used bifrost under Ubuntu 14.04 with gcc 4.8.

benbarsdell commented 6 years ago

Looks like a bug. That function AlignedBuffer::swap needs to take a non-const reference instead of const.

gijzelaerr commented 6 years ago

gcc version 7.3.0 (Ubuntu 7.3.0-12ubuntu1)

gijzelaerr commented 6 years ago

removing the const seems to solve the problem:

--- a/src/udp_capture.cpp
+++ b/src/udp_capture.cpp
@@ -174,7 +174,7 @@ public:
        ~AlignedBuffer() {
                this->free();
        }
-       inline void swap(AlignedBuffer const& other) {
+       inline void swap(AlignedBuffer & other) {
                std::swap(_buf,       other._buf);
                std::swap(_size,      other._size);
                std::swap(_alignment, other._alignment);
benbarsdell commented 6 years ago

Fixed in https://github.com/ledatelescope/bifrost/commit/ee8edc30d0bf5035dd15e44f1f3a0913bd9b7c25