Skip to content

CMake: Prepare for UNITY_BUILD support - #1461

Open
jschueller wants to merge 1 commit into
Reference-LAPACK:masterfrom
jschueller:unity
Open

jschueller wants to merge 1 commit into
Reference-LAPACK:masterfrom
jschueller:unity

Conversation

@jschueller

@jschueller jschueller commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

lsame.f, xerbla.f and xerbla_array.f are compiled into both libblas and liblapack with different content.
With unity builds many sources are batched into a single object, so linking fails with multiple definitions.
Also exclude single-file tests, and batch source generation too.

This branch should yield a nice speedup on low-cores machine like the github runners, need fortran unity build support (cmake >=4.6)

@codecov

codecov Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.23%. Comparing base (b458ca6) to head (e9e13bb).
✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1461      +/-   ##
==========================================
- Coverage   70.23%   70.23%   -0.01%     
==========================================
  Files        6243     6243              
  Lines      501381   501381              
  Branches    23564    23564              
==========================================
- Hits       352126   352123       -3     
- Misses     148776   148778       +2     
- Partials      479      480       +1     
Components Coverage Δ
BLAS 99.71% <ø> (-0.03%) ⬇️
CBLAS 96.95% <ø> (ø)
LAPACK 83.63% <ø> (ø)
LAPACKE 2.17% <ø> (ø)
TMGLIB 55.69% <ø> (ø)
BLAS testing 88.79% <ø> (ø)
CBLAS testing 89.65% <ø> (ø)
LAPACK testing 82.39% <ø> (ø)
LAPACKE testing ∅ <ø> (∅)
see 1 file with indirect coverage changes

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b458ca6...e9e13bb. Read the comment docs.

@jschueller
jschueller marked this pull request as draft October 30, 2026 08:51
@jschueller
jschueller force-pushed the unity branch 2 times, most recently from 7cb55d2 to 97c4fdc Compare October 30, 2026 13:09
@jschueller jschueller changed the title CMake: Keep duplicated lsame/xerbla sources out of unity batches CMake: Prepare for UNITY_BUILD support Oct 30, 2026
@jschueller
jschueller marked this pull request as ready for review October 30, 2026 13:10
@ACSimon33

Copy link
Copy Markdown
Collaborator

@jschueller Could you add a unity CMake build in CI? Best place would be the Special Build Configurations workflow. I can also add it if you want.

@ACSimon33

ACSimon33 commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

Ah, never mind, I didn't realize the feature hasn't been released yet. I guess you tested this already with a CMake build from your CMake branch?

@jschueller

Copy link
Copy Markdown
Collaborator Author

yes!

lsame.f, xerbla.f and xerbla_array.f are compiled into both libblas and liblapack with different content.
With unity builds many sources are batched into a single object, so linking fails with multiple definitions.
Same with test drivers symbols.
@jschueller

Copy link
Copy Markdown
Collaborator Author

fyi cmake fortran unity build support is available in cmake nightly builds if someone wants to try

This branch has not been deployed

No deployments
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.

2 participants