Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactored DNASim library #8

Merged
merged 10 commits into from
Feb 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
92 changes: 92 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
---
# clang-format style definition
# Nicolas Clauvelin, Sendyne Corp. 2019
Language: Cpp
BasedOnStyle: Google
AccessModifierOffset: '-4'
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: 'false'
AlignConsecutiveDeclarations: 'false'
AlignEscapedNewlines: Right
AlignOperands: 'true'
AlignTrailingComments: 'true'
AllowAllParametersOfDeclarationOnNextLine: 'false'
AllowShortBlocksOnASingleLine: 'false'
AllowShortCaseLabelsOnASingleLine: 'false'
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: 'false'
AllowShortLoopsOnASingleLine: 'false'
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: 'false'
AlwaysBreakTemplateDeclarations: 'true'
BinPackArguments: 'false'
BinPackParameters: 'false'
BreakBeforeBraces: Custom
BraceWrapping:
AfterClass: 'false'
AfterControlStatement: 'false'
AfterEnum: 'false'
AfterFunction: 'false'
AfterNamespace: 'false'
AfterStruct: 'false'
AfterUnion: 'false'
AfterExternBlock: 'false'
BeforeCatch: 'true'
BeforeElse: 'true'
IndentBraces: 'false'
SplitEmptyFunction: 'false'
SplitEmptyRecord: 'false'
SplitEmptyNamespace: 'false'
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeInheritanceComma: 'false'
BreakBeforeTernaryOperators: 'true'
BreakConstructorInitializers: BeforeColon
BreakInheritanceList: BeforeColon
BreakStringLiterals: 'true'
ColumnLimit: '80'
CompactNamespaces: 'false'
ConstructorInitializerAllOnOneLineOrOnePerLine: 'true'
ConstructorInitializerIndentWidth: '4'
ContinuationIndentWidth: '4'
Cpp11BracedListStyle: 'true'
DerivePointerAlignment: 'false'
DisableFormat: 'false'
ExperimentalAutoDetectBinPacking: 'false'
FixNamespaceComments: 'true'
IncludeBlocks: Regroup
IndentCaseLabels: 'true'
IndentPPDirectives: AfterHash
IndentWidth: '4'
IndentWrappedFunctionNames: 'false'
KeepEmptyLinesAtTheStartOfBlocks: 'true'
MaxEmptyLinesToKeep: '2'
NamespaceIndentation: None
PointerAlignment: Left
ReflowComments: 'true'
SortIncludes: 'true'
SortUsingDeclarations: 'true'
SpaceAfterCStyleCast: 'false'
SpaceAfterTemplateKeyword: 'true'
SpaceBeforeAssignmentOperators: 'true'
SpaceBeforeCpp11BracedList: 'false'
SpaceBeforeCtorInitializerColon: 'true'
SpaceBeforeInheritanceColon: 'true'
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: 'true'
SpaceInEmptyParentheses: 'false'
SpacesBeforeTrailingComments: '4'
SpacesInAngles: 'false'
SpacesInContainerLiterals: 'false'
SpacesInCStyleCastParentheses: 'false'
SpacesInParentheses: 'false'
SpacesInSquareBrackets: 'false'
Standard: Cpp11
TabWidth: '4'
UseTab: Never
IncludeCategories:
- Regex: '^".*'
Priority: 1
- Regex: '^<.*'
Priority: 2

...
50 changes: 39 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,18 +1,46 @@
# Ignore these files/directories and do not add to git project
### Generic git ignore file ###

### Clion specific directories ###
*.idea
build
cmake-build-debug

### Compiled Object files ###
*.slo
*.lo
# Object files
*.o
*.ko
*.obj
*.elf

# Precompiled Headers
*.gch
*.pch

# Libraries
*.lib
*.a
*.la
*.lo

### Compiled Dynamic libraries ###
# Shared objects (inc. Windows DLLs)
*.dll
*.so
*.so.*
*.dylib
*.dll

# Executables
*.exe
*.out
*.app
*.i*86
*.x86_64
*.hex
*.bin

# Mac specific
.DS_Store

# CLion specific
**/.idea/workspace.xml
**/.idea/tasks.xml
**/.idea/*.iml
**/.idea/modules.xml
**/.idea/vcs.xml

# Build directories
**/build
**/cmake-build-*/
12 changes: 12 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[submodule "deps/googletest"]
path = deps/googletest
url = git@github.com:google/googletest.git
[submodule "deps/cereal"]
path = deps/cereal
url = git@github.com:USCiLab/cereal.git
[submodule "deps/nanoflann"]
path = deps/nanoflann
url = git@github.com:jlblancoc/nanoflann.git
[submodule "deps/eigen"]
path = deps/eigen
url = git@github.com:eigenteam/eigen-git-mirror.git
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

49 changes: 49 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 43 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# ---------------------------------------------------------------------------- #
# emDNA CMake project
#
# Nicolas Clauvelin (n.clauvelin@gmail.com)
#
# ---------------------------------------------------------------------------- #


# --- Project setup ---

# CMake minimal version.
cmake_minimum_required(VERSION 3.13)

# Support for ccache.
find_program(CCACHE_PROGRAM ccache)
if(CCACHE_PROGRAM)
set(CMAKE_C_COMPILER_LAUNCHER ${CCACHE_PROGRAM}
CACHE STRING "(emDNA) C compiler ccache program" FORCE)
set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE_PROGRAM}
CACHE STRING "(emDNA) C++ compiler ccache program" FORCE)
message("C/C++ compiler ccache: ${CCACHE_PROGRAM}")
endif()

# Define project.
project(emDNA C CXX)

# Enforce C++14 standard.
set(CMAKE_CXX_STANDARD 14)

# Enforce C99 standard.
set(CMAKE_C_STANDARD 99)


# --- Project components ---

# Dependencies.
include(deps/cereal.cmake)
include(deps/eigen.cmake)
include(deps/googletest.cmake)
include(deps/nanoflann.cmake)

# DNASim
add_subdirectory(DNASim/)
Loading