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

building master branch gives linker error. building release-4.8.1 (or earlier) does not. #17308

Open
bertwim opened this issue Aug 11, 2024 · 8 comments

Comments

@bertwim
Copy link

bertwim commented Aug 11, 2024

Describe the bug

I frequently build DT from the github master branch.
Since a couple of days (2 weeks?) building fails, due to linker errors:
libdarktable.so: undefined reference to_ZGVbN4v_log2f'
libdarktable.so: undefined reference to _ZGVdN8v_exp2f' libdarktable.so: undefined reference to _ZGVdN8v_log2f'
libdarktable.so: undefined reference to _ZGVbN4v_exp2f'
However, when I build e.g. the version tagged 'release-4.8.1' there are no issues.

Steps to reproduce

  1. Checkout the master branch
  2. cd into the source directory
  3. ./build.sh --prefix /opt/darktable --build-type Release
    Compilation starts as usual. At approx 56% the above erros appear.

Expected behavior

No linker errors

Logfile | Screenshot | Screencast

No response

Commit

release-4.8.1 builds fine. HEAD at master does not.

Where did you obtain darktable from?

GitHub nightly

darktable version

latest github version

What OS are you using?

Linux

What is the version of your OS?

OpenSUSE leap 15.5

Describe your system?

gcc 13.3.0

Are you using OpenCL GPU in darktable?

Yes

If yes, what is the GPU card and driver?

No response

Please provide additional context if applicable. You can attach files too, but might need to rename to .txt or .zip

No response

@kmilos
Copy link
Contributor

kmilos commented Aug 11, 2024

The CI actions and the nightly builds seem fine: https://github.com/darktable-org/darktable/actions

So it's more likely something at your end.

May I suggest seeking user support at https://discuss.pixls.us/c/software/darktable/19 before engaging developers here?

@TurboGit
Copy link
Member

TurboGit commented Aug 11, 2024

A compiler update and maybe you didn't clear the build directory?
EDIT: Reading your report it doesn't look like it is the issue though.

@ralfbrown
Copy link
Collaborator

Those symbols look like an attempt to link vectorized versions of the two functions which don't exist in the runtime library. We haven't changed src/develop/openmp_maths.h since well before the 4.8 release, so it must be a change to your compiler and its runtime library. You can work around the problem by commenting out the DT_OMP_DECLARE_SIMD() before each of those two function declarations in the above file.

@bertwim
Copy link
Author

bertwim commented Aug 11, 2024

Those symbols look like an attempt to link vectorized versions of the two functions which don't exist in the runtime library. We haven't changed src/develop/openmp_maths.h since well before the 4.8 release, so it must be a change to your compiler and its runtime library. You can work around the problem by commenting out the DT_OMP_DECLARE_SIMD() before each of those two function declarations in the above file.

This commenting out of DT_OMP_DECLARE_SIMD indeed made the error disappear!

As a matter of fact, I only commented it out once, before the declaration of log2f(), expecting the error related to exp2f to remain. To my surprise the linker however did not protest anymore about the exp2f function.

Thanks for your help!

@bertwim bertwim closed this as completed Aug 11, 2024
@ralfbrown
Copy link
Collaborator

What likely happened is that the offending calls were both in the same function, and when the compiler wasn't told it had a vectorized version of the one function available, it didn't try to use the vectorized version of the other, either.

@bertwim
Copy link
Author

bertwim commented Aug 12, 2024

Yeah, that sounds plausible.

Do you have any idea how it is possible that the issue occurs for the head of the master branch, but not for a tagged release? This is all on one and the same machine, with the same compiler...

Regards,
Bertwim

@bertwim bertwim reopened this Aug 12, 2024
@ralfbrown
Copy link
Collaborator

For whatever reason, the older code didn't cause vectorization to be applied in a way that resulted those functions being called.

Copy link

This issue has been marked as stale due to inactivity for the last 60 days. It will be automatically closed in 300 days if no update occurs. Please check if the master branch has fixed it and report again or close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants