gocv
gocv copied to clipboard
gocv on riscv64
Hi all,
I want to build gocv on riscv64 platform and cloned gocv from link:- https://github.com/hybridgroup/gocv.git I am using go-1.16.3 I am facing issue:-
sudo yes | apt-get update
sudo yes | apt-get install unzip wget build-essential cmake curl git tbb libgtk-2.0 pkgconfig libjpeg62 libpng16-dev libtiff-dev
Ign:1 http://10.168.1.39:8000/all ./ InRelease
Ign:2 http://10.168.1.39:8000/riscv64 ./ InRelease
Ign:3 http://10.168.1.39:8000/exaleapsemi ./ InRelease
Get:4 http://10.168.1.39:8000/all ./ Release [1213 B]
Get:5 http://10.168.1.39:8000/riscv64 ./ Release [1217 B]
Get:6 http://10.168.1.39:8000/exaleapsemi ./ Release [1221 B]
Ign:7 http://10.168.1.39:8000/all ./ Release.gpg
Ign:8 http://10.168.1.39:8000/riscv64 ./ Release.gpg
Ign:9 http://10.168.1.39:8000/exaleapsemi ./ Release.gpg
Fetched 3651 B in 0s (39.3 kB/s)
Reading package lists... Done
W: The repository 'http://10.168.1.39:8000/all ./ Release' is not signed.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: The repository 'http://10.168.1.39:8000/riscv64 ./ Release' is not signed.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: The repository 'http://10.168.1.39:8000/exaleapsemi ./ Release' is not signed.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
Reading package lists... Done
Building dependency tree
Reading state information... Done
build-essential is already the newest version (1.0-r0).
wget is already the newest version (1.20.3-r0).
curl is already the newest version (7.72.0-r0).
cmake is already the newest version (3.18.2-r0).
libgtk-2.0 is already the newest version (2.24.32-r0).
libpng16-dev is already the newest version (1.6.37-r0).
unzip is already the newest version (1:6.0-r5).
tbb is already the newest version (1:2020.3-r0).
libjpeg62 is already the newest version (1:2.0.5-r0).
libtiff-dev is already the newest version (4.1.0-r0).
pkgconfig is already the newest version (0.29.2+git0+edf8e6f0ea-r0).
git is already the newest version (2.28.0-r0).
The following package was automatically installed and is no longer required:
go-runtime-staticdev
Use 'apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 9 not upgraded.
rm -rf /tmp/opencv
mkdir /tmp/opencv
cd /tmp/opencv
curl -Lo opencv.zip https://github.com/opencv/opencv/archive/4.6.0.zip
unzip -q opencv.zip
curl -Lo opencv_contrib.zip https://github.com/opencv/opencv_contrib/archive/4.6.0.zip
unzip -q opencv_contrib.zip
rm opencv.zip opencv_contrib.zip
cd -
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 90.2M 100 90.2M 0 0 2936k 0 0:00:31 0:00:31 --:--:-- 4727k
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 59.1M 100 59.1M 0 0 3279k 0 0:00:18 0:00:18 --:--:-- 2606k
/home/root/gocv-0.31.0
sudo rm -rf /usr/local/lib/cmake/opencv4/
sudo rm -rf /usr/local/lib/libopencv*
sudo rm -rf /usr/local/lib/pkgconfig/opencv*
sudo rm -rf /usr/local/include/opencv*
cd /tmp/opencv/opencv-4.6.0
mkdir build
cd build
rm -rf *
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_SHARED_LIBS=ON -D OPENCV_EXTRA_MODULES_PATH=/tmp/opencv/opencv_contrib-4.6.0/modules -D BUILD_DOCS=OFF -D BUILD_EXAMPLES=OFF -D BUILD_TESTS=OFF -D BUILD_PERF_TESTS=OFF -D BUILD_opencv_java=NO -D BUILD_opencv_python=NO -D BUILD_opencv_python2=NO -D BUILD_opencv_python3=NO -D WITH_JASPER=OFF -D WITH_TBB=ON -DOPENCV_GENERATE_PKGCONFIG=ON ..
make -j 4
make preinstall
cd -
-- The CXX compiler identification is GNU 10.2.0
-- The C compiler identification is GNU 10.2.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Check for working CXX compiler: /usr/bin/g++
-- Check for working CXX compiler: /usr/bin/g++ - broken
CMake Error at /usr/share/cmake-3.18/Modules/CMakeTestCXXCompiler.cmake:59 (message):
The C++ compiler
"/usr/bin/g++"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: /tmp/opencv/opencv-4.6.0/build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/make cmTC_c70e7/fast && make[1]: Entering directory '/tmp/opencv/opencv-4.6.0/build/CMakeFiles/CMakeTmp'
/usr/bin/make -f CMakeFiles/cmTC_c70e7.dir/build.make CMakeFiles/cmTC_c70e7.dir/build
make[2]: Entering directory '/tmp/opencv/opencv-4.6.0/build/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_c70e7.dir/testCXXCompiler.cxx.o
/usr/bin/g++ -stdlib=libstdc++ -fPIE -o CMakeFiles/cmTC_c70e7.dir/testCXXCompiler.cxx.o -c /tmp/opencv/opencv-4.6.0/build/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
g++: error: unrecognized command-line option '-stdlib=libstdc++'; did you mean '-static-libstdc++'?
make[2]: *** [CMakeFiles/cmTC_c70e7.dir/build.make:85: CMakeFiles/cmTC_c70e7.dir/testCXXCompiler.cxx.o] Error 1
make[2]: Leaving directory '/tmp/opencv/opencv-4.6.0/build/CMakeFiles/CMakeTmp'
make[1]: *** [Makefile:140: cmTC_c70e7/fast] Error 2
make[1]: Leaving directory '/tmp/opencv/opencv-4.6.0/build/CMakeFiles/CMakeTmp'
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:113 (enable_language)
-- Configuring incomplete, errors occurred!
See also "/tmp/opencv/opencv-4.6.0/build/CMakeFiles/CMakeOutput.log".
See also "/tmp/opencv/opencv-4.6.0/build/CMakeFiles/CMakeError.log".
make[1]: Entering directory '/tmp/opencv/opencv-4.6.0/build'
make[1]: *** No targets specified and no makefile found. Stop.
make[1]: Leaving directory '/tmp/opencv/opencv-4.6.0/build'
make[1]: Entering directory '/tmp/opencv/opencv-4.6.0/build'
make[1]: *** No rule to make target 'preinstall'. Stop.
make[1]: Leaving directory '/tmp/opencv/opencv-4.6.0/build'
/tmp/opencv/opencv-4.6.0
cd /tmp/opencv/opencv-4.6.0/build
sudo make install
sudo ldconfig
cd -
make: *** No rule to make target 'install'. Stop.
/home/root/gocv-0.31.0
go clean --cache
rm -rf /tmp/opencv
go run ./cmd/version/main.go
# runtime/cgo
/usr/lib/gcc/riscv64-oe-linux/10.2.0/../../../../riscv64-oe-linux/bin/ld: $WORK/b039/_x008.o: in function `x_cgo_thread_start':
/usr/lib/go/src/runtime/cgo/gcc_util.c:21: undefined reference to `_cgo_sys_thread_start'
collect2: error: ld returned 1 exit status
make: *** [Makefile:277: verify] Error 2
please guide me to build gocv on riscv64.
T&R Kush Kumar