Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
marcinsulikowski opened this issue Apr 2, 2021 · 2 comments
Closed

Comments

@marcinsulikowski
Copy link

Commit fdbc543 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
Copy link
Author

I added a PR with a fix: #216

@davide125
Copy link
Member

Fixed in 0f100c6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants