Daniel Smith - 2012-09-26

Running 'make' on the 1.2.1 source code produces the following errors on my ubuntu 12.04 machine:

smithda@axiom:~/Downloads/FLASH-1.2.1$ make
cc -O2 -Wall -std=c99 -DMULTITHREADED   -c -o flash.o flash.c
cc -O2 -Wall -std=c99 -DMULTITHREADED   -c -o combine_reads.o combine_reads.c
cc -O2 -Wall -std=c99 -DMULTITHREADED   -c -o fastq.o fastq.c
cc -O2 -Wall -std=c99 -DMULTITHREADED   -c -o util.o util.c
cc -lz -lpthread  flash.o combine_reads.o fastq.o util.o   -o flash
util.o: In function `xgzopen':
util.c:(.text.unlikely+0x47c): undefined reference to `gzdopen'
util.c:(.text.unlikely+0x489): undefined reference to `gzopen'
util.c:(.text.unlikely+0x49a): undefined reference to `gzerror'
util.o: In function `xgzclose':
util.c:(.text.unlikely+0x4f3): undefined reference to `gzclose'
flash.o: In function `main':
flash.c:(.text.startup+0x6f1): undefined reference to `pthread_join'
flash.c:(.text.startup+0x862): undefined reference to `pthread_create'
fastq.o: In function `new_read_queue':
fastq.c:(.text+0xa8): undefined reference to `sem_init'
fastq.c:(.text+0xbc): undefined reference to `sem_init'
fastq.c:(.text+0xcc): undefined reference to `sem_init'
fastq.c:(.text+0x12d): undefined reference to `sem_init'
fastq.o: In function `start_fastq_reader':
fastq.c:(.text+0x297): undefined reference to `pthread_create'
fastq.o: In function `start_fastq_writer':
fastq.c:(.text+0x360): undefined reference to `pthread_create'
fastq.o: In function `gzip_getline':
fastq.c:(.text+0x404): undefined reference to `gzgets'
fastq.c:(.text+0x444): undefined reference to `gzeof'
fastq.c:(.text+0x455): undefined reference to `gzerror'
fastq.o: In function `write_read_compressed':
fastq.c:(.text+0x5c2): undefined reference to `gzwrite'
fastq.c:(.text+0x5d5): undefined reference to `gzerror'
fastq.o: In function `free_read_queue':
fastq.c:(.text+0x724): undefined reference to `sem_getvalue'
fastq.c:(.text+0x72c): undefined reference to `sem_destroy'
fastq.c:(.text+0x735): undefined reference to `sem_destroy'
fastq.c:(.text+0x73e): undefined reference to `sem_destroy'
fastq.o: In function `read_queue_get':
fastq.c:(.text+0x7bb): undefined reference to `sem_wait'
fastq.c:(.text+0x7c3): undefined reference to `sem_wait'
fastq.c:(.text+0x7e5): undefined reference to `sem_post'
fastq.c:(.text+0x7ed): undefined reference to `sem_post'
fastq.o: In function `read_queue_put':
fastq.c:(.text+0x832): undefined reference to `sem_wait'
fastq.c:(.text+0x83a): undefined reference to `sem_wait'
fastq.c:(.text+0x859): undefined reference to `sem_post'
fastq.o: In function `fastq_reader_thread_proc':
fastq.c:(.text+0xbfa): undefined reference to `gzclose'
fastq.o: In function `stop_fastq_readers_and_writers':
fastq.c:(.text+0xeca): undefined reference to `pthread_join'
fastq.c:(.text+0xedd): undefined reference to `pthread_join'
fastq.c:(.text+0xef0): undefined reference to `pthread_join'
fastq.c:(.text+0xf03): undefined reference to `pthread_join'
fastq.c:(.text+0xf12): undefined reference to `pthread_join'
fastq.o: In function `read_queue_put':
fastq.c:(.text+0x873): undefined reference to `sem_post'
collect2: ld returned 1 exit status
make: *** [flash] Error 1

However, I noticed that by manually entering the final cc command and moving the -lz and -lpthread flags to the end of the line, rather than the beginning, that the flash executable compiles without any problems:

cc flash.o combine_reads.o fastq.o util.o -o flash -lz -lpthread

Just thought I'd share as an FYI in case anyone else experiences the same problem.