change linking order such that pthread comes in the back
authorMartin Baeuml <baeuml@kit.edu>
Mon, 6 Oct 2014 11:48:29 +0000 (13:48 +0200)
committerMartin Baeuml <baeuml@kit.edu>
Mon, 6 Oct 2014 11:48:29 +0000 (13:48 +0200)
This resolves an error with the static gflags library which would
other wise not link properly with an undefined reference to symbol 'pthread_rwlock_wrlock@@GLIBC_2.2.5'
error under Ubuntu 14.04.

src/caffe/CMakeLists.txt

index 86c7c7e..0ff0412 100644 (file)
@@ -111,13 +111,13 @@ endif()
 target_link_libraries(caffe proto
         ${BLAS_LIBRARIES}
         ${Boost_LIBRARIES}
-        ${CMAKE_THREAD_LIBS_INIT}
         ${GFLAGS_LIBRARIES}
         ${GLOG_LIBRARIES}
         ${HDF5_LIBRARIES}
         ${LEVELDB_LIBS}
         ${LMDB_LIBRARIES}
         ${OpenCV_LIBS}
+        ${CMAKE_THREAD_LIBS_INIT}
 )
 
 #set output directory