FlashRoute
FlashRoute copied to clipboard
difficulties in building the application
I try to install the application but I can not solve this error to be able to use the application. Does anyone know the solution?
ERROR: /home/oan/Desktop/FlashRoute/flashroute/BUILD:230:11: C++ compilation of rule '//flashroute:dump_result' failed (Exit 1): gcc failed: error executing command /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer '-std=c++14' -MD -MF ... (remaining 43 argument(s) skipped)
Use --sandbox_debug to see verbose messages from the sandbox gcc failed: error executing command /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer '-std=c++14' -MD -MF ... (remaining 43 argument(s) skipped)
Use --sandbox_debug to see verbose messages from the sandbox In file included from external/boost/boost/smart_ptr/detail/sp_thread_sleep.hpp:22, from external/boost/boost/smart_ptr/detail/yield_k.hpp:23, from external/boost/boost/smart_ptr/detail/spinlock_gcc_atomic.hpp:14, from external/boost/boost/smart_ptr/detail/spinlock.hpp:42, from external/boost/boost/smart_ptr/detail/spinlock_pool.hpp:25, from external/boost/boost/smart_ptr/shared_ptr.hpp:29, from external/boost/boost/shared_ptr.hpp:17, from external/boost/boost/date_time/time_clock.hpp:17, from external/boost/boost/date_time/posix_time/posix_time_types.hpp:10, from external/boost/boost/asio/time_traits.hpp:23, from external/boost/boost/asio/detail/timer_queue_ptime.hpp:22, from external/boost/boost/asio/detail/deadline_timer_service.hpp:29, from external/boost/boost/asio/basic_deadline_timer.hpp:25, from external/boost/boost/asio.hpp:25, from ./flashroute/dump_result.h:7, from flashroute/dump_result.cc:2: external/boost/boost/bind.hpp:36:1: note: '#pragma message: The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated. Please use <boost/bind/bind.hpp> + using namespace boost::placeholders, or define BOOST_BIND_GLOBAL_PLACEHOLDERS to retain the current behavior.' 36 | BOOST_PRAGMA_MESSAGE( | ^~~~~~~~~~~~~~~~~~~~ flashroute/dump_result.cc: In destructor 'flashroute::ResultDumper::~ResultDumper()': flashroute/dump_result.cc:43:23: error: 'sleep_for' is not a member of 'std::this_thread' 43 | std::this_thread::sleep_for( | ^~~~~~~~~ flashroute/dump_result.cc:43:23: note: suggested alternatives: In file included from external/boost/boost/thread/pthread/condition_variable.hpp:15, from external/boost/boost/thread/condition_variable.hpp:16, from external/boost/boost/thread/condition.hpp:13, from ./flashroute/bounded_buffer.h:7, from ./flashroute/dump_result.h:13, from flashroute/dump_result.cc:2: external/boost/boost/thread/pthread/thread_data.hpp:295:14: note: 'boost::this_thread::sleep_for' 295 | void sleep_for(const chrono::duration<Rep, Period>& d) | ^~~~~~~~~ external/boost/boost/thread/pthread/thread_data.hpp:341:16: note: 'boost::this_thread::no_interruption_point::sleep_for' 341 | void sleep_for(const chrono::duration<Rep, Period>& d) | ^~~~~~~~~ flashroute/dump_result.cc: In member function 'void flashroute::ResultDumper::runDumpingThread()': flashroute/dump_result.cc:92:23: error: 'sleep_for' is not a member of 'std::this_thread' 92 | std::this_thread::sleep_for(std::chrono::milliseconds(kDumpingIntervalMs)); | ^~~~~~~~~ flashroute/dump_result.cc:92:23: note: suggested alternatives: In file included from external/boost/boost/thread/pthread/condition_variable.hpp:15, from external/boost/boost/thread/condition_variable.hpp:16, from external/boost/boost/thread/condition.hpp:13, from ./flashroute/bounded_buffer.h:7, from ./flashroute/dump_result.h:13, from flashroute/dump_result.cc:2: external/boost/boost/thread/pthread/thread_data.hpp:295:14: note: 'boost::this_thread::sleep_for' 295 | void sleep_for(const chrono::duration<Rep, Period>& d) | ^~~~~~~~~ external/boost/boost/thread/pthread/thread_data.hpp:341:16: note: 'boost::this_thread::no_interruption_point::sleep_for' 341 | void sleep_for(const chrono::duration<Rep, Period>& d) | ^~~~~~~~~ Target //flashroute:flashroute failed to build Use --verbose_failures to see the command lines of failed build steps. INFO: Elapsed time: 43.193s, Critical Path: 7.71s INFO: 162 processes: 2 internal, 160 linux-sandbox. FAILED: Build did NOT complete successfully
Wondering what is your OS and GCC version
My operating system is linux ubuntu 22.04 and the version of gcc is 11.3.0.
ubuntu 20.04 gcc 9.4.0 also fail to complie it.
My operating system is linux ubuntu 22.04 and the version of gcc is 11.3.0.
I have the same issue
Did anyone manage to solve this problem? I am also encountering it.
yes, I needed to import <thread>
:
diff --git a/flashroute/dump_result.h b/flashroute/dump_result.h
index b0876ea..7e2c0dc 100644
--- a/flashroute/dump_result.h
+++ b/flashroute/dump_result.h
@@ -3,6 +3,7 @@
#include <memory>
#include <string>
+#include <thread>
#include <boost/asio.hpp>
#include <boost/process.hpp>
afterwards I compiled it with:
bazel build --cxxopt="--std=c++14" --compilation_mode=opt --sandbox_debug flashroute
I encountered the same issue.
My env: gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04)
importing <thread>
solves that, as described by @matbits . Thanks!