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
Beginner
1,284 Views

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 Replies
mecej4
Honored Contributor III
1,284 Views
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.
0 Kudos
TimP
Honored Contributor III
1,284 Views
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
0 Kudos
Snow_Summer
Beginner
1,284 Views
could you possibly tell me how to set the MS link.exe before the Cygwin link.ext? in which file?
Thanks.
0 Kudos
Steven_L_Intel1
Employee
1,284 Views
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.
0 Kudos
forsjh
Beginner
1,284 Views
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
0 Kudos
Steven_L_Intel1
Employee
1,284 Views
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.
0 Kudos
mecej4
Honored Contributor III
1,284 Views
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.
0 Kudos
Reply