Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Poco 1.14.0 now requires libatomic #4806

Open
fedapo opened this issue Dec 3, 2024 · 4 comments
Open

Poco 1.14.0 now requires libatomic #4806

fedapo opened this issue Dec 3, 2024 · 4 comments
Labels
buildsystem cmake Related to cmake build system fixed

Comments

@fedapo
Copy link

fedapo commented Dec 3, 2024

This has been observed on Linux machines.
Version 1.14.0 introduces a dependency on library libatomic which doesn't seem to be present in earlier releases.
This forces code using this version to link against a library that, potentially, is not needed as modern processors use intrisics. As a consequence the library must also be available where the final application runs.

I tried to remove it from the CMake scripts and it all seems to work fine. The change is on file PocoFoundationTargets.cmake:
This line:

  INTERFACE_LINK_LIBRARIES "pthread;atomic;dl;rt"

becomes this:

  INTERFACE_LINK_LIBRARIES "pthread;dl;rt"

Would it be possible to consider alternatives to the current situation? Perhaps linking against libatomic could be made a build configuration (CMake build also, please) or it could be removed altogether as it seems to have always been the case in past releases.
Thanks!

@matejk matejk added this to the Release 1.14.1 milestone Dec 3, 2024
@aleks-f aleks-f closed this as completed Dec 3, 2024
@aleks-f aleks-f reopened this Dec 3, 2024
@aleks-f aleks-f added this to 1.14 Dec 3, 2024
@aleks-f aleks-f moved this to In Progress in 1.14 Dec 3, 2024
@aleks-f
Copy link
Member

aleks-f commented Dec 3, 2024

#4811

@matejk
Copy link
Contributor

matejk commented Dec 4, 2024

@fedapo, which OS and compiler do you use?

@matejk matejk added the cmake Related to cmake build system label Dec 4, 2024
@fedapo
Copy link
Author

fedapo commented Dec 4, 2024

@fedapo, which OS and compiler do you use?

I tested this on CentOS 7 that did not have libatomic installed. Consider that this is a common scenario, even a more recent AlmaLinux 8.9 distro won't have this library installed by default:

> g++ main.cpp -latomic
/usr/bin/ld: cannot find /usr/lib64/libatomic.so.1.2.0
collect2: error: ld returned 1 exit status

Moreover the link to this library is most likely dynamic, adding the requirement of having libatomic installed in the end system, which might be different than the build one.

@matejk
Copy link
Contributor

matejk commented Dec 6, 2024

It seems that linking libatomic is required only on some platforms:

nodejs/node#39546

@matejk matejk moved this from In Progress to Done in 1.14 Dec 9, 2024
@matejk matejk moved this from Done to In Progress in 1.14 Dec 9, 2024
@matejk matejk added the fixed label Dec 9, 2024
@aleks-f aleks-f moved this from In Progress to Done in 1.14 Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
buildsystem cmake Related to cmake build system fixed
Projects
Status: Done
Development

No branches or pull requests

3 participants