Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation Fails on AARCH64 / ARM64 Due to x86 Specific Compiler Flags #541

Open
MattWenham opened this issue Aug 2, 2024 · 2 comments
Assignees

Comments

@MattWenham
Copy link

Version 0.4.8 fails to compile for AARCH64 / ARM64 due to the two x86 specific compiler flags in CMakeLists.txt: -mavx and -mfma.

CMakeLists.txt ideally needs to take into account architecture as well as platform.

@ecm200
Copy link

ecm200 commented Sep 6, 2024

Suggest the following addition to the CMakeLists.txt to accommodate:

Currently the compiler flag options cover the following:

if(MSVC)
    SET(CMAKE_CXX_FLAGS "/EHsc /arch:AVX2")
    SET(CMAKE_CXX_FLAGS_DEBUG "/W4")
elseif(DARWIN)
    SET(CMAKE_CXX_FLAGS "-Wno-int-in-bool-context -std=c++11")
    SET(CMAKE_CXX_FLAGS_DEBUG "-Wall")
else()
    SET(CMAKE_CXX_FLAGS "-march=native -Wno-int-in-bool-context -std=c++11 -mavx -mfma")
    SET(CMAKE_CXX_FLAGS_DEBUG "-Wall")
endif()

Suggest adding a further outcome to cover explicitly the aarch64 compilation and remove flags which cause built errors:

elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
    SET(CMAKE_CXX_FLAGS "-march=native -Wno-int-in-bool-context -std=c++11")
    SET(CMAKE_CXX_FLAGS_DEBUG "-Wall")

I have tested this solution and it builds without issue on aarch64 machine.

@Mamba413
Copy link
Collaborator

Mamba413 commented Sep 9, 2024

Thank you @MattWenham and @ecm200 . We will take a look and update CMakeLists.txt accordingly soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants