nh13 / DWGSIM

Whole Genome Simulator for Next-Generation Sequencing
GNU General Public License v2.0
92 stars 36 forks source link

Fix link error #5

Closed jts closed 11 years ago

jts commented 11 years ago

On my setup (Ubuntu 12.04, gcc 4.6.3) linking fails unless -lpthread is explicitly passed to the linker

nh13 commented 11 years ago

Closing as no response to #4

jts commented 11 years ago

I did not open issue 4 but I should have looked at the issue list before sending the pull request. I'll send my version of samtools next week.

nh13 commented 11 years ago

The git repo now uses samtools as a submodule, so make sure you use that feature when you update dwgsim.

jts commented 11 years ago

Cloning:

> git clone --recursive git://github.com/nh13/DWGSIM
Cloning into 'DWGSIM'...
remote: Counting objects: 569, done.
remote: Compressing objects: 100% (225/225), done.
remote: Total 569 (delta 362), reused 551 (delta 344)
Receiving objects: 100% (569/569), 136.26 KiB, done.
Resolving deltas: 100% (362/362), done.
Submodule 'samtools' (http://github.com/samtools/samtools.git) registered for path 'samtools'
Cloning into 'samtools'...
remote: Counting objects: 4017, done.
remote: Compressing objects: 100% (1953/1953), done.
remote: Total 4017 (delta 2253), reused 3789 (delta 2060)
Receiving objects: 100% (4017/4017), 3.64 MiB, done.
Resolving deltas: 100% (2253/2253), done.
Submodule path 'samtools': checked out '28391e5898804ce6b805016d8c676fdf61442eb3'

Building:

> make
[...]
gcc -g -Wall -O3  -o dwgsim_eval src/dwgsim_eval.o samtools/knetfile.o samtools/bgzf.o samtools/kstring.o samtools/bam_aux.o samtools/bam.o samtools/bam_import.o samtools/sam.o samtools/bam_index.o samtools/bam_pileup.o samtools/bam_lpileup.o samtools/bam_md.o samtools/razf.o samtools/faidx.o samtools/bedidx.o samtools/bam_sort.o samtools/sam_header.o samtools/bam_reheader.o samtools/kprobaln.o samtools/bam_cat.o -Lsamtools -lm -lz
samtools/bgzf.o: In function `bgzf_mt':
/home/jsimpson/work/scratch/DWGSIM/samtools/bgzf.c:445: undefined reference to `pthread_create'
samtools/bgzf.o: In function `mt_destroy':
/home/jsimpson/work/scratch/DWGSIM/samtools/bgzf.c:458: undefined reference to `pthread_join'
samtools/bam_sort.o: In function `sort_blocks':
/home/jsimpson/work/scratch/DWGSIM/samtools/bam_sort.c:421: undefined reference to `pthread_create'
/home/jsimpson/work/scratch/DWGSIM/samtools/bam_sort.c:423: undefined reference to `pthread_join'

Versions:

> gcc --version
gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

> lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 12.04.2 LTS
Release:    12.04
Codename:   precise
``