- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to identify the flang compiler
How can one identify the flang compiler using the preprocessor ?
#if defined(some_appropriate_name)
is there a way to get the flang preprocessor to dump its predefined macros ?
(like -E -dM for gfortran)
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @mfvalin
For flang preprocessor to dump its predefined macros, can you try the command : "flang file_name.F90 -Hx,122,0x40000"
Please ensure that the fortran file has ".F90" extension.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi mfvalin,
You can identify the flang using “__PGLLVM__” constant. Below is the sample program:
program main
#ifdef __PGLLVM__
print *, "hello world"
#endif
end program
This above program can be compiled using the command “flang -cpp -o f.out test.f90”.
I have filed a feature request to get the dump of all the predefined macros in flang.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi mfvalin, can you try below command?
flang -dM -E - < /dev/null
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @mfvalin
For flang preprocessor to dump its predefined macros, can you try the command : "flang file_name.F90 -Hx,122,0x40000"
Please ensure that the fortran file has ".F90" extension.
