Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.

ifort library path under Windows 10

cean
New Contributor I
537 Views

Hi,

This is for Linux Newbie question: ifort library path - Intel Community

How to do under Windows 10?

D:\omp_hello>ifort -Qopenmp omp_hello.f90
Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running on IA-32, Version 2021.1 Build 20201112_000000
Copyright (C) 1985-2020 Intel Corporation.  All rights reserved.

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

-out:omp_hello.exe
-subsystem:console
-defaultlib:libiomp5md.lib
-nodefaultlib:vcomp.lib
-nodefaultlib:vcompd.lib
omp_hello.obj
LINK : fatal error LNK1104: cannot open file 'ifconsol.lib'

my ifconsol.lib is under D:\oneAPI\compiler\2021.1.1\windows\compiler\lib\ia32_win

Cheers,

Cean

 

0 Kudos
5 Replies
Steve_Lionel
Black Belt Retired Employee
509 Views

The Intel oneAPI "setvars.bat" script establishes various environment variables, including LIB, used for locating libraries. How did you start this command prompt session?

cean
New Contributor I
487 Views

I started from the oneAPI command prompt.

If I put D:\oneAPI\compiler\latest\windows\bin\intel64 into window's PATH, then I can start ifort anywhere, but has problem with Link.

D:\omp_hello>ifort -Qopenmp omp_hello.f90
Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running on Intel(R) 64, Version 2021.2.0 Build 20210228_000000
Copyright (C) 1985-2021 Intel Corporation.  All rights reserved.

ifort: error #10041: spawn('link') failed, errno=34

I also need to find the folder where Microsoft (R) Incremental Linker Version 14.16.27040.0 is and added into PATH.

Steve_Lionel
Black Belt Retired Employee
484 Views

Don't do that. The oneAPI command prompt should set this all up for you automatically. Don't try to piecemeal it yourself.

Show me the output from the beginning of the command prompt session, followed by:

set lib
set path
cean
New Contributor I
479 Views

I installed 2021.2 yesterday.

Just tried the oneAPI command prompt and no problem anymore. 

D:\r>ifort -Qopenmp omp_hello.f90
Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running on IA-32, Version 2021.2.0 Build 20210228_000000
Copyright (C) 1985-2021 Intel Corporation.  All rights reserved.

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

-out:omp_hello.exe
-subsystem:console
-defaultlib:libiomp5md.lib
-nodefaultlib:vcomp.lib
-nodefaultlib:vcompd.lib
omp_hello.obj

D:\r>omp_hello
 Hello World from thread =            1
 Hello World from thread =            4
 Hello World from thread =            3
 Hello World from thread =            0
 Number of threads =            8
 Hello World from thread =            7
 Hello World from thread =            2
 Hello World from thread =            5
 Hello World from thread =            6

I need a bat file to change folder after using this prompt.

Steve_Lionel
Black Belt Retired Employee
456 Views

Here's what I do. I copy the Intel shortcut to my desktop, right click on it, select Properties and change "Start in" to be the folder of my choice.

 

Reply