Some more MacOSX ports

Discussion of anything and everything relating to chess playing software and machines.

Moderator: Ras

ZirconiumX
Posts: 1361
Joined: Sun Jul 17, 2011 11:14 am
Full name: Hannah Ravensloft

Re: Some more MacOSX ports

Post by ZirconiumX »

... I suffer from the fact that PPc is RISC not CISC:

Code: Select all

/var/tmp//ccebvo8f.s:2406:Invalid mnemonic 'bsfq'
/var/tmp//ccebvo8f.s:81241:Invalid mnemonic 'bsrq'
...and several billion warnings about the fact that the decembrists forgot to add ULL at the end.

I have tried in the past to 'fix' ippolit, but always end up with a segfaulting executable.

And after replacing the offending instructions:

Code: Select all

/usr/libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: Undefined symbols:
_posix_memalign
collect2: ld returned 1 exit status
Matthew:out
tu ne cede malis, sed contra audentior ito
User avatar
JuLieN
Posts: 2949
Joined: Mon May 05, 2008 12:16 pm
Location: Bordeaux (France)
Full name: Julien Marcel

Re: Some more MacOSX ports

Post by JuLieN »

By Norbert Raimund Leisner's demand, here are 19 more MacOS X ports (for Intel-based Macs) that I've put together in no time and (again) nearly no testing ;)

- amundsen-080
- beowulf-24a
- betsabe-II-109
- daydreamer-175
- dendron-042b
- diablo-051
- guichess-10-beta2
- glaurung22
- hanzo-the-razor-1111
- jester-084
- joanna2002-106
- kurt-092.2
- ms(k)cp-145
- olithink-530
- protector-140
- sloppy-023
- toga2-141se
- toga2-312se
- vanillachess-26g

All downloadable there, as usual:
http://julien.marcel.free.fr/macchess/

Some notes:
1) thanks to the original authors for releasing their source code for us to compile!
2) thanks to Jim Ablett for his great work at making these programs posix-compatible. Very often my work only consists in typing "make"!
3) my tests are really limited: if there was no compile error then I run the program and play a few moves. If the engine seems to behave normally and doesn't crash, then it qualifies for release. And that's about all ;)
4) some of those engines might be available someplace else, as some are listed on http://computer-chess.org/doku.php?id=c ... ngine_list
but as I couldn't find any Mac binary I just compiled them by myself.
5) if you have a POSIX compatible engine that is not on my website and would like me to compile it just send me a message and I'll be happy to add it.
6) if I see that there's yet a Mac binary somewhere else on the Internet, I don't add it to my website. I know it fragmentizes the search for binaries for Mac users, but it's also respectful of the previous posters of those binaries. If anyway you are the author of such a Mac compile and would like me to host it, just tell me and I'll add it.
7) I could compile a few more engines but they either gave me segmentation faults at runtime or produced weird moves (for instance: ZCT or Poor Little Pinkus).
"The only good bug is a dead bug." (Don Dailey)
[Blog: http://tinyurl.com/predateur ] [Facebook: http://tinyurl.com/fbpredateur ] [MacEngines: http://tinyurl.com/macengines ]
User avatar
JuLieN
Posts: 2949
Joined: Mon May 05, 2008 12:16 pm
Location: Bordeaux (France)
Full name: Julien Marcel

Re: Some more MacOSX ports

Post by JuLieN »

Just compiled Viper for MacOSX Intel x64:

http://julien.marcel.free.fr/macchess/
"The only good bug is a dead bug." (Don Dailey)
[Blog: http://tinyurl.com/predateur ] [Facebook: http://tinyurl.com/fbpredateur ] [MacEngines: http://tinyurl.com/macengines ]
User avatar
JuLieN
Posts: 2949
Joined: Mon May 05, 2008 12:16 pm
Location: Bordeaux (France)
Full name: Julien Marcel

Re: Some more MacOSX ports

Post by JuLieN »

On Norbert Raimund Leisner's request, I compiled 10 new chess programs for MacOSX (Intel):

- Buzz Open Source
- cheng3
- Chess One
- Danasah
- GNUChess 5.08
- GNUChess 6.01
- pepito
- Sissa
- Sjeng
- Toledo Nanochess

As usual, they can be downloaded on my website:
http://julien.marcel.free.fr/macchess/
"The only good bug is a dead bug." (Don Dailey)
[Blog: http://tinyurl.com/predateur ] [Facebook: http://tinyurl.com/fbpredateur ] [MacEngines: http://tinyurl.com/macengines ]
User avatar
JuLieN
Posts: 2949
Joined: Mon May 05, 2008 12:16 pm
Location: Bordeaux (France)
Full name: Julien Marcel

Re: Some more MacOSX ports

Post by JuLieN »

Here are six more ports:

- Cyrano
- GFC
- Mizar
- Natwarlal
- Pawny
- Scidlet

http://julien.marcel.free.fr/macchess/


Some notes (again):
1) thanks to the original authors for releasing their source code for us to compile!
2) thanks to Jim Ablett for his great work at making these programs posix-compatible. Very often my work only consists in typing "make"!
3) my tests are really limited: if there was no compile error then I run the program and play a few moves. If the engine seems to behave normally and doesn't crash, then it qualifies for release. And that's about all ;)
4) some of those engines might be available someplace else, as some are listed on http://computer-chess.org/doku.php?id=c ... ngine_list
but as I couldn't find any Mac binary I just compiled them by myself.
5) if you have a POSIX compatible engine that is not on my website and would like me to compile it just send me a message and I'll be happy to add it.
6) if I see that there's yet a Mac binary somewhere else on the Internet, I don't add it to my website. I know it fragmentizes the search for binaries for Mac users, but it's also respectful of the previous posters of those binaries. If anyway you are the author of such a Mac compile and would like me to host it, just tell me and I'll add it.
7) I could compile a few more engines but they either gave me segmentation faults at runtime or produced weird moves (for instance: ZCT, Poor Little Pinkus or Double Check).
"The only good bug is a dead bug." (Don Dailey)
[Blog: http://tinyurl.com/predateur ] [Facebook: http://tinyurl.com/fbpredateur ] [MacEngines: http://tinyurl.com/macengines ]
lucasart
Posts: 3242
Joined: Mon May 31, 2010 1:29 pm
Full name: lucasart

Re: Some more MacOSX ports

Post by lucasart »

ZirconiumX wrote:a) Yes.
b) PPC G4 running 10.4.11
c) Gives

Code: Select all

-bash: /Users/matthew/Desktop/ippolit/ippolit: cannot execute binary file
It is possible to compile universal! (gcc -arch ppc then lipo the two together)

Matthew:out
Hello Matthew,

Beware that PPC are BIGENDIAN, and some hacky code (typically low level bitboard tricks), if not done carefully, can be endianness sensitive. Writing endianness sensitive code is of course very bad programming practice, but there are probably many engines around that do it, knowingly or not.

In fact, I'm not even sure if my engine DoubleCheck is endianness sensitive or not. If I may ask you a favour, would you like to compile and test it on your machine ?

It's very simple:
1/ download it here: http://wbec-ridderkerk.nl/html/details1 ... Check.html
2/ open a terminal, cd into the src directory, and type "make".

Provided there are no compile errors, you should get an executable ./DC, whose integrity (and speed) can be verified with a "bench" command, just like Stockfish. Example on my machine:

Code: Select all

lucas@megatron:~/Chess/DoubleCheck_26/src$ ./DC bench|tail -1
nodes = 4889484	time = 5.710000
The node count on your machine must match this number exactly, otherwise the compile is functionally wrong (and it most likely means my code is endianness sensitive). And the time is of course a speed benchmark. It allows me to:
* rescale testing time between my two machines for example.
* verify any non functional code cleanup didn't introduce any bugs
* measure the speed improvement of non functional speed optimizations

Thank you!
lucasart
Posts: 3242
Joined: Mon May 31, 2010 1:29 pm
Full name: lucasart

Re: Some more MacOSX ports

Post by lucasart »

JuLieN wrote:By Norbert Raimund Leisner's demand, here are 19 more MacOS X ports (for Intel-based Macs) that I've put together in no time and (again) nearly no testing ;)

- amundsen-080
- beowulf-24a
- betsabe-II-109
- daydreamer-175
- dendron-042b
- diablo-051
- guichess-10-beta2
- glaurung22
- hanzo-the-razor-1111
- jester-084
- joanna2002-106
- kurt-092.2
- ms(k)cp-145
- olithink-530
- protector-140
- sloppy-023
- toga2-141se
- toga2-312se
- vanillachess-26g

All downloadable there, as usual:
http://julien.marcel.free.fr/macchess/

Some notes:
1) thanks to the original authors for releasing their source code for us to compile!
2) thanks to Jim Ablett for his great work at making these programs posix-compatible. Very often my work only consists in typing "make"!
3) my tests are really limited: if there was no compile error then I run the program and play a few moves. If the engine seems to behave normally and doesn't crash, then it qualifies for release. And that's about all ;)
4) some of those engines might be available someplace else, as some are listed on http://computer-chess.org/doku.php?id=c ... ngine_list
but as I couldn't find any Mac binary I just compiled them by myself.
5) if you have a POSIX compatible engine that is not on my website and would like me to compile it just send me a message and I'll be happy to add it.
6) if I see that there's yet a Mac binary somewhere else on the Internet, I don't add it to my website. I know it fragmentizes the search for binaries for Mac users, but it's also respectful of the previous posters of those binaries. If anyway you are the author of such a Mac compile and would like me to host it, just tell me and I'll add it.
7) I could compile a few more engines but they either gave me segmentation faults at runtime or produced weird moves (for instance: ZCT or Poor Little Pinkus).
Great work Julien! Portability is all important.

Would you be willing to release the source code of your engine Predateur ? Or are there any secrets you're hiding in there ;)

I'd love to test it in my Open Source Bullet rating list. Especially now that I'm extending it to include weaker engines: I've tested Faile 1.4, and will also test fairy-max soon.
User avatar
JuLieN
Posts: 2949
Joined: Mon May 05, 2008 12:16 pm
Location: Bordeaux (France)
Full name: Julien Marcel

Re: Some more MacOSX ports

Post by JuLieN »

lucasart wrote: Great work Julien! Portability is all important.

Would you be willing to release the source code of your engine Predateur ? Or are there any secrets you're hiding in there ;)

I'd love to test it in my Open Source Bullet rating list. Especially now that I'm extending it to include weaker engines: I've tested Faile 1.4, and will also test fairy-max soon.
Thanks Lucas :)

I don't plan to release Pred's sources for the moment. And no I (obviously :lol: ) have no super secret new trick to protect, but Pred is my baby and I'd feel raped if other people could see my amateurish code. I think I'd lose interest in developing it.

You have the latest Critter in your Bullet rating list and it's not Open Source anymore ;)

I tried to compile your engine, btw, and succeeded, but it crashes :

Code: Select all

DoubleCheck 2.5 JA by Lucas Braesch
Copyright (C) 2011 Lucas Braesch

uci
id name DoubleCheck 2.5
id author Lucas Braesch
option name Hash type spin default 32 min 1 max 8192
option name Verbose type check default true
uciok
ucinewgame
go movetime 10000
info depth 1
Segmentation fault: 11
logout

[Opération terminée]
The strange thing is that Matthew managed to compile it for PPC (and didn't report any crash?). Even if I take his archive with his sources and his makefile I get the same result... Something important to notice is that the newest versions of Xcode don't use GCC anymore but LLVM, so sometimes some incompatibilities happen, plus bugs that are in gcc but not in llvm or in llvm but not in gcc...
"The only good bug is a dead bug." (Don Dailey)
[Blog: http://tinyurl.com/predateur ] [Facebook: http://tinyurl.com/fbpredateur ] [MacEngines: http://tinyurl.com/macengines ]
lucasart
Posts: 3242
Joined: Mon May 31, 2010 1:29 pm
Full name: lucasart

Re: Some more MacOSX ports

Post by lucasart »

JuLieN wrote: Something important to notice is that the newest versions of Xcode don't use GCC anymore but LLVM, so sometimes some incompatibilities happen, plus bugs that are in gcc but not in llvm or in llvm but not in gcc...
Ah, so it's probably because of the compiler. As far as I know all my code is ISO C99 compliant, *except* the bitfield struct types using uint64_t, which are GCC extensions to the ISO C standard:

Code: Select all

// Pack key and type into 8 bytes
typedef struct {
        uint64_t _key: 62;
        unsigned type: 2;
} pack_t;
The thing is that the ISO C standard doesn't specify that compilers should have the capability to handle bitfields of more than 32 bits. I blame the ISO C standard for that, as it's really a must have feature, couldn't code without it. Imagine having to write all the bit masking and shifting etc, just to retrieve fields from a struct, no way.

I suppose that could be the offending code.

I don't have MacOSX nor xcode, so I can't really find the problem. But if you really want to get to the bottom of it, the only way is to compile a debug version, run it until you get an assert squeel. There tons of assert statements in my code to help runtime debugging. I'm sure one of them will squeel before the seg fault occurs. To compile a debug version just remove the -DNDEBUG in the makefile
zullil
Posts: 6442
Joined: Tue Jan 09, 2007 12:31 am
Location: PA USA
Full name: Louis Zulli

Re: Some more MacOSX ports

Post by zullil »

DoubleCheck-2.6 compiled and seems to run normally for me. It must use some sse-4 instruction, since it wouldn't link on my old Core 2 Duo MacBook (the only machine I have with Lion installed.) On my Mac Pro running Snow Leopard it compiled fine with both:

Code: Select all

gcc version 4.2.1 (Apple Inc. build 5666) (dot 3)

Code: Select all

gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build)
I removed -flto from CFLAGS and made LDFLAGS empty. So the makefile became

Code: Select all

CC=llvm-gcc
CFLAGS=-O3  -std=c99 -DPOSIX -DNDEBUG -Wall
LDFLAGS=
SOURCES=bitboard.c board.c eval.c magic.c main.c move.c movegen.c movesort.c psq.c search.c tt.c uci.c uci_option.c util.c zobrist.c
OBJECTS=$(SOURCES:.c=.o)
EXECUTABLE=DC

all: $(SOURCES) $(EXECUTABLE)
        
$(EXECUTABLE): $(OBJECTS)
        $(CC) $(LDFLAGS) $(OBJECTS) -o $@

.c.o: $(CC) $(CFLAGS) $< -o $@
You should have the old non-llvm based gcc on your Lion system; it's called gcc-4.2 not gcc.