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

Commit 42da29d

Browse files
Nicolas Cornupramodk
andauthored
Random123 as a submodule (#258)
* Add Random123 as a submodule and remove files * Get patches from BBP for Random123 * Install Random123 to include directory as it required for nrnivmodl-core Co-authored-by: Pramod Kumbhar <[email protected]>
1 parent ca97c39 commit 42da29d

27 files changed

+37
-5359
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@
77
[submodule "external/nmodl"]
88
path = external/nmodl
99
url = https://github.com/BlueBrain/nmodl
10+
[submodule "external/Random123"]
11+
path = external/Random123
12+
url = https://github.com/BlueBrain/Random123.git

CMake/AddRandom123Submodule.cmake

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# =============================================================================
2+
# Copyright (C) 2020 Blue Brain Project
3+
#
4+
# See top-level LICENSE file for details.
5+
# =============================================================================
6+
7+
8+
include(FindPackageHandleStandardArgs)
9+
find_package(FindPkgConfig QUIET)
10+
find_path(Random123_PROJ NAMES LICENSE PATHS "${CORENEURON_PROJECT_SOURCE_DIR}/external/Random123")
11+
find_package_handle_standard_args(Random123 REQUIRED_VARS Random123_PROJ)
12+
13+
if(NOT Random123_FOUND)
14+
find_package(Git 1.8.3 QUIET)
15+
if(NOT ${GIT_FOUND})
16+
message(FATAL_ERROR "git not found, clone repository with --recursive")
17+
endif()
18+
message(STATUS "Sub-module Random123 missing: running git submodule update --init --recursive")
19+
execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive --
20+
${CORENEURON_PROJECT_SOURCE_DIR}/external/Random123
21+
WORKING_DIRECTORY ${CORENEURON_PROJECT_SOURCE_DIR})
22+
endif()
23+

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ include(ReleaseDebugAutoFlags)
4747
include(CrayPortability)
4848
include(SetRpath)
4949
include(CTest)
50+
include(AddRandom123Submodule)
5051
include(AddCLI11Submodule)
5152
add_subdirectory(${CORENEURON_PROJECT_SOURCE_DIR}/external/CLI11)
5253

coreneuron/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ file(GLOB_RECURSE CORENEURON_UTILS_FILES "utils/*.c*")
3232
list(APPEND CORENEURON_CODE_FILES ${CORENEURON_UTILS_FILES})
3333
file(GLOB_RECURSE CORENEURON_CUDA_FILES "*.cu")
3434
file(GLOB SCOPMATH_CODE_FILES "sim/scopmath/*.cpp")
35+
file(COPY ${CORENEURON_PROJECT_SOURCE_DIR}/external/Random123/include/Random123
36+
DESTINATION ${CMAKE_BINARY_DIR}/include)
3537

3638
set(DIMPLIC_CODE_FILE "mechanism/mech/dimplic.cpp")
3739
set(ENGINEMECH_CODE_FILE "mechanism/mech/enginemech.cpp")
@@ -174,6 +176,8 @@ target_link_libraries(coreneuron
174176
${CALIPER_LIB}
175177
${CALIPER_MPI_LIB}
176178
${likwid_LIBRARIES})
179+
target_include_directories(coreneuron SYSTEM PRIVATE
180+
${CORENEURON_PROJECT_SOURCE_DIR}/external/Random123/include)
177181
target_include_directories(coreneuron SYSTEM PRIVATE ${CORENEURON_PROJECT_SOURCE_DIR}/external/CLI11/include)
178182

179183
target_link_libraries(corenrnmech scopmath coreneuron)
@@ -291,3 +295,7 @@ endif()
291295
# install nrniv-core app
292296
install(TARGETS nrniv-core DESTINATION bin)
293297
install(FILES apps/coreneuron.cpp DESTINATION share/coreneuron)
298+
299+
# install Random123
300+
install(DIRECTORY ${CMAKE_BINARY_DIR}/include/Random123
301+
DESTINATION include)

0 commit comments

Comments
 (0)