Skip to content

Commit

Permalink
Merge branch 'release/v2.3.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
gmarcais committed Dec 7, 2023
2 parents 0294169 + 005774a commit 68b995c
Show file tree
Hide file tree
Showing 27 changed files with 145 additions and 85 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/c-cpp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: C/C++ CI

on:
push:
branches: [ master, develop ]
pull_request:
branches: [ master, develop ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: dependencies
run: sudo DEBIAN_FRONTEND=noninteractive apt-get install -y yaggo gettext swig python3-dev ruby-dev libperl-dev
- name: autotools
run: autoreconf -fi
- name: configure
run: ./configure --enable-all-binding --enable-swig
- name: make
run: make -j2
- name: make check
run: make -j2 check
- name: make distcheck
run: make -j2 distcheck
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ ltmain.sh
*_cmdline.hpp
test-driver
build-*
*~
compile_commands.json
5 changes: 4 additions & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ACLOCAL_AMFLAGS = -I m4
DISTCHECK_CONFIGURE_FLAGS=--enable-swig --enable-all-binding

EXTRA_DIST = doc/jellyfish.pdf doc/jellyfish.man README LICENSE # jellyfish.spec
EXTRA_DIST = doc/jellyfish.pdf doc/jellyfish.man README LICENSE-BSD-3-Clause LICENSE-GPL-3.0 # jellyfish.spec
man1_MANS = doc/jellyfish.man

pkgconfigdir = $(libdir)/pkgconfig
Expand Down Expand Up @@ -228,3 +228,6 @@ include gtest.mk
# Print the value of a variable
print-%:
@echo -n $($*)

# Only compile the the check, don't run
check-programs: $(BUILT_SOURCES) $(check_PROGRAMS) $(check_LTLIBRARIES)
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
![CI workflow](https://github.com/gmarcais/Jellyfish/actions/workflows/c-cpp.yml/badge.svg)

# Jellyfish

## Overview
Expand Down
28 changes: 14 additions & 14 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
AC_INIT([jellyfish], [2.3.0], [gmarcais@umd.edu])
AC_INIT([jellyfish],[2.3.1],[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])
AC_CONFIG_SRCDIR([jellyfish])
AC_CONFIG_HEADERS([config.h])
AC_PROG_LIBTOOL
LT_INIT
AC_LIB_RPATH
PKG_PROG_PKG_CONFIG

Expand Down Expand Up @@ -41,9 +41,9 @@ AS_IF([test "x$UNIX2DOS" = "x"],

# Check for md5 or md5sum
AC_ARG_VAR([MD5], [Path to md5 hashing program])
AS_IF([test "x$MD5" = "x"], AC_CHECK_PROG([MD5], [md5sum], [md5sum]), [])
AS_IF([test "x$MD5" = "x"], AC_CHECK_PROG([MD5], [md5], [md5 -r]), [])
AS_IF([test "x$MD5" = "x"], AC_MSG_ERROR([Could not find md5 hashing program in your path]), [])
AS_IF([test "x$MD5" = "x"], [AC_CHECK_PROG([MD5], [md5sum], [md5sum])], [])
AS_IF([test "x$MD5" = "x"], [AC_CHECK_PROG([MD5], [md5], [md5 -r])], [])
AS_IF([test "x$MD5" = "x"], [AC_MSG_ERROR([Could not find md5 hashing program in your path])], [])

# Check for yaggo
AC_ARG_VAR([YAGGO], [Yaggo switch parser generator])
Expand Down Expand Up @@ -97,15 +97,15 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <mach-o/dyld.h>]],
[AC_DEFINE([HAVE_NSGETEXECUTABLEPATH], [1], [Used to find executable path on MacOS X])],
[AC_MSG_RESULT([no])])

AC_CHECK_HEADERS_ONCE([execinfo.h ext/stdio_filebuf.h sys/syscall.h])
AC_CHECK_HEADERS_ONCE([execinfo.h ext/stdio_filebuf.h sys/syscall.h sys/prctl.h])
AC_CHECK_MEMBER([siginfo_t.si_int],
[AC_DEFINE([HAVE_SI_INT], [1], [Define if siginfo_t.si_int exists])],
[], [[#include <signal.h>]])

# --enable-all-static
# Do not use libtool if building all static
AC_ARG_ENABLE([all-static],
[AC_HELP_STRING([--enable-all-static], [create statically linked executable])])
[AS_HELP_STRING([--enable-all-static],[create statically linked executable])])
STATIC_FLAGS=
AS_IF([test x$enable_all_static = xyes],
[AC_SUBST([STATIC_FLAGS], [-all-static])])
Expand All @@ -116,24 +116,24 @@ AS_IF([test x$enable_all_static = xyes],
maybe_swig=
# --enable-python-binding
AC_ARG_ENABLE([python-binding],
[AC_HELP_STRING([--enable-python-binding@<:@=PATH@:>@], [create SWIG python module and install in PATH])])
[AS_HELP_STRING([--enable-python-binding@<:@=PATH@:>@],[create SWIG python module and install in PATH (user or system site-packages if PATH=user|sys)])])
# --enable-ruby-binding
AC_ARG_ENABLE([ruby-binding],
[AC_HELP_STRING([--enable-ruby-binding@<:@=PATH@:>@], [create SWIG ruby module and install in PATH])])
[AS_HELP_STRING([--enable-ruby-binding@<:@=PATH@:>@],[create SWIG ruby module and install in PATH])])
# --enable-perl-binding
AC_ARG_ENABLE([perl-binding],
[AC_HELP_STRING([--enable-perl-binding@<:@=PATH@:>@], [create SWIG perl module and install in PATH])])
[AS_HELP_STRING([--enable-perl-binding@<:@=PATH@:>@],[create SWIG perl module and install in PATH])])
# --enable-all-binding
AC_ARG_ENABLE([all-binding],
[AC_HELP_STRING([--enable-all-binding@<:@=PATH@:>@], [create SWIG module for all languages and install in PATH])])
[AS_HELP_STRING([--enable-all-binding@<:@=PATH@:>@],[create SWIG module for all languages and install in PATH])])

# --enable-swig
AC_ARG_ENABLE([swig],
[AC_HELP_STRING([--enable-swig], [enable development of swig binding])])
[AS_HELP_STRING([--enable-swig],[enable development of swig binding])])
AS_IF([test x$enable_swig = xyes],
[AX_PKG_SWIG([3.0.0], [], [AC_MSG_ERROR([SWIG version 3 is required])])])
AS_IF([test -n "$SWIG"],
[SWIG_ENABLE_CXX])
[AX_SWIG_ENABLE_CXX])
AM_CONDITIONAL([HAVE_SWIG], [test -n "$SWIG"])

# Python binding setup
Expand All @@ -143,7 +143,7 @@ AM_COND_IF([PYTHON_BINDING],
[AS_IF([test x$enable_python_binding != xyes], [PYTHON_SITE_PKG=$enable_python_binding])]
[AX_PYTHON_DEVEL([], [$prefix])])
AC_ARG_ENABLE([python-deprecated],
[AC_HELP_STRING([--enable-python-deprecated], [enable the deprecated 'jellyfish' module (in addition to 'dna_jellyfish')])])
[AS_HELP_STRING([--enable-python-deprecated],[enable the deprecated 'jellyfish' module (in addition to 'dna_jellyfish')])])
AM_CONDITIONAL([PYTHON_DEPRECATED], [test -z "$enable_python_deprecated" -o x$enable_python_deprecated != xno])

# Ruby binding setup
Expand Down
9 changes: 3 additions & 6 deletions doc/jellyfish.man
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,8 @@
..
.TH "JELLYFISH" "1" "2010/10/1" "k\-mer counter " "k\-mer counter "
.SH NAME
jellyfish - software to count k\-mers in DNA sequences

.PP
Jellyfish
is a software to count k\-mers in DNA sequences.
.PP
.SH SYNOPSIS

jellyfish count
Expand Down Expand Up @@ -157,7 +154,7 @@ occurring many times will used multiple entries in the hash.
Important: the size of the couting field does NOT change the result,
it only impacts the amount of memory used. In particular, there is no
maximum value in the hash. Even if the counting field uses 5 bits, a
k\-mer occuring 2 million times will have a value reported of 2
k\-mer occurring 2 million times will have a value reported of 2
million (i.e., it is not capped at 2^5).
.PP
The \fB\-c\fP
Expand Down Expand Up @@ -459,7 +456,7 @@ Options (default value in (), *required):
.SS QHISTO
Usage: jellyfish qhisto [options] db:string
.PP
Create an histogram of k\-mer occurences
Create an histogram of k\-mer occurrences
.PP
Options (default value in (), *required):
.TP
Expand Down
2 changes: 1 addition & 1 deletion examples/count_in_file/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CC = g++
CXXFLAGS = $(shell pkg-config --cflags jellyfish-2.0) -std=c++0x -Wall -O3
LDFLAGS = -Wl,--rpath=$(shell pkg-config --libs-only-L jellyfish-2.0 | sed -e 's/-L//g')
LDFLAGS = -Wl,--rpath=$(shell pkg-config --libs-only-L jellyfish-2.0 | sed -e 's/ -L/ /g')
LDLIBS = $(shell pkg-config --libs jellyfish-2.0)

all: count_in_file
Expand Down
2 changes: 1 addition & 1 deletion examples/jf_count_dump/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CC = g++
CXXFLAGS = $(shell pkg-config --cflags jellyfish-2.0) -std=c++0x -Wall -O3
LDFLAGS = -Wl,--rpath=$(shell pkg-config --libs-only-L jellyfish-2.0 | sed -e 's/-L//g')
LDFLAGS = -Wl,--rpath=$(shell pkg-config --libs-only-L jellyfish-2.0 | sed -e 's/ -L/ /g')
LDLIBS = $(shell pkg-config --libs jellyfish-2.0)

all: jf_count_dump
Expand Down
2 changes: 1 addition & 1 deletion examples/query_per_sequence/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CC = g++
CXXFLAGS = $(shell pkg-config --cflags jellyfish-2.0) -std=c++0x -Wall -O3
LDFLAGS = -Wl,--rpath=$(shell pkg-config --libs-only-L jellyfish-2.0 | sed -e 's/-L//g')
LDFLAGS = -Wl,--rpath=$(shell pkg-config --libs-only-L jellyfish-2.0 | sed -e 's/ -L/ /g')
LDLIBS = $(shell pkg-config --libs jellyfish-2.0)

all: query_per_sequence
Expand Down
14 changes: 14 additions & 0 deletions include/jellyfish/generic_file_header.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,17 @@ class generic_file_header {

protected:
std::string get_hostname() const {
if(std::getenv("SOURCE_DATE_EPOCH"))
return "hostname";
struct utsname buf;
if(uname(&buf) == -1)
return "";
return buf.nodename;
}

std::string get_pwd() const {
if(std::getenv("SOURCE_DATE_EPOCH"))
return ".";
#ifdef PATH_MAX
size_t len = PATH_MAX;
#else
Expand All @@ -194,6 +198,16 @@ class generic_file_header {
std::string get_localtime() const {
time_t t = time(0);
std::string res(ctime(&t));
char *source_date_epoch = std::getenv("SOURCE_DATE_EPOCH");
if(source_date_epoch) {
std::istringstream iss(source_date_epoch);
iss >> t;
if(iss.fail() || !iss.eof()) {
std::cerr << "Error: Cannot parse SOURCE_DATE_EPOCH as integer\n";
exit(27);
}
res = asctime(gmtime(&t));
}
chomp(res);
return res;
}
Expand Down
2 changes: 1 addition & 1 deletion include/jellyfish/mer_dna.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ struct cmask<U, len, 0> {

// Fast reverse complement of one word through bit tweedling.
inline uint32_t word_reverse_complement(uint32_t w) {
typedef uint64_t U;
typedef uint32_t U;
w = ((w >> 2) & cmask<U, 2 >::v) | ((w & cmask<U, 2 >::v) << 2);
w = ((w >> 4) & cmask<U, 4 >::v) | ((w & cmask<U, 4 >::v) << 4);
w = ((w >> 8) & cmask<U, 8 >::v) | ((w & cmask<U, 8 >::v) << 8);
Expand Down
2 changes: 0 additions & 2 deletions include/jellyfish/sorted_dumper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ class sorted_dumper : public dumper_t<storage_t>, public thread_exec {
std::ostringstream buffer;
heap_type heap(ary_->max_reprobe_offset());
token_type& token = ring_[i];
size_t count = 0;
typename storage_t::key_type key;

for(size_t id = i; id * block_info.second < ary_->size(); id += nb_threads_) {
Expand All @@ -85,7 +84,6 @@ class sorted_dumper : public dumper_t<storage_t>, public thread_exec {
heap_item item = heap.head();
if(item->val_ >= this->min() && item->val_ <= this->max())
static_cast<D*>(this)->write_key_value_pair(buffer, item);
++count;
heap.pop();
if(it.next())
heap.push(it);
Expand Down
9 changes: 9 additions & 0 deletions lib/generator_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
#include <config.h>

#include <unistd.h>
#ifdef HAVE_SYS_PRCTL_H
#include <sys/prctl.h>
#endif
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/wait.h>
Expand Down Expand Up @@ -119,6 +122,9 @@ void generator_manager_base::start() {


// In child
#ifdef PR_SET_PDEATHSIG
prctl(PR_SET_PDEATHSIG, SIGHUP);
#endif
if(setup_signal_handlers() == -1)
exit(EXIT_FAILURE);
start_commands(); // child start commands
Expand Down Expand Up @@ -190,6 +196,9 @@ void generator_manager_base::start_one_command(const std::string& command, int p
}

// In child
#ifdef PR_SET_PDEATHSIG
prctl(PR_SET_PDEATHSIG, SIGHUP);
#endif
int dev_null = open_cloexec("/dev/null", O_RDONLY);
if(dev_null != -1)
dup2(dev_null, 0);
Expand Down
2 changes: 1 addition & 1 deletion lib/jsoncpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1733,7 +1733,7 @@ Value::CZString::operator<( const CZString &other ) const
bool
Value::CZString::operator==( const CZString &other ) const
{
if ( cstr_ )
if ( cstr_ && other.cstr_ )
return strcmp( cstr_, other.cstr_ ) == 0;
return index_ == other.index_;
}
Expand Down
14 changes: 7 additions & 7 deletions m4/m4-ax_ext.m4
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
# and this notice are preserved. This file is offered as-is, without any
# warranty.

#serial 17
#serial 19

AC_DEFUN([AX_EXT],
[
Expand Down Expand Up @@ -160,22 +160,22 @@ AC_DEFUN([AX_EXT],
ax_cv_have_sse_os_support_ext=no,
if test "$((0x$edx_cpuid1>>25&0x01))" = 1; then
AC_LANG_PUSH([C])
AC_TRY_RUN([
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <signal.h>
#include <stdlib.h>
/* No way at ring1 to ring3 in protected mode to check the CR0 and CR4
control registers directly. Execute an SSE instruction.
If it raises SIGILL then OS doesn't support SSE based instructions */
void sig_handler(int signum){ exit(1); }
int main(){
int main(void){
signal(SIGILL, sig_handler);
/* SSE instruction xorps %xmm0,%xmm0 */
__asm__ __volatile__ (".byte 0x0f, 0x57, 0xc0");
return 0;
}],
ax_cv_have_sse_os_support_ext=yes,
ax_cv_have_sse_os_support_ext=no,
ax_cv_have_sse_os_support_ext=no)
}]])],
[ax_cv_have_sse_os_support_ext=yes],
[ax_cv_have_sse_os_support_ext=no],
[ax_cv_have_sse_os_support_ext=no])
AC_LANG_POP([C])
fi
])
Expand Down
Loading

0 comments on commit 68b995c

Please sign in to comment.