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

Test_CPUtime builds and runs using IFORT but gets build errors using IFX

rivkin__steve
新分销商 II
8,232 次查看

Test_CPUtime builds and runs using IFORT but gets build errors using IFX. A test driver, subroutine, and project files are attached.

First build it using IFORT and run it. Then try to build it using IFX. 

标签 (1)
0 项奖励
1 解答
rivkin__steve
新分销商 II
6,286 次查看

Ron, I'm using the latest version of VS 2022 v17.8.4. This is a QuickWin program.

I just solved the problem: In the the linker configuration Linker|System|SubSystem... I changed it to Windows(/SUBSYSTEM:WINDOWS). Was: Console (/SUBSYSTEM:CONSOLE). I've made hundreds of QuickWin programs before - my mistake.

在原帖中查看解决方案

0 项奖励
29 回复数
mecej4
名誉分销商 III
5,873 次查看

The current versions of IFort (Build 20221119) and IFx (Build 20221201) have no trouble with the code that you provided, on Windows 11. I built in the command window.

You did not attach any project files; that did not matter to me, but there may be information in build logs that may help troubleshoot issues on your machine.

0 项奖励
rivkin__steve
新分销商 II
5,859 次查看

I did attach project files but the new Intel hosting service removed them with an error message stating it does not accept vfproj files or sln files.  Moving on:

I downloaded both compilers on 1/13/2023. IFX is version 2023.0.0 and IFORT is v2021.8.0. I am using Windows 11 Pro. This is a QuickWin build like almost all of my other programs.

Here is a copy of the compiler command line:

/nologo /O3 /QxHost /Qopenmp /fpscomp:general /stand:f18 /warn:all /fpe:0 /module:"x64\Release/" /object:"x64\Release/" /Fd"x64\Release\vc170.pdb" /traceback /check:none /libs:qwin /Qmkl:parallel /c

Here is a copy of the linker command line:

/OUT:"x64\Release/Test_CPUtime.exe" /MANIFEST /MANIFESTFILE:"x64\Release\Test_CPUtime.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /SUBSYSTEM:WINDOWS /STACK:1234567890,1234567890 /IMPLIB:"D:\Test_CPUtime\x64\Release\Test_CPUtime.lib"

Here is the build error:

Rebuild started...
1>------ Rebuild All started: Project: Test_CPUtime (IFX), Configuration: Release x64 ------
Deleting intermediate files and output files for project 'Test_CPUtime', configuration 'Release|x64'.
Compiling with Intel® Fortran Compiler 2023.0.0 [Intel(R) 64]...
CPUTIME.F90
Test_CPUtime.f90
Compiling manifest to resources...
Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384
Copyright (C) Microsoft Corporation. All rights reserved.
Linking...
Microsoft (R) Incremental Linker Version 14.34.31937.0
Copyright (C) Microsoft Corporation. All rights reserved.
/OUT:x64\Release/Test_CPUtime.exe
/MANIFEST
/MANIFESTFILE:x64\Release\Test_CPUtime.exe.intermediate.manifest
"/MANIFESTUAC:level='asInvoker' uiAccess='false'"
/SUBSYSTEM:WINDOWS
/STACK:1234567890,1234567890
/IMPLIB:D:\Test_CPUtime\x64\Release\Test_CPUtime.lib
x64\Release/CPUTIME.obj
x64\Release/Test_CPUtime.obj
x64\Release\Test_CPUtime.exe.embed.manifest.res
libcmt.lib(exe_winmain.obj) : error LNK2019: unresolved external symbol WinMain referenced in function "int __cdecl __scrt_common_main_seh(void)" (?__scrt_common_main_seh@@YAHXZ)
x64\Release\Test_CPUtime.exe : fatal error LNK1120: 1 unresolved externals

0 项奖励
Steve_Lionel
名誉分销商 III
5,849 次查看

Put the project/solution files in a ZIP and attach.

The error you're seeing is from the project type being a "Windows" application and not a Console application. What may be contributing to this confusion (you're not the first I've seen recently) is that the list of project types you can select from in Visual Studio, and I think this changed recently, has TWO different "Empty Project" types - one is console and the other windows. If you're not paying attention to the little tags. you might pick the wrong one.

A simple fix may be to change the project property Linker > System > Subsystem to Console.

0 项奖励
rivkin__steve
新分销商 II
5,838 次查看

Zip file is attached. I made the change to subsystem:console and that does work for this test program except for the side effect that the program does not persist on the monitor after it finishes executing (it does persist when using IFORT).

As a heads up, I also submitted two other test programs yesterday and this fix does not work on them.

0 项奖励
Steve_Lionel
名誉分销商 III
5,827 次查看

Ah, this is a QuickWin project. Not currently supported by IFX for some bizarre reason. See Re: Addition of QuickWin library to ifx - Intel Communities

0 项奖励
rivkin__steve
新分销商 II
5,822 次查看

I added "ifqwin.lib ifqw_mdi.lib user32.lib comctl32.lib gdi32.lib comdlg32.lib" to the linker input additional dependencies on the Test_GUI program and now it builds without errors but at runtime throws "Internal Error - unexpected error file qwgutil.c line 2783.

I guess I just need to wait until Intel starts supporting QuickWin within IFX. Is there a time estimate when that is expected to be completed?

0 项奖励
Steve_Lionel
名誉分销商 III
5,814 次查看

I don't know why it isn't supported, as that makes no sense to me. The library is shared with ifort.  Sometimes that sort of error comes from an error in the source, but there may be something else going on. The QuickWin examples I tried all worked. Barbara from Intel filed a ticket with engineering - I'm curious as to what they say.

0 项奖励
rivkin__steve
新分销商 II
5,729 次查看

@Barbara from Intel: what date will Intel add QuickWin support to IFX ? (It has been in IFORT for decades).

0 项奖励
Barbara
初学者
5,716 次查看

Hello, I'm replying, because I got an e-mail notofication about being mentioned.

 

Well, my answer is: why on earth did I come across as working for Intel? I'm a customer myself. 

0 项奖励
Barbara_P_Intel
5,710 次查看

@Barbara, I think @rivkin__steve  got his "Barbara"s mixed up. 

 

0 项奖励
Barbara_P_Intel
5,710 次查看

@rivkin__steve, ifx support of QuickWin is a work in progress. Don't look for it in the next release.

 

0 项奖励
rivkin__steve
新分销商 II
5,705 次查看

When is the approximate date IFX will have QuickWin support? And did you read Steve Lionel's comment above?

0 项奖励
rivkin__steve
新分销商 II
5,393 次查看

The recent update using BaseKit v2023.2.0.49396 did not resolve the issue with CPUTIME after installing todays patch w_ifort_runtime v2023.2.1.19

0 项奖励
Barbara_P_Intel
5,368 次查看

I just downloaded the .zip file, recompiled and ran using the .sln file in the .zip you attached. What output are you expecting? This is what I got.

Barbara_P_Intel_0-1691089788246.png

I double checked. I compiled with ifx 2023.2.0.

 

0 项奖励
rivkin__steve
新分销商 II
5,331 次查看

After rebooting I still got a RTL error. Screenshot attached. Is there an ifx equivalent to the w_ifort_runtime v2023.2.1.19?

 

And yes your output is the expected output.

0 项奖励
Barbara_P_Intel
5,269 次查看

ifx and ifort share the same runtime libraries. 

You mention that you installed the Base Toolkit. Did you also install the HPC Toolkit? The Fortran compilers and their libraries are included there.

Or you can install just the Fortran compilers as Ron outlines in this post.

 

0 项奖励
rivkin__steve
新分销商 II
5,259 次查看

I installed the Base Toolkit, HPC Toolkit, and the w_ifort_runtime v2023.2.1.19, in that order, within minutes of each successive installation, and without rebooting. Rebooting is not a requirement, but I did reboot the next day.

0 项奖励
Barbara_P_Intel
5,240 次查看

Why did you install the runtime libraries? They are part of the HPC Toolkit. 

 

0 项奖励
rivkin__steve
新分销商 II
5,229 次查看

Because Intel requested us to do so on 8/01/2023.

rivkin__steve_0-1691463184707.jpeg

 

0 项奖励
Barbara_P_Intel
5,216 次查看

Yes, there was a compiler patch release last week. To get that patch for Fortran from the Standalone Component Download article, click Compilers in the left column, scroll to Fortran and download the version you need.

The runtime libraries are supplied so that users can run a program on a computer that doesn't have the compiler installed.

 

0 项奖励
回复