diff --git a/Makefile b/Makefile index 1d3dc6e..796e582 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,8 @@ - CC = g++ -Wall -ggdb CC = g++ -pg CC = g++ -# without OpenMP - +# default with OpenMP # with OpenMP # in command line: # make openmp=yes @@ -14,6 +12,21 @@ else CCFLAGS = -fopenmp endif +#LDFLAGS = -static -lz -o +#LDFLAGS = /usr/lib/x86_64-linux-gnu/libz.a -o + +# default with zlib +# without zlib +# in command line: +# make zlib=no +ifeq ($(zlib),no) + CCFLAGS += + LDFLAGS += -o +else + CCFLAGS += -DWITH_ZLIB + LDFLAGS += -lz -o +endif + # support debugging # in command line: # make debug=yes @@ -28,9 +41,6 @@ ifdef MAX_SEQ CCFLAGS += -DMAX_SEQ=$(MAX_SEQ) endif -#LDFLAGS = -static -lz -o -LDFLAGS += -lz -o - PROGS = cd-hit cd-hit-est cd-hit-2d cd-hit-est-2d cd-hit-div cd-hit-454 # Propagate hardening flags diff --git a/README b/README index 0cedd5c..70e44f1 100644 --- a/README +++ b/README @@ -13,10 +13,10 @@ don't have zlib, please install it first. How to compile 1. Compile with multi-threading support (default): make 2. Compile without multi-threading support (if you are on very old systems): make openmp=no - + 3. Compile without zlib (if you can not install zlib): make zlib=no Having problems to compile -Please download the pre-compiled binary packages for Linux systems +Please contact the author For cd-hit-auxtools diff --git a/cdhit-common.c++ b/cdhit-common.c++ index ecd8e30..9582f22 100644 --- a/cdhit-common.c++ +++ b/cdhit-common.c++ @@ -1689,7 +1689,7 @@ void Sequence::PrintInfo( int id, FILE *fout, const Options & options, char *buf // tot_length is the total bytes of sequence record void SequenceDB::Readgz( const char *file, const Options & options ) { - +#ifdef WITH_ZLIB Sequence one; Sequence des; gzFile fin = gzopen(file, "r"); @@ -1766,16 +1766,12 @@ void SequenceDB::Readgz( const char *file, const Options & options ) one.tot_length += strlen(buffer); one += buffer; } } -#if 0 - int i, n = 0; - for(i=0; i #include #include + +#ifdef WITH_ZLIB #include +#endif #include #include