Skip to content

issue/176: 支持macos编译 #178

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

Closed
wants to merge 1 commit into from

Conversation

goldenfox2025
Copy link
Contributor

No description provided.

@@ -2,23 +2,89 @@
import subprocess
import platform
import sys
from set_env import set_env
# 尝试导入 set_env,如果失败则定义一个空函数
try:
Copy link
Collaborator

Choose a reason for hiding this comment

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

这个别这么写,最好是给set_env加一个支持macos平台的功能

user_provided_flags = " ".join(sys.argv[1:])
print(f"User provided flags: '{user_provided_flags}'")
install(user_provided_flags)
print("--- InfiniCore Installation Script Finished ---")
Copy link
Collaborator

Choose a reason for hiding this comment

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

文件结尾空行

install(" ".join(sys.argv[1:]))
print("--- Starting InfiniCore Installation Script ---")
print("Setting up environment variables...")
try:
Copy link
Collaborator

Choose a reason for hiding this comment

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

不要加try catch,这个函数出错直接退

f"{new_lib_path}:{os.environ.get('LD_LIBRARY_PATH', '')}"
)
"""
Sets up environment variables for Infini software, supporting Windows, Linux, and macOS.
Copy link
Collaborator

Choose a reason for hiding this comment

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

请按照之前的格式写,不同平台不要串在一起

@@ -99,7 +99,7 @@ class Test {
\
std::string toString() const override; \
\
~Test(); \
virtual ~Test(); \
Copy link
Collaborator

Choose a reason for hiding this comment

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

不加会报错?

libop_path = find_library_in_infini_root("lib", "libinfiniop.dylib")
librt_path = find_library_in_infini_root("lib", "libinfinirt.dylib")
else:
raise RuntimeError(f"Unsupported operating system: {system_name}")

assert (
Copy link
Collaborator

Choose a reason for hiding this comment

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

把这个检查和打印信息直接放helper里吧

@@ -98,4 +113,4 @@ def find_library_in_ld_path(subdir, library_name):
lib.infinirtSetDevice.argtypes = [c_int, c_int]
lib.infinirtSetDevice.restype = c_int

return lib
return lib
Copy link
Collaborator

Choose a reason for hiding this comment

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

空行

BlasMatrix a_matrix;
BlasMatrix b_matrix;
BlasMatrix c_matrix;

size_t m, n, k, batch;
bool is_transed;

private:
Copy link
Collaborator

Choose a reason for hiding this comment

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

能不能把这个放前面。如果用这个,是不是该删了 MatmulInfo() = default;

@@ -47,4 +55,4 @@ infiniStatus_t Descriptor::calculate(
return INFINI_STATUS_SUCCESS;
}

} // namespace op::rearrange::cpu
Copy link
Collaborator

Choose a reason for hiding this comment

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

空行

static utils::Result<MatmulInfo> create(
infiniopTensorDescriptor_t c_desc,
infiniopTensorDescriptor_t a_desc,
infiniopTensorDescriptor_t b_desc,
MatrixLayout layout) {

auto a_matrix = BlasMatrix::create(a_desc);
Copy link
Collaborator

Choose a reason for hiding this comment

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

为什么需要改这里

@goldenfox2025 goldenfox2025 reopened this Apr 21, 2025
@goldenfox2025 goldenfox2025 closed this by deleting the head repository Jun 4, 2025
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