Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: new warnings in the new intel compiler

Author: Tom Likens

Date: 06:50:30 12/31/02

Go up one level in this thread


On December 31, 2002 at 09:13:15, Uri Blass wrote:

>How do I get rid of this warning?
>
>C:\unzipped\movei257source\main.c(939): warning #181: argument is incompatible
>with corresponding format string conversion
>  num_fields=sscanf(buffer,"level%s %s %s %s %s %s %s %s
>%s",&str1,&str2,&str3,&str4,&str5,&str6,
>
>Is there something wrong with the following?
>
>int num_fields=0;
>char
>str1[10],str2[10],str3[10],str4[10],str5[10],str6[10],str7[10],str8[10],str9[10];
>num_fields=sscanf(buffer,"level%s %s %s %s %s %s %s %s
>%s",&str1,&str2,&str3,&str4,&str5,&str6,
>	   &str7,&str8,&str9);
>
>I use it to read the winboard command after level(can be not more than 9 even in
>the extended level command).
>There were no problems with it but for some reasons the intel compiler see
>problems.
>
>For now there is no speed change from the intel compiler but I still did not
>learn how to do profile optimization and I use only optimize for speed.
>
>Uri

Uri,

I'm not sure what operating system you are using but under Linux (with gnu
make) I use the following command line switches to generate first the
profile enabled version and then the final version.

It's a three step process:

1) Create the profiled-enabled version using the command "make intel_prof".

2) Run the new version against other programs, test suites or on ICC.
    The idea is to run it as it would typically be used, so that the
optimization
     data is gathered for the right parts of your program.

3) Remove all the object files (*.o files under Linux) in your build directory.
    Remake the program using the "make intel_use" command.

There are tons of other optimization switches that you can experiment with,
the Intel manual has an informative section worth looking over. The main
idea is that you should (mostly) keep the switches the same between the
first version and the second version.  When that isn't true the compiler will
usually complain.

One quick note, you will need to create the profile directory "profile" if you
use these flags as presented.

good luck,
--tom

##------------------------------------------------------------------------------------------##
## Intel C/C++ 7.x profile gathering version
##------------------------------------------------------------------------------------------##
intel_prof: CC		= icc
intel_prof: LINKER   = $(CC)
intel_prof: OPT	        = -O3 -prof_dir ./profile -axK -xK -prof_genx
intel_prof: DBG		=
intel_prof: LFLAGS  =
intel_prof: $(OBJS)
	$(LINKER) $(LFLAGS) -o $(NAME) $(OBJS)

##-----------------------------------------------------------------------------------------##
## Intel C/C++ 7.x optimized version (it uses the previously generated
## intel_profile information generated by a previous run).
##-----------------------------------------------------------------------------------------##
intel_use: CC		= icc
intel_use: LINKER    = $(CC)
intel_use: OPT		= -O3 -prof_dir ./profile -axK -xK -ipo -ipo_obj -prof_use
intel_use: DBG		=
intel_use: LFLAGS    = -ipo
intel_use: $(OBJS)
	$(LINKER) $(LFLAGS) -o $(NAME) $(OBJS)



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.