zhanxw / rvtests

Rare variant test software for next generation sequencing data
131 stars 41 forks source link

compile fails in ubuntu 14.04 #3

Closed mjsduncan closed 9 years ago

mjsduncan commented 9 years ago

hello! there seems to be a problem with "make" finding the header for pcreposix. below is the relevant compiler output, including an unrelated warning which might also be an issue:

/home/biocog/projects/rvtests/third/samtools/libbam.a(knetfile.o): In function `socket_connect':
/home/biocog/projects/rvtests/third/samtools/knetfile.c:98: warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking

Main.o: In function `main':
Main.cpp:(.text.startup+0x172d): undefined reference to `pcreposix_regcomp'
Main.cpp:(.text.startup+0x3992): undefined reference to `pcreposix_regfree'
Main.cpp:(.text.startup+0x48a2): undefined reference to `pcreposix_regerror'
/home/biocog/projects/rvtests/libVcf/lib-vcf.a(VCFExtractor.o): In function `VCFExtractor::passFilter()':
VCFExtractor.cpp:(.text+0x10db): undefined reference to `pcreposix_regexec'
VCFExtractor.cpp:(.text+0x1105): undefined reference to `pcreposix_regerror'
/home/biocog/projects/rvtests/libVcf/lib-vcf.a(VCFFilter.o): In function `VCFSiteFilter::~VCFSiteFilter()':
VCFFilter.cpp:(.text+0xb4): undefined reference to `pcreposix_regfree'
/home/biocog/projects/rvtests/libVcf/lib-vcf.a(VCFFilter.o): In function `VCFSiteFilter::~VCFSiteFilter()':
VCFFilter.cpp:(.text+0x124): undefined reference to `pcreposix_regfree'
collect2: error: ld returned 1 exit status
make[1]: *** [/home/biocog/projects/rvtests/executable/rvtest] Error 1
make[1]: Leaving directory `/home/biocog/projects/rvtests/src'
make: *** [release] Error 2

the pre-compiled binary seems to run fine on my machine but only on one core. i am working with very large files so multi-threading ability is necessary.

thank you for your excellent contribution to opensource bioinformatics software!

mike d

zhanxw commented 9 years ago

The warnings during linking will not affect the program.

I will look into the compiling errors related to pcreposix library.

To speed up analysis, you can use "--rangeList" option and spread out the computations for different chunks. For example, you can use "--rangeList 1:1" to analyze chromosome 1; concurrently you run rvtests with "--rangeList 2:1" to analyze chromosome 2.

mjsduncan commented 9 years ago

thank you for your prompt attention and for the tip!

zhanxw commented 9 years ago

I cannot replicate the errors related to pcreposix library on my side.

Can you paste the full compiling outputs?

mjsduncan commented 9 years ago

here is the output of make after a git pull and make clean:

biocog@topdog:~/projects/rvtests$ make clean
make -C /home/biocog/projects/rvtests/src clean
make[1]: Entering directory `/home/biocog/projects/rvtests/src'
rm -rf *.o *.d \
        /home/biocog/projects/rvtests/executable/rvtest \
        /home/biocog/projects/rvtests/executable/dbg/rvtest
make[1]: Leaving directory `/home/biocog/projects/rvtests/src'
make -C /home/biocog/projects/rvtests/vcfUtils clean
make[1]: Entering directory `/home/biocog/projects/rvtests/vcfUtils'
rm -rf *.o *.d \
        ../executable/vcf2plink ../executable/vcfSummary ../executable/vcfConcordance ../executable/vcf2geno ../executable/plink2vcf ../executable/vcfExtractSite ../executable/vcf2ld_gene ../executable/vcf2ld_window ../executable/vcfSummaryLite ../executable/vcfAnnoSummaryLite ../executable/vcfVariantSummaryLite ../executable/vcfIndvSummary ../executable/vcfPair ../executable/vcf2kinship ../executable/vcfPeek ../executable/vcf2ld_neighbor \
        ../executable/dbg/vcf2plink ../executable/dbg/vcfSummary ../executable/dbg/vcfConcordance ../executable/dbg/vcf2geno ../executable/dbg/plink2vcf ../executable/dbg/vcfExtractSite ../executable/dbg/vcf2ld_gene ../executable/dbg/vcf2ld_window ../executable/dbg/vcfSummaryLite ../executable/dbg/vcfAnnoSummaryLite ../executable/dbg/vcfVariantSummaryLite ../executable/dbg/vcfIndvSummary ../executable/dbg/vcfPair ../executable/dbg/vcf2kinship ../executable/dbg/vcfPeek ../executable/dbg/vcf2ld_neighbor
make[1]: Leaving directory `/home/biocog/projects/rvtests/vcfUtils'
biocog@topdog:~/projects/rvtests$ make
make -C /home/biocog/projects/rvtests/src release
make[1]: Entering directory `/home/biocog/projects/rvtests/src'
g++ -MMD -c -o Main.o -O2 -DNDEBUG -D__STDC_LIMIT_MACROS -std=c++0x -Wall -Wno-unused-function -fopenmp -static Main.cpp -I/home/biocog/projects/rvtests/third/samtools/bcftools -I/home/biocog/projects/rvtests/third/samtools -I/home/biocog/projects/rvtests/third/tabix -I/home/biocog/projects/rvtests/third/eigen -I/home/biocog/projects/rvtests/third/pcre/include -I/home/biocog/projects/rvtests/third/gsl/include -I/home/biocog/projects/rvtests/third/bzip2 -I/home/biocog/projects/rvtests/third/nlopt/include -I/home/biocog/projects/rvtests/regression -I/home/biocog/projects/rvtests/libVcf -I/home/biocog/projects/rvtests/base -I/home/biocog/projects/rvtests/libsrc -I. -I/home/biocog/projects/rvtests -D__ZLIB_AVAILABLE__
g++ -MMD -c -o DataConsolidator.o -O2 -DNDEBUG -D__STDC_LIMIT_MACROS -std=c++0x -Wall -Wno-unused-function -fopenmp -static DataConsolidator.cpp -I/home/biocog/projects/rvtests/third/samtools/bcftools -I/home/biocog/projects/rvtests/third/samtools -I/home/biocog/projects/rvtests/third/tabix -I/home/biocog/projects/rvtests/third/eigen -I/home/biocog/projects/rvtests/third/pcre/include -I/home/biocog/projects/rvtests/third/gsl/include -I/home/biocog/projects/rvtests/third/bzip2 -I/home/biocog/projects/rvtests/third/nlopt/include -I/home/biocog/projects/rvtests/regression -I/home/biocog/projects/rvtests/libVcf -I/home/biocog/projects/rvtests/base -I/home/biocog/projects/rvtests/libsrc -I. -I/home/biocog/projects/rvtests -D__ZLIB_AVAILABLE__
g++ -MMD -c -o ModelFitter.o -O2 -DNDEBUG -D__STDC_LIMIT_MACROS -std=c++0x -Wall -Wno-unused-function -fopenmp -static ModelFitter.cpp -I/home/biocog/projects/rvtests/third/samtools/bcftools -I/home/biocog/projects/rvtests/third/samtools -I/home/biocog/projects/rvtests/third/tabix -I/home/biocog/projects/rvtests/third/eigen -I/home/biocog/projects/rvtests/third/pcre/include -I/home/biocog/projects/rvtests/third/gsl/include -I/home/biocog/projects/rvtests/third/bzip2 -I/home/biocog/projects/rvtests/third/nlopt/include -I/home/biocog/projects/rvtests/regression -I/home/biocog/projects/rvtests/libVcf -I/home/biocog/projects/rvtests/base -I/home/biocog/projects/rvtests/libsrc -I. -I/home/biocog/projects/rvtests -D__ZLIB_AVAILABLE__
g++ -MMD -c -o TabixUtil.o -O2 -DNDEBUG -D__STDC_LIMIT_MACROS -std=c++0x -Wall -Wno-unused-function -fopenmp -static TabixUtil.cpp -I/home/biocog/projects/rvtests/third/samtools/bcftools -I/home/biocog/projects/rvtests/third/samtools -I/home/biocog/projects/rvtests/third/tabix -I/home/biocog/projects/rvtests/third/eigen -I/home/biocog/projects/rvtests/third/pcre/include -I/home/biocog/projects/rvtests/third/gsl/include -I/home/biocog/projects/rvtests/third/bzip2 -I/home/biocog/projects/rvtests/third/nlopt/include -I/home/biocog/projects/rvtests/regression -I/home/biocog/projects/rvtests/libVcf -I/home/biocog/projects/rvtests/base -I/home/biocog/projects/rvtests/libsrc -I. -I/home/biocog/projects/rvtests -D__ZLIB_AVAILABLE__
g++ -MMD -c -o ModelManager.o -O2 -DNDEBUG -D__STDC_LIMIT_MACROS -std=c++0x -Wall -Wno-unused-function -fopenmp -static ModelManager.cpp -I/home/biocog/projects/rvtests/third/samtools/bcftools -I/home/biocog/projects/rvtests/third/samtools -I/home/biocog/projects/rvtests/third/tabix -I/home/biocog/projects/rvtests/third/eigen -I/home/biocog/projects/rvtests/third/pcre/include -I/home/biocog/projects/rvtests/third/gsl/include -I/home/biocog/projects/rvtests/third/bzip2 -I/home/biocog/projects/rvtests/third/nlopt/include -I/home/biocog/projects/rvtests/regression -I/home/biocog/projects/rvtests/libVcf -I/home/biocog/projects/rvtests/base -I/home/biocog/projects/rvtests/libsrc -I. -I/home/biocog/projects/rvtests -D__ZLIB_AVAILABLE__
g++ -MMD -c -o Model.o -O2 -DNDEBUG -D__STDC_LIMIT_MACROS -std=c++0x -Wall -Wno-unused-function -fopenmp -static Model.cpp -I/home/biocog/projects/rvtests/third/samtools/bcftools -I/home/biocog/projects/rvtests/third/samtools -I/home/biocog/projects/rvtests/third/tabix -I/home/biocog/projects/rvtests/third/eigen -I/home/biocog/projects/rvtests/third/pcre/include -I/home/biocog/projects/rvtests/third/gsl/include -I/home/biocog/projects/rvtests/third/bzip2 -I/home/biocog/projects/rvtests/third/nlopt/include -I/home/biocog/projects/rvtests/regression -I/home/biocog/projects/rvtests/libVcf -I/home/biocog/projects/rvtests/base -I/home/biocog/projects/rvtests/libsrc -I. -I/home/biocog/projects/rvtests -D__ZLIB_AVAILABLE__
g++ -o /home/biocog/projects/rvtests/executable/rvtest Main.o DataConsolidator.o ModelFitter.o TabixUtil.o ModelManager.o Model.o  -O2 -DNDEBUG -D__STDC_LIMIT_MACROS -std=c++0x -Wall -Wno-unused-function -fopenmp -static /home/biocog/projects/rvtests/regression/lib-regression.a /home/biocog/projects/rvtests/libVcf/lib-vcf.a /home/biocog/projects/rvtests/base/lib-base.a /home/biocog/projects/rvtests/libsrc/lib-goncalo.a /home/biocog/projects/rvtests/third/samtools/bcftools/libbcf.a /home/biocog/projects/rvtests/third/samtools/libbam.a /home/biocog/projects/rvtests/third/tabix/libtabix.a /home/biocog/projects/rvtests/third/pcre/lib/libpcreposix.a /home/biocog/projects/rvtests/third/pcre/lib/libpcre.a /home/biocog/projects/rvtests/third/gsl/lib/libgsl.a /home/biocog/projects/rvtests/third/bzip2/libbz2.a /home/biocog/projects/rvtests/third/nlopt/lib/libnlopt.a  -lz -lm -lpthread
/home/biocog/projects/rvtests/third/samtools/libbam.a(knetfile.o): In function `socket_connect':
/home/biocog/projects/rvtests/third/samtools/knetfile.c:98: warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
Main.o: In function `main':
Main.cpp:(.text.startup+0x172d): undefined reference to `pcreposix_regcomp'
Main.cpp:(.text.startup+0x3992): undefined reference to `pcreposix_regfree'
Main.cpp:(.text.startup+0x48a2): undefined reference to `pcreposix_regerror'
/home/biocog/projects/rvtests/libVcf/lib-vcf.a(VCFExtractor.o): In function `VCFExtractor::passFilter()':
VCFExtractor.cpp:(.text+0x10db): undefined reference to `pcreposix_regexec'
VCFExtractor.cpp:(.text+0x1105): undefined reference to `pcreposix_regerror'
/home/biocog/projects/rvtests/libVcf/lib-vcf.a(VCFFilter.o): In function `VCFSiteFilter::~VCFSiteFilter()':
VCFFilter.cpp:(.text+0xb4): undefined reference to `pcreposix_regfree'
/home/biocog/projects/rvtests/libVcf/lib-vcf.a(VCFFilter.o): In function `VCFSiteFilter::~VCFSiteFilter()':
VCFFilter.cpp:(.text+0x124): undefined reference to `pcreposix_regfree'
collect2: error: ld returned 1 exit status
make[1]: *** [/home/biocog/projects/rvtests/executable/rvtest] Error 1
make[1]: Leaving directory `/home/biocog/projects/rvtests/src'
make: *** [release] Error 2
zhanxw commented 9 years ago

Can you please paste the outputs of "nm /home/biocog/projects/rvtests/third/pcre/lib/libpcreposix.a" and "nm /home/biocog/projects/rvtests/src/Main.o |grep regcomp" ?

mjsduncan commented 9 years ago
nm /home/biocog/projects/rvtests/third/pcre/lib/libpcreposix.a
libpcreposix_la-pcreposix.o:
0000000000000180 r eint
                 U free
                 U malloc
                 U pcre_compile2
                 U pcre_exec
                 U pcre_free
                 U pcre_fullinfo
00000000000000e0 r pstring
00000000000000e0 T regcomp
0000000000000000 T regerror
00000000000001a0 T regexec
00000000000000d0 T regfree
                 U __sprintf_chk
                 U strlen
                 U strncpy
 nm /home/biocog/projects/rvtests/src/Main.o |grep regcomp
                 U pcreposix_regcomp
zhanxw commented 9 years ago

Thanks. I am still puzzled about this problem: the 'pcreposix_regcomp' function does not exist in my codes. I don't know why it's in the Main.o file.

zhanxw commented 9 years ago

I doubt that this bug is caused by parallel compilation. Have you used "-j" option of make previously?

The errors you encounter was probably because a system-wide pcreposix.h is used, but it should actually be the PCRE library located in rvtests/third/pcre directory. Here is my proposed solution:

  1. make libclean
  2. make

Please let me know if this will fix the bug.

PS: A similar bug was discussed in http://www.apsis.ch/pound/pound_list/archive/2006/2006-03/1142850414000/index_html?fullMode=1

mjsduncan commented 9 years ago

source compiled correctly after removing pcre packages that were pre-empting source headers.