halide / Halide

a language for fast, portable data-parallel computation
https://halide-lang.org
Other
5.87k stars 1.07k forks source link

external function '__sync_val_compare_and_swap_4' which could not be resolved #3240

Open r0l1 opened 6 years ago

r0l1 commented 6 years ago

I am using OpenCV with Halide support on an ARMv7 embedded board. During execution Halide fails with:

LLVM ERROR: Program used external function '__sync_val_compare_and_swap_4' which could not be resolved!

Any hints how to resolve this issue? OpenCV and Halide are compiled from source with the default options. LLVM 6.0.1 is used.

Thanks!

zvookin commented 6 years ago

Quick thing is to tey adding -latomic to the link. This is undesirable however so fixing this would be good. Is this with latest Halide? Depending on the processor you are using, you might try adding the Target::ARMv7s flag to the Halide compile if it is not already set.

-Z-

On Sun, Aug 26, 2018 at 11:51 AM Roland Singer notifications@github.com wrote:

I am using OpenCV with Halide support on an ARMv7 embedded board. During execution Halide fails with:

LLVM ERROR: Program used external function '__sync_val_compare_and_swap_4' which could not be resolved!

Any hints how to resolve this issue? OpenCV and Halide are compiled from source with the default options. LLVM 6.0.1 is used.

Thanks!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/halide/Halide/issues/3240, or mute the thread https://github.com/notifications/unsubscribe-auth/ABbqFG9n_TA-r9H0nUsw_gxmGbsrqDxWks5uUu4ngaJpZM4WM5TA .

r0l1 commented 6 years ago

Thanks for the hints. I tried several release including the latest git master state. I also enabled the ARMv7h target and added the -latomic link to the application. The errors still persist...

Edit: I also tried the precompiled releases...

Edit2: I have a lot of warnings during halide compilation:

       _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/8.2.0/map:61,
                 from /home/alarm/halide/src/Halide/tools/halide_image_io.h:12,
                 from /home/alarm/halide/src/Halide/util/HalideTraceDump.cpp:3:
/usr/include/c++/8.2.0/bits/stl_map.h: In member function 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](std::map<_Key, _Tp, _Compare, _Alloc>::key_type&&) [with _Key = std::__cxx11::basic_string<char>; _Tp = FuncInfo; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, FuncInfo> >]':
/usr/include/c++/8.2.0/bits/stl_map.h:518:8: note: parameter passing for argument of type 'std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, FuncInfo>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, FuncInfo> >, std::less<std::__cxx11::basic_string<char> >, std::allocator<std::pair<const std::__cxx11::basic_string<char>, FuncInfo> > >::const_iterator' {aka 'std::_Rb_tree_const_iterator<std::pair<const std::__cxx11::basic_string<char>, FuncInfo> >'} changed in GCC 7.1
    __i = _M_t._M_emplace_hint_unique(__i, std::piecewise_construct,

GCC 8.2.0 is used on an ARCH ARM system

Edit 3: I compiled it with llvm 6.0.1 without any warnings. Errors still there...