This repository has been archived by the owner on Mar 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 757
Initial build system updates for monorepo #1946
Draft
alliepiper
wants to merge
14
commits into
NVIDIA:main
Choose a base branch
from
alliepiper:monorepo_submodules
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
d81953b
Initial build system updates for monorepo.
alliepiper 0ab6a28
Update CMake option docs.
alliepiper 2e495b9
Allow TOPLEVEL_PROJECT logic to be force enabled.
alliepiper c34e0fb
Version lock Thrust to other CCCL components.
alliepiper e62f9fc
Remove leftover RDC flag tomfoolery.
alliepiper 4b5d403
Remove temporary warning suppression.
alliepiper fb52260
Add `LANGUAGES` keyword to CMake project calls.
alliepiper fe29d3e
Simplify some genexes and update compiler ID where needed.
alliepiper d9990fd
Remove unnecessary NVC++ tweaks.
alliepiper 6ffb161
Add guards against unsupported arch options.
alliepiper 7657c7f
Turn on PIC for RDC targets.
alliepiper 7d9ad98
Update more CUDA compiler id checks.
alliepiper 6b373af
Move dev build toggle to the cccl project level.
alliepiper d5ccade
Remove install tests from Thrust/CUB.
alliepiper File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +0,0 @@ | ||
[submodule "cub"] | ||
path = dependencies/cub | ||
url = ../cub.git | ||
[submodule "libcudacxx"] | ||
path = dependencies/libcudacxx | ||
url = ../libcudacxx.git | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,110 +1,16 @@ | ||
# Set up compiler paths and apply temporary hacks to support NVC++. | ||
# This file must be included before enabling any languages. | ||
|
||
# Temporary hacks to make NVC++ work; this requires you to define | ||
# `CMAKE_CUDA_COMPILER_ID=NVCXX and `CMAKE_CUDA_COMPILER_FORCED=ON`. | ||
if ("NVCXX" STREQUAL "${CMAKE_CUDA_COMPILER_ID}") | ||
# If using NVC++, don't set CXX compiler | ||
if (NOT "${CMAKE_CXX_COMPILER}" STREQUAL "") | ||
unset(CMAKE_CXX_COMPILER CACHE) | ||
message(FATAL_ERROR "You are using NVC++ as your CUDA C++ compiler, but have" | ||
" specified a different ISO C++ compiler; NVC++ acts as both, so please" | ||
" unset the CMAKE_CXX_COMPILER variable." | ||
) | ||
endif() | ||
|
||
# We don't set CMAKE_CUDA_HOST_COMPILER for NVC++; if we do, CMake tries to | ||
# pass `-ccbin ${CMAKE_CUDA_HOST_COMPILER}` to NVC++, which it doesn't | ||
# understand. | ||
if (NOT "${CMAKE_CUDA_HOST_COMPILER}" STREQUAL "") | ||
unset(CMAKE_CUDA_HOST_COMPILER CACHE) | ||
message(FATAL_ERROR "You are using NVC++ as your CUDA C++ compiler, but have" | ||
" specified a different host ISO C++ compiler; NVC++ acts as both, so" | ||
" please unset the CMAKE_CUDA_HOST_COMPILER variable." | ||
) | ||
endif() | ||
|
||
set(CMAKE_CXX_COMPILER "${CMAKE_CUDA_COMPILER}") | ||
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -stdpar") | ||
set(CMAKE_CUDA_HOST_LINK_LAUNCHER "${CMAKE_CUDA_COMPILER}") | ||
set(CMAKE_CUDA_LINK_EXECUTABLE | ||
"<CMAKE_CUDA_HOST_LINK_LAUNCHER> <FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>") | ||
|
||
# Setup CMAKE_CXX_LIBRARY_ARCHITECTURE on Debian/Ubuntu so that find_package | ||
# works properly. | ||
if (EXISTS /etc/debian_version) | ||
if (NOT CMAKE_CXX_LIBRARY_ARCHITECTURE) | ||
file(GLOB files_in_lib RELATIVE /lib /lib/*-linux-gnu* ) | ||
foreach (file ${files_in_lib}) | ||
if ("${file}" MATCHES "${CMAKE_LIBRARY_ARCHITECTURE_REGEX}") | ||
set(CMAKE_CXX_LIBRARY_ARCHITECTURE ${file}) | ||
break() | ||
endif() | ||
endforeach() | ||
endif() | ||
if (NOT CMAKE_LIBRARY_ARCHITECTURE) | ||
set(CMAKE_LIBRARY_ARCHITECTURE ${CMAKE_CXX_LIBRARY_ARCHITECTURE}) | ||
endif() | ||
endif() | ||
endif() | ||
|
||
# We don't set CMAKE_CUDA_HOST_COMPILER for NVC++; if we do, CMake tries to | ||
# pass `-ccbin ${CMAKE_CUDA_HOST_COMPILER}` to NVC++, which it doesn't | ||
# understand. | ||
if ((NOT "NVCXX" STREQUAL "${CMAKE_CUDA_COMPILER_ID}")) | ||
if (NOT ("${CMAKE_CUDA_HOST_COMPILER}" STREQUAL "" OR | ||
if (NOT ("${CMAKE_CUDA_HOST_COMPILER}" STREQUAL "" OR | ||
"${CMAKE_CUDA_HOST_COMPILER}" STREQUAL "${CMAKE_CXX_COMPILER}")) | ||
set(tmp "${CMAKE_CUDA_HOST_COMPILER}") | ||
unset(CMAKE_CUDA_HOST_COMPILER CACHE) | ||
message(FATAL_ERROR | ||
"For convenience, Thrust's test harness uses CMAKE_CXX_COMPILER for the " | ||
"CUDA host compiler. Refusing to overwrite specified " | ||
"CMAKE_CUDA_HOST_COMPILER -- please reconfigure without setting this " | ||
"variable. Currently:\n" | ||
"CMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}\n" | ||
"CMAKE_CUDA_HOST_COMPILER=${tmp}" | ||
) | ||
endif () | ||
set(CMAKE_CUDA_HOST_COMPILER "${CMAKE_CXX_COMPILER}") | ||
endif () | ||
|
||
# Temporary hacks to make NVC++ work; this requires you to define | ||
# `CMAKE_CUDA_COMPILER_ID=NVCXX and `CMAKE_CUDA_COMPILER_FORCED=ON`. | ||
if ("NVCXX" STREQUAL "${CMAKE_CUDA_COMPILER_ID}") | ||
# Need 3.17 for the properties used below. | ||
cmake_minimum_required(VERSION 3.17) | ||
|
||
set(CMAKE_CUDA_STANDARD_DEFAULT 03) | ||
|
||
set(CMAKE_CUDA03_STANDARD_COMPILE_OPTION "-std=c++03") | ||
set(CMAKE_CUDA03_EXTENSION_COMPILE_OPTION "-std=c++03") | ||
set(CMAKE_CUDA03_STANDARD__HAS_FULL_SUPPORT TRUE) | ||
set_property(GLOBAL PROPERTY CMAKE_CUDA03_KNOWN_FEATURES) | ||
|
||
set(CMAKE_CUDA11_STANDARD_COMPILE_OPTION "-std=c++11") | ||
set(CMAKE_CUDA11_EXTENSION_COMPILE_OPTION "-std=c++11") | ||
set(CMAKE_CUDA11_STANDARD__HAS_FULL_SUPPORT TRUE) | ||
set_property(GLOBAL PROPERTY CMAKE_CUDA11_KNOWN_FEATURES) | ||
|
||
set(CMAKE_CUDA14_STANDARD_COMPILE_OPTION "-std=c++14") | ||
set(CMAKE_CUDA14_EXTENSION_COMPILE_OPTION "-std=c++14") | ||
set(CMAKE_CUDA14_STANDARD__HAS_FULL_SUPPORT TRUE) | ||
set_property(GLOBAL PROPERTY CMAKE_CUDA14_KNOWN_FEATURES) | ||
|
||
set(CMAKE_CUDA17_STANDARD_COMPILE_OPTION "-std=c++17") | ||
set(CMAKE_CUDA17_EXTENSION_COMPILE_OPTION "-std=c++17") | ||
set(CMAKE_CUDA17_STANDARD__HAS_FULL_SUPPORT TRUE) | ||
set_property(GLOBAL PROPERTY CMAKE_CUDA17_KNOWN_FEATURES) | ||
|
||
include(Internal/FeatureTesting) | ||
include(Compiler/CMakeCommonCompilerMacros) | ||
cmake_record_cuda_compile_features() | ||
|
||
set(CMAKE_CUDA_COMPILE_FEATURES | ||
${CMAKE_CUDA03_COMPILE_FEATURES} | ||
${CMAKE_CUDA11_COMPILE_FEATURES} | ||
${CMAKE_CUDA14_COMPILE_FEATURES} | ||
${CMAKE_CUDA17_COMPILE_FEATURES} | ||
${CMAKE_CUDA20_COMPILE_FEATURES} | ||
set(tmp "${CMAKE_CUDA_HOST_COMPILER}") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can remove this check from all projects. |
||
unset(CMAKE_CUDA_HOST_COMPILER CACHE) | ||
message(FATAL_ERROR | ||
"For convenience, Thrust's test harness uses CMAKE_CXX_COMPILER for the " | ||
"CUDA host compiler. Refusing to overwrite specified " | ||
"CMAKE_CUDA_HOST_COMPILER -- please reconfigure without setting this " | ||
"variable. Currently:\n" | ||
"CMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}\n" | ||
"CMAKE_CUDA_HOST_COMPILER=${tmp}" | ||
) | ||
endif() | ||
endif () | ||
set(CMAKE_CUDA_HOST_COMPILER "${CMAKE_CXX_COMPILER}") |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name
ThrustCompilerHacks
doesn't really make sense anymore.ThrustSetCUDAHostCompiler
makes it clear what is being done.