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 some compilation issues and bump to 2.5.0rc1 #973

Merged
merged 6 commits into from
Feb 5, 2021

Conversation

speth
Copy link
Member

@speth speth commented Feb 4, 2021

Changes proposed in this pull request

  • Skip compilation of Sundials Fortran interface files to fix errors about duplicate symbols encountered on macOS and with MinGW
  • Fix an issue compiling Fortran samples with gfortran when Cantera is compiled with clang
  • Fix some compiler warnings
  • Bump version for release candidate

Checklist

  • There is a clear use-case for this code change
  • The commit message has a short title & references relevant issues
  • Build passes (scons build & scons test) and unit tests address code coverage
  • The pull request is ready for review

Cantera doesn't use this part of Sundials, and bundling all of these
files into the cantera library leads to linker errors when compiling
with MinGW and on macOS, due to redefinition of symbols like
'F2C_CVODE_matrix'.
# Only applies to Python 3.8. The field that is deprecated in Python 3.8
# and causes the warnings to appear will be removed in Python 3.9 so no
# further warnings should be issued.
if localenv['HAS_CLANG'] and localenv['python_version'] == parse_version('3.8'):
Copy link
Member

Choose a reason for hiding this comment

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

If we're using the python_version from the original env here, it will be set based on the value of python_cmd (or the Python running SCons if python_cmd isn't given). In that case, do we need to set py_version on Line 39 of this file? They should be exactly the same version.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, I missed that we were reading the Python version in this SConscript file. I agree that they should be exactly the same. For the sake of making this a more minimal patch, I'll update this to use the local py_version variable.

Copy link
Member

Choose a reason for hiding this comment

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

Sounds good. Just make sure to wrap it in parse_version(). That line got missed when we did that change earlier, so now it's reporting the deprecation warnings for me on my Mac again 😄

Copy link
Member Author

Choose a reason for hiding this comment

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

Are you saying that the current main branch is giving you warnings? Because that would be consistent with what I saw while testing this on Ubuntu, where py_version is the string 3.8 and whatever parse_version returns returns False for comparisons to string values.

My fix (at the moment) is to just compare the string values, since it's just the X.Y version string, but we could wrap both of them in parse_version if there's a reason to.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, that exactly what I mean. I don't see why not use parse_version(), that's what it's there for 😁

The deprecation warnings previously observed only on macOS are also
emitted when using Clang 10.0 on Linux. Also, despite supposedly being
resolved in Cython 0.29.14, I still get these warnings in Cython
0.29.21.
Compiling demo_ftnlib.cpp as a shared object (with -fPIC) fixes an
error about being unable to relocate some pthread-related symbol.
@bryanwweber bryanwweber merged commit 2ed1d27 into Cantera:main Feb 5, 2021
@speth speth deleted the fix-mingw-sundials branch May 23, 2021 02:10
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