Skip to content

Conversation

@branfosj
Copy link
Member

@branfosj branfosj commented Nov 25, 2023

cfr. #4203

Targeting the 5.0.x branch so I can use ** in glob and that is not available in Python 2.7.

@branfosj branfosj marked this pull request as draft November 25, 2023 09:57
@branfosj branfosj added this to the 5.0 milestone Nov 25, 2023
@branfosj branfosj marked this pull request as ready for review November 25, 2023 12:53
Copy link
Member

@boegel boegel left a comment

Choose a reason for hiding this comment

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

@branfosj Would be good to have a dedicated test for this?

@branfosj
Copy link
Member Author

@branfosj Would be good to have a dedicated test for this?

done in 809b694

@branfosj branfosj requested a review from boegel November 25, 2023 13:32

fail_msg = None
if mod_files:
fail_msg = ".mod files (%s) found in the installation." % ', '.join(mod_files)
Copy link
Member

Choose a reason for hiding this comment

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

@branfosj Can we try to filter out false positives here?

I was thinking about checking the output of the file command, if that's available.
Not sure if that makes sense...

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure what we would want to exclude by using file.

$ file 2.3.0-GCCcore-11.2.0/lib64/kim-api/mod/kim_unit_system_module.mod
2.3.0-GCCcore-11.2.0/lib64/kim-api/mod/kim_unit_system_module.mod:                     gzip compressed data, from Unix, original size 57651

$ file Clang/15.0.5-GCCcore-11.3.0/include/flang/omp_lib.mod
Clang/15.0.5-GCCcore-11.3.0/include/flang/omp_lib.mod:                       UTF-8 Unicode (with BOM) text

$ file json-fortran/8.3.0-GCCcore-12.2.0/include/json_value_module.mod
json-fortran/8.3.0-GCCcore-12.2.0/include/json_value_module.mod:     gzip compressed data, from Unix, original size 201261

$ file CPLEX/20.10-GCCcore-10.2.0/opl/examples/opl/cplex_staticLex/staticlex3.mod
CPLEX/20.10-GCCcore-10.2.0/opl/examples/opl/cplex_staticLex/staticlex3.mod: ASCII text

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's always a gzipped file (at least with gfortran), so you could look for that. One could technically unpack it and look for the header

GFORTRAN module version ....

but limiting this to just *.mod and gzipped file should be pretty good.

Copy link
Member

Choose a reason for hiding this comment

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

As discussed, we can refine this later to try and weed out false positives without having to whitelist...

@boegel boegel changed the title detect Fortran .mod files in GCCcore installations detect Fortran .mod files for installations using GCCcore toolchain Mar 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

No open projects
Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants