[ 
https://issues.apache.org/jira/browse/MINIFICPP-1184?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17081864#comment-17081864
 ] 

Dániel Bakai commented on MINIFICPP-1184:
-----------------------------------------

[~Danreyn22] [~willie-engelbrecht]

The proper workaround with CMake is to add
{code:java}
-DCMAKE_EXE_LINKER_FLAGS="-latomic"
{code}
to your CMake command. This will add -latomic to the executables' link 
commands, where it is required.

Using this fix, minifi master builds for me on a Raspberry Pi 4 with Raspbian 
Bullseye, except for StringUtilsTests, which fails to build because char is 
unsigned. You can work that around by disabling tests or by patching that file.

The proper fix for this is to detect when libatomic needs to be linked. I am 
working on a PR that does that (and also fixes StringUtilsTest).

> Cannot compile on Raspberry Pi (Raspbian bullseye)
> --------------------------------------------------
>
>                 Key: MINIFICPP-1184
>                 URL: https://issues.apache.org/jira/browse/MINIFICPP-1184
>             Project: Apache NiFi MiNiFi C++
>          Issue Type: Bug
>    Affects Versions: 0.7.0
>         Environment: Raspberry Pi 4
>            Reporter: dan rey
>            Assignee: Dániel Bakai
>            Priority: Major
>
> I am unable to compile this on a Raspberry Pi running Raspbian GNU/Linux 
> bullseye.
> I continually get an error about linking.
> [ 59%] Linking CXX executable minifi
> /usr/bin/ld: ../libminifi/libcore-minifi.a(Connection.cpp.o): in function 
> `std::__atomic_base<unsigned long long>::load(std::memory_order) const':
> /usr/include/c++/9/bits/atomic_base.h:419: undefined reference to 
> `__atomic_load_8'
> /usr/bin/ld: /usr/include/c++/9/bits/atomic_base.h:419: undefined reference 
> to `__atomic_load_8'



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to