Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
7032 Discussions

OneAPI MKL 2023 - Cannot open include file stdlib.h

Hikarin
Beginner
2,486 Views

Hello

I'm working on a Virtual Machine (no internet access) installing Visual Studio 2022 on Windows 10, after installed oneAPI MKL library and tried to compile my code I get the following error:

"C:\Program Files (x86)\Intel\oneAPI\mkl\2023.0.0\include\mkl_service.h(23,10): fatal error C1083: Cannot open include file: 'stdlib.h': No such file or directory"

 

On Visual Studio I do have installed "C++ Desktop Workload" and also "C++ CMake tools for Windows", currently have uninstalled oneAPI and all its components, uninstalled Visual Studio and install everything back again. I can see the Intel menu under extensions and can change its settings.

 

in my work laptop I have one instance of Visual Studio with oneAPI MKL installed that is running with no issues but the version as a bit different.

 

Versions in VM:

Visual Studio 17.4.4

Base Kit Offline installer 2023.0.0.25940

Base Kit Offline installer 32bit 2023.0.0.25938

onemkl Offline Installer 2023.0.0.25930

 

Version on work laptop (working)

Visual Studio 17.2.3

Base Kit Online installer 2022.2.0.252

Base Kit Offline installer 32bit 2022.2.0.50

onemkl Offline Installer 2022.1.0.192

 

thanks

 

0 Kudos
10 Replies
PraneethA_Intel
Moderator
2,431 Views

Hi Horacio,

 

Thanks for posting on Intel communities.

 

Could you please run the below sample code with Intel compilers and let us know if the issue still persists?

#include <iostream>
#include<stdlib.h>

int main()
{
    std::cout << "Hello World!\n";
    return 0;
}

Could you please provide us with the sample reproducer code you are using?

 

Please let us know if you are facing the same error when you try to run the intel sample codes(extensions -> Intel -> Browse Intel samples...). 

 

If you are using Intel MKL libraries in your code, please refer to the below link for running code in Visual Studio.

https://www.intel.com/content/www/us/en/developer/articles/technical/intel-math-kernel-library-intel-mkl-compiling-and-linking-with-microsoft-visual-cc.html

 

>>Visual Studio 17.4.4

Also, we can see that you are using Visual Studio 17.4.4, please go through the below link and use a compatible Visual Studio version with Intel compilers.

https://www.intel.com/content/www/us/en/developer/articles/reference-implementation/intel-compilers-compatibility-with-microsoft-visual-studio-and-xcode.html

 

Thanks and Regards,

Praneeth Achanta

 

0 Kudos
Hikarin
Beginner
2,393 Views

Hello Praneeth

 

when I create a new project and run Hello World I have no issues running it. 

I tried in the past running Intel's oneAPI samples but I get an error indicating "value cannot be null Parameter Name: input". at first thought this was related to my VM been offline and not able to connect with internet and retrieve samples files, so I downloaded manually as indicated in oneAPI documentation and in Options>Intel oneAPI>Samples I put the path for the samples and is sending this message.

 

I am trying to run DDS solver with oneAPI, configuration of my project has same options as my Visual Studio (17.2.3) on my work laptop that is running with no issues:

Property Pages > Configuration Properties > Intel Libraries for oneAPI > Use oneMKL = Parallel

 

will try to get an older version of Visual Studio as indicated in the link you sent (VS 17.4.2) and see how it goes, any news will reply back

 

thanks!

 

0 Kudos
PraneethA_Intel
Moderator
2,365 Views

Hi Horacio,

 

>>will try to get an older version of Visual Studio as indicated in the link you sent (VS 17.4.2) and see how it goes, any news will reply back

Could you please let us know if the older version of Visual Studio works without any errors.

 

>>I get an error indicating "value cannot be null Parameter Name: input"

Could you try running the Intel oneAPI sample from the Intel command prompt(see steps below) and let us know if the issue still persists.

 

  1. Run oneapi-cli in the Intel oneAPI command prompt(found in the windows search bar)
  2. Follow this path: create a new project -> cpp -> Base: Vector Add 
  3. Enter the destination path(preferably not the source path) -> Create -> quit
  4. Navigate to project path and go to the src directory

 

For compiling and running the code, execute the below command then run the executable file generated(See screenshot attached for final output):

icx -fsycl /EHsc vector-add-buffers.cpp 

Screenshot of final outputScreenshot of final output

Thanks and Regards,

Praneeth Achanta

 

0 Kudos
Hikarin
Beginner
2,351 Views

Hello Praneeth

 

I tried to run oneapi-cli command but I get an error "Failed to fetch sample index, this *may* be your network/proxy environment", as indicated before, this machine is not connected to internet and I believe oneAPI is strill trying to pull the examples from the web. Attached screenshot.

Also, are there any updates on if the new Intel oneAPI would be available for v17.4.4? I am working on v17.4.2 installation, will update as soon I get the installation completed and tested oneAPI again

 

Best Regards

 

 

 

0 Kudos
PraneethA_Intel
Moderator
2,326 Views

Hi Horacio,

 

Could you try compiling and running the attached sample and let us know if any issue still arises. 

 

Thanks and Regards,

Praneeth Achanta

 

0 Kudos
PraneethA_Intel
Moderator
2,279 Views

Hi Horacio,


We have not heard back from you, could you please give us an update on your issue?


Thanks and Regards,

Praneeth Achanta


0 Kudos
Hikarin
Beginner
2,234 Views

Hello Praneeth

sorry for the delay, I am reinstalling the old version as recommended (v17.4.2) to test if the MKL works on Visual Studio (took time as this machine does not have internet connection).

regarding the test, I am able to compile and run the example, attached image with result of the test

 

Best Regards

 

 

 

0 Kudos
PraneethA_Intel
Moderator
2,217 Views

Hi Horacio,

From the screenshot we can see that you we able to get expected results from the Intel command prompt but while you were running from the visual studio samples you are getting an error. So, there might be an integration issue between the Intel oneAPI toolkits and visual studio.


>>I am reinstalling the old version as recommended (v17.4.2)

Could you please try installing and repair it and get back to us.


Thanks and Regards,

Praneeth Achanta


0 Kudos
Hikarin
Beginner
2,172 Views

Hello Praneeth

 

got an update on this topic, my build finally worked on both Visual Studio 2022 versions 17.4.2 and 17.4.4, the main problem I had was related to Platform Toolset and and wrong MSVC,

my configuration was setup to use Platform Toolset v142 but was displaying errors trying to open stdlib.h as indicated at the beginning f the thread.

After ran those Intel test and confirming that a simple Hello World worked fine, downgraded to VS 2022 v17.4.2 and started testing configurations, noticed that after downgrading VS 2022 my Platform Toolset was configured to v143 which I tested and received a similar error fur referencing to afxres.h file, noticed online that this could be related to missing MFC v143 which was not installed, after adding "C++ MFC for latest v143 build tools (x86 & x64)" I was able to run my code.

 

tl:dr: was using the wrong Platform Toolset and missing MFC. oneAPI Base Toolkit 2023 (and oneAPI base Toolkit (x86)) works on Visual Studio 2022 v17.4.4

 

thanks for your support

0 Kudos
PraneethA_Intel
Moderator
2,150 Views

Hi Horacio,

 

Glad to know that your issue is resolved. If you need any additional information, please post a new question as this thread will no longer be monitored by Intel.

 

Thanks and Regards,

Praneeth Achanta


0 Kudos
Reply