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

Enable cross compiling support without patches #1749

Merged

Conversation

bryanwweber
Copy link
Member

@bryanwweber bryanwweber commented Aug 1, 2024

Changes proposed in this pull request

  • Only run the NaN check when we're not cross-compiling. This requires running an executable, which is not possible when cross-compiling unless we can emulate somehow.
  • Run only the pre-processor to find header files for version checks. This means we don't have to run an executable just to find #defined values.
  • Remove the conditional on the OpenMP check. It seems to work on all the platforms in the conda-forge build without problems, as well as the macOS CI here too

If applicable, fill in the issue number this pull request is fixing

Closes Cantera/enhancements#210

If applicable, provide an example illustrating new features this pull request is introducing

Checklist

  • The pull request includes a clear description of this code change
  • Commit messages have short titles and reference relevant issues
  • Build passes (scons build & scons test) and unit tests address code coverage
  • Style & formatting of contributed code follows contributing guidelines
  • The pull request is ready for review

@bryanwweber bryanwweber self-assigned this Aug 1, 2024
Copy link

codecov bot commented Aug 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.23%. Comparing base (06261ed) to head (250bc53).
Report is 23 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1749   +/-   ##
=======================================
  Coverage   73.23%   73.23%           
=======================================
  Files         381      381           
  Lines       54343    54343           
  Branches     9246     9246           
=======================================
  Hits        39796    39796           
  Misses      11573    11573           
  Partials     2974     2974           

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

@bryanwweber bryanwweber force-pushed the bryan-remove-patch-for-cross-compiling branch 3 times, most recently from 9a091a8 to 984488b Compare August 6, 2024 20:01
@bryanwweber bryanwweber force-pushed the bryan-remove-patch-for-cross-compiling branch 6 times, most recently from 4d249f6 to 4369f84 Compare August 13, 2024 12:28
@bryanwweber bryanwweber marked this pull request as ready for review August 13, 2024 12:30
@bryanwweber bryanwweber requested a review from a team August 13, 2024 12:31
@bryanwweber bryanwweber force-pushed the bryan-remove-patch-for-cross-compiling branch from 433c941 to 4d060bd Compare August 13, 2024 21:20
@bryanwweber bryanwweber enabled auto-merge (rebase) August 14, 2024 18:16
Copy link
Member

@ischoegl ischoegl left a comment

Choose a reason for hiding this comment

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

This PR is somewhat out of my wheelhouse, but as far as I can tell it looks overall good to me (and the CI passes!).

I have two trivial comments about buildutils.py ... we may want to start being consistent with PEP 484 for additions as it really takes out the guesswork about what those parameters are to be expected?

@bryanwweber
Copy link
Member Author

Thanks @ischoegl! Good suggestions, I added them 😄

@bryanwweber bryanwweber requested a review from a team August 15, 2024 11:38
@bryanwweber bryanwweber force-pushed the bryan-remove-patch-for-cross-compiling branch from 7ac6ae8 to 1a66bb7 Compare August 15, 2024 12:22
Copy link
Member

@speth speth left a comment

Choose a reason for hiding this comment

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

Thanks, @bryanwweber. It will be really nice to be able to avoid the painfully slow emulator-based builds. I had just a couple of small comments.

Putting the definition in buildutils lets other functions in buildutils use config_error
Introduce a function to run the C preprocessor. This can be used to output values of #defined variables in header files without actually running a program.
Since we can run the C preprocessor to find version information about
Sundials, we can simplify many of the checks we have when the system
Sundials is specified. In particular, we can determine ahead of time
which calls we expect to find and which libraries to use, without having
to compile each one. In addition, the Sundials check is refactored into
buildutils to simplify SConstruct
Why was this even implemented for apple clang?
We don't need defines in there anymore.
The setting previously didn't correctly check for mingw in the toolchain variable.
If the text is empty we don't want to process even if the return was
successsful
Other configuration relies on this being set to 'n' when we're using the
private Sundials submodule
Versions of fmtlib compiled with Unicode support require the /utf-8 flag
@bryanwweber bryanwweber force-pushed the bryan-remove-patch-for-cross-compiling branch from 1a66bb7 to 36e3cf4 Compare August 18, 2024 19:05
@bryanwweber bryanwweber force-pushed the bryan-remove-patch-for-cross-compiling branch from 36e3cf4 to 250bc53 Compare August 18, 2024 19:06
@bryanwweber
Copy link
Member Author

@speth Comments are addressed, thanks for the review!

Copy link
Member

@speth speth left a comment

Choose a reason for hiding this comment

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

Thanks, @bryanwweber!

@bryanwweber bryanwweber merged commit 7aec821 into Cantera:main Aug 18, 2024
50 checks passed
@bryanwweber bryanwweber deleted the bryan-remove-patch-for-cross-compiling branch October 6, 2024 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable compatibilty for cross-compliling in SCons
3 participants