FFmpeg build error pkg-config can't find x265 /usr/bin/ld: cannot find -lnuma: No such file or directory

456 Views Asked by At

I am trying to build ffmpeg with custom libraries from source code.

Every package in my script builds as it should but when it gets time to run the ffmpeg build using all of the packages it fails with a weird error code shown at the bottom of the ffmpeg build log.

BEGIN /home/jman/tmp/ffconf.JouXp6kg/test.c
    1   #include <x265.h>
    2   #include <stdint.h>
    3   long check_x265_api_get(void) { return (long) x265_api_get; }
    4   int main(void) { int ret = 0;
    5    ret |= ((intptr_t)check_x265_api_get) & 0xFFFF;
    6   return ret; }
END /home/jman/tmp/ffconf.JouXp6kg/test.c
gcc -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -DPIC -I/home/jman/Documents/ffmpeg-build/workspace/include -I/home/jman/Documents/ffmpeg-build/workspace/include/lilv-0 -I/usr/local/cuda/include -std=c11 -fomit-frame-pointer -fPIC -I/home/jman/Documents/ffmpeg-build/workspace/include -pthread -DLILV_STATIC -DSRATOM_STATIC -DSORD_STATIC -DSERD_STATIC -I/home/jman/Documents/ffmpeg-build/workspace/include/lilv-0 -I/home/jman/Documents/ffmpeg-build/workspace/include/sratom-0 -I/home/jman/Documents/ffmpeg-build/workspace/include -I/home/jman/Documents/ffmpeg-build/workspace/include/sord-0 -I/home/jman/Documents/ffmpeg-build/workspace/include/serd-0 -I/home/jman/Documents/ffmpeg-build/workspace/include -I/home/jman/Documents/ffmpeg-build/workspace/include/opus -I/home/jman/Documents/ffmpeg-build/workspace/include/opus -I/home/jman/Documents/ffmpeg-build/workspace/include -I/home/jman/Documents/ffmpeg-build/workspace/include/srt -I/home/jman/Documents/ffmpeg-build/workspace/include/svt-av1 -I/home/jman/Documents/ffmpeg-build/workspace/include -I/home/jman/Documents/ffmpeg-build/workspace/include -I/home/jman/Documents/ffmpeg-build/workspace/include -I/home/jman/Documents/ffmpeg-build/workspace/include -I/home/jman/Documents/ffmpeg-build/workspace/include -I/home/jman/Documents/ffmpeg-build/workspace/include -I/home/jman/Documents/ffmpeg-build/workspace/include -I/home/jman/Documents/ffmpeg-build/workspace/include -L/usr/lib/x86_64-linux-gnu -c -o /home/jman/tmp/ffconf.JouXp6kg/test.o /home/jman/tmp/ffconf.JouXp6kg/test.c
gcc -L/home/jman/Documents/ffmpeg-build/workspace/lib -L/usr/local/cuda/lib64 -Wl,--as-needed -Wl,-z,noexecstack -L/usr/lib/x86_64-linux-gnu -o /home/jman/tmp/ffconf.JouXp6kg/test /home/jman/tmp/ffconf.JouXp6kg/test.o -lx265 -lstdc++ -lm -lgcc_s -lgcc -lgcc_s -lgcc -lrt -ldl -lnuma -ldl -lpthread -lm -lz
/usr/bin/ld: cannot find -lnuma: No such file or directory
collect2: error: ld returned 1 exit status
ERROR: x265 not found using pkg-config

Does anyone know what this -lnuma is referring to?

I had no issues just a few days ago when I last ran my build script and then all of a sudden this issue appeared.

This is my build script in its entirety: FFmpeg-build.sh

Update: Per Allan Winds' instructions here is the output of:

find /usr/lib -name libnuma\* -ls

  4987897     48 -rw-r--r--   1 root     root        48152 Mar 24  2022 /usr/lib/x86_64-linux-gnu/libnuma.so.1.0.0
  4992286     76 -rw-r--r--   1 root     root        77086 Mar 24  2022 /usr/lib/x86_64-linux-gnu/libnuma.a
  4987896      0 lrwxrwxrwx   1 root     root           16 Dec 29 12:03 /usr/lib/x86_64-linux-gnu/libnuma.so.1 -> libnuma.so.1.0.0
  4992287      0 lrwxrwxrwx   1 root     root           16 Mar 24  2022 /usr/lib/x86_64-linux-gnu/libnuma.so -> libnuma.so.1.0.0
1

There are 1 best solutions below

4
On

It means your build failed when it's trying to link the numa library. The linker will search for the library using built-in paths along with the ones specified with -L. Specifically, -lnuma will search for libnuma.a and libnuma.so (per man ld(1)). The symlink link from the libnuma.so to the actual library ships libnuma-dev package. You install the package with:

sudo apt install libnuma-dev

The -dev package depends on the libnuma1 which is the actual library. You can, if you want, specify the versioned library directly with -l:libnuma.so.1 instead of -lnuma.