intel / intel-application-migration-tool-for-openacc-to-openmp

OpenACC* to OpenMP* API assisting migration tool
BSD 3-Clause "New" or "Revised" License
32 stars 5 forks source link

Manually provide language for files with nonstandard file extensions #4

Closed hattom closed 1 year ago

hattom commented 1 year ago

In src/migrate_openacc_2_openmp.py, L314-355, the tool attempts to find the file format (FortranFree/FortranFixed/C/C++) based on the file extension (i.e. if the extension.lower() is one of [.f, .f90, .c, .cxx, ...]).

If the file extension is not one of the ones checked, then we get lang == None, and the tool exits.

It would be nice to be able to override the language type from the command line, for cases where non-standard extensions are used, for various reasons including use in preprocessor templates, (plus a number of projects use the various superfluous .f77, .f95, .f03, .f08 extensions).

hservatg commented 1 year ago

Hello -- that's an interesting suggestion, thanks. I think that I could extend the checks to cover .f77, .f95, .f03 and .f08 as Fortran sources (the first as FortranFixed and the rest as FortranFree), and also include a tool option to override the language type. Best,

hservatg commented 1 year ago

This has been implemented in https://github.com/intel/intel-application-migration-tool-for-openacc-to-openmp/pull/5

hattom commented 1 year ago

Many thanks!