- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I am trying to do core isolation and core pinning using the following code on a Linux (ubuntu system)
When I compile the above program using icx , I am getting the following error. Not sure what to include for this compiler.
icx -g -fast test2.c
test2.c:16:5: error: call to undeclared function 'CPU_ZERO'; ISO C99 and later do not support implicit functio
n declarations [-Wimplicit-function-declaration]
CPU_ZERO(&mask);
^
test2.c:17:5: error: call to undeclared function 'CPU_SET'; ISO C99 and later do not support implicit function
declarations [-Wimplicit-function-declaration]
CPU_SET(6, &mask); // core number can be according to your priority
^
test2.c:18:18: error: call to undeclared function 'sched_setaffinity'; ISO C99 and later do not support implic
it function declarations [-Wimplicit-function-declaration]
int result = sched_setaffinity(0, sizeof(mask), &mask);
^
test2.c:22:23: error: call to undeclared function 'CPU_ISSET'; ISO C99 and later do not support implicit funct
ion declarations [-Wimplicit-function-declaration]
printf("%d ", CPU_ISSET(i, &mask));
^
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thanks for posting in the Intel forums.
Could you please let us know the Intel oneAPI version you have been using?
Could you please try with the icpx compiler and let us know if you further have any issues?
For more details please refer the below link
Thanks And Regards,
Aishwarya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Aishwarya
Intel API version is
icx --version
Intel(R) oneAPI DPC++/C++ Compiler 2022.2.1 (2022.2.1.20221020)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /opt/intel/oneapi/compiler/2022.2.1/linux/bin-llvm
Configuration file: /opt/intel/oneapi/compiler/2022.2.1/linux/bin/icx.cfg
I have other problems if I use CPP compiler.
I was anyway able to get over the issue by using the additional flags: -Wall -D_GNU_SOURCE
I am not sure if this is the correct way of doing things.
Regards
RK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi rganti,
_GNU_SOURCE needs to be defined before including header files like,
#define _GNU_SORCE
#include <stdio.h>
#include <stdlib.h>
In the above code you mentioned _GNU_SOURCE is defined after including header files,
so kindly check by defining at the top to ressolve the issue
Or other way to enable _GNU_SOURCE is by using -D_GNU_SOURCE flag
Thanks And regards
Aishwarya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Could you please let us know whether your issue is resolved or not.If yes,make sure to accept this as a solution.
Thanks & Regards
Aishwarya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
We assume 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,
Aishwarya
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page