Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
arbd
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tbgl
tools
arbd
Commits
6bb14c83
Commit
6bb14c83
authored
2 years ago
by
cmaffeo2
Browse files
Options
Downloads
Patches
Plain Diff
Add DEBUG CMake flag
parent
be85a0b7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
CMakeLists.txt
+21
-15
21 additions, 15 deletions
CMakeLists.txt
with
21 additions
and
15 deletions
CMakeLists.txt
+
21
−
15
View file @
6bb14c83
...
...
@@ -8,12 +8,6 @@ endif()
# option(USE_CUDA "Use CUDA" ON)
set
(
USE_CUDA ON
)
if
(
USE_CUDA
)
project
(
arbd VERSION 1.2 LANGUAGES CXX CUDA
)
else
(
USE_CUDA
)
project
(
arbd VERSION 1.2 LANGUAGES CXX
)
endif
()
## specify the C++ standard
set
(
CMAKE_CXX_STANDARD 14
)
set
(
CMAKE_CXX_STANDARD_REQUIRED True
)
...
...
@@ -31,7 +25,6 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
endif
()
if
(
CMAKE_CXX_COMPILER_ID STREQUAL
"GNU"
)
## Some CMake versions use -O2 for release; replace with -O3
if
(
CMAKE_CXX_FLAGS_RELEASE
)
...
...
@@ -44,14 +37,14 @@ endif()
## OPTIONS
option
(
DEBUG
"Build with debug flags"
False
)
option
(
USE_NCCL
"Use NCCL for single node GPU peer communication"
False
)
option
(
USE_NVTX
"Build with NVTX profiling ranges"
False
)
option
(
DEBUG
"Build with debug flags"
False
)
# (not yet optional) message(STATUS "USE_CUDA: ${USE_CUDA}")
message
(
STATUS
"DEBUG:
${
DEBUG
}
"
)
message
(
STATUS
"USE_NCCL:
${
USE_NCCL
}
"
)
message
(
STATUS
"USE_NVTX:
${
USE_NVTX
}
"
)
message
(
STATUS
"DEBUG:
${
DEBUG
}
"
)
## Set flags before adding executable
...
...
@@ -66,18 +59,31 @@ if(USE_CUDA)
include_directories
(
${
CUDA_INCLUDE_DIRS
}
)
endif
()
if
(
DEBUG
)
set
(
CMAKE_BUILD_TYPE Debug
)
set
(
PROJECT_NAME arbd_dbg
)
else
(
DEBUG
)
set
(
PROJECT_NAME arbd
)
endif
()
if
(
USE_NVTX
)
add_definitions
(
-DUSE_NVTX
)
endif
()
if
(
USE_NCCL
)
add_definitions
(
-DUSE_NCCL
)
target_link_libraries
(
arbd
PRIVATE nccl
)
target_link_libraries
(
"
${
PROJECT_NAME
}
"
PRIVATE nccl
)
endif
()
## Two lines below needed?
set
(
CMAKE_CUDA_SEPARABLE_COMPILATION ON
)
set
(
CMAKE_POSITION_INDEPENDENT_CODE ON
)
if
(
USE_CUDA
)
project
(
"
${
PROJECT_NAME
}
"
VERSION 1.2 LANGUAGES CXX CUDA
)
else
(
USE_CUDA
)
project
(
"
${
PROJECT_NAME
}
"
VERSION 1.2 LANGUAGES CXX
)
endif
()
## Print all variables by uncommenting block below
# get_cmake_property(_variableNames VARIABLES)
# list (SORT _variableNames)
...
...
@@ -90,7 +96,7 @@ set(CMAKE_MACOSX_RPATH 1) # Unsure if this works for CMAKE_BUIlD_RPATH, or just
set
(
CMAKE_BUILD_RPATH
"
${
CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES
}
"
)
# set(CMAKE_VERBOSE_MAKEFILE True)
add_executable
(
arbd
src/arbd.cpp
add_executable
(
"
${
PROJECT_NAME
}
"
src/arbd.cpp
src/Configuration.cpp
src/FlowForce.cpp
src/GPUManager.cpp
...
...
@@ -130,13 +136,13 @@ add_executable(arbd src/arbd.cpp
## Add optional libraries
if
(
USE_CUDA
)
target_link_libraries
(
arbd
PRIVATE curand
)
target_link_libraries
(
"
${
PROJECT_NAME
}
"
PRIVATE curand
)
endif
()
if
(
USE_NCCL
)
target_link_libraries
(
arbd
PRIVATE nccl
)
target_link_libraries
(
"
${
PROJECT_NAME
}
"
PRIVATE nccl
)
endif
()
if
(
USE_NVTX
)
target_link_libraries
(
arbd
PRIVATE nvToolsExt
)
target_link_libraries
(
"
${
PROJECT_NAME
}
"
PRIVATE nvToolsExt
)
endif
()
install
(
TARGETS
arbd
)
install
(
TARGETS
"
${
PROJECT_NAME
}
"
)
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
register
or
sign in
to comment