Skip to content

Commit

Permalink
revert style stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
jameslamb committed Jan 24, 2025
1 parent 9109dbd commit 8ae3988
Show file tree
Hide file tree
Showing 11 changed files with 69 additions and 221 deletions.
32 changes: 0 additions & 32 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,38 +53,6 @@ repos:
hooks:
- id: rapids-dependency-file-generator
args: ["--clean"]
- repo: local
hooks:
- id: doxygen-check
name: doxygen-check
entry: ./ci/checks/doxygen.sh
files: ^cpp/include/
types_or: [file]
language: system
pass_filenames: false
verbose: true
- id: cmake-format
name: cmake-format
entry: ./cpp/scripts/run-cmake-format.sh cmake-format
language: python
types: [cmake]
# Note that pre-commit autoupdate does not update the versions
# of dependencies, so we'll have to update this manually.
additional_dependencies:
- cmakelang==0.6.13
verbose: true
require_serial: true
- id: cmake-lint
name: cmake-lint
entry: ./cpp/scripts/run-cmake-format.sh cmake-lint
language: python
types: [cmake]
# Note that pre-commit autoupdate does not update the versions
# of dependencies, so we'll have to update this manually.
additional_dependencies:
- cmakelang==0.6.13
verbose: true
require_serial: true
- repo: https://github.com/codespell-project/codespell
rev: v2.2.2
hooks:
Expand Down
6 changes: 0 additions & 6 deletions ci/check_style.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,5 @@ rapids-dependency-file-generator \
rapids-mamba-retry env create --yes -f env.yaml -n checks
conda activate checks

# get config for cmake-format checks
FORMAT_FILE_URL="https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-25.02/cmake-format-rapids-cmake.json"
export RAPIDS_CMAKE_FORMAT_FILE=/tmp/rapids_cmake_ci/cmake-formats-rapids-cmake.json
mkdir -p $(dirname ${RAPIDS_CMAKE_FORMAT_FILE})
wget -O ${RAPIDS_CMAKE_FORMAT_FILE} ${FORMAT_FILE_URL}

# Run pre-commit checks
pre-commit run --all-files --show-diff-on-failure
32 changes: 17 additions & 15 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@ if(_version_contents MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+).*$")
set(libucxx_version "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}.${CMAKE_MATCH_3}")
else()
string(REPLACE "\n" "\n " _version_contents_formatted "${_version_contents}")
message(
FATAL_ERROR
"Could not determine ucxx version. Contents of VERSION file:\n ${_version_contents_formatted}"
)
message(FATAL_ERROR "Could not determine ucxx version. Contents of VERSION file:\n ${_version_contents_formatted}")
endif()

project(
Expand Down Expand Up @@ -59,9 +56,7 @@ set(UCXX_BUILD_TESTS ${BUILD_TESTS})
set(UCXX_BUILD_BENCHMARKS ${BUILD_BENCHMARKS})
set(UCXX_BUILD_EXAMPLES ${BUILD_EXAMPLES})

set(UCXX_CXX_FLAGS -Wall -Wattributes -Werror -Wextra -Wsign-conversion
-Wno-missing-field-initializers
)
set(UCXX_CXX_FLAGS -Wall -Wattributes -Werror -Wextra -Wsign-conversion -Wno-missing-field-initializers)
set(UCXX_CXX_DEFINITIONS "")

# Set RMM logging level
Expand Down Expand Up @@ -174,7 +169,9 @@ set_target_properties(
INTERFACE_POSITION_INDEPENDENT_CODE ON
)

target_compile_options(ucxx PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:${UCXX_CXX_FLAGS}>")
target_compile_options(
ucxx PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:${UCXX_CXX_FLAGS}>"
)

# Specify include paths for the current target and dependents
target_include_directories(
Expand All @@ -184,21 +181,24 @@ target_include_directories(
INTERFACE "$<INSTALL_INTERFACE:include>"
)

target_compile_definitions(ucxx PUBLIC "$<$<COMPILE_LANGUAGE:CXX>:${UCXX_CXX_DEFINITIONS}>")
target_compile_definitions(
ucxx PUBLIC "$<$<COMPILE_LANGUAGE:CXX>:${UCXX_CXX_DEFINITIONS}>"
)

# Enable RMM if necessary
if(UCXX_ENABLE_RMM)
target_link_libraries(ucxx PUBLIC rmm::rmm)
target_link_libraries(ucxx
PUBLIC rmm::rmm
)

# Define spdlog level
target_compile_definitions(
ucxx PUBLIC UCXX_ENABLE_RMM "SPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_${RMM_LOGGING_LEVEL}"
)
# Define spdlog level
target_compile_definitions(ucxx PUBLIC UCXX_ENABLE_RMM "SPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_${RMM_LOGGING_LEVEL}")
endif()

# Specify the target module library dependencies
target_link_libraries(ucxx PUBLIC ucx::ucp)


# Add Conda library, and include paths if specified
if(TARGET conda_env)
target_link_libraries(ucxx PRIVATE conda_env)
Expand Down Expand Up @@ -251,7 +251,9 @@ install(
EXPORT ucxx-exports
)

install(DIRECTORY ${UCXX_SOURCE_DIR}/include/ucxx DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
install(DIRECTORY ${UCXX_SOURCE_DIR}/include/ucxx
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)

set(doc_string
[=[
Expand Down
5 changes: 4 additions & 1 deletion cpp/benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ function(ConfigureBench CMAKE_BENCH_NAME)
CXX_STANDARD 17
CXX_STANDARD_REQUIRED ON
)
target_link_libraries(${CMAKE_BENCH_NAME} PRIVATE ucxx $<TARGET_NAME_IF_EXISTS:conda_env>)
target_link_libraries(
${CMAKE_BENCH_NAME} PRIVATE ucxx
$<TARGET_NAME_IF_EXISTS:conda_env>
)
add_custom_command(
OUTPUT UCXX_BENCHMARKS
# COMMAND ${CMAKE_BENCH_NAME} --benchmark_out_format=json
Expand Down
50 changes: 0 additions & 50 deletions cpp/cmake/config.json

This file was deleted.

5 changes: 4 additions & 1 deletion cpp/examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ function(ConfigureBench CMAKE_BENCH_NAME)
CXX_STANDARD 17
CXX_STANDARD_REQUIRED ON
)
target_link_libraries(${CMAKE_BENCH_NAME} PRIVATE ucxx $<TARGET_NAME_IF_EXISTS:conda_env>)
target_link_libraries(
${CMAKE_BENCH_NAME} PRIVATE ucxx
$<TARGET_NAME_IF_EXISTS:conda_env>
)
add_custom_command(
OUTPUT UCXX_EXAMPLES
COMMAND ${CMAKE_BENCH_NAME}
Expand Down
42 changes: 24 additions & 18 deletions cpp/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@ if(_version_contents MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+).*$")
set(libucxx_version "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}.${CMAKE_MATCH_3}")
else()
string(REPLACE "\n" "\n " _version_contents_formatted "${_version_contents}")
message(
FATAL_ERROR
"Could not determine ucxx version. Contents of VERSION file:\n ${_version_contents_formatted}"
)
message(FATAL_ERROR "Could not determine ucxx version. Contents of VERSION file:\n ${_version_contents_formatted}")
endif()

project(
Expand Down Expand Up @@ -81,8 +78,13 @@ endif()
# ##################################################################################################
# * python library --------------------------------------------------------------------------------
add_library(
ucxx_python src/exception.cpp src/future.cpp src/notifier.cpp src/python_future.cpp
src/python_future_task_collector.cpp src/worker.cpp
ucxx_python
src/exception.cpp
src/future.cpp
src/notifier.cpp
src/python_future.cpp
src/python_future_task_collector.cpp
src/worker.cpp
)

set_target_properties(
Expand All @@ -97,28 +99,34 @@ set_target_properties(
INTERFACE_POSITION_INDEPENDENT_CODE ON
)

target_compile_options(ucxx_python PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:${UCXX_CXX_FLAGS}>")
target_compile_options(
ucxx_python PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:${UCXX_CXX_FLAGS}>"
)

get_filename_component(ucxx_dir "${CMAKE_CURRENT_SOURCE_DIR}" DIRECTORY)

# Specify include paths for the current target and dependents
target_include_directories(
ucxx_python
PUBLIC "$<BUILD_INTERFACE:${ucxx_dir}/include>" "$<BUILD_INTERFACE:${ucxx_dir}/python/include>"
PUBLIC "$<BUILD_INTERFACE:${ucxx_dir}/include>"
"$<BUILD_INTERFACE:${ucxx_dir}/python/include>"
PRIVATE "$<BUILD_INTERFACE:${ucxx_dir}/src>"
INTERFACE "$<INSTALL_INTERFACE:include>"
)

target_compile_definitions(ucxx_python PUBLIC "$<$<COMPILE_LANGUAGE:CXX>:${UCXX_CXX_DEFINITIONS}>")
target_compile_definitions(
ucxx_python PUBLIC "$<$<COMPILE_LANGUAGE:CXX>:${UCXX_CXX_DEFINITIONS}>"
)

target_compile_definitions(ucxx_python PUBLIC UCXX_ENABLE_PYTHON)
# Define spdlog level
target_compile_definitions(
ucxx_python PUBLIC "SPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_${RMM_LOGGING_LEVEL}"
)
target_compile_definitions(ucxx_python PUBLIC "SPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_${RMM_LOGGING_LEVEL}")

# Specify the target module library dependencies
target_link_libraries(ucxx_python PUBLIC rmm::rmm ucx::ucp ucxx::ucxx ${UCXX_PYTHON_LIB})
target_link_libraries(
ucxx_python
PUBLIC rmm::rmm ucx::ucp ucxx::ucxx ${UCXX_PYTHON_LIB}
)

# Add Conda library, and include paths if specified
if(TARGET conda_env)
Expand All @@ -127,12 +135,10 @@ endif()

include(GNUInstallDirs)
add_library(ucxx::python ALIAS ucxx_python)
install(DIRECTORY ${ucxx_dir}/python/include/ucxx DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
install(
TARGETS ucxx_python
DESTINATION ${CMAKE_INSTALL_LIBDIR}
EXPORT ucxx-python-exports
install(DIRECTORY ${ucxx_dir}/python/include/ucxx
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
install(TARGETS ucxx_python DESTINATION ${CMAKE_INSTALL_LIBDIR} EXPORT ucxx-python-exports)

rapids_export(
INSTALL ucxx-python
Expand Down
83 changes: 0 additions & 83 deletions cpp/scripts/run-cmake-format.sh

This file was deleted.

Loading

0 comments on commit 8ae3988

Please sign in to comment.