dcjones / quip

Compressing next-generation sequencing data with extreme prejudice.
http://www.cs.washington.edu/homes/dcjones/quip/
BSD 3-Clause "New" or "Revised" License
78 stars 10 forks source link

Compilation and linking problems #17

Closed ghuls closed 11 years ago

ghuls commented 11 years ago
make[2]: Entering directory `/compile/quip/src'
  CC     quiplib.o
quiplib.c:513:69: error: expected ';' after expression
        quip_error("Quip has not been compiled with bzip2 support.")
                                                                    ^
                                                                    ;
1 error generated.

src/quiplib.c

#ifdef HAVE_LIBBZ2
        BZFILE* bzf = BZ2_bzdopen(fileno(file), "rb");
        if (bzf == NULL) {
            quip_error("Cannot open bzipped file.");
        }
        return quip_in_open(quip_bzfile_reader, (void*) bzf, format,
                            filter, opts, ref);
#else
        quip_error("Quip has not been compiled with bzip2 support.")
#endif
    }
    else if (filter == QUIP_FILTER_NONE) {
        return quip_in_open(quip_file_reader, (void*) file, format,
                            filter, opts, ref);
    }
    else {
        quip_error("Unsupported input filter.");
        return NULL; /* unreachable */
    }

After this issue, another one pops up, when compiling fastqmd5 and bammd5:

$ cd test
$ rm -f fastqmd5
$ echo "  CCLD  " fastqmd5;clang  -std=gnu99 -Wall -Wextra -pedantic -g -O3 -D_GNU_SOURCE -DNDEBUG  -pthread    -L../src -lquip -o fastqmd5 fastqmd5.o md5.o  -lpthread    -lz
  CCLD   fastqmd5
clang: warning: argument unused during compilation: '-std=gnu99' [warn_drv_unused_argument]
fastqmd5.o: In function `main':
/home/gert/compile/quip/tests/fastqmd5.c:55: undefined reference to `quip_in_open_file'
/home/gert/compile/quip/tests/fastqmd5.c:62: undefined reference to `quip_read'
/home/gert/compile/quip/tests/fastqmd5.c:62: undefined reference to `quip_read'
/home/gert/compile/quip/tests/fastqmd5.c:73: undefined reference to `quip_in_close'
clang: error: linker command failed with exit code 1 (use -v to see invocation) [err_drv_command_failed]

Putting -lquip after the objects "-o fastqmd5 fastqmd5.o md5.o" fixes this compile problem:

$ cd test
$ rm -f fastqmd5
$ echo "  CCLD  " fastqmd5;clang  -std=gnu99 -Wall -Wextra -pedantic -g -O3 -D_GNU_SOURCE -DNDEBUG  -pthread -o fastqmd5 fastqmd5.o md5.o  -L../src -lquip -lpthread    -lz
  CCLD   fastqmd5
clang: warning: argument unused during compilation: '-std=gnu99' [warn_drv_unused_argument]
dcjones commented 11 years ago

Fixed now in version 1.1.6. Thanks for reporting.