facebook / wdt

Warp speed Data Transfer (WDT) is an embeddedable library (and command line tool) aiming to transfer data between 2 systems as fast as possible over multiple TCP paths.
https://www.facebook.com/WdtOpenSource
Other
2.86k stars 392 forks source link

Regression – build no longer works (using cmake on Ubuntu 18.04) #215

Closed marcinsulikowski closed 3 years ago

marcinsulikowski commented 3 years ago

Commit fdbc5432230290f86ff8ad89ab52d5b7fef232b4 adds the use of C++17-only class template argument deduction to wdt. However, CMakeLists.txt specifies set(CMAKE_CXX_STANDARD 14) (see: https://github.com/facebook/wdt/blob/master/CMakeLists.txt#L27). As a result, the project can no longer be built following the steps from documentation because the compilation fails with the following error:

[ 36%] Building CXX object CMakeFiles/wdt_min.dir/util/FileCreator.cpp.o
In file included from /home/user/wdt/util/FileCreator.cpp:9:0:
/home/user/wdt/../wdt/util/FileCreator.h: In member function ‘void facebook::wdt::FileCreator::clearAllocationMap()’:
/home/user/wdt/../wdt/util/FileCreator.h:81:22: error: missing template arguments before ‘guard’
     std::unique_lock guard(lock_);
                      ^~~~~
/home/user/wdt/util/FileCreator.cpp: In member function ‘int facebook::wdt::FileCreator::openForFirstBlock(facebook::wdt::ThreadCtx&, const facebook::wdt::BlockDetails*)’:
/home/user/wdt/util/FileCreator.cpp:98:22: error: missing template arguments before ‘guard’
     std::unique_lock guard(lock_);
                      ^~~~~
/home/user/wdt/util/FileCreator.cpp: In member function ‘bool facebook::wdt::FileCreator::waitForAllocationFinish(int, int64_t)’:
/home/user/wdt/util/FileCreator.cpp:113:24: error: missing template arguments before ‘guard’
       std::unique_lock guard(lock_);
                        ^~~~~
CMakeFiles/wdt_min.dir/build.make:206: recipe for target 'CMakeFiles/wdt_min.dir/util/FileCreator.cpp.o' failed
make[2]: *** [CMakeFiles/wdt_min.dir/util/FileCreator.cpp.o] Error 1
CMakeFiles/Makefile2:105: recipe for target 'CMakeFiles/wdt_min.dir/all' failed
make[1]: *** [CMakeFiles/wdt_min.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

A simple workaround is to switch to set(CMAKE_CXX_STANDARD 17) but really the compatibility with older C++ compilers should still be preserved by providing explicit template arguments for std::unique_lock.

marcinsulikowski commented 3 years ago

I added a PR with a fix: https://github.com/facebook/wdt/pull/216

davide125 commented 3 years ago

Fixed in https://github.com/facebook/wdt/commit/0f100c6f38220378fcfbc672b007f4272c416a03