问题
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'.
回答1:
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.
回答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 everything
enter link description here 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.
来源:https://stackoverflow.com/questions/33065962/ifort-error-10037-could-not-find-link