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

Fix #411 compile flags on Apple Silicon Ubuntu Docker #412

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

krystophny
Copy link

No description provided.

@krystophny
Copy link
Author

@andrewgiuliani or @landreman - can you verify if this is fine? A cleaner solution would be a systematic check for compiler options, but the present fix at least makes it compile in our setup.

@krystophny krystophny changed the title Fix #411 compile flags on Apple Silicon Ubuntu Docker Draft: Fix #411 compile flags on Apple Silicon Ubuntu Docker May 2, 2024
@krystophny krystophny changed the title Draft: Fix #411 compile flags on Apple Silicon Ubuntu Docker Fix #411 compile flags on Apple Silicon Ubuntu Docker May 2, 2024
@landreman landreman requested a review from mbkumar May 15, 2024 13:22
Copy link

codecov bot commented May 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.71%. Comparing base (e8c5433) to head (f595f84).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #412      +/-   ##
==========================================
+ Coverage   91.36%   91.71%   +0.34%     
==========================================
  Files          75       75              
  Lines       13150    13150              
==========================================
+ Hits        12015    12061      +46     
+ Misses       1135     1089      -46     
Flag Coverage Δ
unittests 91.71% <ø> (+0.34%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@landreman
Copy link
Contributor

Looks fine to me. Does anyone else have comments?

set(CMAKE_CXX_FLAGS "-O3 -march=native -mfma -ffp-contract=fast")
endif()
elseif(${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "arm64")
set(CMAKE_CXX_FLAGS "-O3 -mcpu=apple-a14 -ffp-contract=fast")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are there two branches here, one for aarch64 and another for arm64?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, this is confusing because "arm64" is given on macos, and "aarch64" on linux on the same CPU. I didn't want to change the old behavior on macos so just added the aarch64 in addition.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The clang compiler on Mac (v15.x) now supports march=native. So we need to change the conditions to reflect this. I'll adjust the conditions and push them.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd recommend to go with the below if else conditions.

if(COMPILER_SUPPORTS_MARCH_NATIVE)
    set(CMAKE_CXX_FLAGS "-O3 -march=native -ffp-contract=fast")
elseif(${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "arm64")  
    set(CMAKE_CXX_FLAGS "-O3 -mcpu=apple-a14 -ffp-contract=fast")

@mbkumar
Copy link
Collaborator

mbkumar commented May 15, 2024 via email

@krystophny
Copy link
Author

Btw the Docker file we are using is ghcr.io/itpplasma/devel-tex based on Debian 12.

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

Successfully merging this pull request may close these issues.

None yet

4 participants