LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-07-2003, 08:33 AM   #1
galad
LQ Newbie
 
Registered: Jul 2003
Location: Rome, Italy
Distribution: Slackware
Posts: 8

Rep: Reputation: 0
Compile linux kernel using icc (intel c compiler)


Hi,
my name is Roberto and this is my first post in this forum, nice to meet you all.
I hope this is the right place for this post, otherwise I beg your pardon, I hope you will excuse a forum newbie.


I had several problems trying to compile the kernel using icc, formerly intel c compiler.
I searched a lot around the web and on intel's website where Intel claims that compile linux kernel withh icc is possible and performs better than gcc but the informations given are to few for my skill.

The only thing I've found is a patch for kernel 2.5.45, I've applied it and changed the Makefile in this way:
HOSTCC = icc

and I removed some gcc flags that rappresented only optimizations.

Even trying to do: make xconfig
the process fails immediatly giving errors that I'm not able to solve (and to understand alas)
This is the worst:
ld: unrecognized option '--compile_dependencies'
ld: use the --help option for usage information
make[1]: *** [scripts/fixdep] Error 1
make: *** [xconfig] Error 2

Now, it looks like arab to me

I tried to compile the file script/fixdep.c with icc manually and it gives no problem.
So I thougth there must be some "linking" invoked by the Makefile that I'm not able to find.

If you have some info to help me I'd appreciate them very much.
Thank you and my best compliments for this forum, it is very well organized.

grettings,
 
Old 07-07-2003, 10:18 AM   #2
LogicG8
Member
 
Registered: Jun 2003
Location: Long Island, NY
Distribution: Gentoo Unstable (what a misnomer)
Posts: 380

Rep: Reputation: 30
I haven't personally doneanything with the
intel compiler but I think that this might help you
out. You changed from using the gnu CC but
you kept using the gnu linker. Try using intels
linker. It should be somewhere like:
/opt/intel/compiler70/ia32/bin/xild

Now in your kernel makefile you'll have a section
near the top that looks like:
#
# Include the make variables (CC, etc...)
#

AS = $(CROSS_COMPILE)as
LD = $(CROSS_COMPILE)ld
CC = $(CROSS_COMPILE)gcc
CPP = $(CC) -E
AR = $(CROSS_COMPILE)ar
NM = $(CROSS_COMPILE)nm
STRIP = $(CROSS_COMPILE)strip

It should become something like:
#
# Include the make variables (CC, etc...)
#

AS = $(CROSS_COMPILE)as
LD = $(CROSS_COMPILE)xild
CC = $(CROSS_COMPILE)icc
CPP = $(CC) -E
AR = $(CROSS_COMPILE)ar
NM = $(CROSS_COMPILE)nm
STRIP = $(CROSS_COMPILE)strip
 
Old 07-08-2003, 03:05 AM   #3
galad
LQ Newbie
 
Registered: Jul 2003
Location: Rome, Italy
Distribution: Slackware
Posts: 8

Original Poster
Rep: Reputation: 0
Thanx a lot! Now things go much better!
I've found another problem, concerning line 80 of init/main.c file, it was looking for my version of gcc to make sure it is not not old.
Obviously the test fails because I don't use gcc.
It was easy to fix it just commenting the lines 80-82.

Now I've found another error:
compilation aborted for init/main.c (code 2)
make: *** [init/main.o] Error 2

Do you know if it is an icc error code or a linker error?

I'm searching for a list of error codes but I wasn't able to find them by now, I will keep on searching

Thank you very much,
greetings,
 
Old 07-08-2003, 01:01 PM   #4
LogicG8
Member
 
Registered: Jun 2003
Location: Long Island, NY
Distribution: Gentoo Unstable (what a misnomer)
Posts: 380

Rep: Reputation: 30
I seriously doubt my ability to help you with
this, icc and kernel hacking are well out of my
scope of knowledge. I suspect that this will be
the first of many bugs caused by the differences
in compilers some of which may be compilation
errors while others might be subtle bugs that
only show up in rare circumstances at runtime.
Unless you've got some real strong C-Fu I'd give
up and use GCC. That being said I'll give it a
shot anyways. Please post more of the output
before it failed. The warnings and error remarks
that the compiler puts out before make dies.
 
Old 07-09-2003, 06:56 AM   #5
galad
LQ Newbie
 
Registered: Jul 2003
Location: Rome, Italy
Distribution: Slackware
Posts: 8

Original Poster
Rep: Reputation: 0
First of all thank you for your help.
I like C very much but I'm not BruC Lee
My C skill is not enough to heavily put my hands on the kernel sources.

I'm making a stage to take my degree in computer science, and my chief asked me to give a try to build kernel with icc, in order to evaluate performances of icc over the kernel and compare them with gcc.
Since many tests I've made before doesn't seem to give any advantages to icc, indeed gcc runs applications much more faster even on Pentium class cpus, we decided to try the kernel.
As a matter of fact, icc gives better results than gcc only when using MKL.

I will try some other thing before quitting and I let you know error log if I got stuck again.

Thank you again!
greetings
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
trying to compile KDE 3.2 with icc nbitaud Linux - Software 2 03-01-2004 02:43 AM
kernel patch to build with intel compiler galad Linux - Software 10 02-10-2004 06:08 PM
Intel icc/ifc under Slack 9.1 will not install ?? wootletootle Linux - Software 2 11-11-2003 02:26 PM
How to compile the LAM by intel compiler infovore Linux - Software 0 05-21-2003 02:27 PM
c++/intel icc j-ray Linux - Software 1 05-11-2002 11:28 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:49 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration