Showing with 3,075 additions and 3,966 deletions.
  1. +2 −1 .gitmodules
  2. +16 −11 .travis.yml
  3. +1 −1 BOWTIE2_VERSION
  4. +33 −89 CMakeLists.txt
  5. +11 −42 MANUAL
  6. +10 −29 MANUAL.markdown
  7. +43 −83 Makefile
  8. +16 −1 NEWS
  9. +7 −7 README.md
  10. +5 −4 aligner_cache.cpp
  11. +35 −35 aligner_cache.h
  12. +5 −2 aligner_seed.h
  13. +1 −1 aligner_sw_common.h
  14. +4 −2 aligner_swsse_ee_u8.cpp
  15. +122 −119 aligner_swsse_loc_u8.cpp
  16. +49 −49 aln_sink.h
  17. +578 −629 blockwise_sa.h
  18. +418 −382 bowtie2
  19. +13 −2 bt2_build.cpp
  20. +905 −906 bt2_idx.h
  21. +114 −125 bt2_io.cpp
  22. +37 −0 bt2_locks.cpp
  23. +72 −0 bt2_locks.h
  24. +17 −76 bt2_search.cpp
  25. +0 −6 bt2_search.h
  26. +36 −55 diff_sample.h
  27. +5 −59 doc/manual.html
  28. +4 −59 doc/website/manual.ssi
  29. +11 −0 doc/website/recent_news.ssi
  30. +21 −3 doc/website/rhsidebar.ssi
  31. +7 −7 ds.cpp
  32. +13 −4 endian_swap.h
  33. +64 −3 filebuf.h
  34. +31 −31 group_walk.h
  35. +5 −7 outq.cpp
  36. +8 −12 outq.h
  37. +69 −25 pat.cpp
  38. +65 −9 pat.h
  39. +2 −0 read.h
  40. +15 −1 sam.cpp
  41. +5 −4 scripts/bowtie2-hbb.sh
  42. +1 −1 third_party/simde
  43. +9 −63 threading.h
  44. +0 −303 tinythread.cpp
  45. +0 −714 tinythread.h
  46. +3 −2 unique.h
  47. +1 −2 util.h
  48. +155 −0 zstd_decompress.cpp
  49. +31 −0 zstd_decompress.h
3 changes: 2 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[submodule "third_party/simde"]
path = third_party/simde
url = https://github.com/nemequ/simde.git
url = https://github.com/simd-everywhere/simde-no-tests.git
branch = master
27 changes: 16 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
dist: xenial
dist: trusty
language: cpp
sudo: required
branches:
Expand Down Expand Up @@ -29,8 +29,6 @@ matrix:
- CXX=g++-4.9
# Linux (gcc8)
- os: linux
language: python
python: "3.8"
addons:
apt:
sources:
Expand Down Expand Up @@ -58,24 +56,31 @@ matrix:
# ARM 64-bit
- os: linux
arch: arm64
compiler: gcc
compiler: clang
env:
# Set POPCNT_CAPABILITY=0 to avoid build error
- POPCNT_CAPABILITY=0
- NO_TBB=1
script: travis_wait 30 make -j $NPROC allall
- CC=clang
- CXX=clang++
script: travis_wait 30 make -j4 allall
# IBM Z (big endian)
# - os: linux
# arch: s390x
# env:
# - POPCNT_CAPABILITY=0
# - NO_TBB=1
- os: linux
arch: s390x
env:
- POPCNT_CAPABILITY=0
- NO_TBB=1
- CC=clang
- CXX=clang++
# PPC64LE
- os: linux
arch: ppc64le
compiler: clang
env:
- POPCNT_CAPABILITY=0
- NO_TBB=1
- CC=clang
- CXX=clang++
cache: apt
env:
global:
Expand All @@ -86,7 +91,7 @@ before_script:
- echo CC=${CC} CXX=${CXX} NPROC=${NPROC}
- $CC --version
- $CXX --version
script: make -j $NPROC allall && make simple-test
script: travis_wait 25 make -j $NPROC allall && make simple-test
notifications:
slack:
secure: tfzT8N1fNV+oSV7tide9WrAj3ifs+LONJ3fCH1tUzexqrx23te4lE0oAj9C1cEMJ4evyRYwHNG8HZoLCOy8EfapqbWm6vgLIlkIBpeZ9E6f2jG6v0YuVDWWpqQC3qdGXCqWtHPjgs3i5OLsLwwQ/LItLoTqpBk2aYv+vGNs2F9g=
2 changes: 1 addition & 1 deletion BOWTIE2_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.4.2
2.4.3
122 changes: 33 additions & 89 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8)
cmake_minimum_required(VERSION 3.0 FATAL_ERROR)

cmake_policy(SET CMP0048 NEW)
cmake_policy(SET CMP0005 NEW)
Expand All @@ -16,21 +16,22 @@ include(CheckSymbolExists)
ProcessorCount(NUM_CORES)

option(BOWTIE_MM "enable bowtie2 memory mapping" ON)
option(BOWITE_SHARED_MM "enable shared memory mapping" ON)
option(BOWITE_SHARED_MM "enable shared memory mapping" OFF)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

set(NO_TBB ${NO_TBB})
set(NO_SPINLOCK ${NO_SPINLOCK})
set(USE_SRA ${USE_SRA})
set(WITH_THREAD_PROFILING ${WITH_THREAD_PROFILING})
set(NO_POPCNT_CAPABILITY ${NO_POPCNT_CAPABILITY})
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64 -g3 -Wall -msse2")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64 -g3 -Wall")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -funroll-loops")
set(INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Installation directory for executables")

set(CMAKE_EXPORT_COMPILE_COMMANDS on)
include_directories(${SOURCE_DIR}/third_party)

if (MINGW)
option(BOWTIE_MM "Memory mapped files not supported on Windows" OFF)
Expand Down Expand Up @@ -65,6 +66,7 @@ set(SHARED_CPPS
edit.cpp
bt2_idx.cpp
bt2_io.cpp
bt2_locks.cpp
bt2_util.cpp
reference.cpp
ds.cpp
Expand Down Expand Up @@ -119,6 +121,14 @@ add_definitions(
-D_GNU_SOURCE
)

if (BOWTIE_MM)
add_definitions(-DBOWTIE_MM)
endif()

if (BOWTIE_SHARED_MEM)
add_definitions(-DBOWTIE_SHARED_MEM)
endif()

if (WITH_AFFINITY)
add_definitions(-DWITH_AFFINITY=1)
endif()
Expand All @@ -127,9 +137,17 @@ if (NO_SPINLOCK)
add_definitions(-DNO_SPINLOCK)
endif()

if (NOT NO_POPCNT_CAPABILITY)
if (NOT NO_QUEUELOCK)
add_definitions(-DNO_SPINLOCK)
add_definitions(-DWITH_QUEUELOCK=1)
endif()

execute_process(COMMAND uname -m OUTPUT_VARIABLE ARCH)
if (${ARCH} MATCHES aarch64|arm64|390x|ppc64|ppc64le)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp-simd")
elseif (${ARCH} MATCHES amd64|x64_64)
add_definitions(-DPOPCNT_CAPABILITY)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I third_party")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse2")
endif()

if (USE_SRA)
Expand Down Expand Up @@ -199,82 +217,19 @@ endif()

if (CMAKE_BUILD_TYPE STREQUAL "Release")
add_definitions(-DNDEBUG)
else()
message("--------------------------------------------------------------------------")
message("ATTN: Targets built in debug mode will have `-debug' appended to its name.")
message("See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html")
message("--------------------------------------------------------------------------")
set(CMAKE_EXECUTABLE_SUFFIX "-debug")
endif()

find_package(ZLIB REQUIRED)


find_package(Threads REQUIRED)
link_libraries(Threads::Threads)

if (NO_TBB)
set(SHARED_CPPS ${SHARED_CPPS} tinythread.cpp)
else()
find_library(TBB_LIB_PATH tbb)
if (TBB_LIB_PATH)
find_path(TBB_INCLUDE_PATH tbb/tbb.h)
link_libraries(${TBB_LIB_PATH})
find_library(TBBMALLOC_PROXY_LIB_PATH tbbmalloc_proxy)
if (NOT TBBMALLOC_PROXY_LIB_PATH)
find_library(TBBMALLOC_LIB_PATH tbbmalloc)
link_libraries(${TBBMALLOC_LIB_PATH})
else()
link_libraries(${TBBMALLOC_PROXY_LIB_PATH})
endif()
include_directories(${TBB_INCLUDE_PATH})
else()
set(TBB_VER 2019_U4)

if (CMAKE_SYSTEM_NAME STREQUAL Linux)
set(tbb_os linux)
elseif (CMAKE_SYSTEM_NAME STREQUAL Darwin)
set(tbb_os macos)
elseif (CMAKE_SYSTEM_NAME STREQUAL Windows)
set(tbb_os windows)
else()
set(tbb_os ${CMAKE_SYSTEM_NAME})
endif()

find_program(MAKE_EXE NAMES gmake nmake make)
ExternalProject_Add(tbb_project
URL https://github.com/01org/tbb/archive/2019_U4.tar.gz
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/tbb-${TBB_VER}
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND ""
BUILD_COMMAND ${MAKE_EXE} tbb_build_prefix=${TBB_VER} tbb_os=${tbb_os}
INSTALL_COMMAND ""
PREFIX=${CMAKE_CURRENT_BINARY_DIR}/tbb_project
)

ExternalProject_Get_Property(tbb_project SOURCE_DIR)
set(TBB_SOURCE_DIR ${SOURCE_DIR})
set(TBB_RELEASE_DIR ${TBB_SOURCE_DIR}/build/${TBB_VER}_release)
include_directories(${TBB_SOURCE_DIR}/include)
find_path(TBB_INCLUDE_PATH PATHS ${TBB_SOURCE_DIR}/include NAMES tbb/tbb.h)

link_directories(${TBB_RELEASE_DIR})
add_library(tbb SHARED IMPORTED)
add_dependencies(tbb tbb_project)
find_library(LIBTBB tbb PATHS ${TBB_RELEASE_DIR} NO_DEFAULT_PATH)
set_property(TARGET tbb PROPERTY IMPORTED_LOCATION ${LIBTBB})

add_library(tbbmalloc_proxy SHARED IMPORTED)
add_dependencies(tbbmalloc_proxy tbb_project)
find_library(LIBTBBMALLOC_PROXY tbbmalloc_proxy PATHS ${TBB_RELEASE_DIR} NO_DEFAULT_PATH)
if (NOT LIBTBBMALLOC_PROXY)
add_library(tbbmalloc SHARED IMPORTED)
add_dependencies(tbbmalloc tbb_project)
find_library(LIBTBBMALLOC tbbmalloc PATHS ${TBB_RELEASE_DIR} NO_DEFAULT_PATH)
set_property(TARGET tbbmalloc PROPERTY IMPORTED_LOCATION ${LIBTBBMALLOC})
link_libraries(tbb tbbmalloc)
else()
set_property(TARGET tbbmalloc_proxy PROPERTY IMPORTED_LOCATION ${LIBTBBMALLOC_PROXY})
link_libraries(tbb tbbmalloc_proxy)
endif()
endif()
add_definitions(-DWITH_TBB -DWITH_QUEUELOCK=1 -DNO_SPINLOCK)
endif()

if (ZLIB_FOUND)
link_libraries(${ZLIB_LIBRARIES})
include_directories(${ZLIB_INCLUDE_DIRS})
Expand All @@ -293,22 +248,11 @@ add_executable(bowtie2-inspect-l ${INSPECT_CPPS} ${SHARED_CPPS})

set_target_properties(bowtie2-align-l bowtie2-build-l bowtie2-inspect-l PROPERTIES COMPILE_FLAGS "-DBOWTIE2_64BIT_INDEX")
set_target_properties(bowtie2-inspect-s bowtie2-inspect-l PROPERTIES COMPILE_FLAGS "-DBOWTIE_INSPECT_MAIN")
# set_target_properties(${BOWTIE2_BIN_LIST} PROPERTIES DEBUG_POSTFIX -debug)

install(TARGETS ${BOWTIE2_BIN_LIST} DESTINATION bin)
install(FILES ${BOWTIE2_WRAPPER_SCRIPTS}
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
DESTINATION bin)
if (LIBTBB)
install(FILES ${LIBTBB} DESTINATION lib)
install(DIRECTORY ${TBB_INCLUDE_PATH} DESTINATION include)
endif()
if (LIBTBBMALLOC)
install(FILES ${LIBTBBMALLOC} DESTINATION lib)
endif()
if (LIBTBBMALLOC_PROXY)
install(FILES ${LIBTBBMALLOC_PROXY} DESTINATION lib)
endif()

add_test(NAME simple-align
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
Expand Down
53 changes: 11 additions & 42 deletions MANUAL
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,15 @@ to get the source package, i.e., the filename that ends in

Building from source

Building Bowtie 2 from source requires a GNU-like environment with GCC,
GNU Make and other basics. It should be possible to build Bowtie 2 on
most vanilla Linux installations or on a Mac installation with Xcode
installed. (But see note about the TBB library below). Bowtie 2 can also
be built on Windows using a 64-bit MinGW distribution and MSYS. In order
to simplify the MinGW setup it might be worth investigating popular
MinGW personal builds since these are coming already prepared with most
of the toolchains needed.
Building from source

Building Bowtie 2 from source requires a GNU-like environment with
Clang/GCC, GNU Make and other basics. It should be possible to build
Bowtie 2 on most vanilla *NIX installations or on a Mac installation
with Xcode installed. Bowtie 2 can also be built on Windows using a
64-bit MinGW distribution and MSYS. In order to simplify the MinGW setup
it might be worth investigating popular MinGW personal builds since
these are coming already prepared with most of the toolchains needed.

First, download the source package from the sourceforge site. Make sure
you're getting the source package; the file downloaded should end in
Expand All @@ -128,41 +129,9 @@ the Bowtie 2 tools by running GNU make (usually with the command make,
but sometimes with gmake) with no arguments. If building with MinGW, run
make from the MSYS environment.

Bowtie 2 can be run on many threads. By default, Bowtie 2 uses the
Threading Building Blocks library (TBB) for this. If TBB is not
available on your system (e.g. make prints an error like
tbb/mutex.h: No such file or directory), you can install it yourself
from source (see Threading Building Blocks library) or install it using
your operating system's preferred package manager. The table below list
some of the commands for a few of the more popular operating systems.

-----------------------------------------------------------------------
Operating System Sync Package Search Install
List
---------------- -------------- ---------------- ----------------------
Ubuntu, Mint, apt-get update apt-cache search apt-get install
Debian tbb libtbb-dev

Fedora, CentOS yum yum search tbb yum install
check-update tbb-devel.x86_64

Arch packman -Sy pacman -Ss tbb pacman -S
extra/intel-tbb

Gentoo emerge --sync emerge --search emerge dev-cpp/tbb
tbb

macOS brew update brew search tbb brew install tbb

FreeBSD pkg update pkg search tbb pkg install tbb-2019.1
-----------------------------------------------------------------------

If all fails Bowtie 2 can be built with make NO_TBB=1 to use pthreads or
Windows native multithreading instead.

The Bowtie 2 Makefile also includes recipes for basic automatic
dependency management. Running make static-libs && make STATIC_BUILD=1
will issue a series of commands that will: 1. download TBB and zlib 2.
will issue a series of commands that will: 1. download zstd and zlib 2.
compile them as static libraries 3. link the resulting libraries to the
compiled Bowtie 2 binaries

Expand Down Expand Up @@ -2088,7 +2057,7 @@ useful format because the alignments are (a) compressed, which is
convenient for long-term storage, and (b) sorted, which is conveneint
for variant discovery. To generate variant calls in VCF format, run:

samtools mpileup -uf $BT2_HOME/example/reference/lambda_virus.fa eg2.sorted.bam | bcftools view -Ov - > eg2.raw.bcf
bcftools mpileup -f $BT2_HOME/example/reference/lambda_virus.fa eg2.sorted.bam | bcftools view -Ov - > eg2.raw.bcf

Then to view the variants, run:

Expand Down
Loading