First learn to walk, then learn to fly.
If you want to learn, read. Have you read this instruction manual for building the kernel with the Intel C compiler? It's a rethorical question b/c this manual uses a different approach to choosing icc
over gcc
.
You are doing three things at once:
- fiddle with some adopted and patched kernel to fit into the Ubuntu world (which is gcc)
- Up the optimization from
-O2
to -O3
.
- change the compiler
Start out with a vanilla Linux kernel from kernel.org. Keep everything standard and figure out how to build a kernel that works for your computer. Build a kernel that has only the drivers your computer needs, nothing more. Once you can compile and boot into your own kernel, you can start changing the build environment.
Going from -O2
to -O3
will probably never work. -O3
is like opening Pandora's box. If enabling -O3
was that easy, it would probably be the default!
No, it can't fully automatically infer dependencies.
If it had been packaged, apt-get build-dep oprofile
would have helped. If you can find a package elsewhere, you can look up the dependencies there. For example, if the package exists in the next release of your distribution. e.g. here:
http://archive.ubuntu.com/ubuntu/pool/universe/o/oprofile/oprofile_1.0.0-0ubuntu9.dsc
(and if you plan on compiling things yourself, always consider upgrading to the latest version first!)
Other than that it requires a little bit of experience to figure out. configure
scripts unfortunately won't tell you the package names, but usually it's quite easy to find. Also use the search functions on the distribution web pages - they can tell you which packages contain a certain file name.
Instead of iterating through configure
attempts, it may be more convenient to look at the configure.ac
file, from which the script was generated (and which usually is much shorter). You may be able to discover some optional functionality only offered if certain libraries are installed and some flag is given.
LIBERTY_LIBS="-liberty $DL_LIB $INTL_LIB"
BFD_LIBS="-lbfd -liberty $DL_LIB $INTL_LIB $Z_LIB"
POPT_LIBS="-lpopt"
are typical library dependencies.
AC_ARG_ENABLE(gui,[ --enable-gui compile with gui component (qt3|qt4|yes|no),
if not given or set to yes, gui defaults to qt3],, enable_gui=qt3)
indicates that you may also want to consider QT dependencies if you want a GUI.
Best Answer
Here's the method I just successfully used on Ubuntu 18.04:
git clone https://github.com/gwsw/less.git
cd less
autoreconf -i
# install theautoconf
package if you haven't alreadymake -f Makefile.aut dist
This creates a directory
release/less-550
containingless-550.tar.gz
andless-550.zip
. It also attempts to create a gpg signature forless-550.tar.gz
. That hung on my system, so I killed thegpg --detach-sign ...
process from another window. You could also just kill themake
process.less-550.tar.gz
is a standard buildable source tarball, which you can install as usual:tar xf less-550.tar.gz
cd less-550
./configure --prefix=
some-directory other-optionsmake
make install
The most interesting options for
./configure
are probably:Run
./configure --help
for a full list of options.