0

I have recently acquired a copy of Microsoft Visual Studio 2012 and Intel Parallel Studio Visual Fortran Compiler XE 2013.

I am familiar with neither the use of Microsoft Visual Studio nor Fortran as a programming language in general. My objective is to come up with a simple construct/framework in which I can generate and test basic Fortran programs/output in order to learn the Fortran language. This would be similar to using a basic Fortran compiler such as GNU and running things like "hello world" type programs through the command prompt. I am however restricted to the two applications above for reasons not relevant to discuss here.

It seems that Visual Studio does not allow the user to compile/build individual source files if they are not playing some kind of role in the more general project solution (One would have to create, compile and build a separate project for each tiny Fortran program). As described by this post, Visual Studio does not allow this for apparently very good reasons.

I also found this video which describes an apparently simple way to use the ifort command in order to compile and run a simple Fortran program using Intel Visual Fortran. Unfortunately when I try this on my OS, I get the following error message:

ifort: error #10037: could not find 'link'

Although it does successfully generate an object file with the same name, though no executable.

The plausible fix to this error is the following quote which I found on an Intel forum

"the error "cannot find link" is almost always caused by not installing the 64-bit compiler and tools component of Visual Studio"

I do not have administrator privileges on this machine for similar reasons to those for which I am only restricted to the above two applications. For this reason I cannot apply the above fix. Furthermore I do not believe the compiler is not working for this reason.

Again, all I need is a straightforward way to write, compile and run simple Fortran code. As mentioned above, I have attempted several ideas and so my only option is to solicit guidance. Since Visual Studio can build commercial quality applications and Visual Fortran can perform parallel processing with Fortran, I am inclined to think these should be able to cover this basic need.

EDIT

I just ran ifortvars.bat in windows cmd and still get the same error. Please see below for ifortvars output.

enter image description here

EDIT 2

In response to Steve's answer, here are a few commands I ran using the Intel Fortran command prompt. As you can see the problem persists.

enter image description here

user32882
  • 5,094
  • 5
  • 43
  • 82
  • Your installation is probably broken. There is no magical way how to compile programs. Show which command do you run when it prints that error message. Did you set-up your paths with `ifortvars.bat`? Finally, the official support forum might be a better place to ask. – Vladimir F Героям слава Mar 11 '17 at 15:19
  • Could you please elaborate? how do I open ifortvars.bat and what should I do to it? – user32882 Mar 11 '17 at 17:14
  • Normally it is not needed, but you can try to run it. http://csbi.mit.edu/technology/intel_fce/doc/main_for/mergedProjects/bldaps_for/common/bldaps_setup_envars.htm – Vladimir F Героям слава Mar 11 '17 at 17:40
  • You must run it as `ifortvars intel64` if you have a 64 bit system or one of the other options otherwise. But it might not help anyway. – Vladimir F Героям слава Mar 11 '17 at 18:11
  • Did you read this one? http://stackoverflow.com/questions/33065962/ifort-error-10037-could-not-find-link Possible duplicate, one of the first google hits for the error message. It suggests something similar to what I am suggesting. – Vladimir F Героям слава Mar 11 '17 at 18:13
  • If you start the Intel Fortran command prompt (from the start menu, it should be something like `Intel 64 Visual Studio 2012 mode`) it should set up your environment automatically. You can then pin it to your taskbar if you like. FWIW, I don't think I've ever run ifortvars.bat directly. – Matt P Mar 11 '17 at 19:42
  • @MattP Yes, that is what the answer in the duplicate says. Do you think that is the solution to the error message? I don't want to close as duplicate, because I don't have Ifort in Windows to try myself. – Vladimir F Героям слава Mar 11 '17 at 21:01
  • @VladimirF @user32882 I should have checked that link before posting. No, I actually think it's simpler than that -- the OP probably just needs to specify the correct args when calling the .bat file, as suggested by the help msg shown in the attached pic. For example: `ifortvars.bat intel64 vs2012`. If that doesn't fix it, I suspect the problem is that the 64bit compiler isn't installed, or maybe was installed after ifort. – Matt P Mar 11 '17 at 22:01
  • In response to @VladimirF. I ran the ifortvars.bat file (First edit to original question) on the Windows OS command prompt (Not the VS command prompt or the Intel Fortran command prompt, is this correct?). Furthermore, I am well aware of the existence of an Intel 64 Visual Studio 2012 command prompt. The problem is that ALL the command prompts (Intel IA-32, Intel 64 and Visual Studio 2012) exihibit the same behavior namely 1) Cannot find 'link' when compiling f90 source files and 2) displaying the "ERROR:Cannot determine the location of the VS common tools folder" – user32882 Mar 12 '17 at 07:02
  • @user32882 From the Intel Fortran command prompt, type `link` and hit Enter. If the VS compiler tools are set up properly, it will display a list of options for the linker. Otherwise, the linker is somehow not on your path or not installed. Look for `link.exe` in the folder `C:\Program Files (x86)\Microsoft Visual Studio XX\VC\bin` and in `...\bin\amd64` where XX is the version of VS you have installed. If it's there, check your Path variable. Let us know if you need help with that. – Matt P Mar 12 '17 at 15:00
  • Your command line screen shots appear to show that you are an administrator of the machine. If the installation hasn't been done correctly, then you need to fix that. How did you install Visual Studio and Intel Fortran? When you installed Visual Studio, what installation options did you choose? Are the Visual Studio C++ related tools installed? Did you install 64 bit support? Can you show the listing of the installed products that you get from within Visual Studio via Help > About? The Intel software forums are generally a better place to ask these sorts of product specific questions. – IanH Mar 13 '17 at 02:20

1 Answers1

1

If Intel Parallel Studio is correctly installed on your system, you should find in the Start menu an entry something like Intel Parallel Studio XE 2013. Under that (may be in a subfolder) will be an entry something like "Intel Parallel Studio XE with Intel Compiler 13.0". Click that. It opens a command prompt window. cd to the folder containing your source file and use:

ifort yoursourcefile.f90

to compile and link. It is true that in Visual Studio you have to have a project and solution to build an application, but that is pretty easy. Documentation is installed on your computer but also see https://software.intel.com/en-us/node/677903 - this is for the current version but yours will be the same.

Steve Lionel
  • 6,972
  • 18
  • 31
  • Hi Steve, thanks for your response. Unfortunately the problem persists. Please see the screenshot I have included in the original question. Also notice the error above "ERROR: Cannot determine the location of the VS Common Tools Folder" – user32882 Mar 12 '17 at 06:53
  • This solution is already described in http://stackoverflow.com/questions/33065962/ifort-error-10037-could-not-find-link @user32882 Did you try supplying the correct parameter to ifortvars.bat as requested in the comment? Starting the Ifort shell starts that bat automatically (and not much more). – Vladimir F Героям слава Mar 12 '17 at 08:51
  • Yes I have tried that in both windows cmd and the IA-32 and Intel 64 command prompt. It did not work. – user32882 Mar 12 '17 at 08:53
  • What did it print? *"Doesn't work"* does not mean anything. Please update the screenshot. – Vladimir F Героям слава Mar 12 '17 at 08:53
  • Probably time to try to reinstall the Compiler. – Vladimir F Героям слава Mar 12 '17 at 08:55
  • The screenshot would be identical to that already supplied in the first edit. Except it was in IA-32 and Intel 64 command prompt. I got the exact same output message. Also after adding the Path variables as the solution suggests in http://stackoverflow.com/questions/33065962/ifort-error-10037-could-not-find-link, the "could not find 'link'" problem persisted. The solutions proposed in the other post do not solve my problem. Therefore I don't believe my post is a duplicate. – user32882 Mar 12 '17 at 08:59