I am using Nvidia jetson nano dev kit from waveshare. Some background details : I have Installed the OS using sdk manager with ubuntu and jetpack 4.6.3 and then moved the os from internal memory to sd card with this tutorial : Change Root File System to SD Card Directly.
I wanted to enable opencv with cuda I have followed this github repository GitHub - mdegans/nano_build_opencv: Build OpenCV on Nvidia Jetson Nano to do it. while running the script for the build I get errors,
I cannot figure out the probblem and solve it . Can I get some help ?
Error starts from here :
â Check for working C compiler: /usr/bin/cc â broken
CMake Error at /usr/share/cmake-3.10/Modules/CMakeTestCCompiler.cmake:52 (message):
The C compiler
"/usr/bin/cc"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: /tmp/build_opencv/opencv/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_78248/fast"
/usr/bin/make -f CMakeFiles/cmTC_78248.dir/build.make CMakeFiles/cmTC_78248.dir/build
make[1]: Entering directory '/tmp/build_opencv/opencv/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_78248.dir/testCCompiler.c.o
/usr/bin/cc -o CMakeFiles/cmTC_78248.dir/testCCompiler.c.o -c /tmp/build_opencv/opencv/build/CMakeFiles/CMakeTmp/testCCompiler.c
/tmp/build_opencv/opencv/build/CMakeFiles/CMakeTmp/testCCompiler.c: In function âmainâ:
/tmp/build_opencv/opencv/build/CMakeFiles/CMakeTmp/testCCompiler.c:11:1: internal compiler error: Segmentation fault
{ (void)argv; return argc-1;}
^
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
CMakeFiles/cmTC_78248.dir/build.make:65: recipe for target 'CMakeFiles/cmTC_78248.dir/testCCompiler.c.o' failed
make[1]: *** [CMakeFiles/cmTC_78248.dir/testCCompiler.c.o] Error 1
make[1]: Leaving directory '/tmp/build_opencv/opencv/build/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_78248/fast' failed
make: *** [cmTC_78248/fast] Error 2
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:107 (enable_language)
â Configuring incomplete, errors occurred!
See also â/tmp/build_opencv/opencv/build/CMakeFiles/CMakeOutput.logâ.
See also â/tmp/build_opencv/opencv/build/CMakeFiles/CMakeError.logâ.
make: *** No targets specified and no makefile found. Stop.
make: *** No rule to make target âinstallâ. Stop.
Do you wish to remove temporary build files in /tmp/build_opencv ?
(Doing so may make running tests on the build later impossible)
Y/N n
Hi Dave ,
Yes I have the full jetPack components in my system, and also ran this command that you wrote earlier . I ran the Cmake config flags again and it did not work, same error
The internal eMMC is full. It is just 16GB , I donât have space for the build.
Right now in my case what to do if I want to change the boot to sdcard slot , just to remember that right now I am booting from external (port usb) with sd card
Yes I have did that several times , unfortunately it did not solve it.
I have tried to narrow down the problem by compiling a simple hello word c code also I got that error :
turac-ika@turacika-desktop:~$ gcc hello.c -o hello
hello.c: In function âmainâ:
hello.c:6:1: internal compiler error: Segmentation fault
}
^
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
Hi, so where does your system and the test code reside? Is your SD card also near full?
As mentioned by @Honey_Patouceul, someone on stackoverflow also bumped into the similar issue, and one of the solution mentioned in the post was deleting some files to free up disk space:
Check that there is a symbolic link /usr/local/cuda pointing to your actual cuda version (here through /etc/alternatives, note the following is from AGX Orin with R35.1, for Nano the versions may differ):
# Is NVCC available ?
nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2022 NVIDIA Corporation
Built on Wed_May__4_00:02:26_PDT_2022
Cuda compilation tools, release 11.4, V11.4.239
Build cuda_11.4.r11.4/compiler.31294910_0
If not found, you have to add cuda to your shell environment:
You may try this script for building opencv with CUDA.
For booting again from eMMC it should be easy but before trying that,
you would free some space in eMMC (100% is not safe).
you would have a serial console
Then as root you would edit /media/turac-ika/058bdf93-535d-4d45-a038-371b72494303/boot/extlinux/extlinux.conf and copy the default entry and paste it below.
Then give a name to this second entry and change the APPEND line setting linux root from /dev/sda1 to /dev/mmcblk0p1:
TIMEOUT 30
DEFAULT primary
MENU TITLE L4T boot options
LABEL primary
MENU LABEL primary kernel
....
APPEND ${cbootargs} root=/dev/sda1 rw rootwait rootfstype=ext4 ...
LABEL eMMC
MENU LABEL eMMC
....Same as above
APPEND ${cbootargs} root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 ...
Then save it and reboot with serial console attached. When extlinux will be run, youâll have only 3 seconds for selecting the second entry from console.