Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: how much work it is to change source code to work with linux?

Author: Fabien Letouzey

Date: 02:32:55 06/23/04

Go up one level in this thread


On June 23, 2004 at 05:10:07, Uri Blass wrote:

>I ask because Dieter told me in an email that I can install Linux, where I can
>get the newest Intel compiler and it is free for non commercial use.

My own advise is to send your source code to somebody who has a good Windows
compiler.  Slater Wold and probably many others can produce faster executables
than you could, no matter the operating system.

Furthermore I think now is not the right moment for you to learn something
completely new.  You will have all the time to learn Linux after WCCC.

>A related question is if I can see examples of code that work under windows and
>descreption of changes that are done to compile it under linux.

Most open-source engines.

Use only functions that are part of the C standard library (malloc(), fopen(),
etc ...) unless you have absolutely no choice.  In most engines the only
non-portable parts are about measuring time (the standard clock() and time()
have drawbacks) and polling stdin (unfortunately not addressed at all in the C
library).

Writing a portable engine from scratch is easy (it's a state of mind), but
porting a badly-designed engine can be a lot of work.  I don't know how many of
the Microsoft-specific extensions you use in your program.

>Another question is if a program that is compiled under linux can work under
>interfaces like winboard that are based on windows.

Do you mean using networking?  If so yes, the operating system does not matter.
You need additional software though (I think WinBoard does not support
networking by itself).

>I guess that there should be no problem and as far as I know tord writes gothmog
>under linux and it runs under winboard.

He also uses MacOS.  But Tord's case is a bad example because he uses Cygnus GCC
on Windows (as I do with PolyGlot, which is not really portable).  I don't think
Gothmog could be compiled with either Microsoft or Intel compilers (but only few
changes would be needed).

Almost any open-source engine is portable between operating systems.

>When I think about it maybe I need some #if #def to make it work.

Yes, for the functions I have indicated and also for 64-bit types if you use
them.

>Uri

Good luck with your choice.

Fabien.




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.