db3108 / michi-c2

Michi-c2 --- development version for michi-c
25 stars 9 forks source link

Building for Windows #16

Closed anpd03 closed 7 years ago

anpd03 commented 8 years ago

Hi, not tried Michi in a while. Could never get a working build for Windows. I have tried compiling it in Visual Stuido and Code::Blocks with no luck. I can attach Michi to gogui and start games with twogtp but after usually 2 moves Michi crashes with no info. After a genmove command is sent. Anyone had any luck building for Windows and have an idea what I am missing?

db3108 commented 8 years ago

Hi.

Maybe the michi.log file contains useful information. Could you send it to me ? I will try to figure out what happens.

One other question. Were you able to run the built-in tests provided with michi-c2 ? Did they work for you ? This is certainly the first thing to get correct in order to make michi-c2 work on a new platform. I remember Andreas Pearson tried also to build michi-c2 almost a year ago on windows (32 bits) without too much success. Since then, I made a few modifications that should have improved the portability.

By the way, you could also try to define in the Makefile the variable GENCODE=-DPORTABLE to see if it works.

Please, keep me informed. Thanks.

Best, Denis

anpd03 commented 8 years ago

Mail sent with log. Both tests run fine.

Thegoban commented 7 years ago

Hi, same windows problem here, I´ve built michic2 in Mingw and the result has been the same, you can play between 6-30 moves depending un your luck and then... it crashes, it hapens with version 1.2 and 1.4,

GENCODE=-DPORTABLE did nothing :(

db3108 commented 7 years ago

Hello. Sorry that that michi-c2 does not work for you as for other windows users. I have done a lot of extensive checks and code verifications (valgrind, etc) but I cannot reproduce the bug on my Linux box or on a Mac. I do not have a development setup ready for windows and do not intend to spend time on installing one and making it works. However, I may find some time to work again a little bit on this problem in the next weeks, if you can find some time to help me. If you know how to compile with debugging options, you could run the program under debugger control (by directly typing the gtp commands in it : play ..., genmove, etc.) until it crashes. Then we could see where the crash occurs. If you are not a developper and do not know about that stuff, the analysis will be more difficult but maybe we could still make some progress : 1. I could build a debug version that log a lot of information, 2. you run this version and send me the log file for me to analyze. What do you think ? Any other idea ?

Thegoban commented 7 years ago

Hello again, glad to see such a quick anwer :) not a dveloper, I´m a chronical Linux dektop user since... 15 years ago) the only thing I can tell w/o becoming a developer is that I can´t start michi this way:

"michi.exe defaults" it crashes in win10 (don´t see any config.gtp created anywhere), other options worked (mcbenchmark, mcdebug, tsdebug)

"michi.exe gtp" crashes when parsing some malformed gtp commands, ie. "play" instead of "play b b1"

PS: this is my son´s computer, I use michic2 in my Linux box and performs perfect for me, great job!

EDIT: OKK, just tried parsing "play" command in Linux (mint Serena) and michic2 crashes with Seg. fault, maybe gogui in windows is parsing some kind of malformed gtp command??

db3108 commented 7 years ago

Hello. Thank you for your helpful information. 1/ It seems that I need to be more careful in checking the inputs in gtp processing. 2/ I do not understand yet why michi.exe defaults crashes in win10 while mcbenchmark, mcdebug, etc. work. I will try to figure out what differences in program behavior that could explain that.

By the end of this week, I will upload a new hardened version of michi-c2 with more logging information. Will you be able to give it a try ?

A few more questions : how do you use michi-c2 with window10 ? just from the command line or with a gtp controller ? in the last case, which one ? Can you have access to the gtp commands sent by the controller to michi ?

cheshirecats commented 7 years ago

Hi. Same problem here. Michi crashes after running a few genmove commands (in gtp mode from the command line).

@db3108 It's quite simple to setup the environment in Windows. So it'll be great if you can take a look at it :-)

Step 1: get mingw setup (which is actually a package manager) https://sourceforge.net/projects/mingw/files/

Step 2: install mingw32-base and mingw32-gcc-g++ in the package manager

Step 3: set some env variables by running the following command in console: PATH=%path%;C:\MinGW\bin; set MINGW_PATH=C:\MinGW set LIBRARY_PATH=C:\MinGW\lib;C:\MinGW\lib\gcc\mingw32\5.3.0; set C_INCLUDE_PATH=C:\MinGW\include;C:\MinGW\lib\gcc\mingw32\5.3.0\include; set CPLUS_INCLUDE_PATH=C:\MinGW\include;C:\MinGW\lib\gcc\mingw32\5.3.0\include\c++;C:\MinGW\lib\gcc\mingw32\5.3.0\include\c++\backward;C:\MinGW\lib\gcc\mingw32\5.3.0\include\c++\mingw32;

Step 4: run mingw32-make (instead of make) and you will get michi.exe

Step 5: unfortunately it crashes after running a few genmove commands (in gtp mode from the command line).

db3108 commented 7 years ago

Thank you for your feedback and good advises. For the moment, I have only corrected a few problems reported by Thegoban. Yes, I know it still crash (Meanwhile, I have installed mingw 64 on my W7 computer, and run a few tests). I noticed that I can't make it crash when I compile it with -g (even with -O3). Too bad !! But I am on it.

db3108 commented 7 years ago

The last commit ad1e4e29084a359cc5dbfbf7b9319237bc3e277f seems to work on windows (and still on Linux of course) ... at least on my configuration : W7 64 bits + mingw64. I played a few moves manually and run 50 self play games (with and without patterns), it never crashed. Please see the new mode "selfplay" that can be useful for testing. I have corrected two silly but nasty bugs. Thank you all for providing the impetus to investigate this problem. It seems that, at least for this case, Linux/gcc has been too forgiving ... Please, would you be so kind to test this new version and tell me if it works for you ? If yes, we could close this issue, I guess. PS. I have no possibility to test on W10 yet.

db3108 commented 7 years ago

No news, good news. I'll take it as an indication that the problem is solved. So I close the Issue.