Skip to content

Commit

Permalink
wholegraph: remove debugging details from CMake (#109)
Browse files Browse the repository at this point in the history
Proposes some simplifications for `wholegraph` CMake:

* removes code adding timing information via `RULE_LAUNCH_COMPILE` and `RULE_LAUNCH_LINK`
  - *these are internal to `ctest`, per https://cmake.org/cmake/help/latest/prop_dir/RULE_LAUNCH_LINK.html*
* removes `find_package(Python)` and related code in `pylibwholegraph`
  - *this is already handled by `rapids_cython_init()`: https://github.com/rapidsai/cugraph-gnn/blob/87455cfedcc6721f24c783ba555af14a9a180624/python/pylibwholegraph/CMakeLists.txt#L119-L120*

## Notes for Reviewers

### Benefits of doing this?

Similar to #102 and #103, I'm putting up PRs like this because I'm planning to attempt to add libwholegraph wheels, and want to simplify the wholegraph / pylibwholegraph CMake as much as possible before doing that, to reduce the implementation and reviewing effort.

Authors:
  - James Lamb (https://github.com/jameslamb)

Approvers:
  - https://github.com/linhu-nv

URL: #109
  • Loading branch information
jameslamb authored Jan 16, 2025
1 parent a9ab8b4 commit c7e60f0
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 41 deletions.
2 changes: 0 additions & 2 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,6 @@ rapids_find_package(CUDAToolkit REQUIRED
INSTALL_EXPORT_SET wholegraph-exports
)

set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CMAKE_COMMAND} -E time")
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK "${CMAKE_COMMAND} -E time")
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

set(WHOLEGRAPH_CXX_FLAGS "")
Expand Down
39 changes: 0 additions & 39 deletions python/pylibwholegraph/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,47 +38,8 @@ option(WHOLEGRAPH_BUILD_WHEELS "Whether we're building a wheel for pypi" OFF)
##############################################################################
# - Base Rapids Options -----------------------------------------------------

set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CMAKE_COMMAND} -E time")
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK "${CMAKE_COMMAND} -E time")
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

# pywholegraph Options
function(show_python_envs position)
message(STATUS "[PYTHON INFO] POSITION: ${position} Python_ROOT_DIR=${Python_ROOT_DIR}")
message(STATUS " ${position} Python_INCLUDE_DIR=${Python_INCLUDE_DIR} Python_LIBRARY=${Python_LIBRARY} Python_EXECUTABLE=${Python_EXECUTABLE}")
message(STATUS " ${position} PYTHON_INCLUDE_DIR=${PYTHON_INCLUDE_DIR} PYTHON_LIBRARY=${PYTHON_LIBRARY} PYTHON_EXECUTABLE=${PYTHON_EXECUTABLE}")
message(STATUS " ${position} Python_INCLUDE_DIRS=${Python_INCLUDE_DIRS} Python_LIBRARIES=${Python_LIBRARIES}")
endfunction(show_python_envs)

set(SKBUILD ON)
set(Python_USE_STATIC_LIBS TRUE)
if (NOT DEFINED BUILD_PYTHON_EXE)
if (DEFINED Python_EXECUTABLE)
set(BUILD_PYTHON_EXE ${Python_EXECUTABLE})
elseif(DEFINED PYTHON_EXECUTABLE)
set(BUILD_PYTHON_EXE ${PYTHON_EXECUTABLE})
elseif(DEFINED Python_ROOT_DIR)
set(BUILD_PYTHON_EXE "${Python_ROOT_DIR}/bin/python3")
else()
execute_process(COMMAND "which" "python3"
OUTPUT_VARIABLE BUILD_PYTHON_EXE OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
endif()
endif()
execute_process(COMMAND ${BUILD_PYTHON_EXE} -c "import sys; print(sys.exec_prefix)"
OUTPUT_VARIABLE Python_ROOT_DIR OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
execute_process(COMMAND ${BUILD_PYTHON_EXE} -c "import sys; print(sys.executable)"
OUTPUT_VARIABLE Python_EXECUTABLE OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
execute_process(COMMAND ${BUILD_PYTHON_EXE} -c "import sysconfig; print(sysconfig.get_path('include'))"
OUTPUT_VARIABLE Python_INCLUDE_DIR OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
execute_process(COMMAND ${BUILD_PYTHON_EXE} -c "import sysconfig; print(sysconfig.get_config_var('LIBDEST'))"
OUTPUT_VARIABLE Python_LIBRARY OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
set(PYTHON_EXECUTABLE ${Python_EXECUTABLE})
set(PYTHON_INCLUDE_DIR ${Python_INCLUDE_DIR})
set(PYTHON_LIBRARY ${Python_LIBRARY})
find_package(Python 3 COMPONENTS Interpreter Development REQUIRED)

show_python_envs("python env")

# default build type
rapids_cmake_build_type(Release)

Expand Down

0 comments on commit c7e60f0

Please sign in to comment.