esa / pagmo2

A C++ platform to perform parallel computations of optimisation tasks (global and local) via the asynchronous generalized island model.
https://esa.github.io/pagmo2/
GNU General Public License v3.0
804 stars 159 forks source link

Linker issue on mipsel and armel architectures #515

Closed pgrt closed 1 year ago

pgrt commented 2 years ago

Hello,

In Debian, the build is failing on armel and mipsel with messages like /usr/bin/ld: /usr/include/c++/11/bits/atomic_base.h:488: undefined reference to `__atomic_load_8'

I could solve this with the attached patch. Yet the issue is not showing up on other architectures: maybe you won't want to take it into account.

Best, Pierre

linker_flags_for_armel_mipsel.txt

bluescarni commented 1 year ago

@pgrt thanks for the report and apologies for the delay.

This seems the kind of things that would be better done on a case-by-case basis, rather than hard-coding it in the build system. Could you try to see if you can manage to achieve the same effect by using environment variables instead?

bluescarni commented 1 year ago

I mean something like CFLAGS, CXXFLAGS, LDFLAGS and similar.

pgrt commented 1 year ago

Hello,

No worry about the delay, really! Thanks for the suggestions, I will give it a try very soon and have you informed!

Best, Pierre

pgrt commented 1 year ago

Hello again, As you suggested, adding -Wl,--push-state,--no-as-needed,-latomic,--pop-state to LDFLAGS allows to build successfully on mipsel, without patching the CMakeLists.txt!

Best, Pierre

bluescarni commented 1 year ago

Hello again, As you suggested, adding -Wl,--push-state,--no-as-needed,-latomic,--pop-state to LDFLAGS allows to build successfully on mipsel, without patching the CMakeLists.txt!

Best, Pierre

Great to hear, I'll close the issue report then.