Using Makefile and Visual Studio with Intel Visual Fortran Compiler

Using Makefile and Visual Studio with Intel Visual Fortran Compiler

I have a Makefile that I use to build my application in both Windows and Linux. All complex project- and platform-related stuff are already dealt in this Makefile.Today, I use a common editor to code and call GNU make from command line. Now I am considering to move to Microsoft Visual Studio 2010. I already use MSVS2010 when debuging using a not-configured Intel Visual Fortran Empty Project with my files.I don't want to duplicate my work configuring a new Visual Studio project and I want to use the Makefile instead.Is there a way to do it with MSVS2010? Or, is there any other better way to keep the configuration at one place "usable" from Windows and Linux?

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

I don't quite understand what you are asking here.  You can, of course, continue to use a makefile to build the application.  Are you asking how to debug it in VS2010 without creating a VS project that duplicates the makefile?

Here's how to debug a Fortran application built outside Visual Studio:

  1. Compile and link the sources with the /debug option
  2. In Visual Studio, create a new empty Fortran Console Application project
  3. Right click on the project and select Properties. On the Debugging property page, replace the value for Command with the full path of the executable file.  Specify values for Command Arguments and Working Directory if you want.
  4. Add to the project the source file you want to set a breakpoint in, such as the main program.  Open the source file and click in the left margin where you want the breakpoint set.  Repeat as required.
  5. Start debugging (F5 or Debug > Start Debugging).  If you get a warning that the project needs to be rebuilt, dismiss it.

You can now save this project/solution and use it to debug the program in the future. It will preserve the breakpoints you have set.

Retired 12/31/2016

Leave a Comment

Please sign in to add a comment. Not a member? Join today