diff --git a/docs/src/dev/extensions.rst b/docs/src/dev/extensions.rst index a7880e396..3563305bf 100644 --- a/docs/src/dev/extensions.rst +++ b/docs/src/dev/extensions.rst @@ -677,9 +677,9 @@ Let's look at the overall directory structure first. Binding to Python ^^^^^^^^^^^^^^^^^^ -We use PyBind11_ to build a Python API for the C++ library. Since bindings -for all needed components such as `mlx.core.array`, `mlx.core.stream`, etc. -are already provided, adding our :meth:`axpby` becomes very simple! +We use PyBind11_ to build a Python API for the C++ library. Since bindings for +components such as :class:`mlx.core.array`, :class:`mlx.core.stream`, etc. are +already provided, adding our :meth:`axpby` is simple! .. code-block:: C++ @@ -927,18 +927,18 @@ Results: We see some modest improvements right away! -This operation is now good to be used to build other operations, -in :class:`mlx.nn.Module` calls, and also as a part of graph -transformations like :meth:`grad`! +This operation is now good to be used to build other operations, in +:class:`mlx.nn.Module` calls, and also as a part of graph transformations like +:meth:`grad`! Scripts ------- .. admonition:: Download the code - The full example code is available in `mlx-examples `_. + The full example code is available in `mlx `_. -.. code: `TODO_LINK/extensions`_ +.. code: `https://github.com/ml-explore/mlx/tree/main/examples/extensions/`_ .. _Accelerate: https://developer.apple.com/documentation/accelerate/blas?language=objc .. _Metal: https://developer.apple.com/documentation/metal?language=objc diff --git a/examples/extensions/CMakeLists.txt b/examples/extensions/CMakeLists.txt index 0c9951103..79902cbd8 100644 --- a/examples/extensions/CMakeLists.txt +++ b/examples/extensions/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.24) +cmake_minimum_required(VERSION 3.27) project(mlx_sample_extensions LANGUAGES CXX) @@ -63,4 +63,4 @@ target_link_libraries(mlx_sample_extensions PRIVATE mlx_ext) if(BUILD_SHARED_LIBS) target_link_options(mlx_sample_extensions PRIVATE -Wl,-rpath,@loader_path) -endif() \ No newline at end of file +endif() diff --git a/mlx/io/CMakeLists.txt b/mlx/io/CMakeLists.txt index 9b799dfa3..193488ad9 100644 --- a/mlx/io/CMakeLists.txt +++ b/mlx/io/CMakeLists.txt @@ -11,14 +11,8 @@ MESSAGE(STATUS "Downloading json") FetchContent_Declare(json URL https://github.com/nlohmann/json/releases/download/v3.11.3/json.tar.xz) FetchContent_MakeAvailable(json) target_include_directories( - mlx PUBLIC + mlx PRIVATE $ - $ -) -install( - DIRECTORY ${json_SOURCE_DIR}/ - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/json - COMPONENT json_source ) MESSAGE(STATUS "Downloading gguflib") @@ -28,14 +22,8 @@ FetchContent_Declare(gguflib ) FetchContent_MakeAvailable(gguflib) target_include_directories( - mlx PUBLIC + mlx PRIVATE $ - $ -) -install( - DIRECTORY ${gguflib_SOURCE_DIR}/ - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gguflib - COMPONENT gguflib_source ) add_library(