Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
arbor
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
arbor-sim
arbor
Commits
75f7a07d
Unverified
Commit
75f7a07d
authored
Jun 16, 2022
by
Benjamin Cumming
Committed by
GitHub
Jun 16, 2022
Browse files
Options
Downloads
Patches
Plain Diff
add cmake checks for non-bundled random123 (#1907)
parent
48ad369d
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
CMakeLists.txt
+11
-1
11 additions, 1 deletion
CMakeLists.txt
cmake/FindRandom123.cmake
+23
-0
23 additions, 0 deletions
cmake/FindRandom123.cmake
ext/CMakeLists.txt
+11
-6
11 additions, 6 deletions
ext/CMakeLists.txt
with
45 additions
and
7 deletions
CMakeLists.txt
+
11
−
1
View file @
75f7a07d
...
...
@@ -232,6 +232,8 @@ install(FILES mechanisms/generate_catalogue DESTINATION ${ARB_INSTALL_DATADIR} P
# External libraries in `ext` sub-directory: json, tinyopt and randon123.
# Creates interface libraries `ext-json`, `ext-tinyopt` and `ext-random123`
cmake_dependent_option
(
ARB_USE_BUNDLED_FMT
"Use bundled FMT lib."
ON
"ARB_USE_BUNDLED_LIBS"
OFF
)
cmake_dependent_option
(
ARB_USE_BUNDLED_JSON
"Use bundled Niels Lohmann's json library."
ON
"ARB_USE_BUNDLED_LIBS"
OFF
)
if
(
NOT ARB_USE_BUNDLED_JSON
)
find_package
(
nlohmann_json
)
...
...
@@ -239,9 +241,17 @@ if(NOT ARB_USE_BUNDLED_JSON)
else
()
unset
(
nlohmann_json_DIR CACHE
)
endif
()
cmake_dependent_option
(
ARB_USE_BUNDLED_RANDOM123
"Use bundled Random123 lib."
ON
"ARB_USE_BUNDLED_LIBS"
OFF
)
add_library
(
ext-random123 INTERFACE
)
if
(
NOT ARB_USE_BUNDLED_RANDOM123
)
find_package
(
Random123 REQUIRED
)
target_include_directories
(
ext-random123 INTERFACE
${
RANDOM123_INCLUDE_DIR
}
)
endif
()
add_subdirectory
(
ext
)
cmake_dependent_option
(
ARB_USE_BUNDLED_FMT
"Use bundled FMT lib."
ON
"ARB_USE_BUNDLED_LIBS"
OFF
)
install
(
TARGETS ext-random123 EXPORT arbor-targets
)
# Keep track of packages we need to add to the generated CMake config
# file for arbor.
...
...
This diff is collapsed.
Click to expand it.
cmake/FindRandom123.cmake
0 → 100644
+
23
−
0
View file @
75f7a07d
# CMake find_package() Module for Random123 header-only C++ library
# https://github.com/DEShawResearch/random123
#
# Example usage:
#
# find_package(Random123)
#
# If successful the following variables will be defined
# RANDOM123_FOUND
# RANDOM123_INCLUDE_DIR
find_path
(
RANDOM123_INCLUDE_DIR Random123/threefry.h
)
if
(
RANDOM123_INCLUDE_DIR
)
set
(
RANDOM123_FOUND TRUE
)
message
(
STATUS
"Found Random123:
${
RANDOM123_INCLUDE_DIR
}
"
)
endif
()
if
(
RANDOM123_FIND_REQUIRED AND NOT RANDOM123_FOUND
)
message
(
FATAL_ERROR
"Required package Random123 not found"
)
endif
()
This diff is collapsed.
Click to expand it.
ext/CMakeLists.txt
+
11
−
6
View file @
75f7a07d
...
...
@@ -6,17 +6,22 @@ if(ARB_USE_BUNDLED_JSON)
set
(
json_library_name ext-json PARENT_SCOPE
)
endif
()
# Random123 (DE Shaw Research) counter-based random number generators (header-only)
if
(
ARB_USE_BUNDLED_RANDOM123
)
check_git_submodule
(
random123 random123
)
if
(
NOT random123_avail
)
message
(
FATAL_ERROR
"Required Random123 submodule is not available."
)
endif
()
target_include_directories
(
ext-random123 INTERFACE $<BUILD_INTERFACE:
${
CMAKE_CURRENT_SOURCE_DIR
}
>/random123/include
)
message
(
STATUS
"Using Random123 submodule:
${
CMAKE_CURRENT_SOURCE_DIR
}
>/random123"
)
endif
()
# tinyopt command line parsing libary (header-only).
add_library
(
ext-tinyopt INTERFACE
)
target_include_directories
(
ext-tinyopt INTERFACE tinyopt/include
)
# Random123 (DE Shaw Research) counter-based random number generators (header-only)
add_library
(
ext-random123 INTERFACE
)
target_include_directories
(
ext-random123 INTERFACE $<BUILD_INTERFACE:
${
CMAKE_CURRENT_SOURCE_DIR
}
>/random123/include
)
install
(
TARGETS ext-random123 EXPORT arbor-targets
)
# Google benchmark for microbenchmarks:
check_git_submodule
(
gbench google-benchmark
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment