polyglot compile instructions

Programming Topics (Computer Chess) and technical aspects as test techniques, book building, program tuning etc

Moderator: Andres Valverde

polyglot compile instructions

Postby matematiko » 16 Apr 2011, 04:27

Hello Michael,

I quote from file README1.3 of latest release 1.4.66b

On Windows, you *must* use Cygnus GCC to compile PolyGlot.

IMPORTANT: In "io.cpp", the variable "UseCR" should be set to "true".


But I do not see that file, the closest one with that name is io.c and yes UseCR is there:

Code: Select all
static const bool UseCR = FALSE;


Thanks,
One that does not live to serve, does not deserve to live.
matematiko
 
Posts: 219
Joined: 07 Dec 2008, 17:11
Location: Texas

Re: polyglot compile instructions

Postby Michel » 17 Apr 2011, 11:08

I quote from file README1.3 of latest release 1.4.66b


Well this is a very old README file (for version 1.3 as the name indicates).
It has to do with the fact that the end of line terminator on Linux is LF
and on Windows CRLF (if I remember correctly). So if Polyglot sends
something to the engine (through a pipe) it should be correctly terminated.

The MSVC (or Mingw) version handles this automatically.

However I have never known this to be a problem with Cygwin compiled
versions either. Perhaps engines and GUI's are smart enough to recognize
LF as a line terminator?
Michel
 
Posts: 513
Joined: 01 Oct 2008, 12:15

Re: polyglot compile instructions

Postby matematiko » 17 Apr 2011, 14:45

Michel,

It was after I made the post that I realized that perhaps the file was old and was included to respect the GNU License.

Is there a recent "Windows Compiling instructions" somewhere to be found? Reason I am asking is that if I follow the instructions and compile under cygwin, the resulting executable is 1.-too big,
2.- cygwin1.dll dependency
3.- It closes after start and complains about a pipe.

Thank you!!!
One that does not live to serve, does not deserve to live.
matematiko
 
Posts: 219
Joined: 07 Dec 2008, 17:11
Location: Texas

Re: polyglot compile instructions

Postby H.G.Muller » 17 Apr 2011, 18:24

Do you use the compiler option -mno-cygwin ?
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: polyglot compile instructions

Postby Michel » 19 Apr 2011, 10:47

Yes

Code: Select all
gcc  -mno-cygwin -s -O2 *.c -o polyglot.exe


should normally work from a Cygwin bash shell (this is the command I use).
Michel
 
Posts: 513
Joined: 01 Oct 2008, 12:15

Re: polyglot compile instructions

Postby matematiko » 19 Apr 2011, 15:48

Michel wrote:Yes

Code: Select all
gcc  -mno-cygwin -s -O2 *.c -o polyglot.exe


should normally work from a Cygwin bash shell (this is the command I use).


Michel,

Thank you, I will give it a try later.

Please note that the option -mno-cygwin is not longer accepted by the latest and greatest cygwin installation (I installed cygwin latest version few days ago). The compiler says to use a MinGW compiler (or something like that). What version of cygwin do you use? And, so, if you compile the windows polyglot exes under cygwin, can I safely assume that you do this under Windows?

I am going to try to compile as you suggest under Code::Blocks, or maybe under MS Visual C++ Express Edition 2010.

To F. Blumers,

Fonzy, I will quote from file makefile.ms included in the latest 1.4w27 release.

Code: Select all
# Makefile for use with Microsoft tools
# > nmake -f makefile.ms

CC = cl
CFLAGS = -nologo -c -O2 -Ox -D "NDEBUG"
LFLAGS = -nologo

# Disable affinity use?  (Needed for Win95 support)
#CFLAGS += -D "NO_AFFINITY"

EXE = polyglot.exe

OBJS = adapter.obj attack.obj board.obj book.obj book_make.obj \
       book_merge.obj colour.obj engine.obj epd.obj fen.obj game.obj \
       hash.obj io.obj line.obj list.obj main.obj move.obj move_do.obj \
       move_gen.obj move_legal.obj option.obj parse.obj pgn.obj \
       piece.obj posix.obj random.obj san.obj search.obj square.obj \
       uci.obj uci_options.o util.obj
       
$(EXE): $(OBJS)
   $(CC) $(LFLAGS) $(OBJS) -o $(EXE)

clean:
   -erase $(OBJS) $(EXE)

.cpp.obj:
   $(CC) $(CFLAGS) $<



The compiler exits saying that does not know how to create uci_options.o, shoudn't this file be uci_options.obj? After changing to uci_options.obj, compiles and builds the polyglot.exe just fine, with the exception mentioned below.

Additionally, my compiler complains that the option -o is now deprecated, maybe this is something that MSVC does, I do not know I am just passing that information to you.

Regards to all,

matematiko
One that does not live to serve, does not deserve to live.
matematiko
 
Posts: 219
Joined: 07 Dec 2008, 17:11
Location: Texas

Re: polyglot compile instructions

Postby F. Bluemers » 19 Apr 2011, 22:12

matematiko wrote:<------------snipped--------------->
To F. Blumers,

Fonzy, I will quote from file makefile.ms included in the latest 1.4w27 release.

Code: Select all
# Makefile for use with Microsoft tools
# > nmake -f makefile.ms

CC = cl
CFLAGS = -nologo -c -O2 -Ox -D "NDEBUG"
LFLAGS = -nologo

# Disable affinity use?  (Needed for Win95 support)
#CFLAGS += -D "NO_AFFINITY"

EXE = polyglot.exe

OBJS = adapter.obj attack.obj board.obj book.obj book_make.obj \
       book_merge.obj colour.obj engine.obj epd.obj fen.obj game.obj \
       hash.obj io.obj line.obj list.obj main.obj move.obj move_do.obj \
       move_gen.obj move_legal.obj option.obj parse.obj pgn.obj \
       piece.obj posix.obj random.obj san.obj search.obj square.obj \
       uci.obj uci_options.o util.obj
       
$(EXE): $(OBJS)
   $(CC) $(LFLAGS) $(OBJS) -o $(EXE)

clean:
   -erase $(OBJS) $(EXE)

.cpp.obj:
   $(CC) $(CFLAGS) $<



The compiler exits saying that does not know how to create uci_options.o, shoudn't this file be uci_options.obj? After changing to uci_options.obj, compiles and builds the polyglot.exe just fine, with the exception mentioned below.

Additionally, my compiler complains that the option -o is now deprecated, maybe this is something that MSVC does, I do not know I am just passing that information to you.

Regards to all,

matematiko

Hi
Thanks for reporting.
Actually I've never used this makefile.
I always compiled polyglot in visual studio.
I'll fix the file on the website later.
best
Fonzy
F. Bluemers
 
Posts: 175
Joined: 04 Sep 2008, 16:56
Location: Netherlands

Re: polyglot compile instructions

Postby matematiko » 20 Apr 2011, 01:54

Michel wrote:Yes

Code: Select all
gcc  -mno-cygwin -s -O2 *.c -o polyglot.exe


should normally work from a Cygwin bash shell (this is the command I use).


This worked just fine with Code::Blocks, which has MinGW as default compiler,

Thanks again.

Best regards,

matematiko
One that does not live to serve, does not deserve to live.
matematiko
 
Posts: 219
Joined: 07 Dec 2008, 17:11
Location: Texas


Return to Programming and Technical Discussions

Who is online

Users browsing this forum: No registered users and 34 guests