New Intel C++ Compiler v10.1.020

Discussion of chess software programming and technical issues.

Moderator: Ras

User avatar
Denis P. Mendoza
Posts: 415
Joined: Fri Dec 15, 2006 9:46 pm
Location: Philippines

Re: New Intel C++ Compiler v10.1.020

Post by Denis P. Mendoza »

David Dahlem wrote:I downloaded the 30 day trial of the new Intel C++ Compiler version 10.1.020 available here ...

https://registrationcenter.intel.com/Re ... ister.aspx

It's supposed to support the IDE integration of VS2008, but doesn't seem to work with my 2008 express version. So i'm trying to learn how to use the Intel compiler on the command line. I admit i am almost a complete dummy with compilers, and especially the command line.

I have managed to compile a simple Hello.cpp file on the Intel command line with this command - icl Hello.cpp. Could someone help a compiler idiot with the commands for multiple source files?

Thanks
Dave
Hello David,

Welcome to the Intel compiling group. I've been an IDE dependent before, but later on found out that compiling in command prompt is much easier.

Here's a simple tip:

1. Let's say we want to compile Fruit 2.1 src. Extract it in a folder location like c:\fruit21src
2. Start your IA-32 32-bit compiler in command prompt. Type "cd" then click space, and type the location of source, which is "c:\fruit21src". Press enter and your 'source" location will display at command prompt.
3. For ease in typing the command lines, you could prepare the long scripts in a text editor like notepad. Here's the following sample:

Code: Select all

icl -o fruit.exe *.cpp /nologo /MT /W3 /DWIN32 /DNDEBUG /D_CONSOLE /D_MBCS /G7 /Ox /QxK /Qipo /Qprof-gen
(or add some "spices" like /Qunroll /fp:fast /Zp16 (experiment with them))
Copy and paste it at command prompt, then press "enter".
4. Run some games/epd tests without closing "console", using the "instrumented" engine - fruit.exe. Collect enough profiling data - .dyn files.
5. After profiling, compile your optimized code using the same flags. just replace /Qprof-gen with /Qprof-use. You'll now have Fruit.exe with PGO.
For ease again, here is your last command lines:

Code: Select all

icl -o fruit.exe *.cpp /nologo /MT /W3 /DWIN32 /DNDEBUG /D_CONSOLE /D_MBCS /G7 /Ox /QxK /Qipo /Qprof-use
Copy and paste it at command prompt, then press "enter".

I hope this helps David.

Denis
wgarvin
Posts: 838
Joined: Thu Jul 05, 2007 5:03 pm
Location: British Columbia, Canada

Re: New Intel C++ Compiler v10.1.020

Post by wgarvin »

My 2 cents.

I suggest making a small shell script (or batch file) in your source directory, and pasting command(s) into it like the ones in the post above by Denis. I usually call mine "b.bat" so its easy to type. Its handy when I come back to a project I haven't worked on in a long time, because I have a record of what compile options it was using etc.

For small projects, b.bat will compile and run them in one step. If running it requires command line options, or might have harmful effects (deleting files or whatever), I usually put the command line to run it in a separate "t.bat" file (for easy testing).
User avatar
David Dahlem
Posts: 900
Joined: Wed Mar 08, 2006 9:06 pm

Re: New Intel C++ Compiler v10.1.020

Post by David Dahlem »

Jim Ablett wrote:Hi David,
David Dahlem wrote:Another question. I found this in the Intel forum ...

"Intel C++ 10.1.020 is available for downloading now. It supports VS2008 beta2 from command line only. You need to manually update the icvars.bat and icl.cfg to work with VS2008."

How do i do that?

Thanks
Dave
Edit

Code: Select all

'Program Files\Intel\Compiler\C++\10.1.020\IA32\Bin\icl.cfg
Mine looks like this:

Code: Select all

# This Configuration file may be used for additional switches

# Enable Microsoft Visual C++* .NET 8.0 compatibility
-Qvc8

# Path to Microsoft Visual C++* .NET 8.0 linker
-Qlocation,link,"D:\Program Files\Microsoft Visual Studio 8\VC\Bin"

# *Other names and brands may be claimed as the property of others

i got 2 error messages ...

utility.cpp
C:\Program Files\Intel\Compiler\C++\10.1.020\IA32\Bin\system.h(27): error: incomplete type is not allowed
struct timeval tv;

C:\Program Files\Intel\Compiler\C++\10.1.020\IA32\Bin\system.h(28): error: identifier "gettimeofday" is undefined
gettimeofday( &tv, NULL );

I think these errors can be fixed by setting the path to the proper include files, right?
You'll be able to resolve this by looking at the latest Glaurung src which includes 'timeoday.cpp'

regards,
Jim.
Thanks Jim

This code compiles without problems with VC2008 Express, the "gettimeofday" does not give an error message. Why does the Intel compiler have a problem with it?

Regards
Dave
User avatar
David Dahlem
Posts: 900
Joined: Wed Mar 08, 2006 9:06 pm

Re: New Intel C++ Compiler v10.1.020

Post by David Dahlem »

Denis P. Mendoza wrote:
David Dahlem wrote:I downloaded the 30 day trial of the new Intel C++ Compiler version 10.1.020 available here ...

https://registrationcenter.intel.com/Re ... ister.aspx

It's supposed to support the IDE integration of VS2008, but doesn't seem to work with my 2008 express version. So i'm trying to learn how to use the Intel compiler on the command line. I admit i am almost a complete dummy with compilers, and especially the command line.

I have managed to compile a simple Hello.cpp file on the Intel command line with this command - icl Hello.cpp. Could someone help a compiler idiot with the commands for multiple source files?

Thanks
Dave
Hello David,

Welcome to the Intel compiling group. I've been an IDE dependent before, but later on found out that compiling in command prompt is much easier.

Here's a simple tip:

1. Let's say we want to compile Fruit 2.1 src. Extract it in a folder location like c:\fruit21src
2. Start your IA-32 32-bit compiler in command prompt. Type "cd" then click space, and type the location of source, which is "c:\fruit21src". Press enter and your 'source" location will display at command prompt.
3. For ease in typing the command lines, you could prepare the long scripts in a text editor like notepad. Here's the following sample:

Code: Select all

icl -o fruit.exe *.cpp /nologo /MT /W3 /DWIN32 /DNDEBUG /D_CONSOLE /D_MBCS /G7 /Ox /QxK /Qipo /Qprof-gen
(or add some "spices" like /Qunroll /fp:fast /Zp16 (experiment with them))
Copy and paste it at command prompt, then press "enter".
4. Run some games/epd tests without closing "console", using the "instrumented" engine - fruit.exe. Collect enough profiling data - .dyn files.
5. After profiling, compile your optimized code using the same flags. just replace /Qprof-gen with /Qprof-use. You'll now have Fruit.exe with PGO.
For ease again, here is your last command lines:

Code: Select all

icl -o fruit.exe *.cpp /nologo /MT /W3 /DWIN32 /DNDEBUG /D_CONSOLE /D_MBCS /G7 /Ox /QxK /Qipo /Qprof-use
Copy and paste it at command prompt, then press "enter".

I hope this helps David.

Denis
Hi Denis

Wow, tips from a great compiling guru!! Thank you, this should help me a lot. I'll try your tips. My time is limited, i may be moving to a new home next week, and i want to get a fast build of Sage to release before i move. :-)

Thanks
Dave
User avatar
David Dahlem
Posts: 900
Joined: Wed Mar 08, 2006 9:06 pm

Re: New Intel C++ Compiler v10.1.020

Post by David Dahlem »

wgarvin wrote:My 2 cents.

I suggest making a small shell script (or batch file) in your source directory, and pasting command(s) into it like the ones in the post above by Denis. I usually call mine "b.bat" so its easy to type. Its handy when I come back to a project I haven't worked on in a long time, because I have a record of what compile options it was using etc.

For small projects, b.bat will compile and run them in one step. If running it requires command line options, or might have harmful effects (deleting files or whatever), I usually put the command line to run it in a separate "t.bat" file (for easy testing).
Many thanks. I like the idea of using .bat files. With your tips and the ones above by Jim and Denis, i should be busy for a while. Lots of testing to do. :-)

Regards
Dave
User avatar
David Dahlem
Posts: 900
Joined: Wed Mar 08, 2006 9:06 pm

Re: New Intel C++ Compiler v10.1.020

Post by David Dahlem »

Denis P. Mendoza wrote:
David Dahlem wrote:
1. Let's say we want to compile Fruit 2.1 src. Extract it in a folder location like c:\fruit21src
2. Start your IA-32 32-bit compiler in command prompt. Type "cd" then click space, and type the location of source, which is "c:\fruit21src". Press enter and your 'source" location will display at command prompt.
3. For ease in typing the command lines, you could prepare the long scripts in a text editor like notepad. Here's the following sample:

Code: Select all

icl -o fruit.exe *.cpp /nologo /MT /W3 /DWIN32 /DNDEBUG /D_CONSOLE /D_MBCS /G7 /Ox /QxK /Qipo /Qprof-gen
(or add some "spices" like /Qunroll /fp:fast /Zp16 (experiment with them))
Copy and paste it at command prompt, then press "enter".

Hi Denis

Hey, following your instructions up to this point, i got a build!! I used this command ...

icl -o Sage350.exe *.cpp /nologo /MT /W3 /DWIN32 /DNDEBUG /D_CONSOLE /D_MBCS /G7 /Ox /QxK /Qipo /Qprof-gen

But it's very slow, compared to the 2008 Express build. On the mperft test, it takes 21 seconds and the Express build takes 6 seconds. On the bench test, it was obviously taking forever, so i stopped it. I'll keep experiment with the flags.

The following steps i don't understand at all. How do i run games/epd tests with the Intel console open? Sage doesn't have built in commands to run epd tests or to run games. ??

Regards
Dave

4. Run some games/epd tests without closing "console", using the "instrumented" engine - fruit.exe. Collect enough profiling data - .dyn files.
5. After profiling, compile your optimized code using the same flags. just replace /Qprof-gen with /Qprof-use. You'll now have Fruit.exe with PGO.
For ease again, here is your last command lines:

Code: Select all

icl -o fruit.exe *.cpp /nologo /MT /W3 /DWIN32 /DNDEBUG /D_CONSOLE /D_MBCS /G7 /Ox /QxK /Qipo /Qprof-use
Copy and paste it at command prompt, then press "enter".

I hope this helps David.

Denis
User avatar
David Dahlem
Posts: 900
Joined: Wed Mar 08, 2006 9:06 pm

Re: New Intel C++ Compiler v10.1.020

Post by David Dahlem »

Hi Denis

I'm learning. I discovered that by right clicking the toolbar in the Intel command prompt window, selecting "Properties/Quick Edit Mode/Modify Shortcut", then copying the following, everything between the quotes, including the blank line ...

"cd c:\Sage350
icl -o Sage350-Denis4.exe *.cpp /nologo /MT /W3 /DWIN32 /DNDEBUG /D_CONSOLE /D_MBCS /G7 /Ox /QxK

"

then simply right clicking in the command prompt window, i'll get a build. Don't even have to press the enter button. :-)

I haven't figured out how to do this with a .bat file yet. These flags give me a build comparable in speed on the bench and mperft tests to the 2008 Express build. I'll keep searching for the special flags that will create a "Super Sage". :-)

Regards
Dave
wgarvin
Posts: 838
Joined: Thu Jul 05, 2007 5:03 pm
Location: British Columbia, Canada

Re: New Intel C++ Compiler v10.1.020

Post by wgarvin »

David Dahlem wrote:I haven't figured out how to do this with a .bat file yet. These flags give me a build comparable in speed on the bench and mperft tests to the 2008 Express build. I'll keep searching for the special flags that will create a "Super Sage". :-)
Mine usually look something like this:

Code: Select all

@echo off
del MyProgram.exe
cls
g++ MyProgram.cpp SomeOtherSource.cpp AndAnotherSource.cpp -o MyProgram.exe
MyProgram.exe
The last line runs the program. I do that for faster compile-and-test cycles if its a simple program, but you might want to leave it out. The purpose of "@echo off" is so only the output from the commands get printed. The "del MyProgram.exe" line makes sure that the old .exe is gone before it tries to produce the new one. I only do that so that if there's a compile error, it doesn't run the old program and mislead me into thinking that its working.

You want to run this thing from a command prompt (not the Windows GUI) so that you can read any compiler error messages. The reason for the "cls" line is to clear away old messages so you know you're only looking at the current ones.

In your case, maybe you want a "b.bat" something like this:

Code: Select all

@echo off
del fruit.exe
cls
icl -o fruit.exe *.cpp /nologo /MT /W3 /DWIN32 /DNDEBUG /D_CONSOLE /D_MBCS /G7 /Ox /QxK /Qipo /Qprof-gen
User avatar
David Dahlem
Posts: 900
Joined: Wed Mar 08, 2006 9:06 pm

Re: New Intel C++ Compiler v10.1.020

Post by David Dahlem »

wgarvin wrote:
David Dahlem wrote:I haven't figured out how to do this with a .bat file yet. These flags give me a build comparable in speed on the bench and mperft tests to the 2008 Express build. I'll keep searching for the special flags that will create a "Super Sage". :-)
Mine usually look something like this:

Code: Select all

@echo off
del MyProgram.exe
cls
g++ MyProgram.cpp SomeOtherSource.cpp AndAnotherSource.cpp -o MyProgram.exe
MyProgram.exe
The last line runs the program. I do that for faster compile-and-test cycles if its a simple program, but you might want to leave it out. The purpose of "@echo off" is so only the output from the commands get printed. The "del MyProgram.exe" line makes sure that the old .exe is gone before it tries to produce the new one. I only do that so that if there's a compile error, it doesn't run the old program and mislead me into thinking that its working.

You want to run this thing from a command prompt (not the Windows GUI) so that you can read any compiler error messages. The reason for the "cls" line is to clear away old messages so you know you're only looking at the current ones.

In your case, maybe you want a "b.bat" something like this:

Code: Select all

@echo off
del fruit.exe
cls
icl -o fruit.exe *.cpp /nologo /MT /W3 /DWIN32 /DNDEBUG /D_CONSOLE /D_MBCS /G7 /Ox /QxK /Qipo /Qprof-gen
Thanks. Your suggested batch file is working great!!

Regards
Dave
User avatar
Denis P. Mendoza
Posts: 415
Joined: Fri Dec 15, 2006 9:46 pm
Location: Philippines

Re: New Intel C++ Compiler v10.1.020

Post by Denis P. Mendoza »

David Dahlem wrote:
Denis P. Mendoza wrote:
David Dahlem wrote:I downloaded the 30 day trial of the new Intel C++ Compiler version 10.1.020 available here ...

https://registrationcenter.intel.com/Re ... ister.aspx

It's supposed to support the IDE integration of VS2008, but doesn't seem to work with my 2008 express version. So i'm trying to learn how to use the Intel compiler on the command line. I admit i am almost a complete dummy with compilers, and especially the command line.

I have managed to compile a simple Hello.cpp file on the Intel command line with this command - icl Hello.cpp. Could someone help a compiler idiot with the commands for multiple source files?

Thanks
Dave
Hello David,

Welcome to the Intel compiling group. I've been an IDE dependent before, but later on found out that compiling in command prompt is much easier.

Here's a simple tip:

1. Let's say we want to compile Fruit 2.1 src. Extract it in a folder location like c:\fruit21src
2. Start your IA-32 32-bit compiler in command prompt. Type "cd" then click space, and type the location of source, which is "c:\fruit21src". Press enter and your 'source" location will display at command prompt.
3. For ease in typing the command lines, you could prepare the long scripts in a text editor like notepad. Here's the following sample:

Code: Select all

icl -o fruit.exe *.cpp /nologo /MT /W3 /DWIN32 /DNDEBUG /D_CONSOLE /D_MBCS /G7 /Ox /QxK /Qipo /Qprof-gen
(or add some "spices" like /Qunroll /fp:fast /Zp16 (experiment with them))
Copy and paste it at command prompt, then press "enter".
4. Run some games/epd tests without closing "console", using the "instrumented" engine - fruit.exe. Collect enough profiling data - .dyn files.
5. After profiling, compile your optimized code using the same flags. just replace /Qprof-gen with /Qprof-use. You'll now have Fruit.exe with PGO.
For ease again, here is your last command lines:

Code: Select all

icl -o fruit.exe *.cpp /nologo /MT /W3 /DWIN32 /DNDEBUG /D_CONSOLE /D_MBCS /G7 /Ox /QxK /Qipo /Qprof-use
Copy and paste it at command prompt, then press "enter".

I hope this helps David.

Denis
Hi Denis

Wow, tips from a great compiling guru!! Thank you, this should help me a lot. I'll try your tips. My time is limited, i may be moving to a new home next week, and i want to get a fast build of Sage to release before i move. :-)

Thanks
Dave
Thanks, I'm just new to this stuff and I'm no "guru". I only developed much of this through constant practice and from "Matser Jim' himself :wink: . I only share what I learned from him. And yes, it is much easier to make a bat file for this pupose - no sweat :D. You'll forget about your IDE as time goes on.

We'll be waiting for yoiur Intel optimized "Super Sage"!

[/code]