Skip to content

Tag: gcc

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,…

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…

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 …

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.kern…