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

link problem with cygwin

Snow_Summer
Principiante
2.694 Visualizações

Cygwin was installed first and then intel fortran compiler. I run cygwin at the ifort prompt and successfully compiled some fortran files, but there was an error with link showing: "link: unknown option --s".

Does anyone know how to solve the problem?

Thanks.

0 Kudos
7 Respostas
mecej4
Colaborador honorário III
2.694 Visualizações
You should ensure that the Microsoft linker (link.exe) appears earlier in PATH than does the Cygwin link.exe, which creates symbolic links to existing files.

It that is not done, the Intel Fortran compiler does the compilation, and issues a LINK command to link the .OBJ and library files. However, because of the misconfigured PATH, this request is fielded by the Cygwin link.exe, which knows nothing special about object and library files.
TimP
Colaborador honorário III
2.694 Visualizações
We take care of this by adding the -Qlocation,link entry in ifort.cfg e.g. (varies according to your VS version)
-Qlocation,link,"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\amd64"
-assume:minus0,protect_parens,buffered_io,byterecl
-Qprec-div -Qprec-sqrt
Snow_Summer
Principiante
2.694 Visualizações
could you possibly tell me how to set the MS link.exe before the Cygwin link.ext? in which file?
Thanks.
Steven_L_Intel1
Funcionário
2.694 Visualizações
You really need to use the provided compilervars.bat file to establish the environment before starting Cygwin. What I suggest doing is opening a Fortran Command Prompt window using the shortcuts provided by the compiler install and then start Cygwin from there. You need a lot more than just the linker location.
forsjh
Principiante
2.694 Visualizações
Hi Steve, we have tried both of these options - your's and Tim's - together even.
We are still getting the error --s.

We ARE trying to run cygwin in the csh not the bash shell - does this make a difference?

Can you push us further?
Thanks!
Hope
Steven_L_Intel1
Funcionário
2.694 Visualizações
Please show the command you are using to link. I have no experience using Cygwin, but I know many people do successfully use ifort in this environment.
mecej4
Colaborador honorário III
2.694 Visualizações
I use Cygwin almost all the time, but in the following restricted way:

Instead of using the Cygwin shortcut to open a Cygwin command window, I open an IFort command window, and add c:\cygwin\bin to the tail end of PATH. This way, Cygwin tools are used only if there is no IFort/MS tool of the same name. If, at some time, I need to use Bash (to use the more versatile scripting facilities, for example), I type "bash", do the Bash-oriented work and then type "exit" to get back to the IFort environment.
Responder