Page 2 of 2

Re: How to: Compile the latest kernels (Classic Mint & LMDE)

Posted: Fri Jun 13, 2014 5:47 am
by grml4d
the xconfig does not start , message is No rule to make target `scripts/kconfig/.tmp_qtcheck'
what package is missing ?

Re: How to: Compile the latest kernels (Classic Mint & LMDE)

Posted: Wed Feb 11, 2015 12:08 pm
by Magister
This thread is one of the first one to appear in Google when searching for mint compile kernel. It works, but AFAIK the kernel Makefile use their own flags, not CFLAGS, you need to do a:

Code: Select all

export KCFLAGS="-march=native -O2 -pipe"
for it to use the native architecture.

Re: How to: Compile the latest kernels (Classic Mint & LMDE)

Posted: Wed May 20, 2015 5:25 pm
by braggart
grml4d wrote:the xconfig does not start , message is No rule to make target `scripts/kconfig/.tmp_qtcheck'
what package is missing ?
I know this is somewhat late but the libqt4-dev package needs to be installed. The xconfig tutorial line needs to change to:

Code: Select all

sudo apt-get install qt4-designer qt4-dev-tools qt4-doc qt4-linguist-tools qt4-qmake libqt4-dev

Re: How to: Compile the latest kernels (Classic Mint & LMDE)

Posted: Wed Sep 14, 2016 7:41 am
by Dupo
Hi,

I've got a question. If I download a kernel from kernel.org website must I apply the patch file for this kernel ?
I see on the kernel.org website that there are a patch file and an incremental patch file for each kernels. Do I need to apply them ? See it : https://www.kernel.org/.

Thanks.

Re: How to: Compile the latest kernels (Classic Mint & LMDE)

Posted: Wed Sep 14, 2016 8:24 am
by Magister
I prefer to take the ubuntu sources instead of kernel.org one.

For instance for my Mint 17, I clone git://kernel.ubuntu.com/ubuntu/ubuntu-vivid.git

then basically do:
make oldconfig
export KCFLAGS="-O2 -pipe -march=native -mtune=native"
time make -j8 deb-pkg
sudo dpkg -i linux-image-*.deb linux-headers-*.deb

Re: How to: Compile the latest kernels (Classic Mint & LMDE)

Posted: Fri Sep 16, 2016 10:35 am
by Dupo
Hi,

I need the last version of the kernel (4.7.3 is the last stable version). Kernel 4.8.x is still RC. I founded the kernel from the Kernel Mainline Ubuntu PPA website but I have some problems to compile that version. In the first post, the guy explains how to compile the kernel from the kernel.org website for Mint, but I don't know if I must apply the patch available with 4.7.3 kernel from kernel.org website.

Re: How to--compile the latest kernel(s) the Mint/Ubuntu way

Posted: Thu Dec 22, 2016 12:17 pm
by ngholbrook
Part of what you said is true but the -march=native is probably the most optimal you can get. If you wish to share this kernel with other platforms, it may not be the best but as per gnu...

‘native’
This selects the CPU to generate code for at compilation time by determining the processor type of the compiling machine. Using -march=native enables all instruction subsets supported by the local machine (hence the result might not run on different machines). Using -mtune=native produces code optimized for the local machine under the constraints of the selected instruction set.

Thus, native will look at the cpu that is compiling and optimize everything.


catweazel wrote:
Acid_1 wrote:

Code: Select all

export CONCURRENCY_LEVEL=2 
export CHOST="x86_64-pc-Linux-gnu" 
export CFLAGS="-march=native -O2 -pipe"
Some notes on optimising. I know you said this is standard ubuntu, however:

Code: Select all

export CONCURRENCY_LEVEL=2
That the number of jobs and is the same as make's -j option. This can be set much higher on machines with more than one core. I use 16.

Code: Select all

export CHOST="x86_64-pc-Linux-gnu"
That tells the compiler to build a dumbed down kernel and isn't optimal for high-end machines. It's the stock ubuntu setting. "i686-pc-linux-gnu" is more appropriate for later cpus, eg core2, i5, i7.

Code: Select all

export CFLAGS="-march=native -O2 -pipe" 
That too is suboptimal for later processors. march can be set to "corei7 -O2 -pipe", for example.

CHOST and CFLAGS can also be set using make menuconfig.

Cheers.

Re: How to--compile the latest kernel(s) the Mint/Ubuntu way

Posted: Thu Dec 29, 2016 1:43 am
by CrazyElf
ngholbrook wrote:

Code: Select all

export CHOST="x86_64-pc-Linux-gnu"
That tells the compiler to build a dumbed down kernel and isn't optimal for high-end machines. It's the stock ubuntu setting. "i686-pc-linux-gnu" is more appropriate for later cpus, eg core2, i5, i7.

Can you please verify that?

According to the Gentoo Wiki, that is exactly what you are supposed to use. For example for Haswell:

Code: Select all

CHOST="x86_64-pc-linux-gnu"
CFLAGS="-march=haswell -O2 -pipe"
CXXFLAGS="${CFLAGS}"
See:
https://wiki.gentoo.org/wiki/Safe_CFLAGS