0

If I had some source code in C# and I wanted to compile binaries intended to run on Linux, I would specify some CLI options indicating the build target and whether to bundle supporting files.

How do I go about doing the same thing for code that compiles for Windows using gFortran? I need to figure out how to build the same thing for Linux.

Is there some kind of compiler switch and if so what is it called? I have found the gFortran documentation web but the concepts are differently organised and the nomenclature is very different.

There is also a more specific question attending this. According to this answer to another question: Standard input and output units in Fortran 90? stderr, stdin and stdout have the values 0, 5 and 6 respectively. Are these constants consistent across platforms — can the values change depending on whether you're compiling for Windows or Linux?

Peter Wone
  • 17,965
  • 12
  • 82
  • 134
  • I do not see how the constant question is related in an way at all. Anyway, you should NOT be using those values directly. If you do, your next compiler may use other constants. Use normal `print *`, `read *` and `write (*,` instead. – Vladimir F Героям слава Jan 05 '21 at 09:08
  • I do not see why there should be any such switch. C# compiles for virtual.machine but gfortran compiles to actual code for actual OS. I do not think you can cross-compile this way. Just use a virtual machine. – Vladimir F Героям слава Jan 05 '21 at 09:11

0 Answers0