darktable icon indicating copy to clipboard operation
darktable copied to clipboard

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

Open bertwim opened this issue 1 year ago • 8 comments

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

bertwim avatar Aug 11 '24 10:08 bertwim

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?

kmilos avatar Aug 11 '24 11:08 kmilos

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.

TurboGit avatar Aug 11 '24 11:08 TurboGit

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.

ralfbrown avatar Aug 11 '24 13:08 ralfbrown

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 avatar Aug 11 '24 20:08 bertwim

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.

ralfbrown avatar Aug 11 '24 21:08 ralfbrown

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 avatar Aug 12 '24 03:08 bertwim

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

ralfbrown avatar Aug 12 '24 04:08 ralfbrown

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.

github-actions[bot] avatar Oct 12 '24 00:10 github-actions[bot]