Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework libcudf CMakeLists.txt to export targets for CPM #7107

Merged
merged 99 commits into from
Mar 2, 2021
Merged
Show file tree
Hide file tree
Changes from 77 commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
30a890b
move JIT header stringification into separate CMake module
trxcllnt Dec 15, 2020
0a8e80d
Silence cython's '-Wstrict-prototypes' warning
trxcllnt Dec 16, 2020
3b560dc
Move thirdparty/CMakeLists.txt to cmake/Modules/CUDF_thirdparty.cmake
trxcllnt Dec 16, 2020
1801542
Define include paths and link libraries as transitive requirements of…
trxcllnt Dec 16, 2020
0854304
move PTDS option to top
trxcllnt Dec 16, 2020
ae288d6
Merge branch 'branch-0.18' of github.com:rapidsai/cudf into fix/cmake…
trxcllnt Dec 16, 2020
8b1c1d0
WAR libcudacxx dependency getting configured when LLVM is installed
trxcllnt Dec 16, 2020
f84a8e6
fix find_package(dlpack) call
trxcllnt Dec 16, 2020
b12e23a
set the default export name to 'cudf'
trxcllnt Dec 16, 2020
bf95537
hush dlpack
trxcllnt Dec 16, 2020
c3c0708
add rmm and spdlog to cudf target interface include paths
trxcllnt Dec 16, 2020
0653c77
use CPMAddPackage instead of CPMFindPackage
trxcllnt Dec 16, 2020
3b6654c
Fix RMM resolution to work with source builds, use CPM to find or ins…
trxcllnt Dec 16, 2020
95b6d23
fix CPM arrow, wrap CPM things in cmake functions
trxcllnt Dec 17, 2020
0622d4c
add arrow library interface include dirs
trxcllnt Dec 17, 2020
4e6c2ba
silence arrow GCC warnings
trxcllnt Dec 17, 2020
f7616cf
Merge branch 'branch-0.18' of github.com:rapidsai/cudf into fix/cmake…
trxcllnt Dec 17, 2020
f9512fd
add AUTO_DETECT_CUDA_ARCHITECTURES option
trxcllnt Dec 17, 2020
2cd2108
don't set ARROW_USE_CCACHE because it rewrites CMake's RULE_LAUNCH_CO…
trxcllnt Dec 18, 2020
9357077
manually install a few arrow headers
trxcllnt Dec 18, 2020
9014218
fix auto detect logic for legacy flag
trxcllnt Dec 18, 2020
05c4150
allow overriding generated JIT and libcudacxx install dir (for ccache)
trxcllnt Dec 18, 2020
dfff28e
Merge branch 'branch-0.18' of github.com:rapidsai/cudf into fix/cmake…
trxcllnt Dec 18, 2020
eeffda0
fix typo in CPM option DONWLOAD_ONLY -> DOWNLOAD_ONLY
trxcllnt Dec 18, 2020
50a595c
Merge branch 'branch-0.18' of github.com:rapidsai/cudf into fix/cmake…
trxcllnt Jan 7, 2021
db210ff
stop using/setting most global CMAKE_ variables
trxcllnt Jan 7, 2021
44f8a7a
fix lint
trxcllnt Jan 8, 2021
9b9d497
link the Gtest and benchmark alias libraries
trxcllnt Jan 10, 2021
30a2483
relax libboost version for ubuntu bionic
trxcllnt Jan 11, 2021
f99214d
fix building Arrow on aarch64
trxcllnt Jan 12, 2021
fc85527
Merge branch 'branch-0.18' of github.com:rapidsai/cudf into fix/cmake…
trxcllnt Jan 12, 2021
fdaab22
rename CMake project to CUDF, use linker script instead of separating…
trxcllnt Jan 13, 2021
ffd1554
Merge branch 'branch-0.18' of github.com:rapidsai/cudf into fix/cmake…
trxcllnt Jan 13, 2021
384756a
don't set SUPPORTED_CUDA_ARCHITECTURES
trxcllnt Jan 14, 2021
de3cdbe
make target compile options private
trxcllnt Jan 14, 2021
e5c509c
remove project() from tests and benchmarks CMakeLists.txt
trxcllnt Jan 14, 2021
4b27079
use CMAKE_PREFIX_PATH instead of modifying CMAKE_SYSTEM_PREFIX_PATH
trxcllnt Jan 14, 2021
099da5e
Merge branch 'branch-0.18' of github.com:rapidsai/cudf into fix/cmake…
trxcllnt Jan 18, 2021
b37eef4
remove strings/sorting.cu from src files
trxcllnt Jan 18, 2021
0da4783
fix typo
trxcllnt Jan 20, 2021
13107df
Merge branch 'branch-0.19' into fix/cmake-exports
trxcllnt Feb 3, 2021
a2b8f06
add new files to src files list
trxcllnt Feb 3, 2021
a07bb14
set SPDLOG_ACTIVE_LEVEL to RMM_LOGGING_LEVEL
trxcllnt Feb 3, 2021
a52fcf3
Use message(VERBOSE) to reduce cmake output
robertmaynard Feb 2, 2021
6c5765c
CMake now support CONDA_PREFIX out of the box in 3.18
robertmaynard Feb 2, 2021
983b2df
Use relative source paths where possible.
robertmaynard Feb 2, 2021
38684f4
Use PROJECT_VERSION over CMAKE_PROJECT_VERSION
robertmaynard Feb 2, 2021
42cf21e
Prefer usage of list() commands for manipulaton
robertmaynard Feb 2, 2021
a1e8687
Find package shouldn't modify cmake minimum version settings
robertmaynard Feb 2, 2021
865b8aa
Unify multiple install commands into single command when possible.
robertmaynard Feb 2, 2021
cfe2f0c
Simplify cudf cpp test CMake code
robertmaynard Feb 2, 2021
7f2f180
Simplify cudf cpp benchmark CMake code
robertmaynard Feb 2, 2021
dfc3d95
Remove overridding selected CMake's C and C++ compiler
robertmaynard Feb 2, 2021
125697d
libcudf_kafka CMakeLists prefers relative source paths
robertmaynard Feb 2, 2021
6a2f8ad
Use modern cmake style where endif()/endfunction() is empty
robertmaynard Feb 3, 2021
d1ac04d
Use CMake 3.X string literals to remove need for string escapes
robertmaynard Feb 3, 2021
c99cb67
Merge branch 'branch-0.19' into fix/cmake-exports
trxcllnt Feb 4, 2021
0e91e19
cmake --build all target in build.sh
trxcllnt Feb 5, 2021
e7d490b
remove all target
trxcllnt Feb 5, 2021
ee703b2
add new source files after merge
trxcllnt Feb 5, 2021
92062a9
SetGPUArchs updated to work around a CMake FindCUDAToolkit issue
robertmaynard Feb 8, 2021
ac428e4
Merge branch 'branch-0.19' into fix/cmake-exports
trxcllnt Feb 8, 2021
008cdec
build.sh correctly invokes the install target
robertmaynard Feb 11, 2021
d67fa7b
Merge branch 'branch-0.19' of github.com:rapidsai/cudf into fix/cmake…
trxcllnt Feb 11, 2021
4e37b99
move CPMFindPackage for GTest and GBench to top-level CMakeLists.txt
trxcllnt Feb 11, 2021
b445e00
add cudftestutils to cudf-targets
trxcllnt Feb 11, 2021
3bc873b
Use the CMake Threads abstraction over pthreads
robertmaynard Feb 11, 2021
3189f74
FindThrust better matches CMake best practices
robertmaynard Feb 11, 2021
77aff6e
cudf build directory can now be CPM'd
robertmaynard Feb 9, 2021
76259a1
add arrow_static and arrow_cuda_static to export targets
trxcllnt Feb 11, 2021
d8e036f
Merge branch 'branch-0.19' into fix/cmake-exports
robertmaynard Feb 17, 2021
08e20cf
Move EvalGPUArchs to cpp/cmake/Modules
robertmaynard Feb 17, 2021
0a6ff80
Don't try to export CPM deps when they are found locally
robertmaynard Feb 17, 2021
abad7f0
Merge branch 'branch-0.19' of github.com:rapidsai/cudf into fix/cmake…
trxcllnt Feb 19, 2021
f78ea9b
remove unused AUTO_DETECT_CUDA_ARCHITECTURES option
trxcllnt Feb 19, 2021
002ccc3
conditionally add gtest/gmock/benchmark to cudf-targets group
trxcllnt Feb 19, 2021
211ca23
Merge branch 'branch-0.19' of github.com:rapidsai/cudf into fix/cmake…
trxcllnt Feb 19, 2021
a9bb948
add missing source file
trxcllnt Feb 19, 2021
c8214a1
Merge branch 'branch-0.19' of github.com:rapidsai/cudf into fix/cmake…
trxcllnt Feb 19, 2021
bdf4164
fix path to EvalGpuArchs.cmake
trxcllnt Feb 19, 2021
f3f00f6
actually fix path to EvalGPUArchs.cmake
trxcllnt Feb 19, 2021
d3db293
Merge branch 'branch-0.19' of github.com:rapidsai/cudf into fix/cmake…
trxcllnt Feb 19, 2021
cd08f2a
print CMAKE_CUDA_ARCHITECTURES during CMake configuration
trxcllnt Feb 22, 2021
4cd393f
set CUDA in the CMake project's languages list
trxcllnt Feb 22, 2021
f6c7ebe
do enable_language(CUDA) after find_package(CUDAToolkit) again
trxcllnt Feb 22, 2021
2d0446e
move enable_language(CUDA) up a bit
trxcllnt Feb 22, 2021
81ce55a
Merge branch 'branch-0.19' into fix/cmake-exports
trxcllnt Feb 23, 2021
c3a2613
don't modify CUDF_CXX_FLAGS and CMAKE_CUDA_FLAGS
trxcllnt Feb 24, 2021
8ae29e9
Add or find arrow install targets
trxcllnt Feb 24, 2021
e7fa045
Add RMM binary dir to CMAKE_PREFIX_PATH
trxcllnt Feb 24, 2021
f84e4a1
Work around GoogleBench bug with pthreads
trxcllnt Feb 24, 2021
7ca7527
cosmetic updates
trxcllnt Feb 24, 2021
71990ed
remove duplicate include in cudf-build-config.cmake, revert jit-cache…
trxcllnt Feb 24, 2021
25c9d59
only build for sm when auto-detecting CUDA archs
trxcllnt Feb 24, 2021
fb0c1de
only use fatbin.ld for non-release builds
trxcllnt Feb 24, 2021
65d7b35
handle ALL result from EvalGPUArchs.cmake
trxcllnt Feb 24, 2021
2bbcada
Merge branch 'branch-0.19' into fix/cmake-exports
trxcllnt Feb 26, 2021
dcbc978
use fatbin.ld linker script in release builds
trxcllnt Feb 26, 2021
8e301b3
Merge branch 'branch-0.19' of github.com:rapidsai/cudf into fix/cmake…
trxcllnt Mar 1, 2021
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
20 changes: 7 additions & 13 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,10 @@ if hasArg clean; then
fi

if (( ${BUILD_ALL_GPU_ARCH} == 0 )); then
GPU_ARCH="-DGPU_ARCHS="
CUDF_CMAKE_CUDA_ARCHITECTURES="-DCMAKE_CUDA_ARCHITECTURES="
echo "Building for the architecture of the GPU in the system..."
else
GPU_ARCH="-DGPU_ARCHS=ALL"
CUDF_CMAKE_CUDA_ARCHITECTURES=""
echo "Building for *ALL* supported GPU architectures..."
fi

Expand All @@ -148,26 +148,20 @@ fi
if buildAll || hasArg libcudf; then
cmake -S $REPODIR/cpp -B ${LIB_BUILD_DIR} \
-DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} \
${GPU_ARCH} \
${CUDF_CMAKE_CUDA_ARCHITECTURES} \
-DUSE_NVTX=${BUILD_NVTX} \
-DBUILD_TESTS=${BUILD_TESTS} \
-DBUILD_BENCHMARKS=${BUILD_BENCHMARKS} \
-DDISABLE_DEPRECATION_WARNING=${BUILD_DISABLE_DEPRECATION_WARNING} \
-DPER_THREAD_DEFAULT_STREAM=${BUILD_PER_THREAD_DEFAULT_STREAM} \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE}

cd ${LIB_BUILD_DIR}
if [[ ${INSTALL_TARGET} != "" ]]; then
cmake --build . -j${PARALLEL_LEVEL} --target install_cudf ${VERBOSE_FLAG}
else
cmake --build . -j${PARALLEL_LEVEL} --target cudf ${VERBOSE_FLAG}
fi

if [[ ${BUILD_TESTS} == "ON" ]]; then
cmake --build . -j${PARALLEL_LEVEL} --target build_tests_cudf ${VERBOSE_FLAG}
fi
cmake --build . -j${PARALLEL_LEVEL} ${VERBOSE_FLAG}

if [[ ${BUILD_BENCHMARKS} == "ON" ]]; then
cmake --build . -j${PARALLEL_LEVEL} --target build_benchmarks_cudf ${VERBOSE_FLAG}
if [[ ${INSTALL_TARGET} != "" ]]; then
cmake --build . -j${PARALLEL_LEVEL} --target install ${VERBOSE_FLAG}
fi
fi

Expand Down
1,138 changes: 502 additions & 636 deletions cpp/CMakeLists.txt

Large diffs are not rendered by default.

283 changes: 78 additions & 205 deletions cpp/benchmarks/CMakeLists.txt

Large diffs are not rendered by default.

91 changes: 0 additions & 91 deletions cpp/cmake/Modules/ConfigureArrow.cmake

This file was deleted.

64 changes: 64 additions & 0 deletions cpp/cmake/Modules/ConfigureCUDA.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#=============================================================================
# Copyright (c) 2018-2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================

# Find the CUDAToolkit
find_package(CUDAToolkit REQUIRED)

message(STATUS "CUDF: CUDAToolkit_VERSION: ${CUDAToolkit_VERSION}")
message(VERBOSE "CUDF: CUDAToolkit_VERSION_MAJOR: ${CUDAToolkit_VERSION_MAJOR}")
message(VERBOSE "CUDF: CUDAToolkit_VERSION_MINOR: ${CUDAToolkit_VERSION_MINOR}")

# Auto-detect available GPU compute architectures

include(${CUDF_SOURCE_DIR}/cmake/Modules/SetGPUArchs.cmake)
message(STATUS "CUDF: Building CUDF for GPU architectures: ${CMAKE_CUDA_ARCHITECTURES}")

# Only enable the CUDA language after including SetGPUArchs.cmake
enable_language(CUDA)

if(NOT CMAKE_CUDA_COMPILER)
message(SEND_ERROR "CUDF: CMake cannot locate a CUDA compiler")
endif()

if(CMAKE_COMPILER_IS_GNUCXX)
list(APPEND CUDF_CXX_FLAGS -Wall -Werror -Wno-unknown-pragmas -Wno-error=deprecated-declarations)
if(CUDF_BUILD_TESTS OR CUDF_BUILD_BENCHMARKS)
# Suppress parentheses warning which causes gmock to fail
list(APPEND CUDF_CUDA_FLAGS -Xcompiler=-Wno-parentheses)
endif()
endif()

list(APPEND CUDF_CUDA_FLAGS --expt-extended-lambda --expt-relaxed-constexpr)
kkraus14 marked this conversation as resolved.
Show resolved Hide resolved

# set warnings as errors
list(APPEND CUDF_CUDA_FLAGS -Werror=cross-execution-space-call)
list(APPEND CUDF_CUDA_FLAGS -Xcompiler=-Wall,-Werror,-Wno-error=deprecated-declarations)

if(DISABLE_DEPRECATION_WARNING)
list(APPEND CUDF_CXX_FLAGS -Wno-deprecated-declarations)
list(APPEND CUDF_CUDA_FLAGS -Xcompiler=-Wno-deprecated-declarations)
endif()

# Option to enable line info in CUDA device compilation to allow introspection when profiling / memchecking
if(CUDA_ENABLE_LINEINFO)
list(APPEND CUDF_CUDA_FLAGS -lineinfo)
endif()

# Debug options
if(CMAKE_BUILD_TYPE MATCHES Debug)
message(VERBOSE "CUDF: Building with debugging flags")
list(APPEND CUDF_CUDA_FLAGS -G -Xcompiler=-rdynamic)
endif()
48 changes: 0 additions & 48 deletions cpp/cmake/Modules/ConfigureGoogleBenchmark.cmake

This file was deleted.

48 changes: 0 additions & 48 deletions cpp/cmake/Modules/ConfigureGoogleTest.cmake

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#=============================================================================
# Copyright (c) 2019-2020, NVIDIA CORPORATION.
# Copyright (c) 2019-2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -14,12 +14,14 @@
# limitations under the License.
#=============================================================================

enable_language(CUDA)

function(evaluate_gpu_archs gpu_archs)
set(eval_file ${PROJECT_BINARY_DIR}/eval_gpu_archs.cu)
set(eval_exe ${PROJECT_BINARY_DIR}/eval_gpu_archs)
set(error_file ${PROJECT_BINARY_DIR}/eval_gpu_archs.stderr.log)
file(WRITE ${eval_file}
"
[=[
#include <cstdio>
#include <set>
#include <string>
Expand All @@ -32,23 +34,23 @@ int main(int argc, char** argv) {
char buff[32];
cudaDeviceProp prop;
if(cudaGetDeviceProperties(&prop, dev) != cudaSuccess) continue;
sprintf(buff, \"%d%d\", prop.major, prop.minor);
sprintf(buff, "%d%d", prop.major, prop.minor);
archs.insert(buff);
}
}
if(archs.empty()) {
printf(\"ALL\");
printf("ALL");
} else {
bool first = true;
for(const auto& arch : archs) {
printf(first? \"%s\" : \";%s\", arch.c_str());
printf(first? "%s" : ";%s", arch.c_str());
first = false;
}
}
printf(\"\\n\");
printf("\n");
return 0;
}
")
]=])
execute_process(
COMMAND ${CMAKE_CUDA_COMPILER}
-std=c++11
Expand All @@ -58,6 +60,6 @@ int main(int argc, char** argv) {
OUTPUT_VARIABLE __gpu_archs
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_FILE ${error_file})
message("Auto detection of gpu-archs: ${__gpu_archs}")
message(VERBOSE "CUDF: Auto detection of gpu-archs: ${__gpu_archs}")
set(${gpu_archs} ${__gpu_archs} PARENT_SCOPE)
endfunction(evaluate_gpu_archs)
endfunction()
Loading