Skip to content
This repository has been archived by the owner on Mar 20, 2023. It is now read-only.

Commit

Permalink
Merge pull request #2 from pramodk/master
Browse files Browse the repository at this point in the history
CoreNeuron development changes from BBP repository
  • Loading branch information
kupermind authored Oct 5, 2016
2 parents 7338b7d + 8aa48d2 commit ba1fc53
Show file tree
Hide file tree
Showing 172 changed files with 18,126 additions and 7,038 deletions.
94 changes: 94 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
---
Language: Cpp
# BasedOnStyle: Chromium
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: false
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: true
BinPackArguments: true
BinPackParameters: false
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Attach
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: false
ColumnLimit: 100
CommentPragmas: '^ IWYU pragma:'
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
IncludeCategories:
- Regex: '^<.*\.h>'
Priority: 1
- Regex: '^<.*'
Priority: 2
- Regex: '.*'
Priority: 3
IncludeIsMainRegex: '([-_](test|unittest))?$'
IndentCaseLabels: true
IndentWidth: 4
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: All
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: false
PenaltyBreakBeforeFirstCallParameter: 1
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 200
PointerAlignment: Left
ReflowComments: true
SortIncludes: false
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp03
TabWidth: 8
UseTab: Never
JavaScriptQuotes: Leave
...

6 changes: 6 additions & 0 deletions .gitreview
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[gerrit]
host=bbpcode.epfl.ch
port=22
project=sim/coreneuron
defaultbranch=master
defaultremote=origin
5 changes: 5 additions & 0 deletions CMake/ClangFormatUtils.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
string(REPLACE " " ";" FILES_TO_FORMAT ${SOURCE_FILES})

FOREACH(SRC_FILE ${FILES_TO_FORMAT})
execute_process(COMMAND ${CLANG_FORMAT_EXECUTABLE} -i -style=file -fallback-style=none ${SRC_FILE})
ENDFOREACH()
72 changes: 72 additions & 0 deletions CMake/Findmod2c.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Copyright (c) 2016, Blue Brain Project
# All rights reserved.

# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
# 3. Neither the name of the copyright holder nor the names of its contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.

# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
# THE POSSIBILITY OF SUCH DAMAGE.


# Findmod2c
# -------------
#
# Find mod2c
#
# Find the mod2c Blue Brain HPC utils library
#
# Using mod2c:
#
# ::
#
# find_package(mod2c REQUIRED)
# include_directories(${mod2c_INCLUDE_DIRS})
# target_link_libraries(foo ${mod2c_LIBRARIES})
#
# This module sets the following variables:
#
# ::
#
# mod2c_FOUND - set to true if the library is found
# mod2c_INCLUDE_DIRS - list of required include directories
# mod2c_LIBRARIES - list of libraries to be linked

#=============================================================================
# Copyright 2015 Adrien Devresse <[email protected]>
#
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)


# UNIX paths are standard, no need to write.
find_program(mod2c_BINARY
NAMES mod2c_core
PATHS "/usr/bin"
)


# Checks 'REQUIRED', 'QUIET' and versions.
include(FindPackageHandleStandardArgs)

find_package_handle_standard_args(mod2c
FOUND_VAR mod2c_FOUND
REQUIRED_VARS mod2c_BINARY)

1 change: 1 addition & 0 deletions CMake/TestScriptUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
# THE POSSIBILITY OF SUCH DAMAGE.


# Utility functions for manipulating test labels and producing
# tests from scripts:
#
Expand Down
20 changes: 14 additions & 6 deletions CMake/config/CompilerFlagsHelpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
# THE POSSIBILITY OF SUCH DAMAGE.


# CompilerFlagsHelpers.cmake
#
# set of Convenience functions for portable compiler flags
Expand All @@ -33,7 +34,6 @@ set(SUPPORTED_COMPILER_LANGUAGE_LIST "C;CXX")

## detect compiler
foreach(COMPILER_LANGUAGE ${SUPPORTED_COMPILER_LANGUAGE_LIST})

if(CMAKE_${COMPILER_LANGUAGE}_COMPILER_ID STREQUAL "XL")
set(CMAKE_${COMPILER_LANGUAGE}_COMPILER_IS_XLC ON)
elseif(CMAKE_${COMPILER_LANGUAGE}_COMPILER_ID STREQUAL "Intel")
Expand Down Expand Up @@ -72,6 +72,8 @@ foreach(COMPILER_LANGUAGE ${SUPPORTED_COMPILER_LANGUAGE_LIST})
set(CMAKE_${COMPILER_LANGUAGE}_POSITION_INDEPENDANT "-qpic=small")

set(CMAKE_${COMPILER_LANGUAGE}_VECTORIZE "-qhot")
set(ADDITIONAL_THREADSAFE_FLAGS "-qthreaded")
set(IGNORE_UNKNOWN_PRAGMA_FLAGS "-qsuppress=1506-224")

# Microsoft compiler
elseif(CMAKE_${COMPILER_LANGUAGE}_COMPILER_IS_MSVC)
Expand Down Expand Up @@ -104,6 +106,7 @@ foreach(COMPILER_LANGUAGE ${SUPPORTED_COMPILER_LANGUAGE_LIST})
set(CMAKE_${COMPILER_LANGUAGE}_POSITION_INDEPENDANT "-fPIC")

set(CMAKE_${COMPILER_LANGUAGE}_VECTORIZE "-ftree-vectorize")
set(IGNORE_UNKNOWN_PRAGMA_FLAGS "-Wno-unknown-pragmas")

if(CMAKE_${COMPILER_LANGUAGE}_COMPILER_IS_GCC AND ( CMAKE_${COMPILER_LANGUAGE}_COMPILER_VERSION VERSION_GREATER "4.7.0") )
set(CMAKE_${COMPILER_LANGUAGE}_LINK_TIME_OPT "-flto")
Expand All @@ -119,14 +122,19 @@ foreach(COMPILER_LANGUAGE ${SUPPORTED_COMPILER_LANGUAGE_LIST})
## rest of the world
else()

## unknown compiler flags produce error on Cray and hence just set this for intel now
if(CMAKE_${COMPILER_LANGUAGE}_COMPILER_IS_ICC)
set(IGNORE_UNKNOWN_PRAGMA_FLAGS "-Wno-unknown-pragmas")
endif()

set(CMAKE_${COMPILER_LANGUAGE}_WARNING_ALL "")

set(CMAKE_${COMPILER_LANGUAGE}_DEBUGINFO_FLAGS "-g")
set(CMAKE_${COMPILER_LANGUAGE}_DEBUGINFO_FLAGS "")

set(CMAKE_${COMPILER_LANGUAGE}_OPT_NONE "-O0")
set(CMAKE_${COMPILER_LANGUAGE}_OPT_NORMAL "-O2")
set(CMAKE_${COMPILER_LANGUAGE}_OPT_AGGRESSIVE "-O3")
set(CMAKE_${COMPILER_LANGUAGE}_OPT_FASTEST "-O3")
set(CMAKE_${COMPILER_LANGUAGE}_OPT_NONE "")
set(CMAKE_${COMPILER_LANGUAGE}_OPT_NORMAL "")
set(CMAKE_${COMPILER_LANGUAGE}_OPT_AGGRESSIVE "")
set(CMAKE_${COMPILER_LANGUAGE}_OPT_FASTEST "")

set(CMAKE_${COMPILER_LANGUAGE}_STACK_PROTECTION "")
set(CMAKE_${COMPILER_LANGUAGE}_POSITION_INDEPENDANT "")
Expand Down
2 changes: 1 addition & 1 deletion CMake/config/DefineInstallationPaths.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
# THE POSSIBILITY OF SUCH DAMAGE.


IF (UNIX)
IF (NOT APPLICATION_NAME)
MESSAGE(STATUS "${PROJECT_NAME} is used as APPLICATION_NAME")
Expand All @@ -32,7 +33,6 @@ IF (UNIX)

# detect lib suffix


GET_PROPERTY(LIB64_SUFFIX GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS)

IF(LIB64_SUFFIX)
Expand Down
1 change: 1 addition & 0 deletions CMake/config/ReleaseDebugAutoFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
# THE POSSIBILITY OF SUCH DAMAGE.


# ReleaseDebugAutoFlags.cmake
#
# Release / Debug configuration helper
Expand Down
2 changes: 1 addition & 1 deletion CMake/config/TestHelpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
# THE POSSIBILITY OF SUCH DAMAGE.


# TestHelpers.cmake
#
# set of Convenience functions for unit testing with cmake


##
# enable or disable detection of SLURM and MPIEXEC
option(AUTO_TEST_WITH_SLURM "automatically add srun as test prefix in a SLURM environment" TRUE)
Expand Down
2 changes: 2 additions & 0 deletions CMake/packages/FindBBPTestData.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
# THE POSSIBILITY OF SUCH DAMAGE.


##
## Find package file for the Blue Brain Functional test data files
##
Expand Down
40 changes: 40 additions & 0 deletions CMake/packages/FindClangFormat.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Copyright (c) 2016, Blue Brain Project
# All rights reserved.

# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
# 3. Neither the name of the copyright holder nor the names of its contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.

# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
# THE POSSIBILITY OF SUCH DAMAGE.

string(REPLACE ":" ";" _PATH $ENV{PATH})
foreach(p ${_PATH})
file(GLOB cand ${p}/clang-format*)
if(cand)
set(CLANG_FORMAT_EXECUTABLE ${cand})
set(CLANG_FORMAT_FOUND ON)
execute_process(COMMAND ${CLANG_FORMAT_EXECUTABLE} -version OUTPUT_VARIABLE clang_out )
string(REGEX MATCH .*\(version[^\n]*\)\n version ${clang_out})
set(CLANG_FORMAT_VERSION ${CMAKE_MATCH_1})
break()
else()
set(CLANG_FORMAT_FOUND OFF)
endif()
endforeach()
1 change: 1 addition & 0 deletions CMake/packages/FindSLURM.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
# THE POSSIBILITY OF SUCH DAMAGE.


find_program(SLURM_SBATCH_COMMAND sbatch DOC "Path to the SLURM sbatch executable")
find_program(SLURM_SRUN_COMMAND srun DOC "Path to the SLURM srun executable")
find_program(SLURM_SACCTMGR_COMMAND sacctmgr DOC "Path to the SLURM sacctmgr executable")
Expand Down
8 changes: 8 additions & 0 deletions CMake/packages/Findmod2c.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
# THE POSSIBILITY OF SUCH DAMAGE.


# Findmod2c
# -------------
#
Expand All @@ -47,6 +48,13 @@
# mod2c_INCLUDE_DIRS - list of required include directories
# mod2c_LIBRARIES - list of libraries to be linked

#=============================================================================
# Copyright 2015 Adrien Devresse <[email protected]>
#
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)


# UNIX paths are standard, no need to write.
find_program(mod2c_BINARY
Expand Down
Loading

0 comments on commit ba1fc53

Please sign in to comment.