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
94 changes: 0 additions & 94 deletions .clang-format

This file was deleted.

6 changes: 6 additions & 0 deletions .cmake-format.changes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
additional_commands:
cuda_add_library:
pargs: '*'
flags: ["STATIC", "SHARED", "MODULE", "EXCLUDE_FROM_ALL"]
kwargs:
OPTIONS: '*'
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@
[submodule "external/Random123"]
path = external/Random123
url = https://github.com/BlueBrain/Random123.git
[submodule "CMake/hpc-coding-conventions"]
path = CMake/hpc-coding-conventions
url = https://github.com/BlueBrain/hpc-coding-conventions.git
19 changes: 12 additions & 7 deletions CMake/AddCLI11Submodule.cmake
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
# =============================================================================
# Copyright (C) 2020 Blue Brain Project
# Copyright (C) 2016-2020 Blue Brain Project
#
# See top-level LICENSE file for details.
# =============================================================================


include(FindPackageHandleStandardArgs)
find_package(FindPkgConfig QUIET)
find_path(CLI11_PROJ NAMES CMakeLists.txt PATHS "${CORENEURON_PROJECT_SOURCE_DIR}/external/CLI11")

find_path(
CLI11_PROJ
NAMES CMakeLists.txt
PATHS "${CORENEURON_PROJECT_SOURCE_DIR}/external/CLI11")

find_package_handle_standard_args(CLI11 REQUIRED_VARS CLI11_PROJ)

if(NOT CLI11_FOUND)
Expand All @@ -16,8 +20,9 @@ if(NOT CLI11_FOUND)
message(FATAL_ERROR "git not found, clone repository with --recursive")
endif()
message(STATUS "Sub-module CLI11 missing: running git submodule update --init --recursive")
execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive --
${CORENEURON_PROJECT_SOURCE_DIR}/external/CLI11
WORKING_DIRECTORY ${CORENEURON_PROJECT_SOURCE_DIR})
execute_process(
COMMAND
${GIT_EXECUTABLE} submodule update --init --recursive --
${CORENEURON_PROJECT_SOURCE_DIR}/external/CLI11
WORKING_DIRECTORY ${CORENEURON_PROJECT_SOURCE_DIR})
endif()

35 changes: 19 additions & 16 deletions CMake/AddMod2cSubmodule.cmake
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
# =============================================================================
# Copyright (C) 2016-2019 Blue Brain Project
# Copyright (C) 2016-2020 Blue Brain Project
#
# See top-level LICENSE file for details.
# =============================================================================

include(ExternalProject)

find_package(FindPkgConfig QUIET)
find_path(MOD2C_PROJ NAMES CMakeLists.txt PATHS "${CORENEURON_PROJECT_SOURCE_DIR}/external/mod2c")

find_path(
MOD2C_PROJ
NAMES CMakeLists.txt
PATHS "${CORENEURON_PROJECT_SOURCE_DIR}/external/mod2c")

find_package_handle_standard_args(MOD2C REQUIRED_VARS MOD2C_PROJ)

if(NOT MOD2C_FOUND)
Expand All @@ -16,24 +20,23 @@ if(NOT MOD2C_FOUND)
message(FATAL_ERROR "git not found, clone repository with --recursive")
endif()
message(STATUS "Sub-module mod2c missing : running git submodule update --init --recursive")
execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive --
${CORENEURON_PROJECT_SOURCE_DIR}/external/mod2c
WORKING_DIRECTORY ${CORENEURON_PROJECT_SOURCE_DIR})
execute_process(
COMMAND
${GIT_EXECUTABLE} submodule update --init --recursive --
${CORENEURON_PROJECT_SOURCE_DIR}/external/mod2c
WORKING_DIRECTORY ${CORENEURON_PROJECT_SOURCE_DIR})
else()
message(STATUS "Using mod2c submodule from ${MOD2C_PROJ}")
endif()

set(ExternalProjectCMakeArgs
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}
-DCMAKE_C_COMPILER=${CORENRN_FRONTEND_C_COMPILER}
-DCMAKE_CXX_COMPILER=${CORENRN_FRONTEND_CXX_COMPILER})

externalproject_add(mod2c
BUILD_ALWAYS
1
SOURCE_DIR
${CORENEURON_PROJECT_SOURCE_DIR}/external/mod2c
GIT_SUBMODULES
CMAKE_ARGS
${ExternalProjectCMakeArgs})
ExternalProject_Add(
mod2c
BUILD_ALWAYS 1
SOURCE_DIR ${CORENEURON_PROJECT_SOURCE_DIR}/external/mod2c
GIT_SUBMODULES
CMAKE_ARGS ${ExternalProjectCMakeArgs})
19 changes: 12 additions & 7 deletions CMake/AddNmodlSubmodule.cmake
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
# =============================================================================
# Copyright (C) 2016-2019 Blue Brain Project
# Copyright (C) 2016-2020 Blue Brain Project
#
# See top-level LICENSE file for details.
# =============================================================================


find_package(FindPkgConfig QUIET)
find_path(NMODL_PROJ NAMES CMakeLists.txt PATHS "${CORENEURON_PROJECT_SOURCE_DIR}/external/nmodl")

find_path(
NMODL_PROJ
NAMES CMakeLists.txt
PATHS "${CORENEURON_PROJECT_SOURCE_DIR}/external/nmodl")

find_package_handle_standard_args(NMODL REQUIRED_VARS NMODL_PROJ)

if(NOT NMODL_FOUND)
Expand All @@ -15,12 +19,13 @@ if(NOT NMODL_FOUND)
message(FATAL_ERROR "git not found, clone repository with --recursive")
endif()
message(STATUS "Sub-module nmodl missing : running git submodule update --init --recursive")
execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive --
${CORENEURON_PROJECT_SOURCE_DIR}/external/nmodl
WORKING_DIRECTORY ${CORENEURON_PROJECT_SOURCE_DIR})
execute_process(
COMMAND
${GIT_EXECUTABLE} submodule update --init --recursive --
${CORENEURON_PROJECT_SOURCE_DIR}/external/nmodl
WORKING_DIRECTORY ${CORENEURON_PROJECT_SOURCE_DIR})
else()
message(STATUS "Using nmodl submodule from ${NMODL_PROJ}")
endif()

add_subdirectory(${CORENEURON_PROJECT_SOURCE_DIR}/external/nmodl)

19 changes: 12 additions & 7 deletions CMake/AddRandom123Submodule.cmake
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
# =============================================================================
# Copyright (C) 2020 Blue Brain Project
# Copyright (C) 2016-2020 Blue Brain Project
#
# See top-level LICENSE file for details.
# =============================================================================


include(FindPackageHandleStandardArgs)
find_package(FindPkgConfig QUIET)
find_path(Random123_PROJ NAMES LICENSE PATHS "${CORENEURON_PROJECT_SOURCE_DIR}/external/Random123")

find_path(
Random123_PROJ
NAMES LICENSE
PATHS "${CORENEURON_PROJECT_SOURCE_DIR}/external/Random123")

find_package_handle_standard_args(Random123 REQUIRED_VARS Random123_PROJ)

if(NOT Random123_FOUND)
Expand All @@ -16,8 +20,9 @@ if(NOT Random123_FOUND)
message(FATAL_ERROR "git not found, clone repository with --recursive")
endif()
message(STATUS "Sub-module Random123 missing: running git submodule update --init --recursive")
execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive --
${CORENEURON_PROJECT_SOURCE_DIR}/external/Random123
WORKING_DIRECTORY ${CORENEURON_PROJECT_SOURCE_DIR})
execute_process(
COMMAND
${GIT_EXECUTABLE} submodule update --init --recursive --
${CORENEURON_PROJECT_SOURCE_DIR}/external/Random123
WORKING_DIRECTORY ${CORENEURON_PROJECT_SOURCE_DIR})
endif()

13 changes: 6 additions & 7 deletions CMake/CMakeDetermineISPCCompiler.cmake
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
# =============================================================================
# Copyright (C) 2016-2019 Blue Brain Project
# Copyright (C) 2016-2020 Blue Brain Project
#
# See top-level LICENSE file for details.
# =============================================================================

# Find the compiler
# Find the ISPC compiler
find_program(
CMAKE_ISPC_COMPILER
NAMES $ENV{ISPC} ispc
PATHS ENV PATH
DOC "ISPC compiler"
)
CMAKE_ISPC_COMPILER
NAMES $ENV{ISPC} ispc
PATHS ENV PATH
DOC "ISPC compiler")
mark_as_advanced(CMAKE_ISPC_COMPILER)

set(CMAKE_ISPC_SOURCE_FILE_EXTENSIONS ispc)
Expand Down
2 changes: 1 addition & 1 deletion CMake/CMakeISPCInformation.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
set(CMAKE_INCLUDE_FLAG_ISPC "-I")

if(NOT CMAKE_ISPC_COMPILE_OBJECT)
set(CMAKE_ISPC_COMPILE_OBJECT "<CMAKE_ISPC_COMPILER> <FLAGS> <INCLUDES> <SOURCE> -o <OBJECT>")
set(CMAKE_ISPC_COMPILE_OBJECT "<CMAKE_ISPC_COMPILER> <FLAGS> <INCLUDES> <SOURCE> -o <OBJECT>")
endif()
set(CMAKE_ISPC_INFORMATION_LOADED 1)
65 changes: 37 additions & 28 deletions CMake/CMakeTestISPCCompiler.cmake
Original file line number Diff line number Diff line change
@@ -1,30 +1,36 @@
if(CMAKE_ISPC_COMPILER_FORCED)
# The compiler configuration was forced by the user.
# Assume the user has configured all compiler information.
# ~~~
# The compiler configuration was forced by the user. Assume the user has
# configured all compiler information.
# ~~~
set(CMAKE_ISPC_COMPILER_WORKS TRUE)
return()
endif()

set(CMAKE_ISPC_COMPILER_WORKS 1 CACHE INTERNAL "")
set(CMAKE_ISPC_COMPILER_WORKS
1
CACHE INTERNAL "")

# Remove any cached result from an older CMake version.
# We now store this in CMakeISPCCompiler.cmake.
# Remove any cached result from an older CMake version. We now store this in
# CMakeISPCCompiler.cmake.
unset(CMAKE_ISPC_COMPILER_WORKS CACHE)

# This file is used by EnableLanguage in cmGlobalGenerator to
# determine that the selected ispc compiler can actually compile
# and the most basic program. If not, a fatal error
# is set and cmake stops processing commands and will not generate
# any makefiles or projects.
# ~~~
# This file is used by EnableLanguage in cmGlobalGenerator to determine that the selected
# ispc compiler can actually compile and the most basic program. If not, a fatal error is
# set and cmake stops processing commands and will not generate any makefiles or projects.
# ~~~
if(NOT CMAKE_ISPC_COMPILER_WORKS)
PrintTestCompilerStatus("ISPC" "")
printtestcompilerstatus("ISPC" "")
file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/kernel.ispc
"export uniform int kernel(uniform int){return 0;}\n")
"export uniform int kernel(uniform int){return 0;}\n")

execute_process(COMMAND ${CMAKE_ISPC_COMPILER} "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/kernel.ispc"
OUTPUT_VARIABLE __CMAKE_ISPC_COMPILER_OUTPUT
ERROR_VARIABLE __CMAKE_ISPC_COMPILER_ERROR
RESULT_VARIABLE ISPC_RESULT)
execute_process(
COMMAND ${CMAKE_ISPC_COMPILER}
"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/kernel.ispc"
OUTPUT_VARIABLE __CMAKE_ISPC_COMPILER_OUTPUT
ERROR_VARIABLE __CMAKE_ISPC_COMPILER_ERROR
RESULT_VARIABLE ISPC_RESULT)

if(${ISPC_RESULT})
set(CMAKE_ISPC_COMPILER_WORKS 0)
Expand All @@ -37,25 +43,28 @@ if(NOT CMAKE_ISPC_COMPILER_WORKS)
set(ISPC_TEST_WAS_RUN 1)
endif()

# Print compiler status
if(NOT CMAKE_ISPC_COMPILER_WORKS)
PrintTestCompilerStatus("ISPC" " -- broken")
printtestcompilerstatus("ISPC" " -- broken")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if the ISPC compiler works failed with "
"the following output:\n${__CMAKE_ISPC_COMPILER_OUTPUT}\n\n")
string(REPLACE "\n" "\n " _output "${__CMAKE_ISPC_COMPILER_OUTPUT} ${__CMAKE_ISPC_COMPILER_ERROR}")
message(FATAL_ERROR "The ISPC compiler\n \"${CMAKE_ISPC_COMPILER}\"\n"
"is not able to compile a simple test program.\nIt fails "
"with the following output:\n ${_output}\n\n"
"CMake will not be able to correctly generate this project.")
"Determining if the ISPC compiler works failed with "
"the following output:\n${__CMAKE_ISPC_COMPILER_OUTPUT}\n\n")
string(REPLACE "\n" "\n " _output
"${__CMAKE_ISPC_COMPILER_OUTPUT} ${__CMAKE_ISPC_COMPILER_ERROR}")
message(
FATAL_ERROR
"The ISPC compiler\n \"${CMAKE_ISPC_COMPILER}\"\n"
"is not able to compile a simple test program.\nIt fails "
"with the following output:\n ${_output}\n\n"
"CMake will not be able to correctly generate this project.")
else()
if(ISPC_TEST_WAS_RUN)
PrintTestCompilerStatus("ISPC" " -- works")
printtestcompilerstatus("ISPC" " -- works")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining if the ISPC compiler works passed with "
"the following output:\n${__CMAKE_ISPC_COMPILER_OUTPUT}\n\n")
"Determining if the ISPC compiler works passed with "
"the following output:\n${__CMAKE_ISPC_COMPILER_OUTPUT}\n\n")
endif()
endif()


unset(__CMAKE_ISPC_COMPILER_OUTPUT)
unset(__CMAKE_ISPC_COMPILER_ERROR)
Loading