Compile mha from source on M1 Macbook - error clang: error: the clang compiler does not support '-mcpu=cortex-a8'

Post Reply
steffendasenbrock
Site Admin
Posts: 12
Joined: Thu May 02, 2019 1:08 pm

Compile mha from source on M1 Macbook - error clang: error: the clang compiler does not support '-mcpu=cortex-a8'

Post by steffendasenbrock » Wed Sep 15, 2021 9:34 am

Hi,

I tried to compile mha from source on macOS 11. I installed the required software and packages.
When I try make I get the following error:

Code: Select all

felinemalin@MacBook-Air-von-Malin openMHA % make                                    
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C external_libs
cd libemx/. && /Applications/Xcode.app/Contents/Developer/usr/bin/make -j 1
clang -Wall -Wextra -std=gnu11 -fPIC -O3 -mcpu=cortex-a8 -mfloat-abi=hard -mfpu=neon -ffast-math -fomit-frame-pointer -fno-finite-math-only -isystem/opt/local/include -Wno-error=unused-command-line-argument -g -isystem /Users/felinemalin/Desktop/steffens_kram/openMHA/external_libs/arm64-Darwin-clang/include -Wall -Wextra -Werror -std=gnu11 -fPIC -O3 -mcpu=cortex-a8 -mfloat-abi=hard -mfpu=neon -ffast-math -fomit-frame-pointer -fno-finite-math-only -isystem/opt/local/include -Wno-error=unused-command-line-argument -g -isystem /Users/felinemalin/Desktop/steffens_kram/openMHA/external_libs/arm64-Darwin-clang/include -c -o arm64-Darwin-clang/emxAPI.o src/emxAPI.c
clang: error: the clang compiler does not support '-mcpu=cortex-a8'
make[2]: *** [arm64-Darwin-clang/emxAPI.o] Error 1
make[1]: *** [arm64-Darwin-clang/libemx.is_installed] Error 2
make: *** [external_libs] Error 2
Could the reason behind this be that this is an M1 MacBook Air, which does not use an Intel processor or could the reason be something different? Do I need to set the variable COMPILEPREFIX in this case?

Best regards,
Steffen

tobiasherzke
Posts: 109
Joined: Mon Jun 24, 2019 12:51 pm

Re: Compile mha from source on M1 Macbook - error clang: error: the clang compiler does not support '-mcpu=cortex-a8'

Post by tobiasherzke » Wed Sep 15, 2021 4:13 pm

steffendasenbrock wrote:
Wed Sep 15, 2021 9:34 am

Code: Select all

clang: error: the clang compiler does not support '-mcpu=cortex-a8'
Could the reason behind this be that this is an M1 MacBook Air, which does not use an Intel processor
Yes, the configure script is confused. What is the output of

Code: Select all

uname -m
on this computer?
Do I need to set the variable COMPILEPREFIX in this case?
No. Just manually delete the line containing "-mcpu=cortex-a8" from file config.mk.

There may be other problems further into the compilation process. If so, please report them here.

steffendasenbrock
Site Admin
Posts: 12
Joined: Thu May 02, 2019 1:08 pm

Re: Compile mha from source on M1 Macbook - error clang: error: the clang compiler does not support '-mcpu=cortex-a8'

Post by steffendasenbrock » Thu Sep 30, 2021 12:05 pm

Hi,

thanks for your answer!

from

Code: Select all

uname -m 
I got: arm64

Manually deleting the line containing "-mcpu=cortex-a8" from the file config.mk seemed to have solved the issue!

Thanks a lot!

I only get some warnings

Code: Select all

Makefile:84: warning: overriding commands for target `arm64-Darwin-clang/unit-test-runner'
../../rules.mk:97: warning: ignoring old commands for target `arm64-Darwin-clang/unit-test-runner' 
Best regards,

Steffen

Post Reply