cayek / TESS3

[DEPRECATED]
GNU General Public License v2.0
8 stars 3 forks source link

Build fails on linux #1

Closed BenjaminPeter closed 5 years ago

BenjaminPeter commented 8 years ago

Building TESS3 on ubuntu 16.04 I get the following error: x

[100%] Linking C executable TESS3
libbituintlib.a(thread_bituint.c.o): In function `thread_fct_bituint':
/data/programs/TESS3/tess3r/src/bituint/thread_bituint.c:55: undefined reference to `pthread_create'
/data/programs/TESS3/tess3r/src/bituint/thread_bituint.c:80: undefined reference to `pthread_join'
libmatrixlib.a(thread_matrix.c.o): In function `thread_fct_matrix':
/data/programs/TESS3/tess3r/src/matrix/thread_matrix.c:54: undefined reference to `pthread_create'
/data/programs/TESS3/tess3r/src/matrix/thread_matrix.c:79: undefined reference to `pthread_join'
collect2: error: ld returned 1 exit status
CMakeFiles/TESS3.dir/build.make:107: recipe for target 'TESS3' failed
make[2]: *** [TESS3] Error 1
CMakeFiles/Makefile2:77: recipe for target 'CMakeFiles/TESS3.dir/all' failed
make[1]: *** [CMakeFiles/TESS3.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

Google suggests that the -lpthread flag is missing/in the wrong spot. Indeed, manually editing the build/CMakeFiles/TESS3.dir/link.txt file to gcc -lm -lpthread -g -O3 -Wall -Wextra CMakeFiles/TESS3.dir/tess3r/src/main/main_sNMF.c.o -o TESS3 -rdynamic libsNMFlib.a liblapack.a libcreateDataSetlib.a libcrossEntropylib.a libiolib.a libnnlsmlib.a libbituintlib.a libstatslib.a libmatrix lib.a libspatialRegularizationToolslib.a libFstlib.a liblapack.a libstatslib.a -lstdc++ -lm -lpthread allows the file to compile.

cayek commented 5 years ago

tess3r is now hosted here: https://github.com/bcm-uga/TESS3_encho_sen