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

Add macOS support #5

Draft
wants to merge 19 commits into
base: chipStar
Choose a base branch
from
Draft

Add macOS support #5

wants to merge 19 commits into from

Conversation

JayFoxRox
Copy link

(I'll add a description later)

Part of CHIP-SPV/chipStar#602

@JayFoxRox JayFoxRox mentioned this pull request Aug 27, 2023
17 tasks
set(CMAKE_CXX_COMPILER "${HIP_PATH}/bin/hipcc.bin")
set(CMAKE_C_COMPILER "${HIP_PATH}/bin/hipcc.bin")
set(CMAKE_CXX_COMPILER "${HIP_PATH}/bin/hipcc")
set(CMAKE_C_COMPILER "${HIP_PATH}/bin/hipcc")
Copy link
Author

Choose a reason for hiding this comment

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

This should make it possible to use the perl wrapper

set(CMAKE_CXX_COMPILER "${HIP_PATH}/bin/hipcc.bin")
set(CMAKE_C_COMPILER "${HIP_PATH}/bin/hipcc.bin")
set(CMAKE_CXX_COMPILER "${HIP_PATH}/bin/hipcc")
set(CMAKE_C_COMPILER "${HIP_PATH}/bin/hipcc")
set(HIPCONFIG_EXECUTABLE "${HIP_PATH}/bin/hipconfig.bin")
Copy link
Author

Choose a reason for hiding this comment

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

Should be changed to hipconfig so it uses the perl wrapper

@@ -231,7 +231,7 @@ function(catch_executable src)

message("Standalone Catch test: ${exec_name} ${src}")
add_executable(${exec_name} EXCLUDE_FROM_ALL ${src} $<TARGET_OBJECTS:Main_Object_Standalone> $<TARGET_OBJECTS:KERNELS>)
target_link_libraries(${exec_name} PRIVATE stdc++fs -pthread )
target_link_libraries(${exec_name} PRIVATE -pthread )
Copy link
Author

Choose a reason for hiding this comment

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

stdc++fs is spammed all over the HIP codebases, despite often requiring c++17 or newer and with bad conditions.

These changes might break it for some users, but rather than adding it manually, we should be using CMake to add filesystem support, OR, require c++17 through CMake and then fail.

#elif defined(__APPLE__) || defined(__MACOSX)
#define HT_WIN 0
#define HT_LINUX 0
#define HT_MACOS 1
Copy link
Author

Choose a reason for hiding this comment

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

I have no idea where these new flags are used.
The existing code quality here is pretty horrible.

@@ -25,6 +25,8 @@ THE SOFTWARE.

#ifdef __linux__
#include <sys/sysinfo.h>
#elif defined(__APPLE__) || defined(__MACOSX)
// No-op
Copy link
Author

Choose a reason for hiding this comment

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

Should probably be different

@@ -176,7 +176,7 @@ endif()

# skipped due to os related code in tests
# need to work on them when all the tests are enabled
if(UNIX)
if(UNIX AND NOT APPLE)
Copy link
Author

Choose a reason for hiding this comment

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

These tests might be portable. I didn't check yet.


*total = (vmstat.wire_count + vmstat.active_count + vmstat.inactive_count + vmstat.free_count + Pages occupied by compressor + Pages speculative) * pageSize;
*free = vmstat.free_count * pageSize;
#endif
Copy link
Author

Choose a reason for hiding this comment

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

This still needs to be activated. Consider it WIP

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.

3 participants