Of course, the first question is: why I'm doing this. Just for fun! I'm learning more about Linux kernels and I have a virtual machine that I can replace in 15 minutes.
Getting to business, I don't know how to do this, so I went to trying to edit the makefile (trying to learn). So I started with the makefile in the path
ubuntu-raring/Makefile, which is the main make file; can be found under this link:
And there I changed every
icc, and every
icpc, and every
-O3. The result is the following:
I followed the instructions from this site, too:
But eventually, I'm getting weird errors that seem to be caused by using
g++ rather than
icpc. For example, I got an error in the file
ubuntu-raring/include/linux/compiler-gcc.h that some macros are already defined, while this file shouldn't be included in the first place! The macro that includes it is in the file
ubuntu-raring/include/linux/compiler.h, and looks like:
#ifdef __GNUC__ #include <linux/compiler-gcc.h> #endif /* Intel compiler defines __GNUC__. So we will overwrite implementations * coming from above header files here */ #ifdef __INTEL_COMPILER # include <linux/compiler-intel.h> #endif
And while I don't understand the comment written above the Intel header (sounds weird... why would you define implementations then overwrite them? Never done that in C++!), removing the include of the
gcc header manually solved the problem, but other problems came up, and I have no idea whether they're related.
So now I'm confused! What did I do wrong? And should changing every
g++ in the Makefile be sufficient to use a different compiler? Or are there other things to be changed that I overlooked?
Thank you for any efforts.