Skip to content

Commit 13e63fa

Browse files
authored
Merge pull request #42 from bcgsc/nthash2
Nthash2
2 parents 941f99f + a81cc75 commit 13e63fa

113 files changed

Lines changed: 15545 additions & 14992 deletions

File tree

Some content is hidden

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

.clang-format

Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
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: false
49+
SplitEmptyRecord: false
50+
SplitEmptyNamespace: true
51+
BreakBeforeBinaryOperators: None
52+
BreakBeforeConceptDeclarations: true
53+
BreakBeforeBraces: Custom
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+
...

.clang-tidy

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
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+
WarningsAsErrors: '*',
58+
CheckOptions: [
59+
{ key: readability-identifier-naming.ClassCase, value: CamelCase },
60+
{ key: readability-identifier-naming.VariableCase, value: lower_case },
61+
{ key: readability-identifier-naming.FunctionCase, value: lower_case },
62+
{ key: readability-identifier-naming.ParameterCase, value: lower_case },
63+
{ key: readability-identifier-naming.StaticConstantCase, value: lower_case },
64+
{ key: readability-identifier-naming.GlobalConstantCase, value: UPPER_CASE },
65+
{ key: readability-identifier-naming.GlobalConstantPointerCase, value: UPPER_CASE },
66+
{ key: readability-identifier-naming.ConstexprVariableCase, value: UPPER_CASE },
67+
]
68+
}

.gitignore

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
bin/
2+
lib/
3+
build/
4+
release/
5+
cmake-build-debug/
6+
7+
# IntelliJ project files
8+
.idea
9+
*.iml
10+
out
11+
gen
12+
13+
### C++
14+
# Prerequisites
15+
*.d
16+
17+
# Compiled Object files
18+
*.slo
19+
*.lo
20+
*.o
21+
*.obj
22+
23+
# Precompiled Headers
24+
*.gch
25+
*.pch
26+
27+
# Compiled Dynamic libraries
28+
*.so
29+
*.dylib
30+
*.dll
31+
32+
# Fortran module files
33+
*.mod
34+
*.smod
35+
36+
# Compiled Static libraries
37+
*.lai
38+
*.la
39+
*.a
40+
*.lib
41+
42+
# Executables
43+
*.exe
44+
*.out
45+
*.app
46+
47+
### CMake
48+
CMakeLists.txt.user
49+
CMakeCache.txt
50+
CMakeFiles
51+
CMakeScripts
52+
Testing
53+
Makefile
54+
cmake_install.cmake
55+
install_manifest.txt
56+
compile_commands.json
57+
CTestTestfile.cmake
58+
_deps

.gitmodules

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[submodule "vendor/argparse"]
2+
path = vendor/argparse
3+
url = git@github.com:p-ranav/argparse.git
4+
[submodule "vendor/btllib"]
5+
path = vendor/btllib
6+
url = git@github.com:bcgsc/btllib.git

CMakeLists.txt

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
cmake_minimum_required(VERSION 3.22)
2+
project(ntHash)
3+
4+
set(CMAKE_CXX_STANDARD 17)
5+
6+
if (NOT CMAKE_BUILD_TYPE)
7+
set(CMAKE_BUILD_TYPE Release)
8+
endif ()
9+
10+
set(CMAKE_CXX_FLAGS "-Wall -Wextra")
11+
set(CMAKE_CXX_FLAGS_DEBUG "-g")
12+
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
13+
14+
include_directories(include)
15+
include_directories(vendor/btllib/include)
16+
include_directories(vendor/argparse/include)
17+
18+
file(GLOB SRC_FILES ${PROJECT_SOURCE_DIR}/src/nthash/*.cpp)
19+
20+
add_custom_command(
21+
OUTPUT ${PROJECT_BINARY_DIR}/btllib/lib/libbtllib.a
22+
COMMAND ${PROJECT_SOURCE_DIR}/vendor/btllib/compile --prefix ${PROJECT_BINARY_DIR}/btllib
23+
)
24+
25+
add_library(nthash_lib STATIC ${SRC_FILES})
26+
set_target_properties(nthash_lib PROPERTIES OUTPUT_NAME "nthash")
27+
28+
add_executable(nthash main.cpp ${PROJECT_BINARY_DIR}/btllib/lib/libbtllib.a)
29+
target_link_libraries(nthash ${PROJECT_BINARY_DIR}/btllib/lib/libbtllib.a)
30+
target_link_libraries(nthash ${PROJECT_BINARY_DIR}/libnthash.a)
31+
32+
add_executable(nthash_tests ${PROJECT_SOURCE_DIR}/tests/tests.cpp ${PROJECT_BINARY_DIR}/btllib/lib/libbtllib.a)
33+
target_link_libraries(nthash_tests ${PROJECT_BINARY_DIR}/btllib/lib/libbtllib.a)
34+
target_link_libraries(nthash_tests ${PROJECT_BINARY_DIR}/libnthash.a)
35+
enable_testing()
36+
add_test(NAME nthash_tests COMMAND $<TARGET_FILE:nthash_tests>)

ChangeLog

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)