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

Build OpenBLAS from source code for MSVC #1674

Merged
merged 6 commits into from
Dec 11, 2024
Merged

Conversation

zcbenz
Copy link
Contributor

@zcbenz zcbenz commented Dec 8, 2024

Refs #1513.

When building with MSVC, there is no central package manager that allows installing and searching third party packages, so we can not find BLAS with find_package.

This PR adds a MLX_BUILD_BLAS_FROM_SOURCE flag to download and build OpenBLAS from source code which is turned on for MSVC by default. Other platforms can also set it on to test the same build.

The dlfcn-win32 dependency is also changed to build from source for the same reason.

if(WIN32)
if(MSVC)
Copy link
Member

Choose a reason for hiding this comment

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

I'm just curious why we check both of these. Is it common to use a compiler other than MSVC on windows?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Some people use MinGW (JuliaPackaging/Yggdrasil#9761), which provides layers for some POSIX APIs.

CMakeLists.txt Show resolved Hide resolved
Copy link
Member

@awni awni left a comment

Choose a reason for hiding this comment

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

Ty!

@awni awni merged commit 310ad8d into ml-explore:main Dec 11, 2024
5 checks passed
target_link_libraries(mlx PUBLIC ${BLAS_LIBRARIES})

if(WIN32)
find_package(dlfcn-win32 REQUIRED)
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry to see this gone!

A USE_SYSTEM_DLFCN_WIN32 option could have kept it.

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