Skip to content

Commit

Permalink
Merge branch 'release/v1.1.12' into series-1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
gmarcais committed May 1, 2018
2 parents fa9b676 + 1e4186f commit 059ac1f
Show file tree
Hide file tree
Showing 63 changed files with 5,727 additions and 3,936 deletions.
15 changes: 10 additions & 5 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
AC_INIT([jellyfish], [1.1.10], [gmarcais@umd.edu])
AC_INIT([jellyfish], [1.1.12], [gmarcais@cs.cmu.edu])
AC_CANONICAL_HOST
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([subdir-objects foreign parallel-tests color-tests])
AM_SILENT_RULES([yes])
LT_INIT
AC_CONFIG_SRCDIR([jellyfish])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
AC_PROG_LIBTOOL

# Change default compilation flags
#AC_SUBST([ALL_CXXFLAGS], [-std=c++0x])
#CXXFLAGS="-std=c++0x $CXXFLAGS"
AC_LANG(C++)
AC_PROG_CXX

AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([config.h])

dnl define([concat], $1$2$3)dnl
dnl define([PC_FILE], concat([jellyfish-],AC_PACKAGE_VERSION,[.pc]))
Expand Down Expand Up @@ -46,7 +51,7 @@ AC_CHECK_TYPE([__int128],
# Check the version of strerror_r
AC_FUNC_STRERROR_R

AC_CHECK_HEADERS([execinfo.h])
AC_CHECK_HEADERS([execinfo.h sys/syscall.h])

AC_CHECK_MEMBER([siginfo_t.si_int],
[AC_DEFINE([HAVE_SI_INT], [1], [Define if siginfo_t.si_int exists])],
Expand Down
77 changes: 38 additions & 39 deletions gtest.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,45 +5,44 @@
# check_LTLIBRARIES = libgtest.la libgtest_main.la
check_LIBRARIES = libgtest.a libgtest_main.a

libgtest_a_SOURCES = unit_tests/gtest/src/gtest-all.cc
libgtest_main_a_SOURCES = unit_tests/gtest/src/gtest_main.cc
libgtest_main_a_LIBADD = libgtest.a
libgtest_a_CXXFLAGS = -I$(top_srcdir)/unit_tests/gtest \
-I$(top_srcdir)/unit_tests/gtest/include
libgtest_main_a_CXXFLAGS = -I$(top_srcdir)/unit_tests/gtest \
-I$(top_srcdir)/unit_tests/gtest/include

# gtest source files that we don't compile directly. They are
# #included by gtest-all.cc.
GTEST_SRC = unit_tests/gtest/src/gtest-death-test.cc \
unit_tests/gtest/src/gtest-filepath.cc \
unit_tests/gtest/src/gtest-internal-inl.h \
unit_tests/gtest/src/gtest-port.cc \
unit_tests/gtest/src/gtest-printers.cc \
unit_tests/gtest/src/gtest-test-part.cc \
unit_tests/gtest/src/gtest-typed-test.cc \
unit_tests/gtest/src/gtest.cc
libgtest_a_SOURCES = unit_tests/gtest/src/gtest.cc \
unit_tests/gtest/src/gtest-internal-inl.h \
unit_tests/gtest/src/gtest-printers.cc \
unit_tests/gtest/src/gtest-death-test.cc \
unit_tests/gtest/src/gtest-test-part.cc \
unit_tests/gtest/src/gtest-filepath.cc \
unit_tests/gtest/src/gtest-port.cc \
unit_tests/gtest/src/gtest-typed-test.cc
libgtest_a_SOURCES += unit_tests/gtest/include/gtest/gtest.h \
unit_tests/gtest/include/gtest/gtest-test-part.h \
unit_tests/gtest/include/gtest/gtest_prod.h \
unit_tests/gtest/include/gtest/gtest-param-test.h \
unit_tests/gtest/include/gtest/internal/gtest-param-util.h \
unit_tests/gtest/include/gtest/internal/gtest-linked_ptr.h \
unit_tests/gtest/include/gtest/internal/gtest-internal.h \
unit_tests/gtest/include/gtest/internal/gtest-filepath.h \
unit_tests/gtest/include/gtest/internal/gtest-port.h \
unit_tests/gtest/include/gtest/internal/gtest-type-util.h \
unit_tests/gtest/include/gtest/internal/custom/gtest.h \
unit_tests/gtest/include/gtest/internal/custom/gtest-port.h \
unit_tests/gtest/include/gtest/internal/custom/gtest-printers.h \
unit_tests/gtest/include/gtest/internal/gtest-port-arch.h \
unit_tests/gtest/include/gtest/internal/gtest-string.h \
unit_tests/gtest/include/gtest/internal/gtest-tuple.h \
unit_tests/gtest/include/gtest/internal/gtest-death-test-internal.h \
unit_tests/gtest/include/gtest/internal/gtest-param-util-generated.h \
unit_tests/gtest/include/gtest/gtest-death-test.h \
unit_tests/gtest/include/gtest/gtest-spi.h \
unit_tests/gtest/include/gtest/gtest-typed-test.h \
unit_tests/gtest/include/gtest/gtest-message.h \
unit_tests/gtest/include/gtest/gtest-printers.h \
unit_tests/gtest/include/gtest/gtest_pred_impl.h

EXTRA_DIST += $(GTEST_SRC)

# Headers, not installed
GTEST_I = unit_tests/gtest/include/gtest
noinst_HEADERS = $(GTEST_I)/gtest-death-test.h \
$(GTEST_I)/gtest-message.h \
$(GTEST_I)/gtest-param-test.h \
$(GTEST_I)/gtest-printers.h $(GTEST_I)/gtest-spi.h \
$(GTEST_I)/gtest-test-part.h \
$(GTEST_I)/gtest-typed-test.h $(GTEST_I)/gtest.h \
$(GTEST_I)/gtest_pred_impl.h $(GTEST_I)/gtest_prod.h \
$(GTEST_I)/internal/gtest-death-test-internal.h \
$(GTEST_I)/internal/gtest-filepath.h \
$(GTEST_I)/internal/gtest-internal.h \
$(GTEST_I)/internal/gtest-linked_ptr.h \
$(GTEST_I)/internal/gtest-param-util-generated.h \
$(GTEST_I)/internal/gtest-param-util.h \
$(GTEST_I)/internal/gtest-port.h \
$(GTEST_I)/internal/gtest-string.h \
$(GTEST_I)/internal/gtest-tuple.h \
$(GTEST_I)/internal/gtest-type-util.h
libgtest_main_a_SOURCES = unit_tests/gtest/src/gtest_main.cc
libgtest_a_CXXFLAGS = -I$(srcdir)/unit_tests/gtest/include \
-I$(srcdir)/unit_tests/gtest

libgtest_main_a_LIBADD = libgtest.a
libgtest_main_a_CXXFLAGS = -I$(srcdir)/unit_tests/gtest/include

EXTRA_DIST += unit_tests/gtest/COPYING
3 changes: 2 additions & 1 deletion jellyfish/cite.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,12 @@ const char *bibtex =
#include <iostream>
#include <fstream>
#include <stdlib.h>
#include <jellyfish/cite_cmdline.hpp>
#include <jellyfish/err.hpp>
#include <jellyfish/misc.hpp>
#include <jellyfish/fstream_default.hpp>

#include <jellyfish/cite_cmdline.hpp>

int cite_main(int argc, char *argv[])
{
cite_cmdline args(argc, argv);
Expand Down
10 changes: 5 additions & 5 deletions jellyfish/compacted_dumper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,23 +97,23 @@ namespace jellyfish {
file[file_len] = '\0';
int off = snprintf(file, file_len, "%s", file_prefix.c_str());
if(off < 0)
eraise(ErrorWriting) << "Error creating output path" << err::no;
throw ErrorWriting(err::msg() << "Error creating output path" << err::no);
if(off > 0 && off < file_len) {
int _off = snprintf(file + off, file_len - off, "_%uld", file_index++);
if(_off < 0)
eraise(ErrorWriting) << "Error creating output path" << err::no;
throw ErrorWriting(err::msg() << "Error creating output path" << err::no);
off += _off;
}
if(off >= file_len)
eraise(ErrorWriting) << "File path is too long";
throw ErrorWriting(err::msg() << "File path is too long");


// out.exceptions(std::ios::eofbit|std::ios::failbit|std::ios::badbit);
std::cerr << "Open " << file << std::endl;
out.open(file);
if(!out.good())
eraise(ErrorWriting) << "'" << file << "': "
<< "Can't open file for writing" << err::no;
throw ErrorWriting(err::msg() << "'" << file << "': "
<< "Can't open file for writing" << err::no);


out.write("JFLISTDN", 8);
Expand Down
32 changes: 16 additions & 16 deletions jellyfish/compacted_hash.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ namespace jellyfish {
header() { }
explicit header(char *ptr) {
if(memcmp(ptr, file_type, sizeof(type)))
eraise(ErrorReading) << "Bad file type '" << err::substr(ptr, sizeof(type))
<< "', expected '" << err::substr(file_type, sizeof(type)) << "'";
throw ErrorReading(err::msg() << "Bad file type '" << err::substr(ptr, sizeof(type))
<< "', expected '" << err::substr(file_type, sizeof(type)) << "'");
memcpy((void *)this, ptr, sizeof(struct header));
}
};
Expand Down Expand Up @@ -185,22 +185,22 @@ namespace jellyfish {
io = new std::ifstream(filename.c_str());
io->read((char *)&header, sizeof(header));
if(!io->good())
eraise(ErrorReading) << "'" << filename << "': "
<< "File truncated";
throw ErrorReading(err::msg() << "'" << filename << "': "
<< "File truncated");
if(memcmp(header.type, file_type, sizeof(header.type)))
eraise(ErrorReading) << "'" << filename << "': "
throw ErrorReading(err::msg() << "'" << filename << "': "
<< "Bad file type '"
<< err::substr(header.type, sizeof(header.type)) << "', expected '"
<< err::substr(file_type, sizeof(header.type)) << "'";
<< err::substr(file_type, sizeof(header.type)) << "'");

if(header.key_len > 64 || header.key_len == 0)
eraise(ErrorReading) << "'" << filename << "': "
throw ErrorReading(err::msg() << "'" << filename << "': "
<< "Invalid key length '"
<< header.key_len << "'";
<< header.key_len << "'");
if(header.size != (1UL << floorLog2(header.size)))
eraise(ErrorReading) << "'" << filename << "': "
throw ErrorReading(err::msg() << "'" << filename << "': "
<< "Size '" << header.size
<< "' is not a power of 2";
<< "' is not a power of 2");
key_len = (header.key_len / 8) + (header.key_len % 8 != 0);
record_len = key_len + header.val_len;
buffer_len = record_len * (_buff_len / record_len);
Expand All @@ -215,10 +215,10 @@ namespace jellyfish {
std::streamoff list_size = get_file_size(*io);
if(list_size != (std::streamoff)-1 &&
list_size - (header.distinct * record_len) != 0) {
eraise(ErrorReading) << "'" << filename << "': "
throw ErrorReading(err::msg() << "'" << filename << "': "
<< "Bad hash size '" << list_size
<< "', expected '"
<< (header.distinct * record_len) << "' bytes";
<< (header.distinct * record_len) << "' bytes");
}
}
key = val = 0;
Expand Down Expand Up @@ -322,9 +322,9 @@ namespace jellyfish {
canonical(false)
{
if(header.distinct != 0 && file.end() - base - header.distinct * record_len != 0)
eraise(ErrorReading) << "'" << file.path() << "': "
throw ErrorReading(err::msg() << "'" << file.path() << "': "
<< "Bad hash size '" << (file.end() - base)
<< "', expected '" << header.distinct * record_len << "' bytes";
<< "', expected '" << header.distinct * record_len << "' bytes");

get_key(0, &first_key);
first_pos = get_pos(first_key);
Expand All @@ -346,9 +346,9 @@ namespace jellyfish {
canonical(false)
{
if(header.distinct != 0 && file.end() - base - header.distinct * record_len != 0)
eraise(ErrorReading) << "'" << file.path() << "': "
throw ErrorReading(err::msg() << "'" << file.path() << "': "
<< "Bad hash size '" << (file.end() - base)
<< "', expected '" << header.distinct * record_len << "' bytes";
<< "', expected '" << header.distinct * record_len << "' bytes");

get_key(0, &first_key);
first_pos = get_pos(first_key);
Expand Down
1 change: 0 additions & 1 deletion jellyfish/concurrent_queues.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#define __JELLYFISH_CONCURRENT_QUEUES_HPP__

#include <sys/time.h>
#include <sys/syscall.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
Expand Down
3 changes: 2 additions & 1 deletion jellyfish/count_main.yaggo
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,5 @@ option("stream") {
flag; off; hidden }
arg("file") {
description "Sequence file(s) in fasta or fastq format"
c_string; multiple; typestr "path" }
c_string; multiple; typestr "path"
at_least 1 }
Loading

0 comments on commit 059ac1f

Please sign in to comment.