diff --git a/CMakeLists.txt b/CMakeLists.txt index 77a39ec53..eaca32b55 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,7 +29,13 @@ set(MLX_BUILD_ARM OFF) if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - if (${CMAKE_HOST_SYSTEM_PROCESSOR} MATCHES "x86_64") + if (${CMAKE_HOST_SYSTEM_PROCESSOR} MATCHES "x86_64" AND ${CMAKE_HOST_APPLE}) + message(FATAL_ERROR + "Building for x86_64 on macOS is not supported." + " If you are on an Apple silicon system, check the build" + " documentation for possible fixes: " + "https://ml-explore.github.io/mlx/build/html/install.html#build-from-source") + elseif (${CMAKE_HOST_SYSTEM_PROCESSOR} MATCHES "x86_64") message(WARNING "Building for x86_64 on macOS is not supported." " If you are on an Apple silicon system, " diff --git a/docs/src/install.rst b/docs/src/install.rst index 1883329fb..6c0535079 100644 --- a/docs/src/install.rst +++ b/docs/src/install.rst @@ -1,8 +1,8 @@ Build and Install ================= -Install from PyPI ------------------ +Python Installation +------------------- MLX is available on PyPI. All you have to do to use MLX with your own Apple silicon computer is @@ -21,6 +21,14 @@ To install from PyPI you must meet the following requirements: MLX is only available on devices running macOS >= 13.3 It is highly recommended to use macOS 14 (Sonoma) + +MLX is also available on conda-forge. To install MLX with conda do: + +.. code-block:: shell + + conda install conda-forge::mlx + + Troubleshooting ^^^^^^^^^^^^^^^ @@ -213,3 +221,14 @@ Verify the terminal is now running natively the following command: $ uname -p arm + +Also check that cmake is using the correct architecture: + +.. code-block:: shell + + $ cmake --system-information | grep CMAKE_HOST_SYSTEM_PROCESSOR + CMAKE_HOST_SYSTEM_PROCESSOR "arm64" + +If you see ``"x86_64"``, try re-installing ``cmake``. If you see ``"arm64"`` +but the build errors out with "Building for x86_64 on macOS is not supported." +wipe your build cahce with ``rm -rf build/`` and try again. diff --git a/python/README.md b/python/README.md deleted file mode 100644 index 4d6979c19..000000000 --- a/python/README.md +++ /dev/null @@ -1,37 +0,0 @@ -### Packaging for PyPI - -Install `build` and `twine`: - -``` -pip install --user --upgrade build -pip install --user --upgrade twine -``` - -Generate the source distribution and wheel: - -``` -python -m build -``` - -*Warning* use a test server first - -#### Test Upload - -Upload to test server: - -``` -python -m twine upload --repository testpypi dist/* -``` - -Install from test server and check that it works: - -``` -python -m pip install --index-url https://test.pypi.org/simple/ --no-deps mlx -``` - -#### Upload - -``` -python -m twine upload dist/* -``` - diff --git a/setup.py b/setup.py index 4d6792449..23283860c 100644 --- a/setup.py +++ b/setup.py @@ -170,6 +170,7 @@ if __name__ == "__main__": description="A framework for machine learning on Apple silicon.", long_description=long_description, long_description_content_type="text/markdown", + url="https://github.com/ml-explore/mlx", packages=packages, package_dir=package_dir, package_data=package_data,