Skip to content

Commit 5900e32

Browse files
authored
Fix building on Linux (#1446)
1 parent bacced5 commit 5900e32

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

CMakeLists.txt

+6-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ option(MLX_BUILD_TESTS "Build tests for mlx" ON)
1414
option(MLX_BUILD_EXAMPLES "Build examples for mlx" ON)
1515
option(MLX_BUILD_BENCHMARKS "Build benchmarks for mlx" OFF)
1616
option(MLX_BUILD_PYTHON_BINDINGS "Build python bindings for mlx" OFF)
17-
option(MLX_BUILD_METAL "Build metal backend" ON)
17+
option(MLX_BUILD_METAL "Build metal backend" OFF)
1818
option(MLX_BUILD_CPU "Build cpu backend" ON)
1919
option(MLX_METAL_DEBUG "Enhance metal debug workflow" OFF)
2020
option(MLX_ENABLE_X64_MAC "Enable building for x64 macOS" OFF)
@@ -49,15 +49,18 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
4949
else()
5050
message(WARNING "Building for x86_64 arch is not officially supported.")
5151
endif()
52-
set(MLX_BUILD_METAL OFF)
5352
elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm64")
54-
set(MLX_BUILD_ARM ON)
53+
set(MLX_BUILD_METAL ON)
5554
endif()
5655

5756
else()
5857
message(WARNING "MLX is prioritised for Apple silicon systems using macOS.")
5958
endif()
6059

60+
if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm64")
61+
set(MLX_BUILD_ARM ON)
62+
endif()
63+
6164
# ----------------------------- Lib -----------------------------
6265

6366
include(FetchContent)

0 commit comments

Comments
 (0)