Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
No, I didn't forget -- Compile Xfree with ICC
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Off the Wall
View previous topic :: View next topic  
Author Message
jcmorris
Apprentice
Apprentice


Joined: 11 Jun 2003
Posts: 174

PostPosted: Tue Feb 03, 2004 6:20 pm    Post subject: No, I didn't forget -- Compile Xfree with ICC Reply with quote

Hey guys! I've got xfree compiled with icc. I was using icc version 8.0 with the latest patch. Just download the sources for X and extract them, they will all unfold into a directory named xc. So, just enter xc, and create config/cf/host.def. Here is what mine looks like:

Code:

/* Begin XFree86 host.def file */

/* System Related Information.  If you read and configure only one
 * section then it should be this one.  The Intel architecture defaults are
 * set for a i686 and higher.  Axp is for the Alpha architecture and Ppc is 
 * for the Power PC.  Note that there have been reports that the Ppc
 * optimization line causes segmentation faults during build.  If that
 * happens, try building without the DefaultGcc2PpcOpt line.  **************/

#define CcCmd icc   /* Use ICC for C compilation */
#define CplusplusCmd icpc   /* Use ICC for C++ compilation */
#define DefaultGcc2i386Opt  -O2
/* #define DefaultGcc2AxpOpt   -O2 -mcpu=ev6 */
/* #define DefaultGcc2PpcOpt   -O2 -mcpu=750 */

#define OptimizedCDebugFlags -O2 /* I've got most of my optimizations in icc.cfg */
#define MathLibrary -limf /* Use Intel's optimized Math library instead of libm */

/* The following definitions are normally set properly by XFree86's scripts.
 * You can uncomment them if you want to make sure. ************************/

#define HasMTRRSupport      YES   /* Enabled in kernel see kernel docs*/
#define HasMMXSupport       YES   /* Any i586 or above */
#define HasKatmaiSupport    YES   /* PIII SSE instructions */
/* #define Has3DNowSupport      NO  */ /* AMD instructions */


/* This setting reduces compile time a little by omitting rarely used input
 * devices.  You can find the complete list in config/cf/xfree86.cf ********/

#define XInputDrivers                 mouse void

/* VIDEO DRIVERS ***********************************************************/

/* If you are sure you only want the drivers for one or a few video cards,
 * you can delete the drivers you do not want. *****************************/


#define XF86CardDrivers  ati

/* USER AND SYSTEM DEFAULT PATHS *******************************************/

/* These settings set the PATH variables used by xdm. See README for *******/
/* detailed description and modify the following as per your need. *********/

/* #define DefaultSystemPath /usr/bin:/bin:/usr/sbin:/sbin:/usr/X11R6/bin */
/* #define DefaultUserPath /usr/bin:/bin:/usr/X11R6/bin */

/* FONT SERVER AND LIBRARY SETTINGS ****************************************/

/* These settings are the defaults   ***************************************/

/* #define BuildFontServer          YES  */ /* For Ghostscript Print Server*/
/* #define SharedLibFont            YES  */
/* #define CompressAllFonts         YES  */
/* #define GzipFontCompression      YES  */

/* These settings ensure we use our libraries ******************************/
#define HasFreetype2             YES
#define HasFontconfig            YES
#define HasExpat                 YES
#define HasLibpng                YES
#define HasZlib                  YES

/* The font path can be redefined in the XF86Config file *******************/

/*
#define DefaultFontPath                $(FONTDIR)/misc/,$(FONTDIR)/75dpi/,\
$(FONTDIR)/100dpi/,$(FONTDIR)/Type1,$(FONTDIR)/local,\
$(FONTDIR)/TrueType,$(FONTDIR)/CID,$(FONTDIR)/Speedo
*/


/* INTERNATIONAL FONTS.  Change to YES if you need any of them.  These  are
 * the defaults. ***********************************************************/

/* #define BuildCyrillicFonts            NO  */
/* #define BuildArabicFonts              NO  */
/* #define BuildISO8859_6Fonts           NO  */
/* #define BuildGreekFonts               NO  */
/* #define BuildISO8859_7Fonts           NO  */
/* #define BuildHebrewFonts              NO  */
/* #define BuildISO8859_8Fonts           NO  */
/* #define BuildKOI8_RFonts              NO  */
/* #define BuildJapaneseFonts            NO  */
/* #define BuildJISX0201Fonts            NO  */
/* #define BuildKoreanFonts              NO  */
/* #define BuildChineseFonts             NO  */

/* DOCUMENTATION SETTINGS **************************************************/

/* These setting are the defaults. *****************************************/

/* #define BuildLinuxDocHtml             NO  */  /* X Docs in Html format */
/* #define BuildLinuxDocPS               NO  */  /* PostScript format */
/* #define BuildAllSpecsDocs             NO  */  /* Various docs */
/* #define BuildHtmlManPages             NO  */

/* GENERAL SETTINGS: You generally want to leave these alone when
 * building X on an LFS system *********************************************/

#define GccWarningOptions         -pipe /* Speed up compiles */
#define TermcapLibrary            -lncurses
#define XprtServer                YES /* Needed by realplayer */
#define XnestServer               YES
#define XAppLoadDir               EtcX11Directory/app-defaults
#define VarLibDir                 /var/lib
#define XFree86Devel               NO
#define FSUseSyslog               YES
#define ThreadedX                 YES
#define HasPam                     NO       
#define SystemManDirectory        /usr/share/man  /* Instead of /usr/man */
#define HasLibCrypt               YES
#define InstallXinitConfig        YES
#define InstallXdmConfig          YES
#define ForceNormalLib            YES
#define BuildSpecsDocs             NO

/* End XFree86 host.def file */


Now, type make World; make install; make install.man.
I haven't tested it yet, but I hope you guys will help figure out any problems!

jcm[/code]
_________________
Desktop:
Athlon64 3000+ (Socket 939 Venice)
Asus A8N-SLI
1GB Dual-Channel DDR 3200
NVidia Geforce 6800 256MB

Laptop:
IBM R40
Pentium M 1.4 GHz
256 MB RAM
Back to top
View user's profile Send private message
ebrostig
Bodhisattva
Bodhisattva


Joined: 20 Jul 2002
Posts: 3152
Location: Orlando, Fl

PostPosted: Tue Feb 03, 2004 6:30 pm    Post subject: Reply with quote

Why do you post something you haven't tested?

Does it compile and install?
Does it start X?
Can you run any DE/WM?

Please provide some more info.

Erik
_________________
'Yes, Firefox is indeed greater than women. Can women block pops up for you? No. Can Firefox show you naked women? Yes.'
Back to top
View user's profile Send private message
ebrostig
Bodhisattva
Bodhisattva


Joined: 20 Jul 2002
Posts: 3152
Location: Orlando, Fl

PostPosted: Tue Feb 03, 2004 6:59 pm    Post subject: Reply with quote

Ok, so I'm baffeled by your magic :twisted:

I followed you easy steps above and copied the host.def file and no matter what I try, it uses gcc.

Care to enlighten us some more?

Erik
_________________
'Yes, Firefox is indeed greater than women. Can women block pops up for you? No. Can Firefox show you naked women? Yes.'
Back to top
View user's profile Send private message
jcmorris
Apprentice
Apprentice


Joined: 11 Jun 2003
Posts: 174

PostPosted: Tue Feb 03, 2004 8:58 pm    Post subject: Reply with quote

I initially saw a couple of gcc lines as well, but those only lasted until all the makefiles were made. After that, everything was using icc, so you should be okay if you wait a while.

jcm
_________________
Desktop:
Athlon64 3000+ (Socket 939 Venice)
Asus A8N-SLI
1GB Dual-Channel DDR 3200
NVidia Geforce 6800 256MB

Laptop:
IBM R40
Pentium M 1.4 GHz
256 MB RAM
Back to top
View user's profile Send private message
jcmorris
Apprentice
Apprentice


Joined: 11 Jun 2003
Posts: 174

PostPosted: Tue Feb 03, 2004 9:04 pm    Post subject: Reply with quote

Hmm, I still get a signal 11. I'm not sure what is causing it, it is right after it tries initializing DRI (which fails). Can anybody find what I'm doing wrong?

jcm
_________________
Desktop:
Athlon64 3000+ (Socket 939 Venice)
Asus A8N-SLI
1GB Dual-Channel DDR 3200
NVidia Geforce 6800 256MB

Laptop:
IBM R40
Pentium M 1.4 GHz
256 MB RAM
Back to top
View user's profile Send private message
TenPin
Guru
Guru


Joined: 26 Aug 2002
Posts: 500
Location: Kansas City

PostPosted: Tue Feb 03, 2004 11:58 pm    Post subject: Reply with quote

Sounds like it "just didn't work".

Is X known to be regularly and succesfully compiled with icc ?

If it is, is there a performace increase actually worth having ?
Back to top
View user's profile Send private message
jcmorris
Apprentice
Apprentice


Joined: 11 Jun 2003
Posts: 174

PostPosted: Wed Feb 04, 2004 1:25 am    Post subject: Reply with quote

I can't find anything googling around about this, so we are in uncharted territory. Maybe it is an optimization issue? I used the following optimizations: -unroll -ip -xB -long_double -O2

Can you guys help me out by trying compilations with fewer optimizations? We WILL crack this!

jcm
_________________
Desktop:
Athlon64 3000+ (Socket 939 Venice)
Asus A8N-SLI
1GB Dual-Channel DDR 3200
NVidia Geforce 6800 256MB

Laptop:
IBM R40
Pentium M 1.4 GHz
256 MB RAM
Back to top
View user's profile Send private message
jcmorris
Apprentice
Apprentice


Joined: 11 Jun 2003
Posts: 174

PostPosted: Wed Feb 04, 2004 1:43 am    Post subject: Reply with quote

Hey guys, my X log said that it crashed right after trying to initialize DRI (which failed), which means that there could be a problem with icc trying to compile DRI. I'm going to try sometime soon with the following in my host.def:

#define BuildXF86DRI NO

That should disable building DRI. While this is not what I would want, it would help with narrowing down where the problem lay. Also, I could always download the latest DRI cvs snapshot and install that later. Anyway, let's try this.

jcm
_________________
Desktop:
Athlon64 3000+ (Socket 939 Venice)
Asus A8N-SLI
1GB Dual-Channel DDR 3200
NVidia Geforce 6800 256MB

Laptop:
IBM R40
Pentium M 1.4 GHz
256 MB RAM
Back to top
View user's profile Send private message
jcmorris
Apprentice
Apprentice


Joined: 11 Jun 2003
Posts: 174

PostPosted: Wed Feb 04, 2004 2:26 am    Post subject: Reply with quote

Well, I commented out the glx and dri lines of my XF86Config, and X started fine. However, twm (since I've not installed any X software yet) has no color! The xterms do have some color, but still, this is not looking like it will be very stable. Let's try different optimization flags.

jcm
_________________
Desktop:
Athlon64 3000+ (Socket 939 Venice)
Asus A8N-SLI
1GB Dual-Channel DDR 3200
NVidia Geforce 6800 256MB

Laptop:
IBM R40
Pentium M 1.4 GHz
256 MB RAM
Back to top
View user's profile Send private message
jcmorris
Apprentice
Apprentice


Joined: 11 Jun 2003
Posts: 174

PostPosted: Wed Feb 04, 2004 3:28 am    Post subject: Reply with quote

Hold up. There is a problem with building libraries with icc. Even with -cxxlib-gcc, you cannot link a gcc-compiled object with icc-compiled libraries, you get the following:

undefined reference to '_intel_fast_memcpy'
etc.

I can't find out why this is, can anybody else clue me in? Is there something else that needs to be linked in? Thanks!

jcm
_________________
Desktop:
Athlon64 3000+ (Socket 939 Venice)
Asus A8N-SLI
1GB Dual-Channel DDR 3200
NVidia Geforce 6800 256MB

Laptop:
IBM R40
Pentium M 1.4 GHz
256 MB RAM
Back to top
View user's profile Send private message
ebrostig
Bodhisattva
Bodhisattva


Joined: 20 Jul 2002
Posts: 3152
Location: Orlando, Fl

PostPosted: Wed Feb 04, 2004 1:25 pm    Post subject: Reply with quote

I thought you said you had built this in an earlier post and that it was working? I guess that was not true then?

Oh, btw, it uses gcc no matter what I do. No icc is used even after making the makefiles.

Please give us a step by step instruction as to what you are doing. Without that, it is impossible for us to follow you or to try to reproduce your issues.

Erik
_________________
'Yes, Firefox is indeed greater than women. Can women block pops up for you? No. Can Firefox show you naked women? Yes.'
Back to top
View user's profile Send private message
()
l33t
l33t


Joined: 25 Nov 2002
Posts: 610

PostPosted: Wed Feb 04, 2004 1:46 pm    Post subject: Reply with quote

Maybe linking in the Intel runtime library would help (-static-libcxa)?
Back to top
View user's profile Send private message
jcmorris
Apprentice
Apprentice


Joined: 11 Jun 2003
Posts: 174

PostPosted: Wed Feb 04, 2004 2:10 pm    Post subject: Reply with quote

ebrostig wrote:
I thought you said you had built this in an earlier post and that it was working? I guess that was not true then?

Oh, btw, it uses gcc no matter what I do. No icc is used even after making the makefiles.

Please give us a step by step instruction as to what you are doing. Without that, it is impossible for us to follow you or to try to reproduce your issues.

Erik


Really? Hmmm.... I don't know. That is exaclty what I added to my host.def, and I had it made with icc, let me look into it a bit.

jcm
_________________
Desktop:
Athlon64 3000+ (Socket 939 Venice)
Asus A8N-SLI
1GB Dual-Channel DDR 3200
NVidia Geforce 6800 256MB

Laptop:
IBM R40
Pentium M 1.4 GHz
256 MB RAM
Back to top
View user's profile Send private message
jcmorris
Apprentice
Apprentice


Joined: 11 Jun 2003
Posts: 174

PostPosted: Wed Feb 04, 2004 2:21 pm    Post subject: Reply with quote

() wrote:
Maybe linking in the Intel runtime library would help (-static-libcxa)?


I've tried, but I still get the error. Well, so much for using Intel's compiler.

jcm
_________________
Desktop:
Athlon64 3000+ (Socket 939 Venice)
Asus A8N-SLI
1GB Dual-Channel DDR 3200
NVidia Geforce 6800 256MB

Laptop:
IBM R40
Pentium M 1.4 GHz
256 MB RAM
Back to top
View user's profile Send private message
()
l33t
l33t


Joined: 25 Nov 2002
Posts: 610

PostPosted: Wed Feb 04, 2004 2:45 pm    Post subject: Reply with quote

Ok, I think I found the solution for _intel_fast_memcpy. Specify the Intel library dir with -L, and link in libirc (-lirc).
Back to top
View user's profile Send private message
jcmorris
Apprentice
Apprentice


Joined: 11 Jun 2003
Posts: 174

PostPosted: Wed Feb 04, 2004 5:08 pm    Post subject: Reply with quote

Thanks, I'll try that then. Wow this is going to be annoying having to specify LDLFAGS when building every program!

jcm
_________________
Desktop:
Athlon64 3000+ (Socket 939 Venice)
Asus A8N-SLI
1GB Dual-Channel DDR 3200
NVidia Geforce 6800 256MB

Laptop:
IBM R40
Pentium M 1.4 GHz
256 MB RAM
Back to top
View user's profile Send private message
()
l33t
l33t


Joined: 25 Nov 2002
Posts: 610

PostPosted: Wed Feb 04, 2004 5:27 pm    Post subject: Reply with quote

From the docs it seems icc only chooses it's own flavour of memcpy if memcpy doesn't macro expand to __builtin_memcpy. Maybe you could specify this macro explicitly on the command line?
Code:
icc -Dmemcpy=__builtin_memcpy -Dmemset=__builtin_memset
Back to top
View user's profile Send private message
jcmorris
Apprentice
Apprentice


Joined: 11 Jun 2003
Posts: 174

PostPosted: Wed Feb 04, 2004 6:33 pm    Post subject: Reply with quote

Thanks guys! I'd rather use Intel's memcpy and memset, so I'm just going to export my LDFLAGS as "-L/opt/intel_cc_80/lib -lirc" and build my system with that. Thanks!

jcm
_________________
Desktop:
Athlon64 3000+ (Socket 939 Venice)
Asus A8N-SLI
1GB Dual-Channel DDR 3200
NVidia Geforce 6800 256MB

Laptop:
IBM R40
Pentium M 1.4 GHz
256 MB RAM
Back to top
View user's profile Send private message
goanuj
Tux's lil' helper
Tux's lil' helper


Joined: 13 Jul 2002
Posts: 125
Location: California

PostPosted: Wed Feb 04, 2004 9:25 pm    Post subject: can you post your icpibin -V Reply with quote

Code:
[1624][u35354354@infong242:bin]$ icpcbin -V
Intel(R) C++ Compiler for 32-bit applications, Version 8.0   Build 20031016Z Package ID: <installpackageid>
Copyright (C) 1985-2003 Intel Corporation.  All rights reserved.
FOR NON-COMMERCIAL USE ONLY

icpcbin: Command line error: no files specified; for help type "icpcbin -help"


Can you post yours so that we know what build you are working with?
Back to top
View user's profile Send private message
jcmorris
Apprentice
Apprentice


Joined: 11 Jun 2003
Posts: 174

PostPosted: Thu Feb 05, 2004 6:37 pm    Post subject: Reply with quote

icc -V
Intel(R) C++ Compiler for 32-bit applications, Version 8.0 Build 20040122Z Package ID: l_cc_pc_8.0.058_pe059
Copyright (C) 1985-2004 Intel Corporation. All rights reserved.
FOR NON-COMMERCIAL USE ONLY

I've got a 2004 build.

jcm
_________________
Desktop:
Athlon64 3000+ (Socket 939 Venice)
Asus A8N-SLI
1GB Dual-Channel DDR 3200
NVidia Geforce 6800 256MB

Laptop:
IBM R40
Pentium M 1.4 GHz
256 MB RAM
Back to top
View user's profile Send private message
SalsaDoom
Tux's lil' helper
Tux's lil' helper


Joined: 22 Jan 2003
Posts: 105
Location: Saskatoon, Saskatchewan

PostPosted: Thu Feb 05, 2004 7:35 pm    Post subject: Reply with quote

Uh, pardon me guys. But I'm curious, why is this cool? I read that icc is Intels compiler, and I'm assuming that its quite optimized compared to gcc..

But I'm making wild guesses, any real differences between compiling something with icc instead gcc? Perhaps just a minor performance increase?

--SD
Back to top
View user's profile Send private message
jcmorris
Apprentice
Apprentice


Joined: 11 Jun 2003
Posts: 174

PostPosted: Thu Feb 05, 2004 8:34 pm    Post subject: Reply with quote

Yes, you would use it mainly for performance reasons. Benchmarks have usually shown a 10%+ boost in performance and smaller code. Plus, unlike gcc, it currently has an optimization flag for the Pentium M (Centrino). Starting with version 8, Intel has tried to make it more compatible with gcc's command-line options and object code.

EDIT: Also, icc comes with an optimized math library that is faster than libm, so if you compile math-intensive stuff with icc and link in libimf (it's optimized math library), then you will have a faster program. It also has auto-vectorization, so it makes more use of SSE and other multimedia instructions.

jcm
_________________
Desktop:
Athlon64 3000+ (Socket 939 Venice)
Asus A8N-SLI
1GB Dual-Channel DDR 3200
NVidia Geforce 6800 256MB

Laptop:
IBM R40
Pentium M 1.4 GHz
256 MB RAM
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Off the Wall All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum