Hi,
I wrote a small C program to get the processor speed of a
multi-processor system. When I compiled the program I am
getting the following error.
cc -o proc proc_speed.c
ld:
Unresolved:
__sve_p_online
__sve_processor_info
I tried compiling the program with -D__SVE__, but that generated
other errors.
Any clues to make the compilation succesfull will be greatly
appreciated.
Thanks,
Shanmuganathan.
#include <stdio.h>
#include <sys/processor.h>
#include <string.h>
#include <unistd.h>
#include <limits.h>
#include <errno.h>
#define MAX_PROCESSORS 8 /* Info collected on this many
processors max */
main()
{
int processors[MAX_PROCESSORS];
int count = 0;
int i = 0;
int nConfigured = sysconf(_SC_NPROCESSORS_CONF);
for (i = 0; i < nConfigured; i++) {
int status = p_online(i, P_STATUS);
if (status == -1 && errno == EINVAL)
continue;
if (status == P_ONLINE && count < MAX_PROCESSORS) {
proc_info_t info;
processor_info(i, &info);
processors[count++] = info.pi_clock;
printf("Proc speed %d\n",info.pi_clock);
}
}
}
Received on Wed Nov 20 2002 - 02:58:33 NZDT