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

return architecture levels for micromamba #2921

Merged
merged 6 commits into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from 5 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
26 changes: 25 additions & 1 deletion libmamba/src/core/virtual_packages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,30 @@ namespace mamba
return res;
}

#if (defined(__GNUC__) || defined(__clang__)) && __x86_64__
__attribute__((target ("default"))) std::string get_archspec_x86_64()
{
return "x86_64";
}
__attribute__((target ("sse4.2"))) std::string get_archspec_x86_64()
{
return "x86_64_v2";
}
__attribute__((target ("avx2"))) std::string get_archspec_x86_64()
{
return "x86_64_v3";
}
__attribute__((target ("avx512f"))) std::string get_archspec_x86_64()
{
return "x86_64_v4";
}
#else
std::string get_archspec_x86_64()
{
return "x86_64";
}
#endif

isuruf marked this conversation as resolved.
Show resolved Hide resolved
std::vector<PackageInfo> dist_packages(const Context& context)
{
LOG_DEBUG << "Loading distribution virtual packages";
Expand Down Expand Up @@ -222,7 +246,7 @@ namespace mamba

if (arch == "64")
{
arch = "x86_64";
arch = get_archspec_x86_64();
}
else if (arch == "32")
{
Expand Down
2 changes: 1 addition & 1 deletion libmamba/tests/src/core/test_virtual_packages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ namespace mamba
}
#if __x86_64__ || defined(_WIN64)
CHECK_EQ(pkgs.back().name, "__archspec");
CHECK_EQ(pkgs.back().build_string, "x86_64");
CHECK_EQ(pkgs.back().build_string.find("x86_64"), 0);
#endif

// This is bad design, tests should not interfer
Expand Down
Loading