Why is Gfortran not printing on Cygwin?

  • Context: Fortran 
  • Thread starter Thread starter kth
  • Start date Start date
  • Tags Tags
    Gfortran Printing
Click For Summary

Discussion Overview

The discussion revolves around the issue of gfortran not printing output in the command window when executed in Cygwin. Participants explore the behavior of output commands in different execution contexts and seek to understand the underlying reasons for the observed behavior.

Discussion Character

  • Technical explanation, Debate/contested

Main Points Raised

  • One participant notes that using WRITE(6,*) or PRINT(6,*) does not produce any output in the command window during execution.
  • Another participant questions whether the command window remains open after execution or closes immediately, suggesting that the latter might require a command to pause execution.
  • A participant observes that executing the program with ./a.exe results in printed output, while using the command run a.exe does not, prompting curiosity about the difference between these commands.
  • One participant speculates that the run command may open a new shell, causing the output to be displayed in a different process than the one where the command was entered, unlike the direct execution of a.exe.

Areas of Agreement / Disagreement

Participants express differing views on the behavior of output in Cygwin, with no consensus reached regarding the exact cause of the issue or the differences between the execution methods.

Contextual Notes

Some assumptions about the behavior of command execution in Cygwin and the handling of output may be missing, and the discussion does not resolve the technical details of process management in this environment.

kth
Messages
3
Reaction score
0
I use gfortran on cygwin and i want to print in the command window (like it prints in windows)
i use the usual stuff:

WRITE(6,*) 'Give a number:'

or

PRINT(6,*) 'Give a number:'

but the execution completes without any printing..

What is wrong?
 
Technology news on Phys.org
Does the 'black window' stays on the screen without printing anything, or does it disappears without giving you time to read what's on it?

In the former case, we will need more information.

In the latter case, it is probably because the window shuts down at the end of the execution unless you put a command to halt the closing, such as requesting user to enter a key to continue.
 
When i use the command

./ a.exe it prints int the command window

but when i use

run a.exe it does not print

I wonder what's the difference between those commands?
 
I do not have a Linux system to verify the explanation, but I believe the run command opens a new shell so printing is displayed in a different process distinct from where you entered your command "run...". On the other hand, a.exe is executed in the command screen, so you get to see the output.
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
Replies
1
Views
7K
  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 19 ·
Replies
19
Views
7K
  • · Replies 3 ·
Replies
3
Views
5K