Closed Cryptographer63 closed 2 years ago
Does changing the content of https://github.com/encryptogroup/MOTION/blob/3f9ba6a0248677422ee90a4792bc7810a51878c0/src/motioncore/utility/thread.cpp#L29 to
#if !defined(__APPLE__)
assert(name.size() <= 16);
auto handle = thread.native_handle();
pthread_setname_np(handle, name.c_str());
#endif
solve the problem for you?
Resolved, thanks
Would you mind to make a PR?
When I use intel macos to compile, the following problems occur, the version of g++ is g++-11
~In file included from /usr/local/Cellar/gcc/11.2.0_3/include/c++/11/x86_64-apple-darwin21/bits/gthr-default.h:35, from /usr/local/Cellar/gcc/11.2.0_3/include/c++/11/x86_64-apple-darwin21/bits/gthr.h:148, from /usr/local/Cellar/gcc/11.2.0_3/include/c++/11/ext/atomicity.h:35, from /usr/local/Cellar/gcc/11.2.0_3/include/c++/11/bits/basic_string.h:39, from /usr/local/Cellar/gcc/11.2.0_3/include/c++/11/string:55, from /Users/zhangshuguang/Desktop/MOTION/src/motioncore/utility/thread.h:23, from /Users/zhangshuguang/Desktop/MOTION/src/motioncore/utility/thread.cpp:21: /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/usr/include/pthread.h:510:28: note: initializing argument 1 of 'int pthread_setname_np(const char)' 510 | int pthread_setname_np(const char); | ^
~~make[2]: [src/motioncore/CMakeFiles/motion.dir/utility/thread.cpp.o] Error 1 make[1]: [src/motioncore/CMakeFiles/motion.dir/all] Error 2 make: *** [all] Error 2`