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

Preliminary support for the base component on Windows. #44

Merged
merged 1 commit into from
Feb 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
21 changes: 13 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,19 @@ endif()
# don't be fooled).
add_subdirectory(third-party)
add_subdirectory(base)
add_subdirectory(compiler)
add_subdirectory(core)
add_subdirectory(comm-libs)
if(THEROCK_ENABLE_MATH_LIBS)
add_subdirectory(math-libs)
endif()
if(THEROCK_ENABLE_ML_LIBS)
add_subdirectory(ml-libs)

if(NOT WIN32)
add_subdirectory(compiler)
add_subdirectory(core)
add_subdirectory(comm-libs)
if(THEROCK_ENABLE_MATH_LIBS)
add_subdirectory(math-libs)
endif()
if(THEROCK_ENABLE_ML_LIBS)
add_subdirectory(ml-libs)
endif()
else()
# TODO(#36): Enable more project builds on Windows and/or make the full list configurable.
endif()


Expand Down
26 changes: 23 additions & 3 deletions base/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,16 @@ therock_cmake_subproject_activate(rocm-cmake)
# rocm-core
################################################################################

if(WIN32)
set(_shared_libs_arg "OFF")
else()
set(_shared_libs_arg "ON")
endif()

therock_cmake_subproject_declare(rocm-core
EXTERNAL_SOURCE_DIR "rocm-core"
CMAKE_ARGS
"-DBUILD_SHARED_LIBS=ON"
"-DBUILD_SHARED_LIBS=${_shared_libs_arg}"
"-DROCM_VERSION=${ROCM_MAJOR_VERSION}.${ROCM_MINOR_VERSION}.${ROCM_PATCH_VERSION}"
)
therock_cmake_subproject_glob_c_sources(rocm-core
Expand All @@ -33,6 +39,8 @@ therock_cmake_subproject_activate(rocm-core)
# rocm_smi_lib
################################################################################

if(NOT WIN32) # TODO(#36): Enable on Windows and/or make subproject inclusion generally optional

therock_cmake_subproject_declare(rocm_smi_lib
EXTERNAL_SOURCE_DIR "rocm_smi_lib"
INTERFACE_LINK_DIRS
Expand All @@ -46,12 +54,16 @@ therock_cmake_subproject_glob_c_sources(rocm_smi_lib
therock_cmake_subproject_provide_package(rocm_smi_lib rocm_smi lib/cmake/rocm_smi)
therock_cmake_subproject_activate(rocm_smi_lib)

endif()


################################################################################
# rocprofiler-register
# This is a stub that helps runtime libraries and profiles rendezvous
################################################################################

if(NOT WIN32) # TODO(#36): Enable on Windows and/or make subproject inclusion generally optional

therock_cmake_subproject_declare(rocprofiler-register
EXTERNAL_SOURCE_DIR "rocprofiler-register"
Comment on lines +65 to 68
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Argh, and this also won't work due to a dep here:

therock_cmake_subproject_declare(ROCR-Runtime
EXTERNAL_SOURCE_DIR "ROCR-Runtime"
BACKGROUND_BUILD
CMAKE_ARGS
"-DBUILD_SHARED_LIBS=ON"
BUILD_DEPS
amd-llvm
RUNTIME_DEPS
rocprofiler-register

I had this "working" on Friday with my build directory, but now seeing issues with a fresh build.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah... That's a non optional dep to a few things

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I'm going in circles here. This is actually fine, as long as I have 'core' also excluded, which I do:

if(NOT WIN32)
  add_subdirectory(compiler)
  add_subdirectory(core)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Picking this back up with a fresh set of eyes and some hacks to get a CI runner past the symlink issues.

The excludes that I have here are sufficient to build, but they aren't a comfortable solution. I'd like to proceed with this approach for now then see about making rocprofiler-register (and other projects) compile successfully but no-op in some/all of its functionality as needed.

INTERFACE_LINK_DIRS
Expand All @@ -66,6 +78,8 @@ therock_cmake_subproject_provide_package(rocprofiler-register
rocprofiler-register lib/cmake/rocprofiler-register)
therock_cmake_subproject_activate(rocprofiler-register)

endif()


################################################################################
# rocm-half
Expand All @@ -87,6 +101,13 @@ therock_cmake_subproject_activate(rocm-half)
# Artifacts
################################################################################

set(_optional_subproject_deps)
if(NOT WIN32)
# TODO(#36): Enable on Windows and/or make subproject inclusion generally optional
list(APPEND _optional_subproject_deps rocm_smi_lib)
list(APPEND _optional_subproject_deps rocprofiler-register)
endif()

therock_provide_artifact(base
TARGET_NEUTRAL
DESCRIPTOR artifact.toml
Expand All @@ -98,9 +119,8 @@ therock_provide_artifact(base
run
test
SUBPROJECT_DEPS
${_optional_subproject_deps}
rocm-cmake
rocm-core
rocm_smi_lib
rocprofiler-register
rocm-half
)