szpajder / dumphfdl

Multichannel HFDL decoder
GNU General Public License v3.0
125 stars 14 forks source link

Problem compiling dumphfdl #40

Closed sv1 closed 1 year ago

sv1 commented 1 year ago

I am trying to compile dumphfdl on Debian 12 but:

$ cmake ../ -- The C compiler identification is GNU 12.2.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Build type not specified: defaulting to Release -- Performing Test CC_HAS_PTHREAD -- Performing Test CC_HAS_PTHREAD - Success -- Performing Test CC_HAS_FFAST_MATH -- Performing Test CC_HAS_FFAST_MATH - Success -- Performing Test CC_HAS_FNO_COMMON -- Performing Test CC_HAS_FNO_COMMON - Success -- Looking for pthread_barrier_wait -- Looking for pthread_barrier_wait - found -- Found PkgConfig: /usr/bin/pkg-config (found version "1.8.1") -- Found liquid includes: /usr/include/liquid/liquid.h -- Found liquid library: /usr/lib/x86_64-linux-gnu/libliquid.so -- Performing Test LIQUIDDSP_VERSION_CHECK -- Performing Test LIQUIDDSP_VERSION_CHECK - Failed CMake Error at src/CMakeLists.txt:76 (message): LiquidDSP library is too old or missing (min. version required: 1.3.0)

-- Configuring incomplete, errors occurred! See also "/opt/linux/dumphfdl/build/CMakeFiles/CMakeOutput.log". See also "/opt/linux/dumphfdl/build/CMakeFiles/CMakeError.log".

$ cat /opt/linux/dumphfdl/build/CMakeFiles/CMakeError.log Performing C SOURCE FILE Test LIQUIDDSP_VERSION_CHECK failed with the following compile output: Change Dir: /opt/linux/dumphfdl/build/CMakeFiles/CMakeScratch/TryCompile-NYffxH

Run Build Command(s):/usr/bin/gmake -f Makefile cmTC_7fe3e/fast && /usr/bin/gmake -f CMakeFiles/cmTC_7fe3e.dir/build.make CMakeFiles/cmTC_7fe3e.dir/build gmake[1]: Entering directory '/opt/linux/dumphfdl/build/CMakeFiles/CMakeScratch/TryCompile-NYffxH' Building C object CMakeFiles/cmTC_7fe3e.dir/src.c.o /usr/bin/cc -DLIQUIDDSP_VERSION_CHECK -Wall -Wextra -o CMakeFiles/cmTC_7fe3e.dir/src.c.o -c /opt/linux/dumphfdl/build/CMakeFiles/CMakeScratch/TryCompile-NYffxH/src.c Linking C executable cmTC_7fe3e /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_7fe3e.dir/link.txt --verbose=1 /usr/bin/cc -Wall -Wextra -rdynamic CMakeFiles/cmTC_7fe3e.dir/src.c.o -o cmTC_7fe3e /usr/lib/x86_64-linux-gnu/libliquid.so gmake[1]: Leaving directory '/opt/linux/dumphfdl/build/CMakeFiles/CMakeScratch/TryCompile-NYffxH'

...and run output: /opt/linux/dumphfdl/build/CMakeFiles/CMakeScratch/TryCompile-NYffxH/src.c:8: error: invalid liquid runtime library header version : 1005000 library version : 1003002

Return value: 1 Source file was:

include

include

include <liquid/liquid.h>

if LIQUID_VERSION_NUMBER < 1003000

error LiquidDSP library is too old

endif

int main(void) { LIQUID_VALIDATE_LIBVERSION return 0; }

otm64 commented 1 year ago

I run dumphfdl on Debian 12 with no problems. Have you checked that the necessary libraries are installed? This what my build shows.

xxxx@HP-TUNN:~$ sudo apt-cache policy libliquid* libliquid1: Installerad: 1.5.0-2 Kandidat: 1.5.0-2 Versionstabell: 1.5.0-2 500 500 http://ftp.se.debian.org/debian bookworm/main amd64 Packages 100 /var/lib/dpkg/status libliquid-dev: Installerad: 1.5.0-2 Kandidat: 1.5.0-2 Versionstabell: 1.5.0-2 500 500 http://ftp.se.debian.org/debian bookworm/main amd64 Packages 100 /var/lib/dpkg/status

sv1 commented 1 year ago

I have the necessary libraries. I do not know why cmake can not find them

$ apt-cache policy libliquid* libliquid1: Installed: 1.5.0-2 Candidate: 1.5.0-2 Version table: 1.5.0-2 500 500 http://deb.debian.org/debian bookworm/main amd64 Packages 100 /var/lib/dpkg/status libliquid-dev: Installed: 1.5.0-2 Candidate: 1.5.0-2 Version table: 1.5.0-2 500 500 http://deb.debian.org/debian bookworm/main amd64 Packages 100 /var/lib/dpkg/status

szpajder commented 1 year ago

header version : 1005000 library version : 1003002

This looks suspicious. You probably have a stray old version of the library laying around somewhere.

sv1 commented 1 year ago

I can not find anything wrong

$ sudo find / -name "libliquid" /usr/share/doc/libliquid-dev /usr/share/doc/libliquid-dev/examples/libliquid_example.c /usr/share/doc/libliquid1 /usr/lib/x86_64-linux-gnu/libliquid.so /usr/lib/x86_64-linux-gnu/libliquid.so.1 /usr/lib/x86_64-linux-gnu/libliquid.a /var/cache/apt/archives/libliquid1_1.5.0-2_amd64.deb /var/cache/apt/archives/libliquid-dev_1.5.0-2_amd64.deb /var/lib/dpkg/info/libliquid-dev:amd64.md5sums /var/lib/dpkg/info/libliquid-dev:amd64.list /var/lib/dpkg/info/libliquid1:amd64.md5sums /var/lib/dpkg/info/libliquid1:amd64.shlibs /var/lib/dpkg/info/libliquid1:amd64.symbols /var/lib/dpkg/info/libliquid1:amd64.triggers /var/lib/dpkg/info/libliquid1:amd64.list

szpajder commented 1 year ago

Try the following test program test.c:

#include <stdio.h>
#include <liquid/liquid.h>
int main(void) { printf("%d\n", liquid_libversion_number()); return 0; }

Compile with: gcc -lliquid -o test test.c and run with ./test

Does it show 1005000 as it should, or 1003002?

You can also inspect the binary with ldd test to verify where is libliquid.so which is actually loaded during program run.

sv1 commented 1 year ago

I get an error

$ gcc -lliquid -o test test.c /usr/bin/ld: /tmp/ccyVQ9nP.o: in function main': test.c:(.text+0x5): undefined reference toliquid_libversion_number' collect2: error: ld returned 1 exit status

szpajder commented 1 year ago

How about gcc -o test test.c /usr/lib/x86_64-linux-gnu/libliquid.so ?

sv1 commented 1 year ago

Yeap!

$ gcc -o test test.c /usr/lib/x86_64-linux-gnu/libliquid.so $ ./test 1005000

szpajder commented 1 year ago

Then I don't get it. The cmake test program clearly got a different result from this function, as you've shown in your build logs

invalid liquid runtime library
header version : 1005000
library version : 1003002

You may also try the exact same test program:

#include <stdio.h>
#include <stdlib.h>
#include <liquid/liquid.h>
#if LIQUID_VERSION_NUMBER < 1003000
#error LiquidDSP library is too old
#endif
int main(void) { LIQUID_VALIDATE_LIBVERSION return 0; }
sv1 commented 1 year ago

$ gcc -o test2 test2.c /usr/lib/x86_64-linux-gnu/libliquid.so $ ./test2

$

sv1 commented 1 year ago

On Wed, 2023-07-12 at 12:16 -0700, Tomasz Lemiech wrote:

Try the following test program test.c:

#include <stdio.h>
#include <liquid/liquid.h>
int main(void) { printf("%d\n", liquid_libversion_number()); return 0; }

Compile with: gcc -lliquid -o test test.c and run with ./test

Changing the order gcc -o test test.c -lliquid seem to work

Does it show 1005000 as it should, or 1003002?

1005000

You can also inspect the binary with ldd test to verify where is libliquid.so which is actually loaded during program run.

ldd test linux-vdso.so.1 (0x00007fffbd920000) libliquid.so.1 => /lib/x86_64-linux-gnu/libliquid.so.1 (0x00007f15c0527000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f15c0346000) libfftw3f.so.3 => /lib/x86_64-linux-gnu/libfftw3f.so.3 (0x00007f15c0000000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f15c0267000) /lib64/ld-linux-x86-64.so.2 (0x00007f15c065f000)

szpajder commented 1 year ago

So either we're missing some key piece of info from you here or some information that you've submitted above does not match the reality.

I asked a friend who has Debian Bookworm to try it. It built fine.