[CMake] FindAVIFile.cmake, pthread runtime dependency on FreeBSD

Amitha Perera perera at cs.rpi.edu
Mon Oct 10 14:13:13 EDT 2005


I'm posting the message below on behalf of Fred Wheeler.


CMake list:

It seems that with FreeBSD 5.4-RELEASE, the aviplay
(/usr/local/lib/libaviplay.so from pkg_add) library depends on the
pthread (/usr/lib/libpthread.so) library.  I think FindAVIFile.cmake
should check for pthread and add it to AVIFILE_LIBRARIES, at least for
FreeBSD.

%%% This is the compile command CMake produces for VXL
%%% core/vidl/tests/vidl_test_all on this system with no changes.

mobile0% /usr/bin/g++     -Wall -g -fPIC  vidl_test.o    -o /usr/home/fred/dev/vxl_bld_bsd_dbg/core/vidl/tests/vidl_test_all  -L/usr/home/fred/dev/vxl_bld_bsd_dbg/lib -L/usr/local/lib -lvidl -lvbl -lvul -lvil -ljpeg -ltiff -lpng -ldcmtk -lz -lvcl -lm -lmpeg2 -lvo -laviplay -Wl,-rpath,/usr/home/fred/dev/vxl_bld_bsd_dbg/lib:/usr/local/lib
/usr/local/lib/libaviplay.so: undefined reference to `pthread_create'
/usr/local/lib/libSDL-1.1.so.7: undefined reference to `pthread_attr_init'
/usr/local/lib/libaviplay.so: undefined reference to `pthread_exit'
/usr/local/lib/libSDL-1.1.so.7: undefined reference to `pthread_cancel'
/usr/local/lib/libSDL-1.1.so.7: undefined reference to `pthread_setcanceltype'
/usr/local/lib/libSDL-1.1.so.7: undefined reference to `pthread_attr_setdetachstate'
/usr/local/lib/libaviplay.so: undefined reference to `pthread_join'
/usr/local/lib/libaviplay.so: undefined reference to `pthread_cond_timedwait'

%%% If I add -lpthread by hand the link completes.

mobile1% /usr/bin/g++     -Wall -g -fPIC  vidl_test.o    -o /usr/home/fred/dev/vxl_bld_bsd_dbg/core/vidl/tests/vidl_test_all  -L/usr/home/fred/dev/vxl_bld_bsd_dbg/lib -L/usr/local/lib -lvidl -lvbl -lvul -lvil -ljpeg -ltiff -lpng -ldcmtk -lz -lvcl -lm -lmpeg2 -lvo -laviplay -lpthread -Wl,-rpath,/usr/home/fred/dev/vxl_bld_bsd_dbg/lib:/usr/local/lib

%%% Some system information.

mobile0% uname -a
FreeBSD mobile.home.domain 5.4-RELEASE FreeBSD 5.4-RELEASE #0: Sun May  8 10:21:06 UTC 2005     root at harlow.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386

I'm using cmake from the FreeBSD ports (pkg_add), but I see that the
the CVS version of FindAVIFile.cmake does not mention thread either.

Fred Wheeler



More information about the CMake mailing list