Gull compilation for OS X

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
Dariusz
Posts: 364
Joined: Sat Jun 13, 2015 10:08 am
Location: Poland
Full name: Dariusz Domagała

Gull compilation for OS X

Post by Dariusz »

Could someone compile latest Gull to mac binary ?

I like style of play this engine, and I would using it in my IMac.
Regards, Darius
https://chessengeria.eu
JoshPettus
Posts: 730
Joined: Fri Oct 19, 2012 2:23 am

Re: Gull compilation for OS X

Post by JoshPettus »

Your best bet is to follow the wine directions on the OSX xboard thread. I try to make it as simple as possible.
http://www.open-aurec.com:8080/wbforum/ ... 19&t=53274
I got 64bit gull running just fine.

[EDIT] Better yet I'll just copy paste here
Windows Engines on OSX:

You can use wine to run Windows chess engines in XBoard.app! (or any other UI for that matter)

By far the easiest method of installing wine is to simply download this wineskin engine (Although it is meant for Wineskin apps, it is a complete installation of wine with all necessary libraries placed in a convenient bundle and supports OSX 10.6)

http://www.mediafire.com/download/um1xc ... .51.tar.7z

Extract this file completely (Use TheUnarchiver, or something similar, for the 7zip decompression) and you will get a file called wswine.bundle.

Place this in your Documents folder or wherever you prefer.

Next, launch XBoard.app and go to the Engines -> Edit Engine List... window. You can add engines by manually typing them in like so:

Code: Select all

    "Engine" -fcp "~/Documents/wswine.bundle/bin/wine /Directory/to/Engine/Engine.exe" -fd "/Directory/to/Engine" -fUCI (if UCI engine)
Or if you want to be able to select the engine in your Engine -> Load 1st/2nd Engine Dialog, you can also create a textfile with no extension and add the -fcp information there. i.e.:

Code: Select all

    ~/Documents/wswine.bundle/bin/wine /Directory/to/Engine/Engine.exe 
Then, select the script as if it were a native engine in the Load Engine dialog.

The first time you launch an engine, wine will try to configure itself and the engine may fail. Hit cancel to any Wine Gecko install popup, and relaunch the engine. It should then run on the next launch.

Note!: Wine64 is extremely experimental! The bundle supports 64 bit to a limited capacity. Some 64 bit engines may work, others may not... 32 bit engines will have much more common success.
User avatar
Dariusz
Posts: 364
Joined: Sat Jun 13, 2015 10:08 am
Location: Poland
Full name: Dariusz Domagała

Re: Gull compilation for OS X

Post by Dariusz »

Joshua, thank you for your replay.
Regards, Darius
https://chessengeria.eu
Max
Posts: 247
Joined: Tue Apr 13, 2010 10:41 am

Re: Gull compilation for OS X

Post by Max »

Hi Joshua,

great that you got wine64 running for (most) chess engines on the Mac!

Unfortunately this error messages comes up when tested from the terminal:

macbookpro:tools max$ ./wswine.bundle/bin/wine komodo-5-32bit.exe
dyld: Library not loaded: @rpath/libwine.1.dylib
Referenced from: /Users/max/chess/tools/./wswine.bundle/bin/wine
Reason: no suitable image found. Did find:
/Users/max/chess/tools/wswine.bundle/bin/../lib/libwine.1.dylib: file too short
Trace/BPT trap: 5

macbookpro:tools max$ ./wswine.bundle/bin/wine komodo-5-64bit.exe
dyld: Library not loaded: @rpath/libwine.1.dylib
Referenced from: /Users/max/chess/tools/./wswine.bundle/bin/wine
Reason: no suitable image found. Did find:
/Users/max/chess/tools/wswine.bundle/bin/../lib/libwine.1.dylib: file too short
Trace/BPT trap: 5

macbookpro:tools max$ ./wswine.bundle/bin/wine64 komodo-5-64bit.exe
dyld: Library not loaded: @rpath/libwine.1.dylib
Referenced from: /Users/max/chess/tools/./wswine.bundle/bin/wine64
Reason: no suitable image found. Did find:
/Users/max/chess/tools/wswine.bundle/bin/../lib64/libwine.1.dylib: file too short
Trace/BPT trap: 5

Any idea? My Mac still runs on 10.9.5.

-Thanks Max
Hope we're not just the biological boot loader for digital super intelligence. Unfortunately, that is increasingly probable - Elon Musk
JoshPettus
Posts: 730
Joined: Fri Oct 19, 2012 2:23 am

Re: Gull compilation for OS X

Post by JoshPettus »

file too short.... Well that is the file. Sure beats me. You would think every engine needs to use libwine. why is it complaining here?

A bit of a long shot but I compiled 1.7.52
http://www.mediafire.com/download/caym7 ... .52.tar.7z
Doubt it would work as it was compiled from the same method, but you never know. I'm sure its a library linking problem, I may have to rexamine my build script.

[EDIT] Well libwine.1.dylib is actually a symlink hence why it could be too short. I don't understand why, programs call upon symlinked libraries all the time as versions change. But what if you deleted both libwine.1.dylib symlinks in both lib and lib64 folders, duplicated the original libwine.1.0.dylibs and renamed the duplicates libwine.1.dylib? Sorry I don't have komodo.
Max
Posts: 247
Joined: Tue Apr 13, 2010 10:41 am

Re: Gull compilation for OS X

Post by Max »

Used Komodo 5 just as an example (it's free now and there is a native Mac version too). The error happened with every chess engine at my system.

With your new version, the previous error disappeared, and i.e. 32 bit Stockfish 6 and Komodo 5 work :D ... but both 64 bit engines don’t.

Code: Select all

$ ./wswine.bundle/bin/wine stockfish-6-64.exe 
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
err:process:create_process 64-bit application L"Z:\\Users\\max\\chess\\tools\\stockfish-6-64.exe" not supported in 32-bit prefix
wine: Fehlerhaftes EXE-Format für Z:\Users\max\chess\tools\stockfish-6-64.exe.
macbookpro:tools max$ fixme:ole:RemUnknown_QueryInterface No interface for iid {00000019-0000-0000-c000-000000000046}

Code: Select all

$ ./wswine.bundle/bin/wine64 stockfish-6-64.exe 
wine: '/Users/max/.wine' is a 32-bit installation, it cannot support 64-bit applications.
-Max
Hope we're not just the biological boot loader for digital super intelligence. Unfortunately, that is increasingly probable - Elon Musk
JoshPettus
Posts: 730
Joined: Fri Oct 19, 2012 2:23 am

Re: Gull compilation for OS X

Post by JoshPettus »

I think you're suppose to clear out the old ~/.wine folder, and let it generate a new 64bit possible one. the 32 bit will still work
Max
Posts: 247
Joined: Tue Apr 13, 2010 10:41 am

Re: Gull compilation for OS X

Post by Max »

JoshPettus wrote:I think you're suppose to clear out the old ~/.wine folder, and let it generate a new 64bit possible one. the 32 bit will still work
OK, deleted ~/.wine and this issue is gone. 32 bit engines still work, but 64 bit (Stockfish 6 & Komodo 5 tested) now crash with this output:

Code: Select all

$ ./wswine.bundle/bin/wine stockfish-6-64.exe 
wine: Unhandled page fault on read access to 0x00000008 at address 0x4011b8 (thread 0024), starting debugger...
fixme:ole:RemUnknown_QueryInterface No interface for iid {00000019-0000-0000-c000-000000000046}
Unhandled exception: page fault on read access to 0x00000008 in 64-bit code (0x00000000004011b8).
Register dump:
 rip:00000000004011b8 rsp:000000000032fd90 rbp:000000000032ff80 eflags:00010246 (  R- --  I  Z- -P- )
 rax:0000000000000000 rbx:000000000032ff90 rcx:0000000000000000 rdx:000000000032fdb0
 rsi:0000000000000000 rdi:000000000032fe18  r8:0000000000000002  r9:0000000000000000 r10:00000000c0000005
 r11:0000000000000246 r12:0000000081f7f000 r13:0000000081fffaa0 r14:0000000081f7f000 r15:000000007b85b2b0
Stack dump:
0x000000000032fd90:  00000000005eb11b 0000000081f7f000
0x000000000032fda0:  000000000032fdd0 000000007b82ce3f
0x000000000032fdb0:  0000000000000000 0000000000000000
0x000000000032fdc0:  0000000000000000 0000000000000000
0x000000000032fdd0:  0000000000000000 0000000000000000
0x000000000032fde0:  0000000000000000 0000000000000000
0x000000000032fdf0:  0000000000000000 0000000000000000
0x000000000032fe00:  0000000000000000 0000000000000000
0x000000000032fe10:  0000000000000000 0000000000000000
0x000000000032fe20:  000000000032ff90 0000000000000000
0x000000000032fe30:  0000000000000102 000000000032ff80
0x000000000032fe40:  0000000081f7f000 00000000004014f8
Backtrace:
=>0 0x00000000004011b8 in stockfish-6-64 (+0x11b8) (0x000000000032ff80)
  1 0x00000000004014f8 in stockfish-6-64 (+0x14f7) (0x000000000032ff80)
  2 0x000000007bc78680 call_thread_func+0x7f() in ntdll (0x000000000032ff80)
  3 0x000000007bc728ba call_thread_entry_point+0x29() in ntdll (0x000000000032fff0)
  4 0x000000007bc49f46 start_process+0x15() in ntdll (0x000000000032fff0)
  5 0x00000000400060d3 wine_call_on_stack+0x12() in libwine.1.0.dylib (0x0000000081ffece0)
  6 0x0000000040006139 wine_switch_to_stack+0x8() in libwine.1.0.dylib (0x0000000081ffecf0)
  7 0x000000007bc48e96 LdrInitializeThunk+0x345() in ntdll (0x0000000081ffee00)
  8 0x000000007b85a88d in kernel32 (+0x4a88c) (0x0000000081fffe40)
  9 0x000000007bc4a6e5 __wine_process_init+0x1f4() in ntdll (0x0000000081fffef0)
  10 0x00007fff8ce27899 _pthread_body+0x89() in libsystem_pthread.dylib (0x0000000081ffff10)
0x00000000004011b8: movq	0x0000000000000008(%rax),%rbx
Modules:
Module	Address					Debug info	Name (80 modules)
PE	          400000-          620000	Export          stockfish-6-64
PE	        40001000-        401a6000	Stabs           libwine.1.0.dylib
ELF	        44900000-        449d6000	Deferred        msvcrt<elf>
  \-PE	        44910000-        449af000	\               msvcrt
ELF	        7b800000-        7ba98000	Stabs           kernel32<elf>
  \-PE	        7b810000-        7ba5b000	\               kernel32
ELF	        7bc00000-        7bd0d000	Stabs           ntdll<elf>
  \-PE	        7bc10000-        7bcd1000	\               ntdll
ELF	        7bf00000-        7bf03000	Deferred        <wine-loader>
PE	    7fff83713000-    7fff83984000	Deferred        security
PE	    7fff83d5c000-    7fff83d6e000	Deferred        libz.1.dylib
PE	    7fff83d6e000-    7fff83ddb000	Deferred        iokit
PE	    7fff84728000-    7fff84750000	Deferred        libsystem_info.dylib
PE	    7fff847a4000-    7fff847ad000	Deferred        libsystem_dnssd.dylib
PE	    7fff847ad000-    7fff847bf000	Deferred        libsystem_asl.dylib
PE	    7fff84833000-    7fff8483f000	Deferred        netauth
PE	    7fff84da8000-    7fff84dc4000	Deferred        libcrfsuite.dylib
PE	    7fff84e56000-    7fff84e72000	Deferred        libsystem_malloc.dylib
PE	    7fff84e72000-    7fff84f03000	Deferred        metadata
PE	    7fff8510b000-    7fff85113000	Deferred        libcopyfile.dylib
PE	    7fff85127000-    7fff8520f000	Deferred        libxml2.2.dylib
PE	    7fff8523b000-    7fff8528a000	Deferred        libcorecrypto.dylib
PE	    7fff85469000-    7fff85474000	Deferred        libcommoncrypto.dylib
PE	    7fff854da000-    7fff854f7000	Deferred        libsystem_kernel.dylib
PE	    7fff856b0000-    7fff856d5000	Deferred        libxpc.dylib
PE	    7fff856d5000-    7fff8573a000	Deferred        datadetectorscore
PE	    7fff85866000-    7fff85b67000	Deferred        foundation
PE	    7fff85b67000-    7fff85baa000	Deferred        libauto.dylib
PE	    7fff85d14000-    7fff85d19000	Deferred        libpam.2.dylib
PE	    7fff86544000-    7fff8656e000	Deferred        dictionaryservices
PE	    7fff86570000-    7fff86574000	Deferred        libdyld.dylib
PE	    7fff8670c000-    7fff86718000	Deferred        libkxld.dylib
PE	    7fff867d0000-    7fff867f8000	Deferred        libsystem_network.dylib
PE	    7fff867f8000-    7fff867ff000	Deferred        libsystem_platform.dylib
PE	    7fff86bde000-    7fff86be1000	Deferred        libquarantine.dylib
PE	    7fff875a8000-    7fff875aa000	Deferred        libremovefile.dylib
PE	    7fff878b9000-    7fff878c3000	Deferred        libsystem_notify.dylib
PE	    7fff87be6000-    7fff87bea000	Deferred        tcc
PE	    7fff87d1a000-    7fff87d6d000	Deferred        libc++.1.dylib
PE	    7fff87db8000-    7fff87dc3000	Deferred        servicemanagement
PE	    7fff87f18000-    7fff87f90000	Deferred        osservices
PE	    7fff88071000-    7fff880cd000	Deferred        ae
PE	    7fff8819d000-    7fff8819f000	Deferred        libsystem_sandbox.dylib
PE	    7fff88334000-    7fff8841f000	Deferred        libsqlite3.dylib
PE	    7fff88421000-    7fff88429000	Deferred        libcompiler_rt.dylib
PE	    7fff88429000-    7fff885d7000	Deferred        libobjc.a.dylib
PE	    7fff88776000-    7fff88778000	Deferred        libunc.dylib
PE	    7fff88827000-    7fff889c3000	Deferred        cfnetwork
PE	    7fff88b37000-    7fff88b3c000	Deferred        libsystem_stats.dylib
PE	    7fff88de7000-    7fff88e02000	Deferred        libdispatch.dylib
PE	    7fff89717000-    7fff8971d000	Deferred        libunwind.dylib
PE	    7fff89923000-    7fff89925000	Deferred        libsystem_blocks.dylib
PE	    7fff8a075000-    7fff8a0d9000	Deferred        systemconfiguration
PE	    7fff8a11b000-    7fff8a11c000	Deferred        libopenscriptingutil.dylib
PE	    7fff8a11c000-    7fff8a11f000	Deferred        libsystem_configuration.dylib
PE	    7fff8a2bd000-    7fff8a2cb000	Deferred        libxar.1.dylib
PE	    7fff8ae42000-    7fff8ae48000	Deferred        diskarbitration
PE	    7fff8b2e6000-    7fff8b2ee000	Deferred        netfs
PE	    7fff8b6f1000-    7fff8b9dc000	Deferred        carboncore
PE	    7fff8bc41000-    7fff8bccb000	Deferred        libsystem_c.dylib
PE	    7fff8ccfa000-    7fff8ccfc000	Deferred        liblangid.dylib
PE	    7fff8ce26000-    7fff8ce2e000	Stabs           libsystem_pthread.dylib
PE	    7fff8d0ca000-    7fff8d195000	Deferred        launchservices
PE	    7fff8da94000-    7fff8da96000	Deferred        libdiagnosticmessagesclient.dyli
PE	    7fff8da96000-    7fff8daa7000	Deferred        libbsm.0.dylib
PE	    7fff8ebe0000-    7fff8ebe1000	Deferred        coreservices
PE	    7fff8efe1000-    7fff8efef000	Deferred        libbz2.1.0.dylib
PE	    7fff8f321000-    7fff8f38f000	Deferred        searchkit
PE	    7fff8f39c000-    7fff8f3a4000	Deferred        liblaunch.dylib
PE	    7fff8f3d1000-    7fff8f3e9000	Deferred        cfopendirectory
PE	    7fff8f46b000-    7fff8f651000	Deferred        corefoundation
PE	    7fff8f651000-    7fff8f67b000	Deferred        libc++abi.dylib
PE	    7fff8f736000-    7fff8f73c000	Deferred        libmacho.dylib
PE	    7fff8f790000-    7fff8f795000	Deferred        libcache.dylib
PE	    7fff8f809000-    7fff8f80b000	Deferred        libsystem.b.dylib
PE	    7fff8fe53000-    7fff8fe83000	Deferred        libsystem_m.dylib
PE	    7fff90600000-    7fff90601000	Deferred        libkeymgr.dylib
PE	    7fff90e15000-    7fff90e3e000	Deferred        libxslt.1.dylib
PE	    7fff90e3e000-    7fff90ff7000	Deferred        libicucore.a.dylib
PE	    7fff91065000-    7fff91096000	Deferred        libncurses.5.4.dylib
Threads&#58;
process  tid      prio &#40;all id&#58;s are in hex&#41;
0000000e services.exe
	00000020    0
	0000001f    0
	00000019    0
	00000018    0
	00000016    0
	00000010    0
	0000000f    0
00000012 winedevice.exe
	0000001e    0
	0000001b    0
	0000001a    0
	00000013    0
00000014 explorer.exe
	00000029    0
	00000028    0
	00000027    0
	00000015    0
0000001c plugplay.exe
	00000022    0
	00000021    0
	0000001d    0
00000023 &#40;D&#41; Z&#58;\Users\max\chess\tools\stockfish-6-64.exe
	00000024    0 <==
System information&#58;
    Wine build&#58; wine-1.7.52
    Platform&#58; x86_64
    Host system&#58; Darwin
    Host version&#58; 13.4.0
-Max
Hope we're not just the biological boot loader for digital super intelligence. Unfortunately, that is increasingly probable - Elon Musk
JoshPettus
Posts: 730
Joined: Fri Oct 19, 2012 2:23 am

Re: Gull compilation for OS X

Post by JoshPettus »

Those look like legitimate 64bit errors. 64bit is extremely, extremely experimental on OSX. The wine devs would be surprised to know that I got any 64bit code to run at all.... The ones I got to work so far are 64bit versions of TheKing3.5(cracked to work in winboard), Crafty JA build, Gull and Naum4.6. I admit I haven't tried too many. Stockfish Giraffe, and Fire I know do not work. But stockfish at least has an actual OSX compile, which I would recommend because there is 0 additional overhead. (though I don't know how much that effects the engine) I made an OSX compile of Giraffe for the same reason.

Maybe if I recompile clang to the latest version svn, as since I last compiled it, I think the patch that made this possible has been updated and finalized. It might do a better job compiling, IDK. But I wouldn't hold my breath that that's the issue.
Max
Posts: 247
Joined: Tue Apr 13, 2010 10:41 am

Re: Gull compilation for OS X

Post by Max »

Well done Joshua, hope you can improve wine64 for darwin further more.
JoshPettus wrote:Those look like legitimate 64bit errors. 64bit is extremely, extremely experimental on OSX.
You are right, Gull 3 x64 runs well now!

Thanks,
Max
Hope we're not just the biological boot loader for digital super intelligence. Unfortunately, that is increasingly probable - Elon Musk