Skip to content

Updates for ease of building#289

Closed
OlekRaymond wants to merge 6 commits intokokkos:developfrom
OlekRaymond:cmake-changes
Closed

Updates for ease of building#289
OlekRaymond wants to merge 6 commits intokokkos:developfrom
OlekRaymond:cmake-changes

Conversation

@OlekRaymond
Copy link
Copy Markdown

I recently built kokkos tools on windows and found that some things could be communicated better, particularly why some features were not made available.

I have added warnings and more verbose messages to the CMake to make this more obvious.

Copy link
Copy Markdown
Contributor

@JBludau JBludau left a comment

Choose a reason for hiding this comment

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

this seems a bit over the place ... would it not be better to update documentation instead of the cmake?

Comment thread CMakeLists.txt Outdated
if(WIN32)
set(BUILD_SHARED_LIBS OFF) # We need to add __declspec(dllexport/dllimport) for Windows DLLs
set(BUILD_SHARED_LIBS OFF)
message(STATUS "We need to add __declspec(dllexport/dllimport) for Windows DLLs, until then windows building is not supported")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is not really a STATUS. Is there a way to add this to the library?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This is not really a STATUS

I agree, I wanted to keep the things that were being built on windows remaining for pipelines and testing.

Is there a way to add this to the library?

I am intending to do so under another ticket

Comment thread CMakeLists.txt Outdated
if(WIN32)
set(KokkosTools_ENABLE_SINGLE ON)
endif()
option(KokkosTools_ENABLE_SINGLE "Build single library interfacing all profilers and dispatching at runtime" ${WIN32})
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I like the old approach better since it is easier to read and reason about

Comment thread CMakeLists.txt
Comment on lines -122 to -111
set(COMMON_HEADERS_PATH ${CMAKE_CURRENT_BINARY_DIR}/common)
include_directories(${COMMON_HEADERS_PATH})

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why delete these?

Comment thread CMakeLists.txt Outdated

if(APPLE)
message(STATUS "Apple OSX target detected.")
message(STATUS "Apple OSX target detected - skipping Unix-only tools.")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

it is misleading to print this here ... as this line is not skipping anything

kp_add_library(kp_nvtx_connector kp_nvtx_connector.cpp)

target_link_libraries(kp_nvtx_connector CUDA::nvToolsExt)
target_link_libraries(kp_nvtx_connector CUDA::nvtx3)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

how is that related to the description of the pull request?

Comment thread CMakeLists.txt Outdated
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
message(FATAL_ERROR "FATAL: In-source builds are not allowed. You should create a separate directory for build files.")
message(FATAL_ERROR "FATAL: In-source builds are not allowed. You should create a separate directory for build files. \
This can be done with the invocation cmake -B build -S . to create a build directory called build")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would refrain from details how to do stuff in cmake ...

@OlekRaymond OlekRaymond marked this pull request as draft May 8, 2025 19:45
Comment thread CMakeLists.txt
set(BUILD_SHARED_LIBS "Build shared libraries" ON)
if(WIN32)
set(BUILD_SHARED_LIBS OFF) # We need to add __declspec(dllexport/dllimport) for Windows DLLs
option(BUILD_SHARED_LIBS "Build shared libraries" ON)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is not really an option. The tools will only work as shared libs.

Comment thread CMakeLists.txt
# We need to add __declspec(dllexport/dllimport) for Windows DLLs
if(WIN32 AND BUILD_SHARED_LIBS)
set(BUILD_SHARED_LIBS OFF)
message(STATUS "Windows building of .dlls is not yet supported")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we should error out

@OlekRaymond
Copy link
Copy Markdown
Author

Replaced by pull request #298

I had a think about what the best thing to do is.

It would make sense to leave anything that can compile on Windows to remain able to compile so it can be checked on pipelines.

However there are no pipelines that compile anything on Windows so that's all moot.

I am going to open a new PR that fails early if on windows (and a cmake variable is false so it can be turned off for dev) with a message explaining it's not supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants