Urgent Help Requested in Running Intel FORTRAN on Windows

Urgent Help Requested in Running Intel FORTRAN on Windows

Hello Steve Lionel,

This is a SOS.  I have old FORTRAN files (F77 version) in a folder on my desktop.  What I need to do is to compile and run these files.  I am using Windows and have Intel Visual FORTRAN with IMSL libraries.  The steps I used are as below:

1.  Open the Fname.for file using Microsoft Visual Studio 2008.

2.  Now from the "File" menu (top left hand corner of the pane), I am choosing the "Add to Existing Project" or "Add to New Project".

3.  Then I am going to the "Build" menu (top of the pane) and using the option "Build Solution"

On the solution pane I am getting the message: 0 errors 0 warnings (means that compilation is done).

4. Now when I am trying to run the program by choosing "Start without Debugging" -the problem crops up and the message says: "Unable to Start Program 'C\Users\chatd\Desktop....\Special Function\Debug\Special Function.exe'  "

The System cannot find the file specified.  

I do not know how to resolve this problem as I cannot locate the *.exe file either.  Need URGENT help on this.  Any pointers?  

- thanks,

Deb Chatterjee 

31 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.
Steve - Intel Developer Support

 

Steve,

Did everything that you stated in the post. The problem persists,even after resetting the two icons. After I reset the two icons I exited and then opened a new window with Microsoft Visual Studio.  Executing the "Build Solution" gives NO errors. But when I try executing "Start Without Debugging",  I get the following error (exact) message:

"Unable to Start Program 'C\Users\chatd\Desktop\Intel FORTRAN 11.1.048(32 bit) Source Files\Complex Airy Function\Debug\Complex Airy Function.exe' "

The System cannot find the file specified

For your perusal I have attached the source file [complex-airy.for] which I created on 07/04/2014 and I was trying to run it for the 1st time but could not get to that point. Running the source files seems to be a nightmare not because of any FORTRAN/math problems,but the associated protocols which I have not kept a track of. 

Please let me know what should be my next step.

- thanks

Deb Chatterjee

Attachments: 

AttachmentSize
Download complex-airy.for5.4 KB

The source file has a number of syntax errors, and the source code for the function CAI needs to be supplied. Some variables in the common block /BLCK2/ have different types and byte lengths in different places. If CAI is the generic function from the IMSL special functions, you need a USE CAI_INT statement in the subprogram which invokes CAI. Your statement 103 should probably be 102.

As a consequence of the errors, compilation and linking will fail, and the question of debugging is premature. The large number of incorrect types for the variables in a program of such small size is indicative of careless programming. I suggest that you add IMPLICIT NONE to every subprogram and make sure that all variables have correct types before you attempt to debug the program.

Thank you for the remarks/comments.

The CAI is a IMSL subroutine.   The specific FORTRAN 90 interface (as in the IMSL manual) is C_CAI (single precision) and Z_CAI (double precision). [page 171 of the IMSL MATH Library Special Functions documentation].  So, I am somewhat unsure as how to use it in the *.FOR environment. (Old FORTRAN).  What would be the FORTRAN 77 interface for CAI (in double precision). The manual does not specify anything.

Other comments are well-taken.I shall correct them but I am using F77 version of FORTRAN.The file name is complex-airy.for  

Thanks again for pointing out the errors. Do the errors you have pointed out could be the cause of the observed problem? However my question is why when I am trying to BUILD SOLUTION, no errors are reported?

- thanks,

Deb Chatterjee

You are mistaken in assuming that a file with the name <some_name>.for is considered to follow the Fortran 77 standard. The file suffix ".for" simply indicates that the source file is in fixed form, which incidentally was the only source form in Fortran 77 and earlier.

Several of the IMSL subroutines and functions are no longer easy to use from strict Fortran 77 code, because the Fortran 77 interfaces to them are un- or under-documented. That should not be a problem, since you are not using a Fortran 77 compiler. The specific names for the generic CAI are C_CAI and Z_CAI, but you should avoid using them without having a definite reason for doing so.

We do not know which version of Visual Studio and which version of IMSL you are using, and you may have to attached a copy of your project/solution file and build-log file for the purpose of obtaining help with the IDE. I think that this is an additional complication and, at this point and given the other problems mentioned, a distraction. With IMSL properly configured, you should be able to build your application from the IFort command window using the /Qimsl /traceback options. The article https://software.intel.com/en-us/node/510280 may be of help, but note that it probably is written for different versions of Visual Studio, Intel Fortran and IMSL than the ones that you have.

I attach an edited version of your source file that I could compile and run. You must, of course, check the output file to check if the code is correct. Note that I reduced the value of NPT to 121 in order to control the size of the output file.

 

Attachments: 

AttachmentSize
Download complex-airy.for5.53 KB

In the Debug or Release subfolder of your project should be a file buildlog.htm  Please ZIP it and attach the ZIP to a reply here. This will help us understand why your project did not build correctly. My guess is that the wrong project type was chosen, but the build log will tell me.

If there is no buildlog.htm, then ZIP all of the files in the Debug or Release folder and attach the ZIP here.

Steve - Intel Developer Support

mecej4:

Thanks for taking the trouble to modify the code and running it. I downloaded your modified code and ran it.  That is I made a solution file as console1.sln and then built it the response when I execute the command Build Solution is cut and pasted here as below:

1>------ Build started: Project: Complex Airy (Version 2), Configuration: Debug Win32 ------
1>
1>Build log written to  "file://C:\Users\chatd\Desktop\Intel FORTRAN 11.1.048 (32 bit) Source Files\Complex Airy (Version 2)\Debug\BuildLog.htm"
1>Complex Airy (Version 2) - 0 error(s), 0 warning(s)
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

The interesting thing is that when I then try to actually run the program by choosing the command option: Start Without Debugging, I get the message:

Unable to Start Program 'C\Users\chatd\Desktop\Intel FORTRAN 11.1.048(32 bit) Source Files\Complex Airy (Version  2)\Debug\Complex Airy (Version 2).exe' 

The system cannot find the file specified

So, I believe that it is probably (?) not a FORTRAN issue but most likely a Microsoft Visual Studio or Intel Visual FORTRAN issue.

Where am I going wrong with the above? What maybe the possible troubleshooting pointers?

- thanks,

Deb Chatterjee

 

 

 

Quote:

Steve Lionel (Intel) wrote:

In the Debug or Release subfolder of your project should be a file buildlog.htm  Please ZIP it and attach the ZIP to a reply here. This will help us understand why your project did not build correctly. My guess is that the wrong project type was chosen, but the build log will tell me.

If there is no buildlog.htm, then ZIP all of the files in the Debug or Release folder and attach the ZIP here.

Steve,

I am attaching a buildlog.htm file here and a solution (*.sln) file  for your perusal. Please let me know what may be the next better step to resolve this issue. I am just at a dead end. 

- thanks,

Deb Chatterjee

Attachments: 

AttachmentSize
Download Complex Airy (Version 2).zip1.09 KB

Also, should I reinstall Microsoft Visual Studio 2008 and Intel Visual FORTRAN on my desktop? [That looks like a viable option but perhaps very painful. :-( ]

- thanks,

Deb Chatterjee

Your build log contains:

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

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

Nothing was built. Use the configuration manager and check to see if your project(s) are included in build.

Jim Dempsey

www.quickthreadprogramming.com

Thank you Jim.  Now how do I fix this? I have no access to a User's Manual which I can read and fix the issue, and thereby reducing my asking  so many questions on this forum.

However, all said and done do you have any pointers for me how to fix this? Is it a problem with the installation of Microsoft Visual Studio or Intel Visual  FORTRAN? 

- thanks,

Deb C. (aka Deb Chatterjee) 

P.S.: I have two accounts to access this forum. 

Deb,

I have a theory - please also attach the .vfproj file. My guess is that you created a project but didn't add any source files to the project, therefore there was nothing to build. Just opening the source in Visual Studio doesn't put the source in a project.

Select Project > Add Existing Item. Browse to your .f90 source and add it to the project. Then build.

The error about not finding the EXE is that no source files were found to build, thus no EXE got built.

You DO have the user documentation available under Help in Visual Studio, though it might not help you here other than reading the "getting started" information on how to create a project.

Steve - Intel Developer Support

Deb C., for what it's worth, here is a zip file with all the files needed for building the EXE, with VS2012 and IFort 14. Before attempting to build the project, please edit the project properties and change the paths to the INCLUDE and LIB directories of your IMSL installation.

The Intel Fortran documentation is available online at https://software.intel.com/en-us/compiler_14.0_ug_f . If you still have difficulties, I suggest that you

  • start over, using simple programs in the beginning. Write a "hello world" Fortran program, with no IMSL calls, and go through the steps of creating a new VS project, adding the single source file to the project, building the application and running it in the debugger. 
  • build and run one of the IMSL example programs given in the IMSL manual -- for example, the one for CAI.
  • now try your original program with corrections as noted, build and run.

 

Attachments: 

AttachmentSize
Download cairy.zip7.82 KB

mecej4:

I have VS 2008 (Visual Studio 2008 & not 2012).  So, will IFORT 14 work for VS2008? I am not sure.  But, I will try.  Let me also consider to Steve's suggestion - in the post above.

Thanks for helping me out in these dire times.

- Deb C. (Deb Chatterjee)

Steve,

I tend to agree with you.  I shall send you the *.vproj file(s) which are on my office PC.  

- thanks,

Deb C. (Deb Chatterjee)

Here is the VS2008 project. As noted earlier, you will have to change the paths to the IMSL include and lib directories to the values for your installation, under the project properties. You may also need to choose the configuration(s) for which you have a compatible IMSL.

Attachments: 

AttachmentSize
Download cairyvs2008.zip7.26 KB

mecej4:

In my original code the IMSL paths were the same as the earlier ones which were working but before this disastrous crash.  Anyway, I shall modify and try running the yours.  

Thanks again,

Deb C. (Deb Chatterjee) 

Quote:

Steve Lionel (Intel) wrote:

Deb,

I have a theory - please also attach the .vfproj file. My guess is that you created a project but didn't add any source files to the project, therefore there was nothing to build. Just opening the source in Visual Studio doesn't put the source in a project.

Select Project > Add Existing Item. Browse to your .f90 source and add it to the project. Then build.

The error about not finding the EXE is that no source files were found to build, thus no EXE got built.

You DO have the user documentation available under Help in Visual Studio, though it might not help you here other than reading the "getting started" information on how to create a project.

Steve,

I am attaching a *.vproj file here.  Also, I am using the product Intel Visual FORTRAN Compiler 11.1 Professional Edition with IMSL for Windows

Can you please let me know what is that I am doing wrong? I want to set up procedures so that I just create a *.FOR source code, compile and then run for results. My problem is that switching between various versions and protocols etc., is what I cannot (or do not want to) keep a track of. This becomes a never-ending nightmare.

Thanks for your help.

- Deb Chatterjee (aka Deb C.) 

 

Attachments: 

AttachmentSize
Download Complex Airy Function.vfproj1.88 KB

Quote:

mecej4 wrote:

Here is the VS2008 project. As noted earlier, you will have to change the paths to the IMSL include and lib directories to the values for your installation, under the project properties. You may also need to choose the configuration(s) for which you have a compatible IMSL.

Mecej4:

I did have the appropriate changes in my original source code. Your modification to my source code seems to use a the commands USE CAI_INT instead of EXTERNAL CAI. Your one seems appropriate for FORTRAN 90 interface and I am using the *.FOR environment.  I am not sure if I can use a mixed declaration in either *.f90 or *.for environments.  As I responded to Steve Lionel, just earlier, I am using the product Intel Visual FORTRAN Compiler 11.1 Professional Edition with IMSL for Windows

- thanks,

Deb Chatterjee (aka Deb C.)

Apparently, you did not read my comments in #6, which address exactly this issue. In short, you are not using a Fortran 77 compiler. The IFort 11 compiler treats a .for file as a Fortran9X source file in fixed format. You do need to read the documentation and understand the differences between using a USE statement to provide an interface as opposed to simply declaring a function or subroutine as EXTERNAL.

Your VFPROJ file in #19 does not show any files in the "source files" tab of the solution explorer, as Steve Lionel guessed in #13. Therefore, VS decides that there is nothing to do, as the project is empty at this point.

Right click on "source files" in the solution explorer, then left click on Add and then on "Existing Item" . Add your source file using the file selection box that appears.

Mecej4:

Let me summarize what I understood from your last post:

1. I am using a straightforward *.FOR compiler (IFORT 11) and you are stating that I can use USE XXX_YYY instead of EXTERNAL XXX_YYY.  If that is true what you are saying is that I can just use the *.F90 usage of the IMSL in version 11.1 that I have. The IMSL manual (online) showed differently - that is USE XXX_YYY, I thought was restricted to source files ending in *.F90 extensions.  Well I must have been wrong. I always use double precision arithmetic because of stringent numerical accuracy especially in case of electromagnetic scattering problems. So, that part I am hoping will also be taken care of through this generic declaration. 

2. I shall do what you have stated. But before that let me do the changes and try recompiling and running.  Question is: do I again build after I have added the source file (*.for) in the VPROJ?

3. Why suddenly the source files (*.for) are not getting automatically added in the VPROJ?

Thanks a lot for your help, mecej4.

- Deb Chatterjee 

 

 

Quote:

mecej4 wrote:

... In short, you are not using a Fortran 77 compiler. The IFort 11 compiler treats a .for file as a Fortran9X source file in fixed format. ...

OP seems to imply wanting to stick to FORTRAN 77.

Deb C.,

Is that really what you want?  If so, yes you can remain with FORTRAN 77 and depending on your setting in Visual Studio, you can use .for or .f extension, etc.  However, your comments in general suggest it would really help if you start from the beginning again and first read up on Visual Studio, then how Intel Fortran integrates with it, and after that how to set up basic projects with Intel Fortran in Visual Studio - lots of documentation online and with your installation of Intel Fortran. 

Where you are interfacing with IMSL, I agree with mecej4 in recommending the IMSL USE interface, regardless of whether you choose .for (same effect as .f) fixed form source or free form.  As mentioned above, choice of fixed format doesn't switch the compiler out of accepting Fortran 90/95/2003 as well as f77 syntax.

I didn't understand your reservations about double precision.  With ifort, double precision is the same as real(selected_real_kind(12)) , which evaluates to real(kind=8) for ifort. I would hope that the IMSL USE interfaces for double precision would accept either spelling.

There are some issues in generic interfaces as to whether the various methods of arriving at double precision are considered to match, but I haven't seen you indicating you face such issues.

I personally have never seen any of the Fortran 90 versions of IMSL, as I've long given up using that.

Quote:

Tim Prince wrote:
I personally have never seen any of the Fortran 90 versions of IMSL, as I've long given up using that.
Many of the functions and subroutines in IMSL versions FNL-6 and FNL-7 are no longer available with a pure F77 interface. To the point, the Airy function with generic name CAI that the OP uses in his code maps to specific routines C_CAI and Z_CAI. However, even these specific routines take optional second arguments and, therefore, are tricky if not impossible to call from strict F77 code. The argument lists of the specific routines are not even mentioned in the documentation (see http://www.roguewave.com/portals/0/products/imsl-numerical-libraries/for..., Chap.8, "CAI"). One may look at their interfaces in the provided source file numerical_libraries_f90.f90, but even then the problems with calling them from F77 code remain.

Quote:

Tim Prince wrote:

Where you are interfacing with IMSL, I agree with mecej4 in recommending the IMSL USE interface, regardless of whether you choose .for (same effect as .f) fixed form source or free form.  As mentioned above, choice of fixed format doesn't switch the compiler out of accepting Fortran 90/95/2003 as well as f77 syntax.

Well, that's very good news for oldies like me.

Quote:

Tim Prince wrote:

I didn't understand your reservations about double precision.  With ifort, double precision is the same as real(selected_real_kind(12)) , which evaluates to real(kind=8) for ifort. I would hope that the IMSL USE interfaces for double precision would accept either spelling.

Did not quite catch this.  But you maybe correct. I'll try out (following mecej4's prescription), and then if the code runs with no hassles I'll let the forum know.

Quote:

Tim Prince wrote:

There are some issues in generic interfaces as to whether the various methods of arriving at double precision are considered to match, but I haven't seen you indicating you face such issues.

I personally have never seen any of the Fortran 90 versions of IMSL, as I've long given up using that.

IMSL is the main attraction for me to use FORTRAN.  Particularly I have to use a lot of complicated numerical math in my work; if I had to develop the routines myself to the degree of accuracy that IMSL has - particularly (the special functions with complex arguments). The numerical quadrature routines can even handle pole and branch point singularities in the path of integration.  I would be very skeptical if any other software such as MATLAB would do all that to the degree of complication that IMSL (or perhaps NAG) does.

Recommend that you fall in love with IMSL all over again. It can be your princess. :-)

Quote:

mecej4 wrote:

However, even these specific routines take optional second arguments and, therefore, are tricky if not impossible to call from strict F77 code. The argument lists of the specific routines are not even mentioned in the documentation (see http://www.roguewave.com/portals/0/products/imsl-numerical-libraries/for..., Chap.8, "CAI"). One may look at their interfaces in the provided source file numerical_libraries_f90.f90, but even then the problems with calling them from F77 code remain. 

I have access to that online documentation for IMSL.  The point is that I am creating a *.FOR source code and not *.F77 as you have pointed out. So, I am hoping that if I make the changes to the IMSL routines - the way you have indicated in an earlier post, it will compile & execute fine.  

My problem seems to be, following your prescription, that VS is seeing the VPROJ empty. It probably has nothing to do with *.FOR or *.F77 environment.  

So, if I make the (minor) changes as you have suggested to the source code - use IMSL differently than I am using now - and then fill the VPROJ the way you have indicated, I should not see any problems.

I shall let the bloggers know by COB tomorrow.

- thanks as always,

Deb C. (aka Deb Chatterjee) 

Quote:

Deb. C wrote:
So, if I make the (minor) changes as you have suggested to the source code - use IMSL differently than I am using now - and then fill the VPROJ the way you have indicated, I should not see any problems.

I don't think that you should count on that. There are numerous algorithmic errors (variables used without initialization, misnamed common blocks and subroutine arguments, etc.) in the program, which you will encounter only after you succeed in compiling and linking. 

While I agree with those who suggest that you move on to more modern Fortran syntax, don't feel that you are required to do so. Intel Fortran supports Fortran 77 and IMSL supports using it with Fortran 77.

The basic issue here is that you didn't add your source file to the project. Doing so is automatic if you add a new source file, using the project menus, while in the project, but simply creating a project doesn't add existing sources.

Steve - Intel Developer Support

Steve & Mecej4:

Thanks a lot for your help and advice. I could finally clean the code and have it compiled and linked with the IMSL on my Intel Visual FORTRAN (version 11.1).  I have attached the source code and  the buildlog.htm file here.

There is something quite interesting and although mecej4 had mentioned it earlier, I am not sure why it works and if I can do the same in all my other source codes. The issue is with IMSL routines.

The code I finally got to run (error-free), is somewhat different than mecej4 had suggested me to do. I have excluded (just to see if it would work or not), the commands:

   IMPLICIT NONE

   USE CAI_INT

Instead I had called (adventurously) the IMSL routine Z_CAI to see if it would mingle error-free with F77. (The Z_CAI is actually suitable for F90 interface.) I expected errors and I thought that I shall go back to the commands that mecej4 had suggested.  Instead as you can see in the buildlog.htm file, that it worked and indicating that IMSL routines specifically indicated as appropriate for F90 interface, will also work for F77 interface.

I wonder why?  (The attached Airy.zip file has both files for your perusal.) 

Anyways thanks Steve and mecej4. You guys are god & angels to the entire FORTRAN community.

- Deb Chatterjee (aka Deb C.) 

Attachments: 

AttachmentSize
Download Airy.zip2.98 KB

Deb,

If you don't have USE CAI_INT, do NOT call Z_CAI, which as you say is the "Fortran 90" interface. While the program may build, it will not execute correctly. In this case, CAI has an optional argument SCALING which, if you don't have the USE, will not be communicated properly to CAI and it will read uninitialized memory. In cases of more complex IMSL routines, arrays will be passed incorrectly and you'll get run-time errors or wrong results. Don't use EXTERNAL if you're using an explicit interface or module.

I also strongly recommend against using the type-specific names such as Z_CAI, CDSQRT, etc. Use the generic names (CAI, SQRT) instead. It will help you avoid other problems.

Steve - Intel Developer Support

Leave a Comment

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