Hi,
Had trouble compiling with Linux and boost 1.55. Linker complains about undefined references to clock_gettime.
Exact error message is:
cd /home/jbeaulac/mgizapp/mgizapp-updated-0.7.3/src && /usr/local/bin/cmake -E cmake_link_script CMakeFiles/mgiza.dir/link.txt --verbose=1
/usr/bin/c++ CMakeFiles/mgiza.dir/main.cpp.o -o ../bin/mgiza -L/opt/boost-1.55/lib64 -L/home/jbeaulac/mgizapp/mgizapp-updated-0.7.3/lib -rdynamic ../lib/libmgiza.a /opt/boost-1.55/lib64/libboost_thread.a /opt/boost-1.55/lib64/libboost_system.a -lpthread -Wl,-rpath,/opt/boost-1.55/lib64:/home/jbeaulac/mgizapp/mgizapp-updated-0.7.3/lib:
/opt/boost-1.55/lib64/libboost_thread.a(thread.o): In function boost::this_thread::hiden::sleep_until(timespec const&)':
thread.cpp:(.text+0x20cb): undefined reference toclock_gettime'
thread.cpp:(.text+0x2141): undefined reference to clock_gettime'
thread.cpp:(.text+0x21ac): undefined reference toclock_gettime'
thread.cpp:(.text+0x2217): undefined reference to clock_gettime'
thread.cpp:(.text+0x2282): undefined reference toclock_gettime'
/opt/boost-1.55/lib64/libboost_thread.a(thread.o):thread.cpp:(.text+0x22ed): more undefined references to `clock_gettime' follow
I added the following in src/CMakeList.txt, ran cmake again and it then compiled successfully
if(UNIX AND NOT APPLE)
target_link_libraries(mgiza rt)
endif()
if(UNIX AND NOT APPLE)
target_link_libraries(hmmnorm rt)
endif()
if(UNIX AND NOT APPLE)
target_link_libraries(d4norm rt)
endif()
Think I found out why I had this issue, some Boost.Thread functions use Boost.Chrono starting with Boost 1.50.0:
http://www.boost.org/doc/libs/1_55_0/doc/html/thread/time.html
I attached a patch of a fix that probably makes sense. Tested with linux with boost 1.55 and boost 1.41 and it compiles.
Last edit: Jean-Francois 2014-03-18