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

Intel Fortran Compiler In Cygwin

jwd
Beginner
1,406 Views

Good morning:

With yesterday's installation of the Intel Classic Compiler on my Windows 64 desktop PC, I find that I can create an ifort executable in a  DOS cmd window using the following command:

ifort -O2 mpfun90.f mpmod90.f mpmodm90.f mpmodx90.f mpcpxdat90.f mpcpxmath.f stk.f -o stk -free
Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running on Intel(R) 64, Version 2021.8.0 Build 20221119_000000
Copyright (C) 1985-2022 Intel Corporation. All rights reserved.

Microsoft (R) Incremental Linker Version 14.34.31937.0
Copyright (C) Microsoft Corporation. All rights reserved.

-out:stk.exe
-subsystem:console
mpfun90.obj
mpmod90.obj
mpmodm90.obj
mpmodx90.obj
mpcpxdat90.obj
mpcpxmath.obj
stk.obj

This takes my primary Fortran file, stk.f, plus six Fortran files containing modules, and builds the executable stk.exe - which executes as desired.

Now then, my primary execution mode is not in a DOS cmd window, but via a cygwin window. I located the ifort compiler on my PC, and, working from the DOS command, attempt to build an executable with the following:

$ /cygdrive/c/'Program Files (x86)'/intel/oneAPI/compiler/2023.0.0/windows/bin/intel64/ifort.exe mpfun90.f mpmod90.f mpmodm90.f mpmodx90.f mpcpxdat90.f mpcpxmath.f stk.f -o stk  -free


Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running on Intel(R) 64, Version 2021.8.0 Build 20221119_000000
Copyright (C) 1985-2022 Intel Corporation. All rights reserved.

link: unknown option -- s
Try 'link --help' for more information.

I did not find 'link --help' to be of use, and see some old Forum posts from 2007-2013 but don't know whether things have changed. This link from a 2018 post seems to be defunct

 https://software.intel.com/en-us/articles/alias-method-for-using-intel-windows-compilers-under-cygwin-bash-shell/

I would appreciate guidance to correctly build an ifort  stk.exe in a cygwin window.

Thank you - jwd

Labels (1)
0 Kudos
2 Replies
Steve_Lionel
Honored Contributor III
1,398 Views

This is not a compile error. Rather, in the Cygwin environment, "link" is a different command than what the compiler driver wants to use (the Microsoft linker). You could either add the folder containing the MS linker to path, ahead of Cygwin defaults, or invoke the MS linker directly. There are a number of environment variables used by the linker - how are you getting those defined?

0 Kudos
mecej4
Honored Contributor III
1,370 Views

There are a few more utilities that have the same names in Windows and Cygwin, but different functions, options or pedigrees:

expand.exe, find.exe, hostname.exe, sort.exe, tar.exe, timeout.exe, whoami.exe

0 Kudos
Reply