Skip to content

Undefined references to various __atomic macros when building opencv 4.1.1 #15192

@BoxWizard000000

Description

@BoxWizard000000

System information (version)

  • OpenCV => 4.1.1
  • Operating System / Platform => Raspbian Buster armv71
  • Compiler => gcc v8.3.0

Output log

[ 40%] Linking CXX executable ../../bin/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'

Here's my build config:

cmake -D CMAKE_BUILD_TYPE=RELEASE \
   -D CMAKE_INSTALL_PREFIX=/usr/local/ \
   -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib-master/modules/ \
   -D ENABLE_NEON=ON \
   -D ENABLE_VFPV3=ON \
   -D ENABLE_LTO=ON \
   -D CPU_BASELINE=NEON \
   -D WITH_TBB=ON \
   -D WITH_OPENCL=ON \
   -D WITH_GSTREAMER=ON \
   -D BUILD_EXAMPLES=OFF \
   -D BUILD_TESTS=OFF \
   -D BUILD_SHARED=OFF ..

make

Any ideas how I might resolve this issue?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions