Ask Your Question
0

Make error __atomic_fetch_add_8 on RaspberryPi4

asked 2019-07-15 18:35:01 -0600

Dou gravatar image

updated 2019-07-16 10:52:23 -0600

Hello,

I've been trying to compile OpenCV 4.1.1 on my RaspberryPi 4 running Rasbian Buster with Python 3.7. I use the following command for cmake running inside a build folder under opencv (as described here: https://www.pyimagesearch.com/2018/09...):

cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D OPENCV_EXTRA_MODULES_PATH=/home/pi/share/CameraWork/opencv_contrib/modules -D ENABLE_NEON=ON -D ENABLE_VFPV3=ON -D BUILD_TESTS=OFF -D OPENCV_ENABLE_NONFREE=ON -D INSTALL_PYTHON_EXAMPLES=OFF -D BUILD_EXAMPLES=OFF -D ENABLE_NOISY_WARNINGS=ON -D ENABLE_PRECOMPILED_HEADERS=OFF ..

However I keep getting the following errors when make moves on to make opencv_perf_core:

/usr/bin/ld: ../../lib/libopencv_core.so.4.1.1: undefined reference to '__atomic_fetch_add_8'
/usr/bin/ld: ../../lib/libopencv_core.so.4.1.1: undefined reference to '__atomic_fetch_sub_8'
/usr/bin/ld: ../../lib/libopencv_core.so.4.1.1: undefined reference to '__atomic_store_8'
/usr/bin/ld: ../../lib/libopencv_core.so.4.1.1: undefined reference to '__atomic_load_8'
/usr/bin/ld: ../../lib/libopencv_core.so.4.1.1: undefined reference to '__atomic_compare_exchange_8'
collect2: error: ld returned 1 exit status
make[2]: *** [modules/core/CMakeFiles/opencv_perf_core.dir/build.make:541: bin/opencv_perf_core] Error 1
make[1]: *** [CMakeFiles/Makefile2:2597: modules/core/CMakeFiles/opencv_perf_core.dir/all] Error 2
make: *** [Makefile:163: all] Error 2

Has anyone come across any similar trouble? Do you have any suggestions?

Thanks in advance.

edit retag flag offensive close merge delete

Comments

Mine is working on Raspberry pi 4B with Buster ver 10, OpenCV 4.1.0. But not with your cmake as above.

supra56 gravatar imagesupra56 ( 2019-07-22 21:42:19 -0600 )edit

I have the same problem, using the same tutorial. Did you find a solution?

I found some hints that -latomic could help, but no idea where to add this. Thanks

Luki1000 gravatar imageLuki1000 ( 2019-07-24 12:20:08 -0600 )edit

could you please tell us your steps? thanks

Luki1000 gravatar imageLuki1000 ( 2019-07-24 12:22:25 -0600 )edit

3 answers

Sort by ยป oldest newest most voted
0

answered 2020-05-08 01:13:59 -0600

try to use opencv4.0.1.XX.

I have the similar question with u.

But I run it on raspberry pi 4B 4G python37

pip uninstall opencv-python

pip install opencv-python==4.1.0.25

edit flag offensive delete link more
0

answered 2019-07-27 03:31:26 -0600

mt08 gravatar image

Hi,

It may need to be linked with libatomic library.
I could build by adding -DCMAKE_SHARED_LINKER_FLAGS='-latomic' to cmake.

Here is my cmake settings:

OPENCV_VERSION=4.1.1
cmake -DCMAKE_BUILD_TYPE=Release \
    -D CMAKE_INSTALL_PREFIX=/usr/local \
    -D OPENCV_EXTRA_MODULES_PATH=${HOME}/opencv_contrib-${OPENCV_VERSION}/modules \
    -D ENABLE_VFPV3=ON \
    -D ENABLE_NEON=ON \
    -D BUILD_TESTS=OFF \
    -D WITH_TBB=OFF \
    -D INSTALL_PYTHON_EXAMPLES=ON \
    -D OPENCV_SKIP_PYTHON_LOADER=ON \
    -D OPENCV_PYTHON2_INSTALL_PATH=/usr/local/lib/python2.7/dist-packages \
    -D OPENCV_PYTHON3_INSTALL_PATH=/usr/local/lib/python3.7/dist-packages \
    -D OPENCV_GENERATE_PKGCONFIG=ON \
    -D BUILD_EXAMPLES=ON \
    -DCMAKE_SHARED_LINKER_FLAGS='-latomic' \
    ..

Environment:

  • Raspberry Pi 4B (4GB) with fan
  • 2019-07-10-raspbian-buster (apt upgrade on Jul27'19)
edit flag offensive delete link more
-3

answered 2019-07-20 11:46:28 -0600

Reino gravatar image

updated 2019-07-22 03:16:06 -0600

Hi, I also have the same problem.

But looking on the web I found this solution : https://github.com/leswright1977/RPI4...

Thanks to Les Wright, and it's works for me !

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2019-07-15 18:35:01 -0600

Seen: 8,741 times

Last updated: Jul 22 '19