How to set up compilation with Intel Fortran compiler on Windows correctly?

Martin Beseda
Tue, 21 Jan 2020 18:45:50 +0000
Usage

Hello,
I’m trying to build my C/C++/Fortran project both on Ubuntu and Windows10. The compilation on Linux posses no problems, but Intel Fortran compiler on Windows seems to cause great complications for CMake.

I’ve tried 3 configurations so far:

1. Visual Studio 15 2017 Win64 generator, no Fortran path specified -> Fortran compiler is not detected at all

2. Visual Studio 15 2017 Win64 generator, path to the Fortran compiler is specified -> Fortran is not able to compile a test program

3. NMake Makefiles generator -> Fortran compiler is detected successfully, but compilation fails shortly afterwards with some syntax error

I’m using Visual Studio 2017 and Intel Compiler 19.0 on Windows 10 in this case.

So, what is the “official” way to use CMake on Windows together with cl compiler provided by Visual Studio and ifort compiler provided by Intel Parallel Studio XE? I would prefer solution using Visual Studio Generator for my project, if possible.

Thank you very much for your advice,
Martin

Full Compilation Outputs

Visual Studio 15 2017 Win64 generator, no Fortran path specified

https://pastebin.com/quCgtYx3

Visual Studio 15 2017 Win64 generator, path to the Fortran compiler is specified

https://pastebin.com/kHpRcBfD

NMake Makefiles generator

https://pastebin.com/pj7cetHk

12 posts - 6 participants