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

Build rubberband cli failed with errors about openmp #90

Open
LilyWangLL opened this issue Jul 27, 2023 · 4 comments
Open

Build rubberband cli failed with errors about openmp #90

LilyWangLL opened this issue Jul 27, 2023 · 4 comments

Comments

@LilyWangLL
Copy link

I use rubberband 3.2.1 on vcpkg, when I build rubberband[cli] on Linux, it built failed with the following errors:

/usr/bin/c++  -o rubberband-r3 rubberband-r3.p/main_main.cpp.o -L/home/user/lily/0725/installed/x64-linux/debug/lib -Wl,--as-needed -Wl,--no-undefined -Wl,--start-group librubberband_objlib.a -lsleefdft -lsleef /home/user/lily/0725/installed/x64-linux/debug/lib/pkgconfig/../../lib/libsamplerate.a -lm -pthread /home/user/lily/0725/installed/x64-linux/debug/lib/pkgconfig/../../lib/libsndfile.a /home/user/lily/0725/installed/x64-linux/debug/lib/pkgconfig/../../lib/libmp3lame.a /home/user/lily/0725/installed/x64-linux/debug/lib/pkgconfig/../../lib/libFLAC.a /home/user/lily/0725/installed/x64-linux/debug/lib/pkgconfig/../../lib/libvorbisenc.a /home/user/lily/0725/installed/x64-linux/debug/lib/pkgconfig/../../lib/libvorbis.a /home/user/lily/0725/installed/x64-linux/debug/lib/pkgconfig/../../lib/libogg.a /home/user/lily/0725/installed/x64-linux/debug/lib/pkgconfig/../../lib/libopus.a /home/user/lily/0725/installed/x64-linux/debug/lib/pkgconfig/../../lib/libmpg123.a -lsleefdft -lsleef -Wl,--end-group
FAILED: rubberband-r3
/usr/bin/c++  -o rubberband-r3 rubberband-r3.p/main_main.cpp.o -L/home/user/lily/0725/installed/x64-linux/debug/lib -Wl,--as-needed -Wl,--no-undefined -Wl,--start-group librubberband_objlib.a -lsleefdft -lsleef /home/user/lily/0725/installed/x64-linux/debug/lib/pkgconfig/../../lib/libsamplerate.a -lm -pthread /home/user/lily/0725/installed/x64-linux/debug/lib/pkgconfig/../../lib/libsndfile.a /home/user/lily/0725/installed/x64-linux/debug/lib/pkgconfig/../../lib/libmp3lame.a /home/user/lily/0725/installed/x64-linux/debug/lib/pkgconfig/../../lib/libFLAC.a /home/user/lily/0725/installed/x64-linux/debug/lib/pkgconfig/../../lib/libvorbisenc.a /home/user/lily/0725/installed/x64-linux/debug/lib/pkgconfig/../../lib/libvorbis.a /home/user/lily/0725/installed/x64-linux/debug/lib/pkgconfig/../../lib/libogg.a /home/user/lily/0725/installed/x64-linux/debug/lib/pkgconfig/../../lib/libopus.a /home/user/lily/0725/installed/x64-linux/debug/lib/pkgconfig/../../lib/libmpg123.a -lsleefdft -lsleef -Wl,--end-group
/usr/bin/ld: /home/user/lily/0725/installed/x64-linux/debug/lib/libsleefdft.a(dftcommon.c.o): in function `initPlanMapLock':
/home/user/lily/0725/buildtrees/sleef/src/3.5.1-7f3a2e645a.clean/src/dft/dftcommon.c:183: undefined reference to `GOMP_critical_start'
/usr/bin/ld: /home/user/lily/0725/buildtrees/sleef/src/3.5.1-7f3a2e645a.clean/src/dft/dftcommon.c:187: undefined reference to `omp_init_lock'
/usr/bin/ld: /home/user/lily/0725/buildtrees/sleef/src/3.5.1-7f3a2e645a.clean/src/dft/dftcommon.c:183: undefined reference to `GOMP_critical_end'
/usr/bin/ld: /home/user/lily/0725/installed/x64-linux/debug/lib/libsleefdft.a(dftcommon.c.o): in function `PlanManager_loadMeasurementResultsP':
/home/user/lily/0725/buildtrees/sleef/src/3.5.1-7f3a2e645a.clean/src/dft/dftcommon.c:330: undefined reference to `omp_set_lock'
/usr/bin/ld: /home/user/lily/0725/buildtrees/sleef/src/3.5.1-7f3a2e645a.clean/src/dft/dftcommon.c:337: undefined reference to `omp_unset_lock'
/usr/bin/ld: /home/user/lily/0725/buildtrees/sleef/src/3.5.1-7f3a2e645a.clean/src/dft/dftcommon.c:354: undefined reference to `omp_unset_lock'
/usr/bin/ld: /home/user/lily/0725/installed/x64-linux/debug/lib/libsleefdft.a(dftcommon.c.o): in function `PlanManager_saveMeasurementResultsP':
/home/user/lily/0725/buildtrees/sleef/src/3.5.1-7f3a2e645a.clean/src/dft/dftcommon.c:365: undefined reference to `omp_set_lock'
/usr/bin/ld: /home/user/lily/0725/buildtrees/sleef/src/3.5.1-7f3a2e645a.clean/src/dft/dftcommon.c:371: undefined reference to `omp_unset_lock'
/usr/bin/ld: /home/user/lily/0725/buildtrees/sleef/src/3.5.1-7f3a2e645a.clean/src/dft/dftcommon.c:386: undefined reference to `omp_unset_lock'
/usr/bin/ld: /home/user/lily/0725/installed/x64-linux/debug/lib/libsleefdft.a(dftcommon.c.o): in function `PlanManager_loadMeasurementResultsT':
/home/user/lily/0725/buildtrees/sleef/src/3.5.1-7f3a2e645a.clean/src/dft/dftcommon.c:398: undefined reference to `omp_set_lock'
/usr/bin/ld: /home/user/lily/0725/buildtrees/sleef/src/3.5.1-7f3a2e645a.clean/src/dft/dftcommon.c:406: undefined reference to `omp_unset_lock'
/usr/bin/ld: /home/user/lily/0725/installed/x64-linux/debug/lib/libsleefdft.a(dftcommon.c.o): in function `PlanManager_saveMeasurementResultsT':
/home/user/lily/0725/buildtrees/sleef/src/3.5.1-7f3a2e645a.clean/src/dft/dftcommon.c:419: undefined reference to `omp_set_lock'
/usr/bin/ld: /home/user/lily/0725/buildtrees/sleef/src/3.5.1-7f3a2e645a.clean/src/dft/dftcommon.c:429: undefined reference to `omp_unset_lock'
/usr/bin/ld: /home/user/lily/0725/installed/x64-linux/debug/lib/libsleefdft.a(dft.c.o): in function `omp_thread_count':
/home/user/lily/0725/buildtrees/sleef/src/3.5.1-7f3a2e645a.clean/src/dft/dft.c:237: undefined reference to `GOMP_parallel'

It seems need link -fopenmp, but rubberband depends on sleef, and sleef have flags -fopenmp, the version of sleef is 3.5.1.
Could someone help me to take a look this issue? If need any logs, please ping me. Thanks in advance.

@cannam
Copy link
Member

cannam commented Jul 27, 2023

The Sleef support in Rubber Band is relatively new and hasn't had a huge amount of real-world exposure yet, but the build system does attempt to use pkg-config to identify any dependencies it may have.

I guess that isn't working here, which could mean

  1. Sleef's pkg-config doesn't declare this dependency, or
  2. Sleef lacks a pkg-config description entirely, or
  3. Sleef is not normally built to use OpenMP but for some reason it has been wrongly enabled, or
  4. Rubber Band's build system has some error in how it handles the dependency

Only the last would be fixable in Rubber Band itself. So it is perhaps worth checking what Sleef provides by way of pkg-config support.

(It isn't appropriate for Rubber Band's build system to simply guess at the flags or libraries required for any given dependency, at least when they are not universal - i.e. Sleef does not always use OpenMP and we do not want to add this dependency unnecessarily since Rubber Band never uses it itself.)

I guess you, or somebody, explicitly requested Sleef support when building Rubber Band? (It doesn't get used by default, not even when the libraries are present.) If so, presumably that means some custom Meson command line args have been provided already when configuring Rubber Band (such as -Dfft=sleef). So a workaround would be to add another argument that gives the OpenMP dependency explicitly, e.g. -Dcpp_link_args=-fopenmp. Or to drop the Sleef configuration and use the built-in FFT or another library.

@diizzyy
Copy link

diizzyy commented Jul 29, 2023

Sleef is kinda dead right now (shibatch/sleef#442) and there are quite a bit of bugs fixed (not all known though) using bleeding edge compared to release. Might be worth doing a quick evaluation if it offers any type of performance enhancement otherwise drop support completely.

@cannam
Copy link
Member

cannam commented Sep 15, 2023

I mentioned this in the linked vcpkg issue, but Sleef DFT is measurably faster than other open source options, so provided it produces the right results with Rubber Band (which in my limited tests it does) it could be a valuable option for certain uses even if it isn't actively supported.

But the above comment does suggest it might not be the wisest choice for general use when packaging Rubber Band.

@diizzyy
Copy link

diizzyy commented Sep 16, 2023

Have you considered KFR which seems pretty fast?
https://github.com/kfrlib/kfr

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

No branches or pull requests

3 participants