-
Notifications
You must be signed in to change notification settings - Fork 265
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Incomplete pkg-config module when using OpenMP. #1224
Comments
Ok, understood. I tried to reproduce the problem locally, but couldn't trigger a linker error. I've tried setting up an extra step in the linux CI pipeline (on this branch) but this succeeds as well for both, gcc and clang. About which functions is the linker complaining in your case? Apart from that I thought through this problem and agree that introducing (yet another) list seems to be the best idea. If possible, I would like to see a CI test failing before we fix this. So if you have any suggestions for triggering that, you're welcome. |
Sure! The issue happens specifically on my macbook since OpenMP is not a compiler built-in for Apple Clang.
This also made me notice another issue. The CMake scripts expect that if readline is found that it has a pkg-config file, but on macOS, the system ships with readline but does not provide a pc file for it:
Homebrew's version of readline is not added to the usual search paths for this very reason:
This leads to the following issue when calling pkg-config:
|
Ok, I finally got the omp issue reproduced for both, MacOS and Linux, see the above PR. I got confused myself - ofc. the test program has to call a fluidsynth-function that is acually OMP parallelized. As we're linking statically, everything else will get dropped and therefore I never saw the omp related linking errors you see. And I had a hard time convincing cmake on MacOS Azure Pipeline to actually find and use OpenMP. They're running the latest version of cmake 3.26 which is no longer creating a Anyway, I would probably merge the linked PR today. But I'm afraid I won't have time to actually implement the fix for openmp as you suggested. It will probably take me until next weekend to do so. Perhaps you might be faster in the meantime. Regarding the readline issue: I have now worked it around by setting the |
FluidSynth version
Execute
fluidsynth --version
and provide the output.Describe the bug
Provide a clear and concise description of the current situation, e.g. how the bug manifests.
When building a programs against fluidsynth using the flags provided by pkg-config, the link step fails with undefined references to OpenMP.
Expected behavior
Provide a clear and concise description of what you expected to happen.
The program builds successfully.
Steps to reproduce
Please explain the steps required to duplicate the issue, esp. if you are able to provide a sample application. E.g. how to start fluidsynth, what shell commands to enter, what midi events to send, etc.
pkg-config --libs --static fluidsynth
Additional context
If you are able to illustrate the bug with an example, please provide simple
source code below or as attached file. List any other information that is relevant to your issue, e.g. stack traces, related issues, build logs, suggestions on how to fix, links to related discussions at fluid-dev, etc.
I noticed the following snippet in
cmake_admin/PkgConfigHelpers.cmake
:This excludes all targets, which includes
OpenMP_C
.Similarly, this snippet will add PulseAudio's libraries since they aren't linked through a target, despite PulseAudio providing a pkg-config module.
A possible solution could be to build a list similar to
PC_REQUIRES_PRIV
that contains libraries which do not have pkg-config module files, instead of relying on theINTERFACE_LINK_LIBRARIES
of the libfluidsynth target. For example:Then in the helper macro, we only need to remove duplicate and apply the same process as currently:
The text was updated successfully, but these errors were encountered: