Skip to content
Advertisement

Tag: gcc

implicit declaration of function ‘sched_setaffinity’

I’m writing a program which needed to be run on single core. To bind it to single core, I’m using sched_setaffinity(), but the compiler gives warning: implicit declaration of function ‘sched_setaffinity’ My test code is: Can you please help me to figure it out. Actually code is compiled and run, but I’m not sure whether it is running on single

__rdtscp calibration unstable under Linux on Intel Xeon X5550

I’m trying to use __rdtscp intrinsinc function to measure time intervals. Target platform is Linux x64, CPU Intel Xeon X5550. Although constant_tsc flag is set for this processor, calibrating __rdtscp gives very different results: As we can see the difference between program executions can be up to 3 times (125-360). Such instability is not appropriate for any measurements. Here is

How can I LD_PRELOAD my own compiled library?

I was wondering how this works, creating a library and preloading it so a program can use it instead of the one in the include statement. here is what I am doing and is not working so far . Then in the terminal: and finally which doesnt print 33, just random numbers… Answer Your programs are C programs, but the

How do we compile kernel code in C?

I am new to C and Linux. I am trying to compile the below code but it gives some fatal error while compiling. Any help on fixing this appreciated. Here is the code measurecpu.c: I am trying to compile it this way: I get this error: Answer I am trying to compile it this way gcc -c -O2 -W -Wall

R: cannot install ‘rasclass’ package on Ubuntu 14.04

I am trying to install ‘rasclass’ package on R (version 3.2.3) but somehow the installation always fails. The output is too large to be pasted here, but I found something interested in this question, that might be the key to solve this issue. Shortly: from the terminal I can see I have gcc-4.8 and 4.9, g++-4.8 and 4.9, and gfortran-4.8.

Time spends in CPU faster than in reality

I am wondering why my entire application runs in less than 8 seconds while the time obtained from clock_gettime is 19.3468 seconds which is more than two times as much as what happens in reality. Where is the problem from? Update: I am not using any OpenMP explicitly. Answer CLOCK_MONOTONIC should be used if you want to measure total elapsed

Regarding gcov output in Linux kernel?

I am running gcov in Linux kernel tree , I am getting correct report but some summary that printed at every file header is coming incorrect like below :- Here we can see number of runs and programs runs are coming zero which is not correct. what could be reason of this bug ? Answer From here: https://www.kernel.org/doc/Documentation/gcov.txt And are

Advertisement