Page 1 of 1

polyglot compile instructions

PostPosted: 16 Apr 2011, 04:27
by matematiko
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,

Re: polyglot compile instructions

PostPosted: 17 Apr 2011, 11:08
by Michel
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?

Re: polyglot compile instructions

PostPosted: 17 Apr 2011, 14:45
by matematiko
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!!!

Re: polyglot compile instructions

PostPosted: 17 Apr 2011, 18:24
by H.G.Muller
Do you use the compiler option -mno-cygwin ?

Re: polyglot compile instructions

PostPosted: 19 Apr 2011, 10:47
by Michel
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).

Re: polyglot compile instructions

PostPosted: 19 Apr 2011, 15:48
by matematiko
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

Re: polyglot compile instructions

PostPosted: 19 Apr 2011, 22:12
by F. Bluemers
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

Re: polyglot compile instructions

PostPosted: 20 Apr 2011, 01:54
by matematiko
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