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
detect Fortran .mod files in GCCcore installations #4389
Conversation
There was a problem hiding this 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?
easybuild/framework/easyblock.py
Outdated
|
||
fail_msg = None | ||
if mod_files: | ||
fail_msg = ".mod files (%s) found in the installation." % ', '.join(mod_files) |
There was a problem hiding this comment.
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...
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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...
cfr. #4203
Targeting the
5.0.x
branch so I can use**
inglob
and that is not available in Python 2.7.