- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You are probably lacking the following prerequisite:
Microsoft Visual Studio*
- Microsoft Visual Studio* 2019 or 2022 Community, Enterprise and Professional Editions with 'Desktop development with C++' component installed
Verify by opening a OneAPI or Visual Studio developer command prompt, and entering the "link /?" command. If you do not have the Microsoft C compiler and tools installed, run the Visual Studio installer again and ask for the C++ desktop development tools package to be added.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I also traced the link.exe file to the visual studio folder. Link cmd is recognized in oneapi cmd prompt but not from folder where my Fortran code resides.
Btw, does it matter that ms visual studio is in c/program files and not in c/program files (x86) where intel stuff is.
Do I need set path for link.exe and if so where and how
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How are you starting your command prompt session. Ideally you would use the Intel installed shortcut under All Apps > Intel oneAPI 2023 > Intel oneAPI Command Prompt for Intel 64 for Visual Studio 2022. If you have manually added things to PATH for this, you'll miss a lot.
Show us the complete output from when you started the command prompt session to the command that gets the error.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please see the attached files:
first three showing the link/? checks I did at oneapi cmd and where the link files are
fourth one showing the link error i get while compiling .f file using ifort
Thanks for your time and help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I notice that the output you show where link works are all (apparently) from using the Intel shortcut, which ends up with your default folder being the Intel install folder. Then when it doesn't work, you're now in a different folder. This suggests to me that when you issued the ifort command, you were NOT in the environment created by the Intel shortcut.
What I wanted to see was a continuous display from where you started the session to where you got the error. Something like:
:: initializing oneAPI environment...
Initializing Visual Studio command-line environment...
Visual Studio version 17.5.0 environment configured.
"C:\Program Files\Microsoft Visual Studio\2022\Community\"
Visual Studio command-line environment initialized for: 'x64'
: compiler -- latest
: debugger -- latest
: mpi -- latest
:: oneAPI environment initialized ::
D:\Projects>ifort t.f90
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.35.32215.0
Copyright (C) Microsoft Corporation. All rights reserved.
-out:t.exe
-subsystem:console
t.obj
If I had to guess (which I do), I'd say that you are NOT executing the ifort command from the Intel build environment but rather from some other setup which does not have the complete environment.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That is
Open cmd prompt
CD to directory where .f file is
Then type
ifort fn.f
That’s what I am supposed to do if all the paths are set correctly
Just fyi that I did the same thing a few months ago and it worked and I could compile link and get .exe file. I still have that and it works fine
Because of computer issues I have to reinstall the visual studio basic and hpc api again two weeks ago, however now I can not compile any new Fortran file anymore
You think I need to set any path in env
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
>>I start the session as shown in image 4 above.
>>That is
>>Open cmd prompt
>>CD to directory where .f file is
This does not state that you explicitly opened the oneAPI command prompt (as you did in the 2nd and 3rd .png files)...
but rather opened the cmd prompt by other means (Start | Run | cmd).
Therefor, start the oneAPI command prompt (as you did in the 2nd and 3rd .png files).
Then CD to your development folder (you may additionaly issue the link /? prior to CD to confirm link is found).
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ah, big "if". Your paths are NOT set correctly. If you want to do it from a bare cmd prompt, then type the following command first:
call "C:\Program Files (x86)\Intel\oneAPI\setvars.bat" intel64 vs2022
Or, use the shortcut installed under Start > All Apps > Intel oneAPI 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Otherwise it does not recognize ifort command as well
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Show us, please.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page