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

Install mlx.dll into the same dir with python bindings on Windows #1690

Merged
merged 4 commits into from
Dec 14, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
10 changes: 8 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.24)
cmake_minimum_required(VERSION 3.25)

project(mlx LANGUAGES C CXX)

Expand Down Expand Up @@ -126,7 +126,10 @@ if(WIN32)
GIT_REPOSITORY https://github.com/dlfcn-win32/dlfcn-win32.git
GIT_TAG v1.4.1
EXCLUDE_FROM_ALL)
block()
set(BUILD_SHARED_LIBS OFF)
FetchContent_MakeAvailable(dlfcn-win32)
endblock()
target_include_directories(mlx PRIVATE "${dlfcn-win32_SOURCE_DIR}/src")
target_link_libraries(mlx PRIVATE dl)
endif()
Expand Down Expand Up @@ -264,7 +267,10 @@ install(
EXPORT MLXTargets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
RUNTIME
DESTINATION
# On Windows, DLLs must be put in the same dir with the python bindings.
$<IF:$<BOOL:${WIN32}>,${CMAKE_INSTALL_PREFIX},${CMAKE_INSTALL_BINDIR}>
INCLUDES
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})

Expand Down
2 changes: 1 addition & 1 deletion docs/src/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Build Requirements
^^^^^^^^^^^^^^^^^^

- A C++ compiler with C++17 support (e.g. Clang >= 5.0)
- `cmake <https://cmake.org/>`_ -- version 3.24 or later, and ``make``
- `cmake <https://cmake.org/>`_ -- version 3.25 or later, and ``make``
- Xcode >= 15.0 and macOS SDK >= 14.0

.. note::
Expand Down
2 changes: 1 addition & 1 deletion examples/extensions/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[build-system]
requires = [
"setuptools>=42",
"cmake>=3.24",
"cmake>=3.25",
"mlx>=0.18.0",
"nanobind==2.2.0",
]
Expand Down
2 changes: 1 addition & 1 deletion examples/extensions/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
setuptools>=42
cmake>=3.24
cmake>=3.25
mlx>=0.21.0
nanobind==2.2.0
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
requires = [
"setuptools>=42",
"nanobind==2.2.0",
"cmake>=3.24",
"cmake>=3.25",
]
build-backend = "setuptools.build_meta"