3

I downloaded and installed evaluation software of: Intel Parallel Studio XE Professional Edition for Fortran Windows. My system is a 64 bit, Windows 7 OS. During its installation I was asked to download and install also: Microsoft Visual C++ 2013 Redistributable(x64)- 12.0.21005 .

I am trying to compile my source files using the command line.

In order for the command ifort to be recognized, I added the directory:

C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.0.110\windows\bin\intel64

to the PATH environment variable . (This folder contains the file ifort.exe).

However, when I try to compile a simple 'Hello World' program by the command:

ifort hello.for

I get the error:

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

The file 'hello.obj' , however, was created.

The steps I tried in order to fix this error (but that made no difference):

1) I tried to add to the PATH environment variable the directory:

C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.0.110\windows\bin\intel64_gfx

This folder contains the file: gfx_linker.exe, which I thought is the needed linker.

2) I tried to change the configuration of Visual Studio to add 64-bit support, according to the 4 steps Steve Lionel (Intel) sugested in (https://software.intel.com/en-us/forums/intel-visual-fortran-compiler-for-windows/topic/300121), but the window that appeared (after pressing the change option in the 'Uninstall or change a program utility' of the control panel) showed no 'x64 compiler&tools' checkbox option, only a repair button option, which made no difference.

3) I tried to update the ifort installation, as Tim Prince suggested in (https://software.intel.com/en-us/forums/intel-visual-fortran-compiler-for-windows/topic/280266). I tried to do it through the 'Uninstall or change a program utility' in the control panel. But selecting the 'Repair' option in the window that appeared blocked the completion of the process by stating that 'repair cannot be done because no available sources were found', and selecting the 'Modify' option, blocked me in the step of 'selecting components to modify' (nothing I chose enabled the 'next' button).

4) Before calling ifort I tried to execute the cammand:

"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.0.110\windows\bincompilervars.bat" intel64 vs2013  

as Steve Lionel (Intel) suggested in the previous link, but got the error:

ERROR: Visual Studio 2013 is not found in the system.

Right now I'm out of options, and beg for help to show me how to fix this error of ifort not being able to find the 'link'.

O.T.
  • 137
  • 2
  • 12

4 Answers4

2

You can simply compile your Fortran files from command line using ifort, to do that:

Start menu > programs > Intel parallel studio XE 2O16 > Intel 64 visual studio mode or search for Intel 64 in the start menu

open Intel 64 visual studio mode . Now you can start to use ifort and it will work fine.

If you want to know how to invoke it (the parameters used) then right click over Intel 64 visual mode, from the menu choose open file location.

I uploaded these screenshots, just take a look: the first screenshot

the second screenshot

From the second screenshot notice the parameters passed to the batch file.

Note: according to Intel documentation the second argument (vs2013) is optional.

s.ouchene
  • 1,682
  • 13
  • 31
  • Please go back and check the question. I am mentioning that in my system `ifort hello.for` results in `error #10037, could not find link`. In my computer the Target for Intel 64 Visual Studio 2012 mode is `C:\Windows\SysWOW64\cmd.exe /E:ON /V:ON /K ""C:\Program Files (x86)\Intel\Composer XE 2013\bin\ipsxe-comp-vars.bat" intel64 vs2012"`. Your second screenshot does not show all of the arguments passed to the batch file. – user32882 Jun 26 '17 at 13:35
2

My friend got the same problem. Here was what I advise him to do and it worked. The reason why this happened is that you missed link.exe located in C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\ and other related folders too. So, you can use a small software called everything to search your computer to find out whether the link.exe is missing in your Microsoft Visual Studio folder. If it is the case, you can copy these files from someone else or just reinstall your visual studio and make sure everything is right in place.

Cody Gray - on strike
  • 239,200
  • 50
  • 490
  • 574
ylin
  • 21
  • 1
0

I had the same issue.

First of all add "C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.0.110\windows\bin" to path.

Now, from windows command line run: compilervars.bat intel64

It sets up the environment on the windows command line. now you can access the "ifort" commands without getting the linking errors.

Bakmna
  • 1
0

I'm going to start by pointing out the required steps needed for code to metamorphose into executables: [SO]: LNK2005 Error in CLR Windows Form (@CristiFati's answer). That's for C, for Fortran it's the same thing, except:

  • Step #1. does not exist (at least, I don't think so)

  • Step #2. will be performed (obviously) by the Fortran compiler

Ran into the same issue when working on [SO]: What is numpy.ctypeslib.as_ctypes exacty doing (@CristiFati's answer). Environment:

  • Intel's oneAPI HPC Toolkit (also Base - which is a direct dependency) for ifort.exe

  • Microsoft's Visual Studio (I have many versions installed, chosen v2019 as it was the newest at the time) for link.exe

As seen (one has to look in both Output snippets) I built it manually in 2 steps.
But ifort.exe can automatically invoke link.exe, if the latter's dir is in the PATH variable. For more details on invoking VStudio commands, check [MS.Learn]: Building on the Command Line.

CristiFati
  • 38,250
  • 9
  • 50
  • 87