Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

f90com.exe screen flash

funkhouser
Beginner
1,509 Views
We have a tool has compiles Fortran files from command-line. We find it absolutely impossible to do any other work on the machine due to hundreds of "f90com.exe" DOS prompts appearing and taking focus. Is there any way to disable the popping up of these prompts?

Attached is a picture of the prompt. Note that the prompt contains no text and is absolutely useless.
0 Kudos
8 Replies
Steven_L_Intel1
Employee
1,509 Views
How does this tool spawn the command? I'm guessing that it's the tool that creates the window, at least implicitly - you don't see this happening when the compiler is invoked from the IDE.

Steve
0 Kudos
funkhouser
Beginner
1,509 Views
Yes, you are correct. Reproducing this behavior within the IDE or from within a DOS-shell appears to be impossible.

We have a Tcl/Tk application which invokes GNU make and pipes the output through "cat" into a "text" widget.

Within our makefile, we are compiling each fortran file with the following:
ifl /nologo /Qlowercase /us /Qfpp /DRECL_WORDS /Gm /w95

If you are familiar with Tk, here are the commands:
Where $makeText is the text widget
Where $command is the call to make

catch {open "|$command |& $cat" "r"} data(Make,pipe)
$makeText insert end $data(Make,pipe)
catch {$makeText see end}
update idletasks
0 Kudos
Steven_L_Intel1
Employee
1,509 Views
Sorry, you're out of my league here... I'd guess it has something to do with the way the "open" command creates the process to run the compiler, but that's about as far as I can take it.

Steve
0 Kudos
funkhouser
Beginner
1,509 Views
I think I know what the problem is. When the Intel developers compile the f90com.exe executable, do you link it such that the operating system runs it as a CONSOLE or WINDOWS? Under the MS Visual C++ compiler, this option is specfied via the /SUBSYSTEM command.
0 Kudos
funkhouser
Beginner
1,509 Views
In addition, can you tell me how "ifl" invokes "f90com.exe"?
0 Kudos
Steven_L_Intel1
Employee
1,509 Views
Urm...

f90com.exe appears to be built with subsystem:console. This doesn't seem unreasonable to me for an application that writes to the console.

ifl invokes f90com.exe using _spawnvp

Steve

0 Kudos
funkhouser
Beginner
1,509 Views
I've been able to create a stand-alone use case. An individual on the comp.lang.tcl newsgroup was kind enough to provide the explanation (which may I note appears in other applications which start without a console):

--- BEGIN EXPLANATION ---

When Windows starts a subprocess, it will try and attach it to a console unless the CreateProcess() call specifies that the child is "detached". Windows attaches the new process to the parent's console, if it has one; otherwise it creates a new console window for the child.

Wish (the interpreter for Tk) starts subprocesses as "detached" children, which means that they do not have a console. If the child (make, in your example) then starts another process but doesn't provide the detached flag, Windows will create a console for this grandchild process. The implementation of _spawnXX() in Microsoft's libraries does not normally provide the detached flag.

--- END EXPLANATION ---

To exercise this explanation, I wrote two applications. The 1st use case had the first application launch the second application using _spawnXX using a WISH. The behavior I see with "ifl" launching "f90com" was reproduced. Then I modified the first application to use CreateProcess instead. Since Windows was going to create the console regardless, I set a flag (SW_HIDE) in CreateProcess to not show the window.

How would I go about requesting for Intel to create an optional command-line for "ifl" (say /suppressSubconsoleWindowCreation) which would use CreateProcess (similar to the code below) instead of _spawnvp when launching f90com?

Here's my code for launching the application via CreateProcess instead of _spawnvp. Note that stdout, stdin, and stderr are inherited from the parent.

char command[] = "f90com.exe";

STARTUPINFO si;
PROCESS_INFORMATION pi;

ZeroMemory(&si, sizeof(si));
si.cb = sizeof(si);
si.dwFlags = STARTF_USESHOWWINDOW | STARTF_USESTDHANDLES;
si.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE);
si.hStdError = GetStdHandle(STD_ERROR_HANDLE);
si.hStdInput = GetStdHandle(STD_INPUT_HANDLE);
si.wShowWindow = SW_HIDE;

ZeroMemory(π, sizeof(pi));

// New process inherits handles from the calling process
if (!CreateProcess(NULL, command, NULL, NULL,
TRUE,
NULL, NULL, NULL,
&si, π)) {
//
// Big bad error
//
} else {
WaitForSingleObject(pi.hProcess, INFINITE);
}

CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
0 Kudos
Steven_L_Intel1
Employee
1,509 Views
You can submit feature requests at https://premier.intel.com/

Steve
0 Kudos
Reply