Closed ghost closed 7 years ago
If you give me the version you want (popcnt/bmi2) I can send you an object file along with the command that would generate an executable on your mac. If you have the complete syzygy345 wdl and dtz, I will also ask that you test out syzygy on your mac
Great - I have bmi2 and syzygy - at least I think its the complete tb if its around 19gb. (Just remembered its the CB Turbo which I bought a few years ago both wdl and dtz.)
Meant to ask if you need an email address or will one on record here suffice.
Email doesn't matter. After I finish porting asmFish from fasm to fasmg, I will assemble you a object file with fasm that you can convert. After that, I will debug the fasmg port, and if this goes well, we should be able to generate exe's for all os's without using the unnecessary o files.
Thank you - enjoy your day !!
I had better luck than expected in porting to fasmg, so I should be able to make mach-o executables directly. Just give me some time to make sure there are no more bugs in fasmg.
Thank you for the update. No rush take your time.
If Mac executables become available through Windows or Linux, I shall be able to make them routinely after respective patches as the rest.
Great stuff ! Many thanks to Mohammed and you @lantonov.
maxchess,
the o file is at https://github.com/lantonov/asmFish/blob/master/Mac/asmFishX_bmi2.o
I have done the first two steps in the readme. Your machine is needed to do the last.
Make sure you cd to the directory where you downloaded the o file. Then do
gcc asmFishX_bmi2.o -image_base 400000 -pagezero_size 1000 -lm -o asmFishX_bmi2
This should complete with no errors, and the exe asmFishX_bmi2 should be ready to go. You might have to do a
chmod 755 ./asmFishX_bmi2
What I want you to test is only the complete set of syzygy345 wld+dtz. Please check the bold numbers
$ ./asmFishC asmFishC_2017-08-18_popcnt setoption name syzygypath value /home/me/syzygy345 info string found 145 tablebases in "/home/me/syzygy345" info string found 145 of 510 tablebases bench *** bench hash 16 threads 1 depth 13 realtime 0 *** 1: nodes: 207523 1503 knps 2: nodes: 245099 1667 knps 3: nodes: 107594 2030 knps 4: nodes: 131905 1628 knps 5: nodes: 61347 1460 knps 6: nodes: 267189 1428 knps 7: nodes: 203533 1553 knps 8: nodes: 458488 1698 knps 9: nodes: 241759 1510 knps 10: nodes: 133200 1604 knps 11: nodes: 207457 1492 knps 12: nodes: 290419 1474 knps 13: nodes: 136141 1583 knps 14: nodes: 134188 1490 knps 15: nodes: 91285 1755 knps 16: nodes: 59179 1849 knps 17: nodes: 45146 2149 knps 18: nodes: 17276 2879 knps 19: nodes: 215513 966 knps 20: nodes: 288058 1516 knps 21: nodes: 150029 1402 knps 22: nodes: 53394 2321 knps 23: nodes: 110346 3152 knps 24: nodes: 45870 2414 knps 25: nodes: 14292 2382 knps 26: nodes: 43804 2085 knps 27: nodes: 325655 2048 knps 28: nodes: 276342 1879 knps 29: nodes: 71395 1929 knps 30: nodes: 34798 2319 knps 31: nodes: 28771 1150 knps 32: nodes: 88678 1477 knps 33: nodes: 58260 1713 knps 34: nodes: 248156 2001 knps 35: nodes: 130787 2043 knps 36: nodes: 86756 1577 knps 37: nodes: 396680 1871 knps =========================== Total time (ms) : 3471 Nodes searched : 5706312 Nodes/second : 1643996 quit
@tthsqe12
Fabulous .. thank you. This is what I got .. ignore the bit at the end set apart as I dont have the 'normal' syzygy - this is via ChessBase Turbo so includes the most accessed bases (I think) .. !!
(I will download the 345 shortly)
Total time (ms) : 3361 Nodes searched : 5608839 Nodes/second : 1668800
setoption name syzygypath value /Users/um/Desktop/D-Top/Mac Chess/syzygy info string found 172 tablebases in "/Users/um/Desktop/D-Top/Mac Chess/syzygy" info string found 172 of 510 tablebases bench bench hash 16 threads 1 depth 13 realtime 0 1: nodes: 207523 1392 knps 2: nodes: 245099 1776 knps mmap failed in _FileMap rax: 0xffffffffffffffff iMac:asm um$
Crap !! Again - I did not BOLD anything !!
macOS Sierra 10.12.6 3.1 Ghz i7
I've just downloaded the syzygy 345 from Shriver's site. Will set everything up later tonight (I'm on Eastern) and have an update for you for Sat morning.
@tthsqe12 with the 345syzygy
Last login: Fri Aug 18 17:55:27 on ttys000 /Users/um/Desktop/asm/asmFishX_bmi2-18aug ; exit; iMac:~ um$ /Users/um/Desktop/asm/asmFishX_bmi2-18aug ; exit; asmFishX_2017-08-18_bmi2 setoption name syzygypath value /Users/um/Desktop/syzygy345 info string found 145 tablebases in "/Users/um/Desktop/syzygy345" info string found 145 of 510 tablebases bench bench hash 16 threads 1 depth 13 realtime 0 1: nodes: 207523 1365 knps 2: nodes: 245099 1485 knps mmap failed in _FileMap rax: 0xffffffffffffffff logout Saving session... ...copying shared history... ...saving history...truncating history files... ...completed. Deleting expired sessions...63 completed.
[Process completed]
Second attampt ..
asmFishX_2017-08-18_bmi2 setoption name syzygypath value /Users/um/Desktop/syzygy345 info string found 145 tablebases in "/Users/um/Desktop/syzygy345" info string found 145 of 510 tablebases bench bench hash 16 threads 1 depth 13 realtime 0 1: nodes: 207523 2184 knps 2: nodes: 245099 2334 knps mmap failed in _FileMap rax: 0xffffffffffffffff
It looks like apple messed something else up. Do the same thing with try2.
I’m not familiar with ‘try2’ – would you mind please listing exactly how !! Noob here for the most part.
Sent from Mail for Windows 10
From: tthsqe12 Sent: Saturday, August 19, 2017 6:56 AM To: lantonov/asmFish Cc: maxchess; Author Subject: Re: [lantonov/asmFish] NOT an ISSUE - a Thank You and an ASK .. !!(#76)
It looks like apple messed something else up. Do the same thing with try2.
info string found 145 of 510 tablebases bench bench hash 16 threads 1 depth 13 realtime 0 1: nodes: 207523 1548 knps 2: nodes: 245099 1789 knps in _FileMap size: 0000000000f9ead0 stat struct: 0000000000000801 0000000000e0921e 0000000000000001 000003eb000081a4 00000000000003eb 0000000000000000 0000000000f9ead0 0000000000001000 0000000000007cf8 000000005996f6b3 0000000011668f58 0000000057584416 0000000000000000 000000005984a075 0000000027cc4b10 0000000000000000 0000000000000000 0000000000000000 — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.
Do the same thing with https://github.com/lantonov/asmFish/blob/master/Mac/asmFishX_bmi2_try2.o
Okay I did this – assuming this is what you wanted – apologise if not
Last login: Sat Aug 19 06:08:23 on ttys000 iMac:~ um$ cd /Users/um/Desktop/try2 iMac:try2 um$ gcc asmFishX_bmi2_try2.o -image_base 400000 -pagezero_size 1000 -lm -o asmFishX_bmi2 ld: warning: PIE disabled. Absolute addressing (perhaps -mdynamic-no-pic) not allowed in code signed PIE, but used in .code from asmFishX_bmi2_try2.o. To fix this warning, don't compile with -mdynamic-no-pic or link with -Wl,-no_pie iMac:try2 um$ /Users/um/Desktop/try2/asmFishX_bmi2 asmFishX_2017-08-18_bmi2 setoption name syzygypath value /Users/um/Desktop/syzygy345 info string found 145 tablebases in "/Users/um/Desktop/syzygy345" info string found 145 of 510 tablebases bench bench hash 16 threads 1 depth 13 realtime 0 1: nodes: 207523 1957 knps 2: nodes: 245099 2402 knps mmap failed in _FileMap rax: 0xffffffffffffffff iMac:try2 um$
Sent from Mail for Windows 10
From: tthsqe12 Sent: Saturday, August 19, 2017 7:16 AM To: lantonov/asmFish Cc: maxchess; Author Subject: Re: [lantonov/asmFish] NOT an ISSUE - a Thank You and an ASK .. !!(#76)
Do the same thing with https://github.com/lantonov/asmFish/blob/master/Mac/asmFishX_bmi2_try2.o — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.
Seems I have not installed something in my Linux emulation
lantonov@DESKTOP-ICVQJ2N:/mnt/c/Git/asmFish/Mac$ gcc asmFishX_bmi2.o -image_base 400000 -pagezero_size 1000 -lm -o asmFishX_bmi2
gcc: error: 400000: No such file or directory
gcc: error: 1000: No such file or directory
gcc: error: unrecognized command line option ‘-image_base’
gcc: error: unrecognized command line option ‘-pagezero_size’
you are going to have to use a compiler that targets the mach-o format. This is clang on apple boxes.
I don't have apple. Can clang be installed in Linux or Windows ?
Okay thank you – never used the compiler before so need to read up on usage.
Sent from Mail for Windows 10
From: tthsqe12 Sent: Saturday, August 19, 2017 7:40 AM To: lantonov/asmFish Cc: maxchess; Author Subject: Re: [lantonov/asmFish] NOT an ISSUE - a Thank You and an ASK .. !!(#76)
you are going to have to use a compiler that targets the mach-o format. This is clang on apple boxes. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.
You need a compiler that targets mach-o format. Even if you get clang, I doubt that you will be able to get mach-o working on a linux box. Maxchess has an apple, thus can do it (I hope he/she tries _try2.o soon)
Fasmg has macros for outputting the mach-o format, and I could give this a try, but we first to make sure that the program bits work.
He’s a he .. !! Okay so its just after 8am here and I need to shower first. I think I need Xcode plus its command line tools then clang so all that in about an hour. I’ll update once everything I need is installed successfully or not.
Sent from Mail for Windows 10
From: tthsqe12 Sent: Saturday, August 19, 2017 7:48 AM To: lantonov/asmFish Cc: maxchess; Author Subject: Re: [lantonov/asmFish] NOT an ISSUE - a Thank You and an ASK .. !!(#76)
You need a compiler that targets mach-o format. Even if you get clang, I doubt that you will be able to get mach-o working on a linux box. Maxchess has an apple, thus can do it (I hope he/she tries _try2.o soon) Fasmg has macros for outputting the mach-o format, and I could give this a try, but we first to make sure that the program bits work. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.
Xcode is still downloading from Apple Store but I downloaded a pre-compiled binary of clang/llvm. Now I just need to figure out how this stuff works.
Sent from Mail for Windows 10
From: tthsqe12 Sent: Saturday, August 19, 2017 7:48 AM To: lantonov/asmFish Cc: maxchess; Author Subject: Re: [lantonov/asmFish] NOT an ISSUE - a Thank You and an ASK .. !!(#76)
You need a compiler that targets mach-o format. Even if you get clang, I doubt that you will be able to get mach-o working on a linux box. Maxchess has an apple, thus can do it (I hope he/she tries _try2.o soon) Fasmg has macros for outputting the mach-o format, and I could give this a try, but we first to make sure that the program bits work. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.
maxchess, why are you downloading more stuff? Don't you have mac? Just try the second o file on your mac!
I tried the second o file and posted the results – same thing. Check the post – maybe I did something wrong – let me know.
Sent from Mail for Windows 10
From: tthsqe12 Sent: Saturday, August 19, 2017 9:25 AM To: lantonov/asmFish Cc: maxchess; Author Subject: Re: [lantonov/asmFish] NOT an ISSUE - a Thank You and an ASK .. !!(#76)
maxchess, why are you downloading more stuff? Don't you have mac? Just try the second o file on your mac! — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.
I think I got my knickers in a twist here - what exactly is the o file ? Is it a binary file or does it need to be compiled ? You mentioned clang so it needs compiling ?
the gcc command on your mac is going to invoke the clang compiler.
An o file contains all of the machine code with symbolic references to functions in the standard c library. It is not in format of an executable, so some tools are required to get it into one. That is what clang can do while linking with std c library.
Step 1: download https://github.com/lantonov/asmFish/blob/master/Mac/asmFishX_bmi2_try2.o
Step 2: open terminal and cd to location of downloaded file.
Step 3: do gcc asmFishX_bmi2_try2.o -image_base 400000 -pagezero_size 1000 -lm -o asmFishX_bmi2_try2
Step 4: possibly do a chmod 755 ./asmFishX_bmi2_try2
and run the bench with syzygy345 as before.
Thank you - exactly what I did up top. Anyway here ..
Last login: Sat Aug 19 09:47:35 on ttys000
iMac:~ um$ cd /Users/um/Desktop/try219aug
iMac:try219aug um$ gcc asmFishX_bmi2_try2.o -image_base 400000 -pagezero_size 1000 -lm -o asmFishX_bmi2_try2
ld: warning: PIE disabled. Absolute addressing (perhaps -mdynamic-no-pic) not allowed in code signed PIE, but used in .code from asmFishX_bmi2_try2.o. To fix this warning, don't compile with -mdynamic-no-pic or link with -Wl,-no_pie
iMac:try219aug um$ chmod 755 /Users/um/Desktop/try219aug/ asmFishX_bmi2_try2
iMac:try219aug um$ /Users/um/Desktop/try219aug/asmFishX_bmi2_try2 asmFishX_2017-08-18_bmi2
setoption name syzygypath value /Users/um/Desktop/syzygy345
info string found 145 tablebases in "/Users/um/Desktop/syzygy345" info string found 145 of 510 tablebases
bench bench hash 16 threads 1 depth 13 realtime 0 1: nodes: 207523 890 knps 2: nodes: 245099 830 knps mmap failed in _FileMap rax: 0xffffffffffffffff iMac:try219aug um$
Alright, try the third one. Github seems to be down, so the file is at https://expirebox.com/download/b5399de33399c3a88430694622cbee0a.html
Okay here's 'try3' .. I've skipped the compiler warning - looked the same as before but should you want to see it would be happy to recompile ..
asmFishX_2017-08-19_bmi2 setoption name syzygypath value /Users/um/Desktop/syzygy345 info string found 145 tablebases in "/Users/um/Desktop/syzygy345" info string found 145 of 510 tablebases bench bench hash 16 threads 1 depth 13 realtime 0 1: nodes: 207523 749 knps 2: nodes: 245099 972 knps in _FileMap size: 0000000000000000 stat struct: 09d6517f01000008 000001f5000181a4 0000000000000014 000000005997742c 0000000000000000 000000005997742c 0000000000000000 000000005997742c 0000000000000000 0000000000f9ead0 0000000000007cf8 0000000000001000 0000000000000000 0000000000000000 0000000000000000 0000000000236380 000000000062fff0 0000000000406b32 mmap failed in _FileMap rax: 0xffffffffffffffff iMac:~ um$
Would it not easier to use TeamViewer so that Moha can try himself on maxchess computer!
Ipm - problem solved - you can see the file size (0000000000f9ead0) is at offset 72 in the struct instead of where it is supposed to be at offset 96. Apple changed something else...
github still broken so try4 is at https://expirebox.com/download/dde08656b4c85d5e80cae27d8fa0bae1.html
maxchess - it should work now. Give it a try with syzygy345 one more time.
Okay sure - will try as many times as you wish no problem.
Hip Hip Hooray !!
Total time (ms) : 4286 Nodes searched : 5706312 Nodes/second : 1331384
Thank you so very much @tthsqe12 for your time and patience with a man in his dotage !!
Okay no issues with asmFish-Mac to date. Question : I understand that updates to the Mac version will be irregular at best so no worries - since @lantonov does not have an Apple and I do - happy to help - anything I can do ?
After much perusing of the apple documentation and the source of fasmg, It looks like fasmg is able to make good executables for mac. This means that we can create the exe's directly with fasmg instead of using fasm (win/linux) -> objconv (win/linux) -> clang (macOS). Fasmg runs on windows/linux/macOS and can produce executables for windows/linux/macOS from any one of these systems. It can also produce executable for android, but this is going to first require me to implement the armv8 instruction set in fasmg! I'm about 3% done with this project, and currently only have hello world working. But once hello world is working, it is not a big conceptual leap to get a chess engine working.
Impressive! This is hard to achievable even with the "superportable" C++. Do I understand well that windows/linux/macOS exe's can be made right now using fasmg and you are working to join arm to the herd?
Wonderful news !!!
The only down side is that the assembly times for the engine are now ~20sec for linux/macOS and ~25sec for windows. This is per executable. This makes source code testing a little slower. The reason for this is that fasmg is completely macro driven. The instruction sets are coded completely in macros, and since x86 is notoriously complex, the macros are equally complex. Not sure how long it would take to build armFish. For building all of the executables to put in your executable branch, we should have the make file run multiple processes of fasmg at the same time. This would build the executables in parallel and cut down on overall time.
Do I understand well that windows/linux/macOS exe's can be made right now using fasmg and you are working to join arm to the herd?
Yes. Everything would be written for fasmg and assembled by fasmg.
fasm arm is written in assembly language and the developer doesn't have time to support lots of output formats. asm is not the most productive language. I think only the plain 'binary' format is supported for 64 bit. This is in contrast to fasmg, which is also written in asm, but the productive parts can be implemented fairly easily with its powerful macros. You can see the current incomplete implementation of armv8 at https://github.com/tthsqe12/asm/blob/master/arm/include/aarch64.inc I just need to add all of the instructions (there are hundreds of them)
maxchess, could you try the executables at https://github.com/lantonov/asmFish/tree/executables/macOS
They work for me!
@tthsqe12 .. work for me too - I did not use syzygy - will rerun with syzygy if you wish.
Total time (ms) : 2200 Nodes searched : 5608839 Nodes/second : 2549472
Total time (ms) : 1929 Nodes searched : 5608839 Nodes/second : 2907640
Total time (ms) : 1977 Nodes searched : 5608839 Nodes/second : 2837045 quit iMac:macOS24aug um$
Thank you for the engines and also - any chance of an updated Mac version please ? You lost me at .. 'mac os x: this is tricky' .. !!