Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29280 Discussions

Input/Output Redirection - Debugging

kenneth_l_fowler
Beginner
2,068 Views
Dear Moderator,
I would like to see posted the definitive solution to trying to debug a IVF console application in Visual Studio .NET with redirection of input (unit 5) and output (unit 6). In the project properties pages if I select the Debugging section I get three text boxes displayed : Command, Command Arguments, and Working Directory. The Command textbox by default shows the text $(TargetPath). If I select Start from the Debug menu the console application runs as I would expect : it writes to the console window and accepts typed input in the console window. If I change the Command Arguments textbox to read output.txt and select Start then I get an error display that says :
Unable to start debugging.
Unable to start program (displays the path to the debug executable and its name)
Output cannot be redirected because specified file is invalid.
The Working Directory textbox is left blank (and I verified the project directory is the default by having some code at the beginning of the program create and write to a file - which showed up in the expected directory).
I didn't have this problem in CVF 6.x.
Thanks,
Ken Fowler
0 Kudos
2 Replies
Steven_L_Intel1
Employee
2,068 Views
I've noticed this too - it appears to be a VS.NET thing. Some kinds of redirection do work, such as 2>&1, but file redirection seems to be ignored. I'll see if I can locate some information on how to get this to work.

Here's a workaround. Start a Fortran command build environment session (Start..Programs..Intel Software Development Tools.. Intel Fortran Compiler..Build Environment for IA-32 Applications. Define the environment variables FORT5 and FORT6 to point to the files, such as:

set FORT5=input.txt
set FORT6=output.txt

now type "devenv" to open the IDE, then open your solution. Now when you debug, these environment variables will be defined and will redirect the files.
0 Kudos
Steven_L_Intel1
Employee
2,068 Views
I verified that MSVC has the same problem. MS has acknowledged that it is a bug and says it is fixed in "the next version" (presumably VS2005).

I did find that if you specify an explicit path for the input and output file, for example:

< C:myprojectinput.txt > C:myprojectoutput.txt

it works. This goes in Command Arguments. Specifying the working directory doesn't help. Bizarre.
0 Kudos
Reply