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

Properly handle compiler versions #318

Open
hiker opened this issue Jun 20, 2024 · 1 comment
Open

Properly handle compiler versions #318

hiker opened this issue Jun 20, 2024 · 1 comment

Comments

@hiker
Copy link
Collaborator

hiker commented Jun 20, 2024

Atm compiler versions are only handled as strings. We need to properly convert them to integer-tuples to allow comparison, and also support compiler-specific compiler flags to be added

@jasonjunweilyu
Copy link
Collaborator

This is the current way of how LFRic makefiles do compiler version comparison. I have converted this into Python:

compiler_version_comparison = ''.join(f"{int(version_component):02d}" for version_component in compiler.get_version().split('.')) 

if compiler_version_comparison >= '190000':
    runtime_flags = ...
else: ...

So current get_version() returns a string 1.20.0. It is converted to string 012000 and then compared with string 190000

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

2 participants