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.
29281 Discussions

how to run a fortran source code with build menu (with "compile" and "go" buttons)?

Xun_Zhu
Beginner
3,214 Views

I am using Intel Visual Fortran Composer XE for Windows*.

I am trying to run the program for a simple test program (test01.f) but cannot find the buttons on the menu bar that would allow me to compile and run the test program. Starting from my using the web downloaded test version of the intel fortran compiler, it has been several weeks for me trying to solve the same problem, and yet up to this point, I am still unable to run a simple fortran test program with this product.

I used to use the Compaque Fortran Compiler that had the "compile" and "go" buttons, but that old software does not work on my new pc.

0 Kudos
11 Replies
TimP
Honored Contributor III
3,214 Views
The evaluation version of ifort requires a Microsoft C++ development software installation. Only with one of the qualifying versions of Visual Studio do you get GUI compile buttons, by starting up Visual Studio and making a Fortran project.
0 Kudos
Steven_L_Intel1
Employee
3,214 Views
You need to create a project and add your source files to it. There is not the ability to just compile and link a file in VS without a project. CVF would create a project for you if you tried this.
0 Kudos
Xun_Zhu
Beginner
3,214 Views
Still not working though I have tried various approaches.

I cannot find documentation such as reference manu or getting start tutorial in the purchased softward CD. I cannot find sample projects or sample source code on the CD either, feel really frustrating.

I can compile and run the very simple fortran code "test01.f" on the unix machine by typing:

ifort test01.f (intel fortran)
a.out

or

pgf77 test01.f (PGI fortran)
a.out

I can also compile and run "test01.f" on my old PC (32-bit, Compaque Fortran) by double-clicking to open the file and then click the "go" button.

and yet, I am not able to run the simple "test01.f" with "Intel Visual Fortran Composer" no matter how I have tried.
0 Kudos
Steven_L_Intel1
Employee
3,214 Views
The documentation and samples are installed onto your system when you install the product - they are not directly accessible on the product CD.

You can get at the documentation in the Help menu of Visual Studio or through Start > All Programs > Intel Parallel Studio XE 2011. Samples are installed into a Samples subfolder of the product folder.

You can compile and run a program from the command line with Intel Visual Fortran too. First you have to open a Fortran build environment command session - that can be done with Start > All Programs > Intel Parallel Studio XE 2011 > Parallel Studio XE with Intel Compiler 12.1 In this command window, type:

ifort test01.f

then you can run it as test01.exe

In the Visual Studio environment, you must first create a project and then add your source file to the project. You may find this tutorial to be helpful.
0 Kudos
Xun_Zhu
Beginner
3,214 Views
Thanks for showing the tutorial link.
The tutorial example in MS Visual Studio 2010 is:
c+++++++++++++++++
open System
let int1 = 1
.........
c+++++++++++++++++
It worked!

Below is my test01.f:
c+++++++++++++++++
PROGRAM test
implicit real*8(a-h,o-z)
data pi/3.14159265359d0/
open(21,file='test_01.out',status='replace')
a=1.0d0
print '(2f14.6)', pi, a
write(21,'(2f14.6)') pi,a
close(unit=21)
stop
end
c+++++++++++++++++

Using select and paste I copied my test01.f into the tutorial template. The compiler is unable to run my program (with many error messages). Clearly, these are two different kinds of code though they are all called Fortran programs (F# vs F77?). I have thousands of programs written in F77. Do I need to first learn a new language and convert all those programs into F# in order to use this Intel Visual Fortran Composer XE for Windows?
0 Kudos
Steven_L_Intel1
Employee
3,214 Views
F# has no relationship to Fortran - it is a Microsoft "functional" language. You want to choose the project type Intel Visual Fortran > Console Application. I suggest choosing "Empty Project" and adding your .F as a source file, rather than pasting into the sample application, since the sample is free-form .f90 source.
0 Kudos
Xun_Zhu
Beginner
3,214 Views

Thanks.

The original problem now has been solved.
It appears that I have to generate extra different working folders:

Documents\Visual Studio 2010\Projects\work01
Documents\Visual Studio 2010\Projects\work02
Documents\Visual Studio 2010\Projects\work03
Documents\Visual Studio 2010\Projects\work04
Documents\Visual Studio 2010\Projects\work05

within the "Projects" folder to move files back and forth among different folders in order to run programs. I will start new threads in future when I have additional questions that cannot be solved with dumb methods. How convenient would it be if one can just double-click to open a file and click one more time to run a fortran program!

Please imagine every time when you want to edit a word or a txt file to change a few words, you first need to move the file to a special work folder and have to go through a series of steps to open it before you can make valid changes. How inconvenient it would be!

0 Kudos
Steven_L_Intel1
Employee
3,214 Views
If you are just building small, individual programs, you may find it easier to use the command line environment. I agree that the Visual Studio project is more suited to medium-to-large size applications with multiple source files - if you had such a project, you would appreciate more the organization. You are right that for a single, "one-off" program, the need to create a Visual Studio project is a bit of overhead.

I will suggest to our developers that we provide a way to automatically create a project from source files. I note that MS Visual C++ has this as an option.
0 Kudos
rase
New Contributor I
3,214 Views
Steve wrote: I will suggest to our developers that we provide a way to automatically create a project from source files. I note that MS Visual C++ has this as an option.

The automatic creation of a project from a set of source files would facilitate certain tasks during program development, e. g. transfer of existing program collections into the IVF environment. Go ahead!
0 Kudos
Steven_L_Intel1
Employee
3,214 Views
Duly suggested. ID is DPD200176246.
0 Kudos
Steven_L_Intel1
Employee
3,214 Views

I missed this - "New Fortran Project from Existing Code" is now available in the 15.0 compiler. I will have a mention added to the release notes.

0 Kudos
Reply