Skip to content
This repository was archived by the owner on Mar 20, 2023. It is now read-only.
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .bbp-project.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
tools:
ClangFormat:
enable: True
include:
match:
- coreneuron/.*\.((cu)|(h)|([chi]pp))$
CMakeFormat:
enable: True
23 changes: 5 additions & 18 deletions .github/workflows/clang_cmake_format_check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,11 @@ jobs:
steps:
- name: Fetch repository
uses: actions/checkout@v3
- name: Install clang-format 11
run: |
sudo apt-get update
sudo apt-get install clang-format-11 python3-pip libboost-all-dev libopenmpi-dev openmpi-bin
- name: Install cmake-format 0.6.13
run: python3 -m pip install cmake-format==0.6.13
- name: Configure
- name: Fetch hpc-coding-conventions submodules
shell: bash
working-directory: ${{runner.workspace}}/CoreNeuron
run: |
export PATH=/home/runner/.local/bin:$PATH
mkdir BUILD && cd BUILD
cmake -DCORENRN_CLANG_FORMAT=ON -DCORENRN_CMAKE_FORMAT=ON -DCORENRN_ENABLE_MPI=ON -DCORENRN_ENABLE_OPENMP=OFF -DClangFormat_EXECUTABLE=$(which clang-format-11) -DCMakeFormat_EXECUTABLE=$(which cmake-format) ..
- name: Run clang-format
run: git submodule update --init --depth 1 -- CMake/hpc-coding-conventions
- name: Run clang-format and cmake-format
shell: bash
working-directory: ${{runner.workspace}}/CoreNeuron/BUILD
run: make check-clang-format VERBOSE=1
- name: Run cmake-format
shell: bash
working-directory: ${{runner.workspace}}/CoreNeuron/BUILD
run: make check-cmake-format
working-directory: ${{runner.workspace}}/CoreNeuron
run: CMake/hpc-coding-conventions/bin/format -v --dry-run
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ spconfig.*
.clang-tidy
.cmake-format.yaml
.pre-commit-config.yaml
.bbp-project-venv/
11 changes: 5 additions & 6 deletions CMake/packages/FindSphinx.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@
# See top-level LICENSE file for details.
# =============================================================================

find_program(SPHINX_EXECUTABLE
NAMES sphinx-build
DOC "/path/to/sphinx-build")
find_program(
SPHINX_EXECUTABLE
NAMES sphinx-build
DOC "/path/to/sphinx-build")

include(FindPackageHandleStandardArgs)

find_package_handle_standard_args(Sphinx
"Failed to find sphinx-build executable"
SPHINX_EXECUTABLE)
find_package_handle_standard_args(Sphinx "Failed to find sphinx-build executable" SPHINX_EXECUTABLE)
5 changes: 3 additions & 2 deletions CMake/packages/Findlikwid.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# See top-level LICENSE file for details.
# =============================================================================

# ~~~
# Findlikwid
# -------------
#
Expand All @@ -26,12 +27,12 @@
# likwid_FOUND - set to true if the library is found
# likwid_INCLUDE - list of required include directories
# likwid_LIBRARIES - list of required library directories
# ~~~

find_path(likwid_INCLUDE_DIRS "likwid.h" HINTS "${LIKWID_DIR}/include")
find_library(likwid_LIBRARIES likwid HINTS "${LIKWID_DIR}/lib")

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

find_package_handle_standard_args(likwid
REQUIRED_VARS likwid_INCLUDE_DIRS likwid_LIBRARIES)
find_package_handle_standard_args(likwid REQUIRED_VARS likwid_INCLUDE_DIRS likwid_LIBRARIES)
13 changes: 8 additions & 5 deletions CMake/packages/Findnmodl.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# See top-level LICENSE file for details.
# =============================================================================

# ~~~
# Findnmodl
# -------------
#
Expand All @@ -26,19 +27,21 @@
# nmodl_FOUND - set to true if the library is found
# nmodl_INCLUDE - list of required include directories
# nmodl_BINARY - the nmodl binary

# ~~~

# UNIX paths are standard, no need to write.
find_program(nmodl_BINARY NAMES nmodl${CMAKE_EXECUTABLE_SUFFIX}
HINTS "${CORENRN_NMODL_DIR}/bin" QUIET)
find_program(
nmodl_BINARY
NAMES nmodl${CMAKE_EXECUTABLE_SUFFIX}
HINTS "${CORENRN_NMODL_DIR}/bin" QUIET)

find_path(nmodl_INCLUDE "nmodl/fast_math.ispc" HINTS "${CORENRN_NMODL_DIR}/include")
find_path(nmodl_PYTHONPATH "nmodl/__init__.py" HINTS "${CORENRN_NMODL_DIR}/lib")

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

find_package_handle_standard_args(nmodl
find_package_handle_standard_args(
nmodl
FOUND_VAR nmodl_FOUND
REQUIRED_VARS nmodl_BINARY nmodl_INCLUDE nmodl_PYTHONPATH)

8 changes: 5 additions & 3 deletions CMake/packages/Findreportinglib.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# See top-level LICENSE file for details.
# =============================================================================

# ~~~
# Findreportinglib
# -------------
#
Expand All @@ -26,17 +27,18 @@
# reportinglib_FOUND - set to true if the library is found
# reportinglib_INCLUDE_DIRS - list of required include directories
# reportinglib_LIBRARIES - list of libraries to be linked
# ~~~

# UNIX paths are standard, no need to write.
find_path(reportinglib_INCLUDE_DIR reportinglib/Report.h)
find_library(reportinglib_LIBRARY reportinglib)
get_filename_component(reportinglib_LIB_DIR ${reportinglib_LIBRARY} DIRECTORY)
find_program (reportinglib_somaDump somaDump ${reportinglib_LIB_DIR}/../bin)
find_program(reportinglib_somaDump somaDump ${reportinglib_LIB_DIR}/../bin)

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

find_package_handle_standard_args(reportinglib
find_package_handle_standard_args(
reportinglib
FOUND_VAR reportinglib_FOUND
REQUIRED_VARS reportinglib_INCLUDE_DIR reportinglib_LIBRARY reportinglib_LIB_DIR)

11 changes: 0 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,6 @@ list(APPEND CMAKE_MODULE_PATH ${CORENEURON_PROJECT_SOURCE_DIR}/CMake
# =============================================================================
set(CODING_CONV_PREFIX "CORENRN")
set(CORENRN_3RDPARTY_DIR "external")
# Adds .cu with respect to the current default in hpc-coding-conventions, and drops various patterns
# that don't match anything in CoreNEURON.
set(CORENRN_ClangFormat_FILES_RE
"^.*\\\\.cu$$" "^.*\\\\.h$$" "^.*\\\\.[chi]pp$$"
CACHE STRING "List of regular expressions matching C/C++ filenames" FORCE)
set(CORENRN_ClangFormat_EXCLUDES_RE
""
CACHE STRING "list of regular expressions to exclude C/C++ files from formatting" FORCE)
set(CORENRN_CMakeFormat_EXCLUDES_RE
"CMake/packages/.*$$"
CACHE STRING "list of regular expressions to exclude CMake files from formatting" FORCE)
include(AddHpcCodingConvSubmodule)
add_subdirectory(CMake/hpc-coding-conventions/cpp)

Expand Down