Repository navigation
Install mlx.dll into the same dir with python bindings on Windows - #1690
Conversation
| SOURCE_SUBDIR use-an-unexist-path-to-skip-cmake-of-dlfcn-win32 | ||
| EXCLUDE_FROM_ALL) | ||
| FetchContent_MakeAvailable(dlfcn-win32) | ||
| target_include_directories(mlx PRIVATE "${dlfcn-win32_SOURCE_DIR}/src") | ||
| target_link_libraries(mlx PRIVATE dl) | ||
| target_sources(mlx PRIVATE ${dlfcn-win32_SOURCE_DIR}/src/dlfcn.c) |
There was a problem hiding this comment.
it might be simpler to set(BUILD_SHARED_LIBS OFF) ?
There was a problem hiding this comment.
Updated the code to set BUILD_SHARED_LIBS, also bumped the required cmake version for using block.
awni
left a comment
There was a problem hiding this comment.
Thanks! I'm ok with the cmake bump.
|
We should update our documentation though I think it specifies cmake 3.24. I can send a patch here or you can add it if you have time. |
|
Updated the docs and requirements. |
|
Thank you! |
|
Sorry there was a cmake lint error, can you run tests again? |
|
This broke building/installing shared libs on (MinGW) Windows for non-Python applications: https://buildkite.com/julialang/yggdrasil/builds/15595#0193cee0-171b-4396-ace6-6e62a0345b11 E.g., |
|
It should be statically linked 🤔 |
|
Static linking seems to be the simplest solution, I'll send a PR to do static linking in |
Refs #1513.
On Windows the statically linked DLLs must be put in the same directory with the python bindings (or in the system DLL locations), and there is no compiler option to change that. This PR changes the install destination of
mlx.dlltoCMAKE_INSTALL_PREFIXinstance ofCMAKE_INSTALL_BINDIR.The dlfcn-win32 dependency is also changed to be linked statically.