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

Unresolved External Symbol __detect_cpu_core_type When Switching from ifort to ifx on Windows

lins2
Novice
901 Views

Hello,

I need help understanding why this symbol issue arises with ifx on Windows and not with ifort. Any guidance on resolving this linking error would be appreciated.

Background

I am encountering an unresolved external symbol error for __detect_cpu_core_type when compiling my project using the ifx2024 on Windows. This issue does not occur with the Intel Fortran Compiler (ifort) or on Linux using GCC and ifx.

The symbol __detect_cpu_core_type is not defined in my source code and isn't found within the project. Verbose linking confirmed it is an undefined external symbol:

0B0 00000000 UNDEF  notype       External     | __detect_cpu_core_type

Error Message

Error error LNK2001: unresolved external symbol __detect_cpu_core_type 

Error error LNK2001: unresolved external symbol __init_cpu_core_type 

 

System Information

  • OS: Windows10
  • ifx Version: 2024.2
  • Visual Studio 2019

 

Request for Assistance

  • Is there an additional library or dependency required for ifx on Windows?
  • Are there specific compiler or linker flags for ifx that differ from ifort?
  • How can the unresolved symbol __detect_cpu_core_type be resolved?

 

 

Notes 

Providing source code or steps to reproduce is challenging due to the size of the project.

0 Kudos
8 Replies
Ron_Green
Moderator
830 Views

I will have to research this one.  It appears to be part of the processor dispatch functionality.  Do you link in MKL or other external libraries?  Do you compile with the -ax or /Qax option?  I'll ask the runtime library team about this one. 

lins2
Novice
768 Views

Hi Ron,

Thanks for getting back to me. We link MKL and we do compile with /QaxCORE-AVX2

After removing this option we are able to compile, but we do want to keep this, tho.

0 Kudos
lins2
Novice
770 Views

.

0 Kudos
lins2
Novice
693 Views

Hi @Ron_Green ,

We found another linking error for matmul_mkl_f64_ , which also occurs with ifx on Windows and not with ifort.

Thanks

 

0 Kudos
Ron_Green
Moderator
641 Views

i'd have to see the build log for ifx, and the build log for ifort.  How are you linking into MKL?  Do you use the /Qmkl option (or Properties, Fortran, Libraries, Use Intel Math Kernel Library)?  OR do you manually add the library paths and libraries based on the MKL Link Line Advisor web tool?  

 

Check to make sure there are no ia32 paths to MKL 32bit.  IFX cannot use the 32bit MKL library. 

0 Kudos
lins2
Novice
577 Views

Hi @Ron_Green ,

 

Regarding the /QaxCORE-AVX2, we require support for this feature. Is there a plan for the IFX team to include this support?

 

And about the linking error related to matmul_mkl_f64_, we created a custom MKL library following the instructions provided on Intel's website. There may be some specific functions from MKL that should be exported to prevent this error for ifx?

 

I can provide the build log and also a list of the functions we are exporting to the custom library, if that would be helpful. Can let me know the preferred method for sharing this information with you?

 

Thank you for your assistance. 

0 Kudos
Ron_Green
Moderator
548 Views

/Qax option and keywords DO work with ifx.  Many users use this function with ifx without any problems.

the functions *_cpu_core_type* are in libirc and it's variants 'md' and 'mt'.  That library should be in your path c:\Program File (x86)\Intel\oneAPI\compiler\latest\lib and should be found by the compiler.  same ones used by ifort, no difference.

 

similarly, matmul_mkl_f64 is in library libmatmul in that same folder.  These libraries are common to both ifort and ifx, no difference, same folder same name same library

 

I have attached a zip'ed solution/project with an MKL example.  the project should be built with Release config which had /QaxCORE-AVX2.  this compiles and runs.  Try it on your system to see if you have a configuration or installation issue.

 

ifx and ifort use the same binary format for objects and DLLs.  There is only 1 copy of libraries that both use.  That is why this makes no sense to me.  What links with ifort will link with IFX IF the objects are built for x64 configuration.  If you are linking in any other libraries that were built for ia32 then this could explain why linking is failing.  

0 Kudos
Ron_Green
Moderator
545 Views

One other thought or thing to check - in the build, Configuration, make sure you do NOT have /check:all or /check:uninit

If you are using those, remove them and try to build again.

0 Kudos
Reply