-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Failed to build Could NOT find Threads (missing: Threads_FOUND) #10041
Comments
Thanks very much @Obrepal for the highly detailed information. It is a good rule of debugging to start with the first error that occurs in a log, as subsequent errors may be occurring as a consequence of that original problem. As you highlighted, the first error that is listed is Could NOT find Threads. An M1 Mac user who encountered this same error shared a workaround at #8250 (comment) that enabled CMake to build correctly for them. Does the procedure at this link resolve this error for you too, please? |
so I added it to CMakeLists.txt
EDIT I changed but after make -j2 I installed it via brew but still the same |
There is a librealsense example of this 'Threads' CMake error at #5656 In a non-librealsense discussion, someone who encountered the same issue with CMake shared the following advice. I solve this problem by adding find_package(Threads) to the CMakeLists.txt file in the root directory. |
ok, so now this |
Thanks very much for your patience. There is advice about ld: library not found for -latomic at #9999 (comment) and the comment beneath it which advises using XCode to build librealsense instead of 'make -j'. |
Come on, without you I would not know what to do. Thanks a lot I really appreciate it. Used this alternative formula from mentioned comment. EDIT
The last thing I need to do is python wrapper.
[Is it done?] |
Thanks very much for your kind words. :) I do not think that you are doing anything wrong, as building librealsense for M1 Macs does tend to be a step by step process of error-correcting for most M1 users at present. When the pyrealsense2 wrapper has been successfully built on Mac, you should be able to locate the files 'pyrealsense2.so' and 'pybackend2.so' in the folder location build > wrappers > python > Debug |
I am really starting to wish it was Linux. M1 is like being stabbed on every step. |
I apologize for the difficulties that you are experiencing. I do not have a Mac computer to test with at my location, unfortunately. #1671 has advice about problems with building with XCode on Mac. |
There is no need to apologize, I just have to learn more, as I mentioned before building stuff from Github is something new for me and also M1 doesn't want to cooperate so it is hard to start. I just hope that I will manage to build it and won't give up. |
I researched your case from the beginning in search of fresh insights. Most RealSense users attempting to install on an M1 computer likely start with a common reference source, such as the GitHub version of the official Mac installation guide, which was last updated in September 2021 at the time of writing this and so has advice that is relatively up to date. https://github.com/IntelRealSense/librealsense/blob/master/doc/installation_osx.md Once the guide is followed and an error occurs on M1, this is the point where users tend to have a different installation experience. For example, they may experience similar errors but not in the same order as other users, and so they refer to the M1 installation issues on the forum to find pieces of information for the particular error that they currently have. This makes it currently difficult to assemble a single universal instruction guide that will work for a majority of M1 users. |
I am aware of it.
Tomorrow I will try to reinstall it, now I know how to solve some issues
and maybe other were created by mistake (while solving previous ones) so
it might help a little.
|
Hi @Obrepal Do you have an update that you can provide about this case, please? Thanks! |
Not yet, I had to take a rest.
I will try again next week. Maybe this time will be easier. I will let you
know in case of any problem
|
Okay, thanks very much for the update - good luck! |
Hi @Obrepal Do you have a further update about this case that you can provide, please? Thanks! |
Case closed due to no further comments received. |
Sorry, my other projects kept me busy.
But then I run into this: [ 2%] Built target fw Update the VERSION argument value or use a ... suffix to tell ld: library not found for -latomic I really feel helpless but will check this one more time. |
I note that your build log has a deprecation warning about the CMake version. CMake Deprecation Warning at CMakeLists.txt:4 (cmake_minimum_required): Compatibility with CMake < 2.8.12 will be removed from a future version of CMake. The message would suggest that a CMake version less than 2.8.12 is being detected. Intel's official MacOS installation instructions state that CMake 3.8 or newer is required by librealsense. |
According to brew I have: I still have this issue with latomic other threads with similar error didn't help me 😞
I installed it with |
It is worth noting that there have been problems with a number of RealSense users in recent times with using RealSense on Monterey, as described in #9916 - this has affected Monterey-using Macs with both Intel and M1 processors. |
Ok, so we are waitng for patch from Intel?
…On Tue, 22 Feb 2022 at 19:32, MartyG-RealSense ***@***.***> wrote:
It is worth noting that there have been problems with a number of
RealSense users in recent times with using RealSense on Monterey, as
described in #9916
<#9916> - this has
affected Monterey using Macs with both Intel and M1 processors.
—
Reply to this email directly, view it on GitHub
<#10041 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALRKFXFE6T6ENGXILNW3OE3U4PJCNANCNFSM5JWOZPMQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Intel concluded that the problem needs to be addressed from Apple's side in MacOS rather than implementing a fix in the RealSense SDK. A RealSense M1 user did manage to build on Monterey at #9916 (comment) - though with errors - and another RealSense user at #9916 (comment) speculated that it may be related to camera permissions on MacOS. |
Ok, so we are stuck again. But maybe solving this latmoic is a key.
Thanks a lot for help
|
The previous advice for those who experienced the -latomic error was to build the SDK as an XCode project. I note that earlier in this discussion at #10041 (comment) you had difficulty with building with XCode though. |
So I could get my app to build with RealSense on Apple M1 / Monterey, but I can't ask my users to start my app with a sudo... |
Hi @mattbeghin There has been significant progress with Mac installation on Monterey and on M1 Macs recently, as described at #9916 (comment) |
| Operating System & Version | MacOS Monterey 12.0.1 M1 chip |
I do have much experience with CMake.
I downloaded folder using:
it clone https://github.com/IntelRealSense/librealsense
and then followed the steps for MacOS
When I want to build it
cmake .. -DBUILD_EXAMPLES=true -DBUILD_WITH_OPENMP=false -DHWM_OVER_XU=false
This occurs
build % cmake .. -DBUILD_EXAMPLES=true -DBUILD_WITH_OPENMP=false -DHWM_OVER_XU=false -- Checking internet connection... -- Internet connection identified -- Info: REALSENSE_VERSION_STRING=2.50.0 -- Setting Unix configurations -- using RS2_USE_LIBUVC_BACKEND CMake Error at /opt/homebrew/Cellar/cmake/3.22.0/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message): Could NOT find Threads (missing: Threads_FOUND) Call Stack (most recent call first): /opt/homebrew/Cellar/cmake/3.22.0/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE) /opt/homebrew/Cellar/cmake/3.22.0/share/cmake/Modules/FindThreads.cmake:238 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) examples/measure/CMakeLists.txt:9 (find_package)
After first run I got this
-- Looking for pthread.h -- Looking for pthread.h - not found CMake Error at /opt/homebrew/Cellar/cmake/3.22.0/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message): Could NOT find Threads (missing: Threads_FOUND) Call Stack (most recent call first): /opt/homebrew/Cellar/cmake/3.22.0/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE) /opt/homebrew/Cellar/cmake/3.22.0/share/cmake/Modules/FindThreads.cmake:238 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) examples/measure/CMakeLists.txt:9 (find_package)
I don't want to make it too long but here is CMakeError.log
Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: /Library/Developer/CommandLineTools/usr/bin/c++
Build flags:
Id flags:
The output was:
1
ld: library not found for -lc++
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: /Library/Developer/CommandLineTools/usr/bin/cc
Build flags:
Id flags:
The output was:
1
ld: library not found for -lSystem
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Determining if the include file pthread.h exists failed with the following output:
Change Dir: /Users/Obrepal/librealsense/build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/make -f Makefile cmTC_5e8f1/fast && /Library/Developer/CommandLineTools/usr/bin/make -f CMakeFiles/cmTC_5e8f1.dir/build.make CMakeFiles/cmTC_5e8f1.dir/build
Building C object CMakeFiles/cmTC_5e8f1.dir/CheckIncludeFile.c.o
/Library/Developer/CommandLineTools/usr/bin/cc -pedantic -g -D_DEFAULT_SOURCE -mfpu=neon -mfloat-abi=hard -ftree-vectorize -latomic -pthread -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.0.sdk -fPIE -MD -MT CMakeFiles/cmTC_5e8f1.dir/CheckIncludeFile.c.o -MF CMakeFiles/cmTC_5e8f1.dir/CheckIncludeFile.c.o.d -o CMakeFiles/cmTC_5e8f1.dir/CheckIncludeFile.c.o -c /Users/Obrepal/librealsense/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c
clang: warning: -latomic: 'linker' input unused [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-mfpu=neon' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-mfloat-abi=hard' [-Wunused-command-line-argument]
Linking C executable cmTC_5e8f1
/opt/homebrew/Cellar/cmake/3.22.0/bin/cmake -E cmake_link_script CMakeFiles/cmTC_5e8f1.dir/link.txt --verbose=1
/Library/Developer/CommandLineTools/usr/bin/cc -pedantic -g -D_DEFAULT_SOURCE -mfpu=neon -mfloat-abi=hard -ftree-vectorize -latomic -pthread -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.0.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTC_5e8f1.dir/CheckIncludeFile.c.o -o cmTC_5e8f1
ld: library not found for -latomic
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [cmTC_5e8f1] Error 1
make: *** [cmTC_5e8f1/fast] Error 2
The text was updated successfully, but these errors were encountered: