Skip to content

Commit

Permalink
Moved PacBio, prepare, ufasta, quorum, SuperReads, and SOAPdenovo2 mo…
Browse files Browse the repository at this point in the history
…dule into a global compilation module
  • Loading branch information
Guillaume Marçais committed Jun 26, 2015
1 parent 600bc82 commit 9994ce4
Show file tree
Hide file tree
Showing 9 changed files with 145 additions and 32 deletions.
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,12 @@
autom4te.cache
build
*.in
config.*
aclocal.m4
configure
depcomp
install-sh
missing
autom4te.cache
ltmain.sh
compile
57 changes: 34 additions & 23 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,19 @@ VERSION = 3.0.1
NCPU = $(shell grep -c '^processor' /proc/cpuinfo 2>/dev/null || sysctl hw.ncpu 2>/dev/null || echo 1)

# Component versions
COMPONENTS = jellyfish SuperReads quorum PacBio CA CA8 SOAPdenovo2 prepare ufasta
COMPONENTS = jellyfish CA CA8 global # PacBio prepare ufasta quorum SuperReads SOAPdenovo2

##################################################################
# Rules for compilling a working distribution in build (or DEST) #
##################################################################
UPD_INSTALL = $(shell which install) -C
PWD = $(shell pwd)
PREF ?= $(PWD)
# PREF ?= .
BUILDDIR ?= $(PREF)/build
SUBDIRS = $(foreach i,$(COMPONENTS),$(BUILDDIR)/$(i))
check_config = test -f $@/Makefile -a $@/Makefile -nt $(1)/configure.ac || (cd $@; $(PWD)/$(1)/configure --prefix=$(BUILDDIR)/inst $(2))
global_config = test -f $@/Makefile -a $@/Makefile -nt configure.ac || (cd $@; $(PWD)/configure --prefix=$(BUILDDIR)/inst $(1))
make_install = $(MAKE) -C $@ -j $(NCPU) install INSTALL="$(UPD_INSTALL)"

# Get info of where things are installed
Expand All @@ -36,24 +38,34 @@ $(BUILDDIR)/jellyfish: jellyfish/configure
$(call check_config,jellyfish,--program-suffix=-2.0)
$(call make_install)

$(BUILDDIR)/SuperReads: SuperReads/configure
mkdir -p $@
$(call check_config,SuperReads,PKG_CONFIG_PATH=$(PKGCONFIGDIR))
$(call make_install)
# $(BUILDDIR)/SuperReads: SuperReads/configure
# mkdir -p $@
# $(call check_config,SuperReads,PKG_CONFIG_PATH=$(PKGCONFIGDIR))
# $(call make_install)

$(BUILDDIR)/quorum: quorum/configure
mkdir -p $@
$(call check_config,quorum,--enable-relative-paths JELLYFISH=$(BINDIR)/jellyfish-2.0 PKG_CONFIG_PATH=$(PKGCONFIGDIR))
$(call make_install)
# $(BUILDDIR)/quorum: quorum/configure
# mkdir -p $@
# $(call check_config,quorum,--enable-relative-paths JELLYFISH=$(BINDIR)/jellyfish-2.0 PKG_CONFIG_PATH=$(PKGCONFIGDIR))
# $(call make_install)

$(BUILDDIR)/PacBio: PacBio/configure
mkdir -p $@
$(call check_config,PacBio,PKG_CONFIG_PATH=$(PKGCONFIGDIR))
$(call make_install)
# $(BUILDDIR)/PacBio: PacBio/configure
# mkdir -p $@
# $(call check_config,PacBio,PKG_CONFIG_PATH=$(PKGCONFIGDIR))
# $(call make_install)

$(BUILDDIR)/ufasta: ufasta/configure
# $(BUILDDIR)/ufasta: ufasta/configure
# mkdir -p $@
# $(call check_config,ufasta,PKG_CONFIG_PATH=$(PKGCONFIGDIR))
# $(call make_install)

# $(BUILDDIR)/prepare: prepare/configure
# mkdir -p $@
# $(call check_config,prepare,)
# $(call make_install)

$(BUILDDIR)/global: ./configure
mkdir -p $@
$(call check_config,ufasta,PKG_CONFIG_PATH=$(PKGCONFIGDIR))
$(call global_config,PKG_CONFIG_PATH=$(PKGCONFIGDIR) --enable-relative-paths JELLYFISH=$(BINDIR)/jellyfish-2.0)
$(call make_install)

$(BUILDDIR)/CA: CA/build-default/tup.config CA/.tup/db
Expand All @@ -76,14 +88,9 @@ CA/build-default/tup.config:
echo -n "CONFIG_JELLYFISH_LIBS="; pkg-config --libs jellyfish-2.0 \
) > $@

$(BUILDDIR)/prepare: prepare/configure
mkdir -p $@
$(call check_config,prepare,)
$(call make_install)

$(BUILDDIR)/SOAPdenovo2: SOAPdenovo2/build-default/tup.config SOAPdenovo2/.tup/db
cd SOAPdenovo2; tup upd
mkdir -p $(BUILDDIR)/inst/bin; install -t $(BUILDDIR)/inst/bin -C SOAPdenovo2/build-default/SOAPdenovo-63mer SOAPdenovo2/build-default/SOAPdenovo-127mer
# $(BUILDDIR)/SOAPdenovo2: SOAPdenovo2/build-default/tup.config SOAPdenovo2/.tup/db
# cd SOAPdenovo2; tup upd
# mkdir -p $(BUILDDIR)/inst/bin; install -t $(BUILDDIR)/inst/bin -C SOAPdenovo2/build-default/SOAPdenovo-63mer SOAPdenovo2/build-default/SOAPdenovo-127mer

SOAPdenovo2/build-default/tup.config:
mkdir -p $(dir $@)
Expand Down Expand Up @@ -122,6 +129,10 @@ clean_distdir:
$(DISTDIST)/%:
$(MAKE) -C $(BUILDDIR)/$* -j $(NCPU) distdir distdir="$@"

$(DISTDIST)/global:
#$(MAKE) -C $(BUILDDIR)/global -j $(NCPU) distdir distdir=$(DISTDIST)
cd $(BUILDDIR)/global; make -j $(NCPU) dist && tar zxf global*.tar.gz -C $(DISTDIST)

# For the module that do not support 'make distdir', get a verbatim copy from git
define GIT_TAR =
$(DISTDIST)/$1:
Expand Down
1 change: 1 addition & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SUBDIRS = prepare ufasta PacBio quorum SuperReads SOAPdenovo2
2 changes: 1 addition & 1 deletion SOAPdenovo2
Submodule SOAPdenovo2 updated from bd0b24 to ea637a
2 changes: 1 addition & 1 deletion SuperReads
Submodule SuperReads updated from 6e9ad2 to ffab6a
88 changes: 88 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
AC_INIT([global], [1], [gmarcais@umd.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([.])
AC_CONFIG_HEADERS([config.h])
AC_PROG_LIBTOOL

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

# Checks for libraries.
AC_CHECK_LIB([pthread], [pthread_create])
AC_SEARCH_LIBS([clock_gettime], [rt], [AC_DEFINE([HAVE_CLOCK_GETTIME], [1], [Define to 1 if you have the `clock_gettime' function])])

# Checks for Jellyfish module
PKG_CHECK_MODULES([JELLYFISH2_0], [jellyfish-2.0])
JELLYFISH_VERSION=$(pkg-config --modversion jellyfish-2.0)
AC_SUBST([JELLYFISH_VERSION])
AC_ARG_VAR([JELLYFISH], [Jellyfish executable absolute path (default to looking in PATH)])
AS_IF([test "x$JELLYFISH" = "x"], [AC_PATH_PROG([JELLYFISH], [jellyfish], [false])])

# On MacOS X, use _NSGetExecutablePath to find path to own executable
AC_MSG_CHECKING([for _NSGetExecutablePath])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <mach-o/dyld.h>]],
[[_NSGetExecutablePath(0, 0);]])],
[AC_MSG_RESULT([yes])]
[AC_DEFINE([HAVE_NSGETEXECUTABLEPATH], [1], [Used to find executable path on MacOS X])],
[AC_MSG_RESULT([no])])

# AC_CHECK_LIB(boost_regex, toto)
AC_MSG_CHECKING([for libboost_regex])
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <boost/regex.hpp>],
[boost::regex regexp])],
[AC_MSG_RESULT([yes])] [AC_DEFINE([HAVE_BOOST_REGEX], 1, [Have libboost_regex])]
[have_boost=true],
[AC_MSG_RESULT([no])]
[have_boost=false])
AM_CONDITIONAL([BOOST_REGEX], [test x$have_boost = xtrue])

# Checks for library functions.
AC_FUNC_MMAP
AC_CHECK_FUNCS([mremap])

# Use valgrind to check memory allocation with mmap
AC_ARG_ENABLE([valgrind],
[AS_HELP_STRING([--enable-valgrind], [Instrument mmap memory allocation with valgrind])])
AS_IF([test "x$enable_valgrind" = xyes],
[AC_DEFINE([HAVE_VALGRIND], [1], [Define is using Valgrind])]
[PKG_CHECK_MODULES([VALGRIND], [valgrind >= 1.8.0])])

# Check for builtin functions
AC_MSG_CHECKING([for __builtin_prefetch])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[int x = 0;]],
[[__builtin_prefetch(&x);]])],
[AC_MSG_RESULT([yes])]
[AC_DEFINE([HAVE_BUILTIN_PREFETCH], [1], [Defined if __builtin_prefetch is supported])],
[AC_MSG_RESULT([no])])

# From Quorum
# --enable-relative-paths
AC_ARG_ENABLE([relative-paths],
[AC_HELP_STRING([--enable-relative-paths], [store relative paths in quorum Perl script])])
AM_CONDITIONAL([RELATIVE_PATHS], [test x$enable_relative_paths = xyes])

# --with-relative-jf-path
AC_ARG_WITH([relative-jf-path],
[AC_HELP_STRING([--with-relative-jf-path], [relative path from quorum to jellyfish (use an absolute path if not given. default to "." if given with no argument)])],
[case "$withval" in (yes) with_relative_jf_path="jellyfish" ;; (no) with_relative_jf_path= ;; (*) with_relative_jf_path=$withval/jellyfish ;; esac],
[with_relative_jf_path= ])
AC_SUBST([RELATIVE_JF_PATH], $with_relative_jf_path)
AM_CONDITIONAL([HAVE_RELATIVE_JF_PATH], [test x$with_relative_jf_path != x])

AC_CHECK_TYPE([__int128],
[AC_DEFINE([HAVE_INT128], [1], [Define if type __int128 is supported])])


# Check for yaggo
AC_ARG_VAR([YAGGO], [Yaggo switch parser generator])
AS_IF([test "x$YAGGO" = "x"], [AC_PATH_PROG([YAGGO], [yaggo], [false])])

AC_CONFIG_FILES([Makefile prepare/Makefile ufasta/Makefile PacBio/Makefile quorum/Makefile SuperReads/Makefile SOAPdenovo2/Makefile])
AC_OUTPUT
13 changes: 8 additions & 5 deletions install.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,18 @@ BINDIR=$(make -s -C $JF_DIR print-bindir)
LIBDIR=$(make -s -C $JF_DIR print-libdir)
PATH="$BINDIR:$PATH"

(cd global-1 && ./configure --prefix=$DEST && make -j $NUM_THREADS install)

(cd CA/src && make LD_RUN_PATH="$LIBDIR")
(cd CA8/kmer && make install)
(cd CA8/samtools && make)
(cd CA8/src && make)
(cd $SR_DIR && ./configure --prefix=$DEST && make -j $NUM_THREADS install)
(cd $QR_DIR && ./configure --prefix=$DEST --enable-relative-paths && make -j $NUM_THREADS install)
(cd PacBio && ./configure --prefix=$DEST && make -j $NUM_THREADS install)
(cd SOAPdenovo2 && make --eval="debug=true" && install -t "$BINDIR" SOAPdenovo-63mer SOAPdenovo-127mer)
(cd prepare && ./configure --prefix=$DEST && make -j $NUM_THREADS install)

# (cd $SR_DIR && ./configure --prefix=$DEST && make -j $NUM_THREADS install)
# (cd $QR_DIR && ./configure --prefix=$DEST --enable-relative-paths && make -j $NUM_THREADS install)
# (cd PacBio && ./configure --prefix=$DEST && make -j $NUM_THREADS install)
# (cd SOAPdenovo2 && make --eval="debug=true" && install -t "$BINDIR" SOAPdenovo-63mer SOAPdenovo-127mer)
# (cd prepare && ./configure --prefix=$DEST && make -j $NUM_THREADS install)

if [ "$ROOT" != "$DEST" ]; then
for i in CA CA8; do
Expand Down
2 changes: 1 addition & 1 deletion jellyfish
Submodule jellyfish updated from 8a112f to b24568
2 changes: 1 addition & 1 deletion ufasta
Submodule ufasta updated from 5913fb to a70322

0 comments on commit 9994ce4

Please sign in to comment.