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

Problem setting up the Fortran Compiler

Nils_Lange
Novice
657 Views

Hello,

 

I'm Working from Windows 11 and try to set up the Fortran Compiler. I want to use it together with MSC Marc, a Finite Element Code, however I struggle to get everything run in the first place.

 

I installed Visual Studio 2022 und Build Tools 2022 with the C++ Desktop Development Tools. Then I installed the oneapi Base Kit 2024.2 and afterwards the HPC Kit 2024.2 where I installed the ifort compiler.

 

Now say I open the oneAPI promt and want to compile a simple "Hello World" Test.f90 program. This is what it gives me:

Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running on Intel(R) 64, Version 2021.13.0 Build 20240602_000000
Microsoft (R) Incremental Linker Version 14.44.35221.0
C:\Program Files (x86)\Intel\oneAPI\2024.2\bin\ifort.exe
-out:Test.exe
-subsystem:console
Test.obj
LINK : fatal error LNK1181: Eingabedatei "C:\Program.obj" kann nicht geöffnet werden.

When I promt "link /" it gives

Microsoft (R) Incremental Linker Version 14.44.35221.0
C:\Program Files (x86)\Intel\oneAPI\2024.2\bin\ifort.exe
LINK : fatal error LNK1117: Syntaxfehler in Option "".

What is my problem with the linker and how can I fix it?

 

Many thanks in advance

Nils Lange

0 Kudos
1 Solution
Nils_Lange
Novice
601 Views

I found my error. I had a system environment variable "LINK" and when I deleted it, now it compiles without error.

 

Thanks for the help anyway!! I must say though that getting ifort to run on Windows is quite tricky, was much simpler on Linux, but I have no choise which system to use here...

View solution in original post

0 Kudos
5 Replies
MarcGrodent
New Contributor II
630 Views

The linker is trying to open the object file "Program.obj" instead of "Test.obj" => the problem is probably due to blanks in the file path that are not correctly interpreted => define your file path using double quotes

Have you tried building the project directly from Visual Studio? VS takes care of the file path for you...

Nils_Lange
Novice
623 Views

Thanks for the quick reply, but that cannot be it. My path does not contain any blanks. I also tried to build a program out of Visual Studio in different locations and it is always the same error.

0 Kudos
andrew_4619
Honored Contributor III
618 Views

You did not show the command so I do not know what you did.

I have later Oneapi installed so for ifort I made a cmd window and ran:

"C:\Program Files (x86)\Intel\oneAPI\2024.2\oneapi-vars.bat"

Then:

 

C:\tmp>ifort hello.f90
Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running on Intel(R) 64, Version 2021.13.0 Build 20240602_000000
Copyright (C) 1985-2024 Intel Corporation. All rights reserved.

ifort: remark #10448: Intel(R) Fortran Compiler Classic (ifort) is now deprecated and will be discontinued late 2024. Intel recommends that customers transition now to using the LLVM-based Intel(R) Fortran Compiler (ifx) for continued Windows* and Linux* support, new language support, new language features, and optimizations. Use '/Qdiag-disable:10448' to disable this message.
Microsoft (R) Incremental Linker Version 14.44.35214.0
Copyright (C) Microsoft Corporation. All rights reserved.

-out:hello.exe
-subsystem:console
hello.obj

 

C:\tmp>type hello.f90
Program Hello
write(*,*) ' Hello world'
end program hello
C:\tmp>

I

 

0 Kudos
Nils_Lange
Novice
609 Views

Thanks for the reply, yes that is exaxtly what I did

ifort Test.f90

Basically I did all the step you did and it creates Test.obj with no issue and then comes

LINK : fatal error LNK1181: Eingabedatei "C:\Program.obj" kann nicht geöffnet werden

 

0 Kudos
Nils_Lange
Novice
602 Views

I found my error. I had a system environment variable "LINK" and when I deleted it, now it compiles without error.

 

Thanks for the help anyway!! I must say though that getting ifort to run on Windows is quite tricky, was much simpler on Linux, but I have no choise which system to use here...

0 Kudos
Reply