mlx: error: "NEON intrinsics not available with the soft-float ABI. Please use -mfloat-abi=softfp or -mfloat-abi=hard"
When building the mlx project I’m getting an error in regards to : NEON intrinsics not available with the soft-float ABI Please use -mfloat-abi=softfp or -mfloat-abi=hard
ChatGPT suggests updating MakeFile with, but this doesn’t work
CFLAGS += -mfloat-abi=softfp
or updating CMakeLists.txt (in project root) didn’t help either.
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfloat-abi=softfp")
Steps to reproduce
git clone git@github.com:ml-explore/mlx.git mlx && cd mlx
mkdir -p build && cd build
cmake .. && make -j
throws
/Library/Developer/CommandLineTools/usr/lib/clang/15.0.0/include/arm_neon.h:28:2: error: "NEON intrinsics not available with the soft-float ABI. Please use -mfloat-abi=softfp or -mfloat-abi=hard"
#error "NEON intrinsics not available with the soft-float ABI. Please use -mfloat-abi=softfp or -mfloat-abi=hard"
^
/Users/stephan/projects/mlx/mlx/backend/accelerate/softmax.cpp:59:8: error: unknown type name 'float16x8_t'; did you mean 'float16_t'?
inline float16x8_t neon_fast_exp(float16x8_t x) {
^~~~~~~~~~~
float16_t
/Users/stephan/projects/mlx/mlx/types/half_types.h:16:29: note: 'float16_t' declared here
typedef struct _MLX_Float16 float16_t;
^
/Users/stephan/projects/mlx/mlx/backend/accelerate/softmax.cpp:59:34: error: unknown type name 'float16x8_t'; did you mean 'float16_t'?
inline float16x8_t neon_fast_exp(float16x8_t x) {
^~~~~~~~~~~
float16_t
...
Apple M1 Max I’m on Sonoma 14.1.1 (23B81) cmake version 3.27.9 Python 3.10.5
About this issue
- Original URL
- State: open
- Created 7 months ago
- Comments: 17 (7 by maintainers)
That’s probably the problem. It’s building for x86_64
Sorry closed this prematurely, reopened.
Please reopen if this is still unresolved.
I can confirm it’s fine to build on M1 Mac (Ventura 13.4) @jagrit06 . I built here on M1 Air with cmake version 3.27.4, Python 3.10.13 (and xcode and command line tools installed). So it’s totally possible @stephanj