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

librealsense make -j5 error #11525

Closed
tsaiboyu opened this issue Mar 6, 2023 · 20 comments
Closed

librealsense make -j5 error #11525

tsaiboyu opened this issue Mar 6, 2023 · 20 comments

Comments

@tsaiboyu
Copy link

tsaiboyu commented Mar 6, 2023

HI everyone , I have a problem compiling librealsense
I used jetson nano Xvaier nx

[ 2%] Built target libcurl
[ 3%] Built target fw
[ 8%] Built target realsense-file
[ 41%] Built target realsense2
[ 46%] Built target pybackend2
[ 50%] Built target pyrealsense2
[ 55%] Built target glfw
[ 59%] Built target realsense2-gl
[ 59%] Built target rs-hello-realsense
[ 60%] Built target rs-software-device
[ 61%] Built target rs-capture
[ 61%] Built target rs-callback
[ 62%] Built target rs-save-to-disk
[ 62%] Built target rs-multicam
[ 63%] Built target rs-pointcloud
[ 64%] Built target rs-align
[ 65%] Built target rs-align-advanced
[ 65%] Built target rs-sensor-control
[ 66%] Built target rs-measure
[ 66%] Linking C executable rs-depth
../../../librealsense2.so.2.53.1: undefined reference to std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream()@GLIBCXX_3.4.26' ../../../librealsense2.so.2.53.1: undefined reference to std::__throw_bad_array_new_length()@GLIBCXX_3.4.29'
../../../librealsense2.so.2.53.1: undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits, std::allocator >::basic_ostringstream()@GLIBCXX_3.4.26'
collect2: error:ld return 1
examples/C/depth/CMakeFiles/rs-depth.dir/build.make:101: recipe for target 'examples/C/depth/rs-depth' failed
make[2]: *** [examples/C/depth/rs-depth] Error 1
CMakeFiles/Makefile2:1221: recipe for target 'examples/C/depth/CMakeFiles/rs-depth.dir/all' failed
make[1]: *** [examples/C/depth/CMakeFiles/rs-depth.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Mar 6, 2023

Hi @tsaiboyu If a build fails when using a '-j' value (which accelerates build time by enabling the use of multiple CPU threads) then you can simply use make - which has a longer build time but can be more stable by having a lower risk of a random crash occurring during the build.

@tsaiboyu
Copy link
Author

tsaiboyu commented Mar 9, 2023

@MartyG-RealSense HI i used "make -" get same result
/catkin_ws/src/librealsense/build$ make -
[ 2%] Built target libcurl
[ 3%] Built target fw
[ 8%] Built target realsense-file
[ 41%] Built target realsense2
[ 46%] Built target pybackend2
[ 50%] Built target pyrealsense2
[ 55%] Built target glfw
[ 59%] Built target realsense2-gl
[ 59%] Built target rs-hello-realsense
[ 60%] Built target rs-software-device
[ 61%] Built target rs-capture
[ 61%] Built target rs-callback
[ 62%] Built target rs-save-to-disk
[ 62%] Built target rs-multicam
[ 63%] Built target rs-pointcloud
[ 64%] Built target rs-align
[ 65%] Built target rs-align-advanced
[ 65%] Built target rs-sensor-control
[ 66%] Built target rs-measure
[ 66%] Linking C executable rs-depth
../../../librealsense2.so.2.53.1: undefined reference to std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream()@GLIBCXX_3.4.26' ../../../librealsense2.so.2.53.1: undefined reference to std::__throw_bad_array_new_length()@GLIBCXX_3.4.29'
../../../librealsense2.so.2.53.1: undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits, std::allocator >::basic_ostringstream()@GLIBCXX_3.4.26'
collect2: 錯誤:ld 回傳 1
examples/C/depth/CMakeFiles/rs-depth.dir/build.make:101: recipe for target 'examples/C/depth/rs-depth' failed
make[2]: *** [examples/C/depth/rs-depth] Error 1
CMakeFiles/Makefile2:1221: recipe for target 'examples/C/depth/CMakeFiles/rs-depth.dir/all' failed
make[1]: *** [examples/C/depth/CMakeFiles/rs-depth.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

@tsaiboyu
Copy link
Author

tsaiboyu commented Mar 9, 2023

Before, i have deleted build and mkdir build again

@MartyG-RealSense
Copy link
Collaborator

Can you link me to the instructions that you are using to build librealsense from source code, please? For example, is it the Jetson-specific instructions at the link below.

https://github.com/IntelRealSense/librealsense/blob/master/doc/installation_jetson.md#building-from-source-using-native-backend

@MartyG-RealSense
Copy link
Collaborator

Hi @tsaiboyu Do you require further assistance with this case, please? Thanks!

@tsaiboyu
Copy link
Author

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Mar 15, 2023

Your English is good, don't worry. :) If you would prefer to use your native language though then that is okay as I can translate.

When building with CMake, build problems may occur if your gcc version is older than 5.0. You can check your current gcc version with the command gcc -v

https://github.com/IntelRealSense/librealsense/blob/master/doc/installation.md#building-librealsense2-sdk

@tsaiboyu
Copy link
Author

Hi @MartyG-RealSense
my gcc
Use built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/aarch64-unknown-linux-gnu/11.2.0/lto-wrapper
Purpose: aarch64-unknown-linux-gnu
The configuration is: ../configure -enable-checking=release -enable-languages=c,c++ -disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 11.2.0 (GCC)

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Mar 15, 2023

At #6964 (comment) there is an alternative set of instructions for building from source code on Jetson that works well on different Jetson models including Nano and NX.

@tsaiboyu
Copy link
Author

ok,I try it!

@tsaiboyu
Copy link
Author

HI @MartyG-RealSense
I used "make -j" can run 100% ,but still error.
the problem:
[ 95%] Built target rs-pose-predict
[ 95%] Linking CXX executable rs-record
[ 95%] Built target rs-pose-and-image
[ 96%] Linking CXX executable rs-fw-logger
[ 96%] Built target rs-record
[ 97%] Linking CXX executable rs-gl
[ 97%] Built target rs-fw-logger
[ 97%] Linking CXX executable rs-fw-update
[ 97%] Linking CXX executable rs-ar-basic
[ 97%] Linking CXX executable rs-record-playback
[ 97%] Built target rs-gl
[ 98%] Linking CXX executable rs-trajectory
[ 99%] Linking CXX executable rs-motion
[ 99%] Linking CXX executable rs-tracking-and-depth
[ 99%] Linking CXX executable rs-post-processing
[ 99%] Built target rs-fw-update
[ 99%] Linking CXX executable rs-enumerate-devices
[100%] Linking CXX executable rs-ar-advanced
[100%] Built target rs-ar-basic
[100%] Linking CXX executable rs-hdr
[100%] Built target rs-record-playback
[100%] Built target rs-trajectory
[100%] Built target rs-motion
[100%] Built target rs-tracking-and-depth
[100%] Built target rs-enumerate-devices
[100%] Built target rs-post-processing
[100%] Built target rs-ar-advanced
[100%] Built target rs-hdr
[100%] Linking CXX executable rs-convert
[100%] Linking CXX executable rs-benchmark
[100%] Built target rs-convert
[100%] Built target rs-benchmark
[100%] Linking CXX executable rs-terminal
[100%] Built target rs-terminal
[100%] Linking CXX executable rs-data-collect
[100%] Built target rs-data-collect
[100%] Linking CXX executable rs-rosbag-inspector
[100%] Built target rs-rosbag-inspector
[100%] Linking CXX executable rs-depth-quality
[100%] Linking CXX executable realsense-viewer
[100%] Built target rs-depth-quality
[100%] Built target realsense-viewer
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

@MartyG-RealSense
Copy link
Collaborator

It may be worth trying the installation script installLibrealsense provided by the website JetsonHacks instead to build the SDK from packages instead of compiling source code.

https://jetsonhacks.com/2019/12/22/install-realsense-camera-in-5-minutes-jetson-nano/

@tsaiboyu
Copy link
Author

@MartyG-RealSense I need "pyrealsense2 module" ,is there any other way to get it?

@MartyG-RealSense
Copy link
Collaborator

Using the JetsonHacks buildLibrealsense script to build librealsense from source code instead of packages includes the instruction to build the pyrealsense2 wrapper.

https://github.com/jetsonhacks/installRealSenseSDK#buildlibrealsensesh

@MartyG-RealSense
Copy link
Collaborator

Hi @tsaiboyu Do you require further assistance with this case, please? Thanks!

@tsaiboyu
Copy link
Author

@MartyG-RealSense So sad , still have problem
The CUDA compiler

"/usr/local/cuda/bin/nvcc"

is not able to compile a simple test program.

It fails with the following output:

Change Dir: /home/boyu/librealsense/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_46bd1/fast"
/usr/bin/make -f CMakeFiles/cmTC_46bd1.dir/build.make CMakeFiles/cmTC_46bd1.dir/build
make[1]: Entering directory '/home/boyu/librealsense/build/CMakeFiles/CMakeTmp'
Building CUDA object CMakeFiles/cmTC_46bd1.dir/main.cu.o
/usr/local/cuda/bin/nvcc     -x cu -c /home/boyu/librealsense/build/CMakeFiles/CMakeTmp/main.cu -o CMakeFiles/cmTC_46bd1.dir/main.cu.o
在從下述位置 include 的檔案: /usr/local/cuda/bin/../targets/aarch64-linux/include/cuda_runtime.h:83,
                 來自 <命令列>:
/usr/local/cuda/bin/../targets/aarch64-linux/include/crt/host_config.h:138:2: 錯誤:#error -- unsupported GNU version! gcc versions later than 8 are not supported!
  138 | #error -- unsupported GNU version! gcc versions later than 8 are not supported!
      |  ^~~~~
CMakeFiles/cmTC_46bd1.dir/build.make:65: recipe for target 'CMakeFiles/cmTC_46bd1.dir/main.cu.o' failed
make[1]: *** [CMakeFiles/cmTC_46bd1.dir/main.cu.o] Error 1
make[1]: Leaving directory '/home/boyu/librealsense/build/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_46bd1/fast' failed
make: *** [cmTC_46bd1/fast] Error 2

CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMake/cuda_config.cmake:3 (project)
CMake/global_config.cmake:69 (include)
CMakeLists.txt:52 (global_set_flags)

-- Configuring incomplete, errors occurred!
See also "/home/boyu/librealsense/build/CMakeFiles/CMakeOutput.log".
See also "/home/boyu/librealsense/build/CMakeFiles/CMakeError.log".
Building librealsense, headers, tools and demos
make: *** No targets specified and no makefile found. Stop.

real 0m0.007s
user 0m0.000s
sys 0m0.004s
librealsense did not build
Retrying ...
make: *** No targets specified and no makefile found. Stop.

real 0m0.008s
user 0m0.004s
sys 0m0.000s
librealsense did not successfully build
Please fix issues and retry build

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Mar 23, 2023

There was a past case of that /usr/local/cuda/bin/nvcc error at #7229

@MartyG-RealSense
Copy link
Collaborator

Hi @tsaiboyu Was the comment above useful to you, please? Thanks!

@MartyG-RealSense
Copy link
Collaborator

Hi @tsaiboyu Do you require further assistance with this case, please? Thanks!

@MartyG-RealSense
Copy link
Collaborator

Case closed due to no further comments received.

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

No branches or pull requests

2 participants