How to Create an Executable in Intel Fortran Using Visual Studio?

  • Context: Fortran 
  • Thread starter Thread starter MechEng2010
  • Start date Start date
  • Tags Tags
    Fortran Programming
Click For Summary
SUMMARY

The discussion centers on creating an executable in Intel Fortran 9.1 using Microsoft Visual Studio 2005. The user successfully runs a debug version of their Fortran program but struggles to locate the generated executable file. Key insights include the use of the Intel Visual Fortran Compiler to compile source files and link them into a single executable. It is noted that the executable may reside in a sub-directory rather than the main project directory.

PREREQUISITES
  • Familiarity with Intel Fortran 9.1
  • Basic understanding of Microsoft Visual Studio 2005
  • Knowledge of compiling and linking processes in programming
  • Experience with Fortran programming language
NEXT STEPS
  • Explore the Intel Visual Fortran Compiler Documentation for detailed instructions on building executables
  • Learn how to navigate project directories in Visual Studio to locate output files
  • Research the use of the ifort command for command-line compilation
  • Investigate the differences between static and shared libraries in Fortran applications
USEFUL FOR

This discussion is beneficial for beginner programmers, particularly those using Intel Fortran and Microsoft Visual Studio, as well as anyone interested in understanding the executable creation process in Fortran development.

MechEng2010
Messages
12
Reaction score
0
Hello all,

I am new to programming and fortran, I have Intel Fortran 9.1 and using this via Microsoft Visual Studio 2005. To start with I have found a simple exmaple from the a Intel Fortran 90 book. I seem to be able to run a debug, but can't seem to create an executable? Its my first time using Visual Studio and Fortran. Any help would be appreciated.

PROGRAM Sum_and_Average
!
! This program reads in three numbers and sums and averages them
!
IMPLICIT NONE
REAL :: N1,N2,N3,Average = 0.0, Total = 0.0
INTEGER :: N = 3
PRINT *, 'Type in three numbers, separated by spaces or commas'
READ *,N1,N2,N3
Total= N1+N2+N3
Average=Total/N
PRINT *,'Total of numbers is ',Total
PRINT *,'Average of the numbers is ',Average
END PROGRAM Sum_and_Average

For example the Intel Visual Fortran Compiler Documentation provides this information, but no more on how to do this... can anyone help?

"Creating Fortran Executables
The simplest way to build an application is to compile all of your Intel® Fortran source files and then link the resulting object files into a single executable file. You can build single-file executables using the ifort command from the command line. For Windows*, you can also use the visual development environment.

The executable file you build with this method contains all of the code needed to execute the program, including the run-time library. Because the program resides in a single file, it is easy to copy or install. However, the project contains all of the source and object files for the routines that you used to build the application. If you need to use some of these routines in other projects, you must link all of them again.

Exceptions to this are as follows:

If you are using shared libraries, all code will not be contained in the executable file.

On Mac OS* X, the object files contain debug information and would need to be copied along with the executable."
 
Last edited:
Technology news on Phys.org
If you can run your code then you will almost certainly have created an executable. It may not be in the same directory as your Fortran - quite often in a sub-directory.
 
Yep, problem solved thanks
 

Similar threads

  • · Replies 0 ·
Replies
0
Views
2K
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 16 ·
Replies
16
Views
2K
  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 19 ·
Replies
19
Views
7K
  • · Replies 5 ·
Replies
5
Views
3K