Skip to content

Commit 7f99b1c

Browse files
author
Vladimir Nikolić
authored
Merge pull request #103 from bcgsc/update_btllib_1.4.1
Update btllib to v1.4.1
2 parents b11a004 + 31c1958 commit 7f99b1c

File tree

969 files changed

+13049
-5393
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

969 files changed

+13049
-5393
lines changed

bin/tigmint-make

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ endif
126126
endif
127127

128128
# Set-up PYTHON PATH
129-
PYTHONPATH=$(bin)/../src/btllib/python/
129+
PYTHONPATH=$(bin)/../src/btllib/install/python/
130130

131131
# Record run time and memory usage in a file using GNU time.
132132
ifdef time

src/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
all: btllib_build long-to-linked-pe
22

3-
long-to-linked-pe: CXXFLAGS=-O3 -Wall -Werror -Wno-unknown-pragmas -std=c++11 -pthread -Ibtllib/include -Iinclude -Lbtllib/lib -lbtllib
3+
long-to-linked-pe: CXXFLAGS=-O3 -Wall -Werror -Wno-unknown-pragmas -std=c++11 -pthread -Ibtllib/install/include -Iinclude -Lbtllib/install/lib -lbtllib
44

55
btllib_build:
66
./btllib/compile

src/btllib/.clang-format

Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
---
2+
Language: Cpp
3+
# BasedOnStyle: Mozilla
4+
AccessModifierOffset: -2
5+
AlignAfterOpenBracket: Align
6+
AlignArrayOfStructures: None
7+
AlignConsecutiveMacros: None
8+
AlignConsecutiveAssignments: None
9+
AlignConsecutiveBitFields: None
10+
AlignConsecutiveDeclarations: None
11+
AlignEscapedNewlines: Right
12+
AlignOperands: Align
13+
AlignTrailingComments: true
14+
AllowAllArgumentsOnNextLine: true
15+
AllowAllConstructorInitializersOnNextLine: true
16+
AllowAllParametersOfDeclarationOnNextLine: false
17+
AllowShortEnumsOnASingleLine: true
18+
AllowShortBlocksOnASingleLine: Never
19+
AllowShortCaseLabelsOnASingleLine: false
20+
AllowShortFunctionsOnASingleLine: Inline
21+
AllowShortLambdasOnASingleLine: All
22+
AllowShortIfStatementsOnASingleLine: Never
23+
AllowShortLoopsOnASingleLine: false
24+
AlwaysBreakAfterDefinitionReturnType: TopLevel
25+
AlwaysBreakAfterReturnType: TopLevel
26+
AlwaysBreakBeforeMultilineStrings: false
27+
AlwaysBreakTemplateDeclarations: Yes
28+
AttributeMacros:
29+
- __capability
30+
BinPackArguments: false
31+
BinPackParameters: false
32+
BraceWrapping:
33+
AfterCaseLabel: false
34+
AfterClass: true
35+
AfterControlStatement: Never
36+
AfterEnum: true
37+
AfterFunction: true
38+
AfterNamespace: false
39+
AfterObjCDeclaration: false
40+
AfterStruct: true
41+
AfterUnion: true
42+
AfterExternBlock: true
43+
BeforeCatch: false
44+
BeforeElse: false
45+
BeforeLambdaBody: false
46+
BeforeWhile: false
47+
IndentBraces: false
48+
SplitEmptyFunction: true
49+
SplitEmptyRecord: false
50+
SplitEmptyNamespace: true
51+
BreakBeforeBinaryOperators: None
52+
BreakBeforeConceptDeclarations: true
53+
BreakBeforeBraces: Mozilla
54+
BreakBeforeInheritanceComma: false
55+
BreakInheritanceList: BeforeComma
56+
BreakBeforeTernaryOperators: true
57+
BreakConstructorInitializersBeforeComma: false
58+
BreakConstructorInitializers: BeforeComma
59+
BreakAfterJavaFieldAnnotations: false
60+
BreakStringLiterals: true
61+
ColumnLimit: 80
62+
CommentPragmas: '^ IWYU pragma:'
63+
CompactNamespaces: false
64+
ConstructorInitializerAllOnOneLineOrOnePerLine: false
65+
ConstructorInitializerIndentWidth: 2
66+
ContinuationIndentWidth: 2
67+
Cpp11BracedListStyle: false
68+
DeriveLineEnding: true
69+
DerivePointerAlignment: false
70+
DisableFormat: false
71+
EmptyLineAfterAccessModifier: Never
72+
EmptyLineBeforeAccessModifier: LogicalBlock
73+
ExperimentalAutoDetectBinPacking: false
74+
FixNamespaceComments: false
75+
ForEachMacros:
76+
- foreach
77+
- Q_FOREACH
78+
- BOOST_FOREACH
79+
IfMacros:
80+
- KJ_IF_MAYBE
81+
IncludeBlocks: Preserve
82+
IncludeCategories:
83+
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
84+
Priority: 2
85+
SortPriority: 0
86+
CaseSensitive: false
87+
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
88+
Priority: 3
89+
SortPriority: 0
90+
CaseSensitive: false
91+
- Regex: '.*'
92+
Priority: 1
93+
SortPriority: 0
94+
CaseSensitive: false
95+
IncludeIsMainRegex: '(Test)?$'
96+
IncludeIsMainSourceRegex: ''
97+
IndentAccessModifiers: false
98+
IndentCaseLabels: true
99+
IndentCaseBlocks: false
100+
IndentGotoLabels: true
101+
IndentPPDirectives: None
102+
IndentExternBlock: AfterExternBlock
103+
IndentRequires: false
104+
IndentWidth: 2
105+
IndentWrappedFunctionNames: false
106+
InsertTrailingCommas: None
107+
JavaScriptQuotes: Leave
108+
JavaScriptWrapImports: true
109+
KeepEmptyLinesAtTheStartOfBlocks: true
110+
LambdaBodyIndentation: Signature
111+
MacroBlockBegin: ''
112+
MacroBlockEnd: ''
113+
MaxEmptyLinesToKeep: 1
114+
NamespaceIndentation: None
115+
ObjCBinPackProtocolList: Auto
116+
ObjCBlockIndentWidth: 2
117+
ObjCBreakBeforeNestedBlockParam: true
118+
ObjCSpaceAfterProperty: true
119+
ObjCSpaceBeforeProtocolList: false
120+
PenaltyBreakAssignment: 2
121+
PenaltyBreakBeforeFirstCallParameter: 19
122+
PenaltyBreakComment: 300
123+
PenaltyBreakFirstLessLess: 120
124+
PenaltyBreakString: 1000
125+
PenaltyBreakTemplateDeclaration: 10
126+
PenaltyExcessCharacter: 1000000
127+
PenaltyReturnTypeOnItsOwnLine: 200
128+
PenaltyIndentedWhitespace: 0
129+
PointerAlignment: Left
130+
PPIndentWidth: -1
131+
ReferenceAlignment: Pointer
132+
ReflowComments: true
133+
ShortNamespaceLines: 1
134+
SortIncludes: CaseSensitive
135+
SortJavaStaticImport: Before
136+
SortUsingDeclarations: true
137+
SpaceAfterCStyleCast: false
138+
SpaceAfterLogicalNot: false
139+
SpaceAfterTemplateKeyword: false
140+
SpaceBeforeAssignmentOperators: true
141+
SpaceBeforeCaseColon: false
142+
SpaceBeforeCpp11BracedList: false
143+
SpaceBeforeCtorInitializerColon: true
144+
SpaceBeforeInheritanceColon: true
145+
SpaceBeforeParens: ControlStatements
146+
SpaceAroundPointerQualifiers: Default
147+
SpaceBeforeRangeBasedForLoopColon: true
148+
SpaceInEmptyBlock: false
149+
SpaceInEmptyParentheses: false
150+
SpacesBeforeTrailingComments: 1
151+
SpacesInAngles: Never
152+
SpacesInConditionalStatement: false
153+
SpacesInContainerLiterals: true
154+
SpacesInCStyleCastParentheses: false
155+
SpacesInLineCommentPrefix:
156+
Minimum: 1
157+
Maximum: -1
158+
SpacesInParentheses: false
159+
SpacesInSquareBrackets: false
160+
SpaceBeforeSquareBrackets: false
161+
BitFieldColonSpacing: Both
162+
Standard: Latest
163+
StatementAttributeLikeMacros:
164+
- Q_EMIT
165+
StatementMacros:
166+
- Q_UNUSED
167+
- QT_REQUIRE_VERSION
168+
TabWidth: 8
169+
UseCRLF: false
170+
UseTab: Never
171+
WhitespaceSensitiveMacros:
172+
- STRINGIZE
173+
- PP_STRINGIZE
174+
- BOOST_PP_STRINGIZE
175+
- NS_SWIFT_NAME
176+
- CF_SWIFT_NAME
177+
...
178+

src/btllib/.clang-format-ignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
wrappers/*
2+
tests/*
3+
examples/*
4+
subprojects/*

src/btllib/.clang-tidy

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
{
2+
Checks: '*,
3+
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
4+
-hicpp-no-array-decay,
5+
-fuchsia-default-arguments,
6+
-fuchsia-overloaded-operator,
7+
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
8+
-hicpp-avoid-c-arrays,-google-readability-casting,
9+
-cppcoreguidelines-pro-bounds-constant-array-index,
10+
-modernize-avoid-c-arrays,
11+
-cppcoreguidelines-avoid-c-arrays,
12+
-modernize-use-equals-default,
13+
-hicpp-use-equals-default,
14+
-google-runtime-references,
15+
-google-explicit-constructor,
16+
-hicpp-explicit-conversions,
17+
-misc-non-private-member-variables-in-classes,
18+
-cppcoreguidelines-special-member-functions,
19+
-modernize-use-nodiscard,
20+
-hicpp-special-member-functions,
21+
-llvm-header-guard,
22+
-google-runtime-int,
23+
-readability-isolate-declaration,
24+
-fuchsia-default-arguments-calls,
25+
-modernize-use-trailing-return-type,
26+
-bugprone-branch-clone,
27+
-fuchsia-default-arguments-declarations,
28+
-cppcoreguidelines-pro-type-union-access,
29+
-cppcoreguidelines-pro-type-cstyle-cast,
30+
-cppcoreguidelines-pro-type-vararg,
31+
-android-cloexec-pipe,
32+
-hicpp-signed-bitwise,
33+
-cert-err58-cpp,
34+
-hicpp-vararg,-abseil-string-find-startswith,
35+
-misc-definitions-in-headers,
36+
-clang-analyzer-valist.Uninitialized,
37+
-android-cloexec-open,
38+
-cppcoreguidelines-owning-memory,
39+
-cppcoreguidelines-non-private-member-variables-in-classes,
40+
-fuchsia-statically-constructed-objects,
41+
-modernize-return-braced-init-list,
42+
-clang-analyzer-unix.Vfork,
43+
-clang-analyzer-security.insecureAPI.vfork,
44+
-cppcoreguidelines-init-variables,
45+
readability-identifier-naming,
46+
-google-readability-todo,
47+
-cppcoreguidelines-macro-usage,
48+
-cppcoreguidelines-pro-type-reinterpret-cast,
49+
-llvmlibc-*,
50+
-readability-function-cognitive-complexity,
51+
-altera-struct-pack-align,
52+
-bugprone-easily-swappable-parameters,
53+
-altera-unroll-loops,
54+
-altera-id-dependent-backward-branch,
55+
-clang-diagnostic-unused-command-line-argument,
56+
-clang-diagnostic-unneeded-internal-declaration',
57+
CheckOptions: [
58+
{ key: readability-identifier-naming.ClassCase, value: CamelCase },
59+
{ key: readability-identifier-naming.VariableCase, value: lower_case },
60+
{ key: readability-identifier-naming.FunctionCase, value: lower_case },
61+
{ key: readability-identifier-naming.ParameterCase, value: lower_case },
62+
{ key: readability-identifier-naming.StaticConstantCase, value: lower_case },
63+
{ key: readability-identifier-naming.GlobalConstantCase, value: UPPER_CASE },
64+
{ key: readability-identifier-naming.GlobalConstantPointerCase, value: UPPER_CASE },
65+
{ key: readability-identifier-naming.ConstexprVariableCase, value: UPPER_CASE },
66+
]
67+
}

src/btllib/.clang-tidy-ignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
wrappers/*
2+
tests/*
3+
examples/*
4+
subprojects/*

src/btllib/.gitmodules

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[submodule "subprojects/sdsl-lite"]
2+
path = subprojects/sdsl-lite
3+
url = https://github.com/simongog/sdsl-lite
4+
[submodule "subprojects/cpptoml"]
5+
path = subprojects/cpptoml
6+
url = https://github.com/skystrife/cpptoml

src/btllib/README.md

Lines changed: 35 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,47 +17,64 @@ Download
1717
---
1818
The recommended way is to download the [latest release](https://github.com/bcgsc/btllib/releases/latest).
1919

20-
Usage
20+
Dependencies
2121
---
22-
- Dependencies
23-
* GCC 5+ or Clang 4+ with OpenMP
22+
- Build
23+
* GCC 6+ or Clang 5+ with OpenMP
2424
* Python 3.5+
25-
* Meson and Ninja Python3 packages, and CMake (optional -- if they are missing, they will be automatically downloaded to a temporary directory)
25+
* Meson and Ninja Python3 packages, CMake (If you are a user and not a developer, these will be automatically installed to a temporary directory)
26+
- Run time
27+
* SAMtools for reading SAM, BAM, and CRAM files.
28+
* gzip, tar, pigz, bzip2, xz, lrzip, zip, and/or 7zip for compressing/decompressing files. Not all of these are necessary, only the ones whose compressions you'll be using.
29+
* wget for downloading sequences from a URL.
30+
31+
For users
32+
---
2633
- Copy the root `btllib` directory into your project
2734
- Run `btllib/compile`
2835
- C++
29-
* Link your code with `btllib/lib/libbtllib.a` (pass `-L btllib/lib -l btllib` flags to the compiler).
30-
* `#include` any header from the `btllib/include` directory (pass `-I btllib/include` flag to the compiler).
36+
* Link your code with `btllib/install/lib/libbtllib.a` (pass `-L /path/to/btllib/install/lib -l btllib` flags to the compiler).
37+
* `#include` any header from the `btllib/install/include` directory (pass `-I /path/to/btllib/install/include` flag to the compiler).
3138
* `btllib` uses `C++11` features, so that standard should be enabled at a minimum.
3239
- Python wrappers
3340
* The wrappers correspond one-to-one with C++ code so any functions and classes can be used under the same name. The only exception are nested classes which are prefixed with outer class name (e.g. `btllib::SeqReader::Flag` in C++ versus `btllib.SeqReaderFlag` in Python).
34-
* Use Python's `sys.path.append()` to include `btllib/python` directory
41+
* Use `PYTHONPATH` environment variable or `sys.path.append()` in your Python code to include `/path/to/btllib/install/python` directory
3542
* Include the library with `import btllib`
43+
- Executables
44+
* btllib generated executables can be found in `/path/to/btllib/install/bin` directory. Append that path to the `PATH` environment variable to make it available to your shell.
3645

37-
Contributing
46+
For developers
3847
---
39-
If you want to make changes to the btllib code, first create a build directory by running `meson build` in `btllib` directory. `cd` to `build` directory and run `ninja build-sdsl` once to build the `sdsl` dependency. After that, every time you want to build the tests and wrappers, run `ninja` in `build` directory. To run the tests, run `ninja test`.
48+
- Initial setup:
49+
* `git clone --recurse-submodules https://github.com/bcgsc/btllib` in order to obtain all the code.
50+
* In `btllib` dir, run `meson build` to create a build directory.
51+
- Every time you want to run tests, in the `build` dir:
52+
* `ninja wrap` to regenerate wrappers.
53+
* `ninja test` to build wrappers and tests, and run tests.
54+
- Before making a pull request, in the `build` dir:
55+
* `ninja quality-assurance` to make sure all CI tests pass.
56+
* Make a commit after the above step, in case it has made any changes to wrappers or formatting. Don't commit the changes made to the `sdsl-lite` subproject. Meson config file adjusts the `sdsl-lite` config in order for it to work for `btllib`, but this is done ad hoc and is not necessary to be committed. By doing it ad hoc we keep a list of differences compared to the upstream repository.
57+
- Before making a release, in the `build` dir:
58+
* Do the same as for a pull request and
59+
* `ninja docs` to regenerate docs to reflect the release and then commit the changes.
60+
* `meson dist --allow-dirty` to generate a self-contained package based on the last commit. `--allow-dirty` permits making a distributable with uncommited changes. This is necessary as `sdsl-lite` dependency has ad hoc changes made during the build process. The resulting distributable will be compressed with xz. For easier use, decompress it and then compress with gzip. Attach the resulting file to the release.
4061

41-
The following are the available `ninja` commands which can be run within `build` directory:
42-
- `ninja build-sdsl` builds the sdsl-lite dependency library.
62+
The following are all the available `ninja` commands which can be run within `build` directory:
4363
- `ninja format` formats the whitespace in code (requires clang-format 8+).
4464
- `ninja wrap` wraps C++ code for Python (requires SWIG 4.0+).
45-
- `ninja tidycheck` runs clang-tidy on C++ code and makes sure it passes (requires clang-tidy 8+).
46-
- `ninja cppcheck` runs cppcheck on C++ code and makes sure it passes (requires cppcheck).
65+
- `ninja clang-tidy` runs clang-tidy on C++ code and makes sure it passes (requires clang-tidy 8+).
4766
- `ninja` builds the tests and wrapper libraries / makes sure they compile.
4867
- `ninja test` runs the tests.
4968
- `ninja sanitize-undefined` runs undefined sanitization.
50-
- `ninja docs` generates code documentation from comments (requires Doxygen).
5169
- `ninja test-wrappers` tests whether wrappers work.
52-
- `ninja complete` runs all of the above commands in the listed order.
53-
54-
Before making a pull request, make sure to run `ninja complete` to make sure the code passes the CI test.
70+
- `ninja docs` generates code documentation from comments (requires Doxygen).
71+
- `ninja quality-assurance` runs `clang-format`, `wrap`, `clang-tidy`, `test`, `sanitize-undefined`, and `test-wrappers`. These are all checked at the CI test.
5572

5673
Credits
5774
---
5875
- Author: [Vladimir Nikolic](https://github.com/vlad0x00)
5976
- Components:
60-
- [Hamid Mohamadi](https://github.com/mohamadi) for [ntHash](https://github.com/bcgsc/ntHash)
77+
- [Hamid Mohamadi](https://github.com/mohamadi) and [Parham Kazemi](https://github.com/parham-k) for [ntHash](https://github.com/bcgsc/ntHash)
6178
- [Justin Chu](https://github.com/JustinChu) for [MIBloomFilter](https://github.com/bcgsc/btl_bloomfilter)
6279
- [Chase Geigle](https://github.com/skystrife) for [cpptoml](https://github.com/skystrife/cpptoml)
6380
- Simon Gog, Timo Beller, Alistair Moffat, and Matthias Petri for [sdsl-lite](https://github.com/simongog/sdsl-lite)

src/btllib/compile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,9 @@ if [[ $missing_dep -eq 1 ]]; then
129129
fi
130130

131131
rm -rf __build-compile python bin
132-
meson setup --buildtype release --prefix=$SCRIPTPATH __build-compile
132+
meson setup --buildtype release --prefix=$SCRIPTPATH/install __build-compile
133133
if [[ $? -eq 0 ]]; then
134134
cd __build-compile
135-
ninja build-sdsl
136135
ninja install
137136
cd ..
138137
fi

0 commit comments

Comments
 (0)