Commit 004f0d13 authored by Andreas Tille's avatar Andreas Tille
Browse files

New upstream version 5.3.1+dfsg

parent 849e1e0c
Loading
Loading
Loading
Loading

.clang-format

0 → 100644
+13 −0
Original line number Diff line number Diff line
BasedOnStyle:  Google
BreakBeforeBraces: Mozilla

AllowShortLoopsOnASingleLine: false
AccessModifierOffset: -4
BreakConstructorInitializersBeforeComma: true
ColumnLimit: 100
IndentWidth: 4
PointerAlignment: Left
TabWidth: 4

ReflowComments: false  # protect ASCII art in comments
KeepEmptyLinesAtTheStartOfBlocks: true
+7 −1
Original line number Diff line number Diff line
@@ -8,5 +8,11 @@ tags
defines.mk
all.xml
*.h5
libconfig.h
LibBlasrConfig.h
/hdf/hdf5-1.8.12-headers/
/build

# Meson WrapDB stuff
subprojects/packagecache/
subprojects/googletest*
subprojects/pbbam*

.gitmodules

0 → 100644
+8 −0
Original line number Diff line number Diff line
[submodule "pbbam"]
	path = pbbam
	url = ../pbbam.git
	branch = master
[submodule "googletest"]
	path = googletest
	url = https://github.com/google/googletest.git
	branch = master

CMakeLists.txt

0 → 100644
+85 −0
Original line number Diff line number Diff line
##############################################
# CMake build script for the BLASRLIBCPP library
##############################################

cmake_policy(SET CMP0048 NEW)
project(BLASRLIBCPP VERSION 5.3.0 LANGUAGES CXX C)
cmake_minimum_required(VERSION 3.6)

set(ROOT_PROJECT_NAME ${PROJECT_NAME} CACHE STRING "root project name")

# Build type
IF(NOT CMAKE_BUILD_TYPE)
    SET(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build, options are: Debug Release Profile RelWithDebInfo ReleaseWithAssert" FORCE)
ENDIF(NOT CMAKE_BUILD_TYPE)

# Main project paths
set(BLASRLIBCPP_RootDir ${BLASRLIBCPP_SOURCE_DIR})

# Project configuration
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake ${CMAKE_MODULE_PATH})

# Fixed order, do not sort or shuffle
include(blasrlibcpp-ccache)
include(blasrlibcpp-releasewithassert)
include(blasrlibcpp-dependencies)
include(blasrlibcpp-compilerflags)
include(blasrlibcpp-gitsha1)

file(WRITE pbdata/LibBlasrConfig.h "")

GET_PROPERTY(BLASRLIBCPP_COMPIPLE_FLAGS GLOBAL PROPERTY BLASRLIBCPP_COMPIPLE_FLAGS_GLOBAL)
GET_PROPERTY(BLASRLIBCPP_LINK_FLAGS GLOBAL PROPERTY BLASRLIBCPP_LINK_FLAGS_GLOBAL)
GET_PROPERTY(HDF5_LINKER_FLAG_LOCAL GLOBAL PROPERTY HDF5_LINKER_FLAG_GLOBAL)

set(LOCAL_LINKER_FLAGS "${HDF5_LINKER_FLAG_LOCAL} ${BLASRLIBCPP_LINK_FLAGS}")

# libcpp library
file(GLOB HDF5_CPP "${BLASRLIBCPP_RootDir}/hdf/*.cpp")
file(GLOB_RECURSE ALIGNMENT_CPP "${BLASRLIBCPP_RootDir}/alignment/*.cpp")
file(GLOB_RECURSE PBDATA_CPP "${BLASRLIBCPP_RootDir}/pbdata/*.cpp")

add_library(libcpp
    ${HDF5_CPP}
    ${ALIGNMENT_CPP}
    ${PBDATA_CPP}
)

target_include_directories(libcpp PUBLIC
    ${BLASRLIBCPP_RootDir}/hdf
    ${BLASRLIBCPP_RootDir}/alignment
    ${BLASRLIBCPP_RootDir}/pbdata
    ${HDF5_INCLUDE_DIRS}
    ${PacBioBAM_INCLUDE_DIRS}
)

target_link_libraries(libcpp ${PacBioBAM_LIBRARIES})

set_target_properties(libcpp PROPERTIES COMPILE_FLAGS ${BLASRLIBCPP_COMPIPLE_FLAGS})
if (LOCAL_LINKER_FLAGS)
    set_target_properties(libcpp PROPERTIES LINK_FLAGS ${LOCAL_LINKER_FLAGS})
endif()

# Tests
enable_testing()

## build gtest
add_subdirectory(${BLASRLIBCPP_RootDir}/googletest/googletest external/gtest)

## build libcpp tests
file(GLOB_RECURSE TEST_CPP "${BLASRLIBCPP_RootDir}/unittest/*/*.cpp")

add_executable(libcpptest ${TEST_CPP})
target_include_directories(libcpptest PUBLIC ${BLASRLIBCPP_RootDir}/unittest)
target_link_libraries(libcpptest gtest_main libcpp hdf5 hdf5_cpp ${ZLIB_LDFLAGS})
add_test(libcpptest libcpptest)

set_target_properties(libcpptest PROPERTIES COMPILE_FLAGS "${BLASRLIBCPP_COMPIPLE_FLAGS}")

if (LOCAL_LINKER_FLAGS)
    set_target_properties(libcpptest PROPERTIES LINK_FLAGS ${LOCAL_LINKER_FLAGS})
endif()

add_custom_target(check_libcpp
    COMMAND libcpptest --gtest_output=xml:${CMAKE_BINARY_DIR}/libcpp-unit.xml
    WORKING_DIRECTORY ${BLASRLIBCPP_RootDir})

DEVELOPER.md

0 → 100644
+45 −0
Original line number Diff line number Diff line
# Developer environment

## Clang-format pre commit hook

### What?
The intention here is to get source code formatting automatically
checked and guaranteed before checkin.

### Why?
- Automate style-guide compliance to avoid squabbles
- Post-checkin reformatting binges mess up history.  It's best to get
  it right from the get-go.


### How?
See the tools:
  - `tools/check-formatting --staged` for fast style-checking of
    changed files, in a git commit/push hook;
  - `tools/check-formatting --all` for slower style-checking of everything
  - `tools/format-all`to format everything

To enable the checking as a pre-commit hook, place the following in
`.git/hooks/pre-commit` (and make that file executable):

```sh
#!/bin/bash
./tools/check-formatting --staged
```

### Tips
- We should *not* reformat bundled third-party code as it will make it
  difficult to diff with upstream.  Put such code in a subdirectory
  with its own .clang-format file containing: "BasedOnStyle: None" to
  disable formatting.

- If clang-format mangles something (for example, a comment block with
  ASCII art or significant whitespace), you can protect a block using
  `// clang-format off` and then `// clang-format on`.

* What are these binaries?
  The `clang-format` binaries that are checked in are static builds of
  clang-format v3.9 from https://github.com/angular/clang-format.
  They are bundled because the LLVM toolchain has a reputation for
  rapid change and incompatibility.  We want to guarantee that devs
  are using the same version as CI is.
Loading