-Hx compiler option

-Hx,123,8 -Hx,123,0x40000 -Hx,0,0x40000000 -Mx,0,0x40000000 -Hx,0,0x20000000

I’m joining a project using pgfortran with visual studio 2012 on windows 7. What, please, do these command line options do? Thank you, David Lambert.

Hi David,

These are internal flags to the Fortran compilers. Users should not use them directly.

“-Hx,0,0x40000000 -Mx,0,0x40000000” tells the front and back end compiler to use Visual Studio error formatting.

“-Hx,0,0x20000000” suppresses some extraneous warning messages.

“-Hx,123,8” generates makefile dependency information used to create dependency list automatically for your project.

“-Hx,123,0x40000” skips a check for “STDC”.

  • Mat

I will probably use the makefile dependency output.

Thank you.

I will probably use the makefile dependency output.

The named flag for this is “-MD” which then gets internally set as -Hx,123,8. Please use the named flags since internal flags can change.

  • Mat

To me, MS deliberately obscures their systems, and I certainly haven’t learned to work with them. Visual studio chose these -Hx,blah-blah flags without documentation which I merely found and copied. I also struggle with paths. Microsoft says “Let’s look in the Library”. My file is on a path that’s long to type or requires … never mind. Just about everything I do with Windows turns into a fight, and has since first release in the mid '80’s.
Anyway, thank you.


(Why would Word have consumed all the time on one core all morning? I have no instances of WinWord running as an application. Come on! Word’s been around 30 years. Shake out the bugs!)

Hi David,

I just realized I listed the wrong flag name above. “-MD” is for the C/C++ compilers. For Fortran, to get the dependencies you need to use the C cpp preprocessor (instead of the default Fortran version) and pass in the MD flag, i.e. use “pgfortran -Mcpp=md …”.

Apologies for the mistake.

  • Mat