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

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

rivkin__steve
New Contributor II
3,728 Views

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. 

Labels (1)
0 Kudos
1 Solution
rivkin__steve
New Contributor II
1,782 Views

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.

View solution in original post

0 Kudos
29 Replies
mecej4
Honored Contributor III
2,747 Views

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 Kudos
rivkin__steve
New Contributor II
2,733 Views

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 Kudos
Steve_Lionel
Honored Contributor III
2,723 Views

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 Kudos
rivkin__steve
New Contributor II
2,712 Views

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 Kudos
Steve_Lionel
Honored Contributor III
2,701 Views

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 Kudos
rivkin__steve
New Contributor II
2,696 Views

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 Kudos
Steve_Lionel
Honored Contributor III
2,688 Views

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 Kudos
rivkin__steve
New Contributor II
2,603 Views

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

0 Kudos
Barbara
Beginner
2,590 Views

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 Kudos
Barbara_P_Intel
Employee
2,584 Views

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

 

0 Kudos
Barbara_P_Intel
Employee
2,584 Views

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

 

0 Kudos
rivkin__steve
New Contributor II
2,579 Views

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

0 Kudos
rivkin__steve
New Contributor II
2,267 Views

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 Kudos
Barbara_P_Intel
Employee
2,242 Views

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 Kudos
rivkin__steve
New Contributor II
2,205 Views

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 Kudos
Barbara_P_Intel
Employee
2,143 Views

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 Kudos
rivkin__steve
New Contributor II
2,133 Views

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 Kudos
Barbara_P_Intel
Employee
2,114 Views

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

 

0 Kudos
rivkin__steve
New Contributor II
2,103 Views

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

rivkin__steve_0-1691463184707.jpeg

 

0 Kudos
Barbara_P_Intel
Employee
2,090 Views

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 Kudos
Reply