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

URGENT Help Needed with Some Questions

Deb_Chatterjee
Beginner
2,085 Views
Hello,

I need some urgent help with compiling. I have recently installed Intel Visual FORTRAN Compiler Professional on my office PC which has the Windows 7 Enterprise OS. In the past, I have worked somewhat extensively with Digital Visual FORTRAN and have developed codes in F77. The older Digital Visual FORTRAN (from Visual Numerics) is gone. I believe that because we purchased a new Intel FORTRAN we have guaranteed technical support for 1 year.

I need to compile my old FORTRAN codes. While I can open the source code and edit and save, I just cannot compile the old codes in the new Intel FORTRAN. It won't let me.This is the problem. I just don't seehow to open a window and click on which icon (probably BUILD) to compile my code. My old FORTRAN codes have the extension*.FOR (i.e. like say COMPUTE.FOR) and the Intel FORTRAN is not recognizing these codes. So, I cannotcompile.

What should I do ?Can anyone help me with this please ?

If possible, please respond to me directly as I do not have a lot of time tosearch through the threads. I would appreciate direct communication on this matter.

- thanking you all,

Dr. Deb Chatterjee

Associate Professor, UMKC
chatd@umkc.edu
(816)235-1276 (work)
0 Kudos
1 Solution
Steven_L_Intel1
Employee
2,073 Views
Deb,

You will not find the w_cprofimsl file there. The w_cprofimsl file is what you would use to install IMSL on a system that did not have it. It appears that your system already has IMSL installed.

You need to add the paths for the IMSL INCLUDE and LIB folders as explained in this article - see the section on configuring for use from Visual Studio.

By default, your executable will be named projectname.EXE (where "projectname" is the name of the project) and will be in the Debug or Release folder. Since you have not successfully built the program yet, you can't find the executable.

View solution in original post

0 Kudos
21 Replies
TimP
Honored Contributor III
1,915 Views
In what way is ifort "not recognizing" them? .FOR is treated the same as .f (fixed form source), either in Visual Studio GUI or from command line.
You could open the command line prompt window from the Windows Start menu, lower left corner of the screen. In the current version, it's Start>Intel Parallel Studio XE2011>Command Prompt>Parallel Studio XE v 12.0 update 2>whichever version you installed
At the command line prompt, cd to your source code and type ifort COMPUTE.FOR
Microsoft VS GUI also would work.
0 Kudos
mecej4
Honored Contributor III
1,915 Views
What should I do ?

Pretty much the same as what you had to do when using CVF. Read the documentation. In particular, the user guide, available online at

http://software.intel.com/sites/products/documentation/hpc/composerxe/en-us/fortran/win/index.htm

has a chapter called Building Applications, with two sections called Building Applications from Microsoft Visual Studio and Building Applications from the Command Line.

From your description I guess that you started up Visual Studio, opened some of your source files and tried to compile or build. That will not work. You have to first create a project -- this can be as simple as asking for the creation of a new console application, and adding all your source files to the project, and selecting whether to build for IA32 or Intel64, in release mode or debug mode.
0 Kudos
Steven_L_Intel1
Employee
1,915 Views
If you have a project with the source files added, but building the proiject ignores the sources, follow the steps in this article, especially the one that discusses the options page that lists file extensions.
0 Kudos
Deb_Chatterjee
Beginner
1,915 Views
Well, mecej4, your diagnosis is the closest to the solution. I still have a long way to go, but basically the key in your response is to open a "project" and add my existing (i.e. old *.FOR) files [developed in 2000 and inlater years] to this projectlabeled as "Console1".

If I understand you right, "Console1" is just a project folder which shallhave *.FOR files which can be"BUILD". Now Ihave the following questions:

1. I use IMSL math libraries. Do I need special commands tocompile and link these libraries and prepare the executable filesuch as *.EXE ?

2. I have a separate folder (for which a shortcut exists on my desktop) that has all my old FORTRAN files. So, when I open Microsoft Visual Studio 2008 and the activatethe Intel FORTRAN Ican open my old FORTRAN files and BUILD them. But, how do Iget the *.EXEfiles after "building" them ? Where will they be stored - in the Console1 projects folder ?

- thanks,

Deb
0 Kudos
Steven_L_Intel1
Employee
1,915 Views
Deb,

As mecej4 says, there isn't much difference from CVF other than terminology and perhaps a slight difference in how projects are organized. Two articles you should read. The first is Migrating from CVF, and the second is Configuring for IMSL. I will comment that, at this time, we have IMSL available for use with the 11.1 compilers only. We hope to have IMSL for the new version 12 (Composer XE 2011) soon.

Your source files can be wherever you want them to be. Some people put them in the same folder as the project file, but there's no requirement for that. When you build the solution (a solution is a container for one or more projects), the executable will be in the Debug or Release subfolder of the project, just like CVF.

You can name the project whatever you want - Console1 is just a default name chosen when you select a new console project. You may also want to view this tutorial on using Intel Visual Fortran.
0 Kudos
Deb_Chatterjee
Beginner
1,915 Views
Steve,

I think I have some homework to do. I would basically need to read some stuff that you and mecej4 have provided and I have them on my FAVORITES. I can, following mecej4's diagnosis, open and BUILD my old *.FOR files writtenon CVF platform with IMSL. But, I need to start making the executable (*.EXE) files again and Iam not there yet. I have the commands for linking in CVF which are as follows:


kernel32.lib Sf90mp.lib Smathd.lib Sstatd.lib
C:\Program Files\Microsoft Visual Studio\DF98\IMSL\LIB


That means I have not figured out theright "click and go" or the command line operationfor Intel FORTRANto do just that. Is linking with IMSL on Intel FORTRAN done using similar (but perhaps not identical) commands ?

I have alsonot figured out how to rename from thedefault "Console1" to something like "(Intel)FORTRAN Source Files" where I can store my old *.FOR files. (Having multiple directories is a nuisance, and I'm just trying to avoid that by making things simpler - so the question of having a single 'realizable' project folder and not some generic name which I might forget.)

Iwas also told(by my system admin) that I have Intel Premier Support as a deal when Ipurchased the product (Intel FORTRAN). Whatis the difference between posting my questions on this forum as opposed to that on the Intel Premier Support forum ? When my 1 year premium warranty runs out how will I be disadvantaged of not renewing my premium membership ?

- thanks,

Deb
0 Kudos
mecej4
Honored Contributor III
1,915 Views
Do you have a version of IMSL built for the version of IFort that you have?

If not, and you plan to use the old IMSL libraries from CVF 6.0 (SMATHS.LIB, etc.), be aware of the following limitations:

(i) Only IMSL routines with a Fortran-77 calling sequence will work. Those will have to be called with the CVF calling convention. You may have to provide lots of DEC $ directives to do this correctly, or you may need to use the risky /iface:cvf compiler option.

(ii) Only 32-bit objects, executables and DLLs can be used.

(iii) You will have to link the CVF runtimes because the old IMSL libraries call routines that are not present in the Intel runtimes. Doing that, however, will cause multiple definitions of other routines that are present in both.

You will be better off by obtaining a version of IMSL compatible with whatever Fortran compiler you intend to use. And, one of these days, you may wish to modernize your source code.
0 Kudos
Deb_Chatterjee
Beginner
1,915 Views
Oh, no ! I do have with my new Intel FORTRAN 11.1.048 the IMSL library of math and stat functions. What I was wondering is that I am still to find out how to use IMSl. My question was that while compiling will the IMSL libraries be linked, or is it like the CVF, where after compiling we had to link the IMSL libraries separately (and the commands were exactly what I had written to Steve), for our number crunching ...

I was unsure at what stage IMSL gets linked. And yes, how do I call the specific IMSL math routines in my source code ? Is it identical the way as I used to call IMSL in F77 ?

- thanks,

Deb
0 Kudos
Andrew_Smith
Valued Contributor I
1,915 Views
There are two basic stages to producing an exe. Compiling and Linking.

Both can be combined in VS by doing a build. Building a project produces an exe.

IMSL would get linked at the linking stage. You need to find out how to get the .lib files included at the link stage. There are several .lib options depending on if you want static or dynamic libraries and if you want 32 bit or 64 bit etc. The documents refered to already will tell you the best way to specify them in your project.

Your idea of renaming your exe project from Console1 to "(Intel)FORTRAN Source Files" is [ill-advised].

The hard drive folder could be called that but your VS project name should match the name you want for your .exe.

[ Edited by Steve L]
0 Kudos
Steven_L_Intel1
Employee
1,915 Views
Andrew, please keep the tone professional here...

There are two parts to IMSL - the modules that declare the interfaces, and the libraries themselves. CVF provided only one type of library but with Intel Fortran there are some six alternatives to chose from, depending on your needs.

The article on configuring IMSL I linked to explains how to add IMSL to Visual Studio so that it is available to your projects. If you simply want to rebuild CVF code, the simplest approach, once you have done the configuring, is to add the lines:

INCLUDE 'link_fnl_static.h'
!DEC$ OBJCOMMENT LIB:"libiomp5md.lib"

to one of your Fortran sources, such as your main program. This selects the static library version of IMSL and pulls in the multiprocessing support IMSL uses. You will want to remove any specification of IMSL libraries from your linker options.

You won't have to make any other changes in your code.

I do recommend, once you get settled in, to download and install Update 7 to 11.1 so that you have the latest compiler.
0 Kudos
Deb_Chatterjee
Beginner
1,915 Views
Steve,

Great info. From what you & Andrew wrote, I am sure thatmy CVF experience with IMSL is quite limitedthough not completely useless.

I'd however need a link to the Update 7 to Intel FORTRAN 11.1.048for downloading and installation. Can you please provide me with the link ? I'll share my experiences with this event later on this forum. (It'll take me a little time ...)

BTW, Steve, the lines you have suggested are to be typed in the old FORTRAN source code ? (I mean I did not have that experience, and hence the question.)

- thanks,

Deb
0 Kudos
TimP
Honored Contributor III
1,915 Views
If your license term extends through the release of that update, you can download from https://registrationcenter.intel.com. You would first register your license there, if you haven't already done so.
0 Kudos
Steven_L_Intel1
Employee
1,915 Views
Deb,

Yes, those lines would be entered into one of the Fortran source files. These lines specify one combination of IMSL libraries that is most commonly used.

For product updates, you need to log in to the Intel Registration Center. If you have not registered your serial number, do it there and then you get access to updates.
0 Kudos
Deb_Chatterjee
Beginner
1,915 Views
Steve,

I watched your tutorial and could compile an oldFORTRAN code (cyl_scatter_v2.for). This code was not using any IMSL package. The message(s) I got on the output paneare as follows:

1>------ Rebuild All started: Project: Console1, Configuration: Debug Win32 ------

1>Deleting intermediate files and output files for project 'Console1', configuration 'Debug|Win32'.

1>Compiling with Intel Visual Fortran 11.1.048 [IA-32]...

1>cyl_scatter_v2.for

1>Linking...

1>Embedding manifest...

1>

1>Build log written to "file://C:\Users\chatd\Documents\Visual Studio 2008\Projects\Console1\Console1\Debug\BuildLog.htm"

1>Console1 - 0 error(s), 0 warning(s)

========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========

Once I ran the code and the window opened for me to enter data, then I was expecting that the output will be saved to an output file. However I am not finding where it stored the output file. I checked Console1 and it is not there. The source code (cyl_scatter_v2.for) has the following lines for opening & closing the output file.

OPEN
(UNIT=10,FILE='CYLEIGENF.OUT',STATUS='NEW',CARRIAGECONTROL='LIST')

..........
..........
..........
..........
CLOSE(UNIT=10)

So, am I doing something wrong to locate the output file CYLEIGENF.OUT ? Previously, in CVF days, the folder in which I ran the executable used to store the outout file.

Could you please guess where this might go ?

- thanks,

Deb
0 Kudos
mecej4
Honored Contributor III
1,915 Views
Output files opened with only the name (i.e., no path prefix) are created in the current working directory. I realize that when Visualstudio is used the concept of current working directory is blurred.

1. You can ask Windows to search for the output file by name, starting at the root directory of your project.

2. You can try to run the program again; since the file is opened with STATUS='NEW', the program will abort saying that the file already exists, and you may be able to locate the file using the information in the message.

3. You should find the .EXE file in the ..\Debug folder of your project. You can open a command window, change to the subdirectory where the .EXE file exists and run the program. Assuming that the program does not read input files from some other directory, and that the output file does not exist in the same subdirectory, a new copy of the output file should be found after run completion.

0 Kudos
Deb_Chatterjee
Beginner
1,915 Views
mecej4:

I'll give it a try. In the meantime, tired of saving my source *.FOR files, I put all of them in a folder and name it as Intel FORTRAN 11.1.048 (32 bit) Source Files. Istarted Visual Studio 2008 and then added all the files in that folder as my project. There is one other project and it is called Console1. I am wondering if this renaming of a project folder from the default (Console1) would cause problems. Therenamed folder is on my desktop.

Also, on another issue. To run IMSL I would need the installation file

w_cprofimsl_p_11.1.xxx_ia32.exe

am I correct on this ? (I did not see it in my \VIN\imsl\fnl600 subfolder and hence was wondering if that would be a cause for an compilation and run-time error.

- thanks,

Deb
0 Kudos
Steven_L_Intel1
Employee
1,915 Views
Deb,

As long as you don't rename the folder after adding the files to your project, it should not be a problem. I suggest however that you choose folder names more descriptive of your application rather than the compiler being used.

The w_cprofimsl... file you refer to is the IMSL installer. If you already have a VNI\IMSL\fnl600 folder, you probably have IMSL installed already, but if you want to install again, you can download that file from the Intel Registration Center the same as you do compiler installers.
0 Kudos
Deb_Chatterjee
Beginner
1,915 Views

Steve,

I have looked in my VNI\imsl\fnl600 folders and there are these subfolders in fnl600 and they are:

help
IA32
IA64
Intel64
Readme

Where should I be looking forw_cprofimsl... file and under what name ?(I just reinstalled Intel Visual Fortran Compiler Professional Edition with IMSL version 11.1 for windows, but I cannot find the file under that name in fnl600 folder.)So, whenever I try toBUILD and link I get the error message(s):

Error1 error #5102: Cannot open include file 'link_fnl_static.h'C:\Users\chatd\Desktop\Intel FORTRAN 11.1.048 (32 bit) Source Files\cylbesfunction.for10


Error2Compilation Aborted (code 1)C:\Users\chatd\Desktop\Intel FORTRAN 11.1.048 (32 bit) Source Files\cylbesfunction.for1

The error # 5102can be resolved as stated in the document for IMSL libraries, but I have tried reloading the installation file for IA32 architecture windows, and it still doesnort wrk - gives me the same error message.

Also, I do not see where my output file *.OUT maybe stored, and in which directory the *.exe files will be saved. Is there any way I can find these ?

- thanks,

Deb

0 Kudos
Steven_L_Intel1
Employee
2,074 Views
Deb,

You will not find the w_cprofimsl file there. The w_cprofimsl file is what you would use to install IMSL on a system that did not have it. It appears that your system already has IMSL installed.

You need to add the paths for the IMSL INCLUDE and LIB folders as explained in this article - see the section on configuring for use from Visual Studio.

By default, your executable will be named projectname.EXE (where "projectname" is the name of the project) and will be in the Debug or Release folder. Since you have not successfully built the program yet, you can't find the executable.
0 Kudos
Deb_Chatterjee
Beginner
1,759 Views
Steve and others:

I could finally successfully compile and run my old F77 codes that were calling IMSL. I also ran codes that were not calling IMSL. All this happened today [03/04/2011].I was notgivin the correct link pathto the actual folder where IMSL was installed. Changing the folder name on the link path worked the wonders. I am hoping to start the heavy-duty number crunching soon.

Again, I thank you all from the very bottom of my heart for helping me out on this. This form has been very educational and helpful for me, and I shall keep frequently in touch.

Thanks to you all forthe support and putting up with my insane questions.

- Deb

0 Kudos
Reply