georgmartius / vid.stab

Video stabilization library
http://public.hronopik.de/vid.stab/
Other
842 stars 108 forks source link

openmp related linking issue with ffmpeg #34

Open pprkut opened 8 years ago

pprkut commented 8 years ago

I'm facing linking issues when trying to compile ffmpeg against an openmp enabled vid.stab (git master 97c6ae2). My system is Slackware-current, glibc 2.22, gcc 5.3.0.

This is the source file that ffmpeg's configure check uses to test vid.stab availability:

#include <vid.stab/libvidstab.h>
long check_vsMotionDetectInit(void) { return (long) vsMotionDetectInit; }
int main(void) { return 0; }

This is the command ffmpeg's configure uses to compile the test code:

gcc -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -std=c99 -fomit-frame-pointer -pthread -c -o test.o test.c

And this is the command it uses to link the test code:

gcc -Wl,--as-needed -Wl,-z,noexecstack -o test test.o -lvidstab -lm -lgomp -lm -llzma -lbz2 -lz -pthread

And finally, these are the errors I'm getting:

/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libvidstab.so: undefined reference to `_ZGVeN16vv_powf'
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libvidstab.so: undefined reference to `_ZGVcN4v_log'
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libvidstab.so: undefined reference to `_ZGVdN8v_expf'
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libvidstab.so: undefined reference to `_ZGVbN2v_exp'
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libvidstab.so: undefined reference to `_ZGVeN16v_logf'
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libvidstab.so: undefined reference to `_ZGVdN8vv_powf'
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libvidstab.so: undefined reference to `_ZGVcN4vv_pow'
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libvidstab.so: undefined reference to `_ZGVeN8vv_pow'
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libvidstab.so: undefined reference to `_ZGVdN4vv_pow'
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libvidstab.so: undefined reference to `_ZGVcN4v_exp'
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libvidstab.so: undefined reference to `_ZGVcN8v_logf'
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libvidstab.so: undefined reference to `_ZGVbN4vv_powf'
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libvidstab.so: undefined reference to `_ZGVcN8v_expf'
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libvidstab.so: undefined reference to `_ZGVdN4v_log'
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libvidstab.so: undefined reference to `_ZGVeN8v_log'
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libvidstab.so: undefined reference to `_ZGVcN8vv_powf'
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libvidstab.so: undefined reference to `_ZGVbN2v_log'
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libvidstab.so: undefined reference to `_ZGVbN4v_expf'
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libvidstab.so: undefined reference to `_ZGVbN4v_logf'
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libvidstab.so: undefined reference to `_ZGVeN16v_expf'
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libvidstab.so: undefined reference to `_ZGVdN8v_logf'
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libvidstab.so: undefined reference to `_ZGVeN8v_exp'
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libvidstab.so: undefined reference to `_ZGVbN2vv_pow'
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libvidstab.so: undefined reference to `_ZGVdN4v_exp'
collect2: error: ld returned 1 exit status

If I compile with -DUSE_OMP=0 everything links fine, so it's definitely something openmp related, but I can't figure out what exactly :-/

georgmartius commented 8 years ago

Hi,

Am 21. Februar 2016 14:06:44 MEZ, schrieb Heinz Wiesinger notifications@github.com:

I'm facing linking issues when trying to compile ffmpeg against an openmp enabled vid.stab (git master 97c6ae2). My system is Slackware-current, glibc 2.22, gcc 5.3.0.

This is the source file that ffmpeg's configure check uses to test vid.stab availability:

#include <vid.stab/libvidstab.h>
long check_vsMotionDetectInit(void) { return (long) vsMotionDetectInit;
}
int main(void) { return 0; }

This is the command ffmpeg's configure uses to compile the test code:

gcc -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
-D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -std=c99
-fomit-frame-pointer -pthread -c -o test.o test.c

And this is the command it uses to link the test code:

gcc -Wl,--as-needed -Wl,-z,noexecstack -o test test.o -lvidstab -lm
-lgomp -lm -llzma -lbz2 -lz -pthread

The error looks more like the math lib. Try to use -lm before lvidstab.
I can't check it right now.

Georg

And finally, these are the errors I'm getting:

/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libvidstab.so:
undefined reference to `_ZGVeN16vv_powf'
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libvidstab.so:
undefined reference to `_ZGVcN4v_log'
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libvidstab.so:
undefined reference to `_ZGVdN8v_expf'
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libvidstab.so:
undefined reference to `_ZGVbN2v_exp'
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libvidstab.so:
undefined reference to `_ZGVeN16v_logf'
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libvidstab.so:
undefined reference to `_ZGVdN8vv_powf'
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libvidstab.so:
undefined reference to `_ZGVcN4vv_pow'
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libvidstab.so:
undefined reference to `_ZGVeN8vv_pow'
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libvidstab.so:
undefined reference to `_ZGVdN4vv_pow'
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libvidstab.so:
undefined reference to `_ZGVcN4v_exp'
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libvidstab.so:
undefined reference to `_ZGVcN8v_logf'
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libvidstab.so:
undefined reference to `_ZGVbN4vv_powf'
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libvidstab.so:
undefined reference to `_ZGVcN8v_expf'
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libvidstab.so:
undefined reference to `_ZGVdN4v_log'
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libvidstab.so:
undefined reference to `_ZGVeN8v_log'
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libvidstab.so:
undefined reference to `_ZGVcN8vv_powf'
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libvidstab.so:
undefined reference to `_ZGVbN2v_log'
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libvidstab.so:
undefined reference to `_ZGVbN4v_expf'
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libvidstab.so:
undefined reference to `_ZGVbN4v_logf'
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libvidstab.so:
undefined reference to `_ZGVeN16v_expf'
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libvidstab.so:
undefined reference to `_ZGVdN8v_logf'
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libvidstab.so:
undefined reference to `_ZGVeN8v_exp'
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libvidstab.so:
undefined reference to `_ZGVbN2vv_pow'
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libvidstab.so:
undefined reference to `_ZGVdN4v_exp'
collect2: error: ld returned 1 exit status

If I compile with -DUSE_OMP=0 everything links fine, so it's definitely something openmp related, but I can't figure out what exactly :-/


Reply to this email directly or view it on GitHub: https://github.com/georgmartius/vid.stab/issues/34

Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.

pprkut commented 8 years ago

I tried that, no dice I'm afraid. Also tried with both -lm and -lgomp before -lvidstab, which doesn't work either, and neither with -fopenmp in the compile call.

Nezteb commented 4 years ago

This user's solution worked for me: https://github.com/georgmartius/vid.stab/issues/65#issuecomment-565986212