[Computer-go] pachi: how to build?

Hideki Kato hideki_katoh at ybb.ne.jp
Fri Apr 15 08:23:53 PDT 2011


Hello,

Petr Baudis: <20110415133748.GW3258 at machine.or.cz>:
<cut>
>> Jay:pachi 2 jonathanchetwynd$  make MAC=1
>..snip..
>> [LINK] zzgo
>> Undefined symbols:
>>   "___sync_fetch_and_add", referenced from:
>>   "___sync_synchronize", referenced from:
>>   "___sync_fetch_and_sub", referenced from:
>>   "___sync_lock_test_and_set", referenced from:
>> ld: symbol(s) not found
>> collect2: ld returned 1 exit status
>> make: *** [zzgo] Error 1
>
>  These intrinsics are provided by gcc 4.1 and newer, but your cc does
>not appear to provide them. Just out of interest, is that gcc and what
>is it's version? (cc --version)

That's not the version of gcc issue but the processor.  PowerPC has 
another type of atomic operations than x86.

>  There are few ways from here...
>
>  (i) Disable multi-threading support on MAC. Are you actually
>interested in running Pachi with multiple threads in your use-case?
>
>  (ii) Use non-synchronized operations instead. It opens few race
>conditions, but they should not be fatal and it is not clear if they
>would impair program strength significantly, especially with shorter
>thinking times.
>
>  (iii) Substitute with proper OS/X calls, e.g. as described in:
>
>	
>http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man3/atomic.3.html
>
>The complication is that I wouldn't be able to properly test this on
>my own.

I'd like to add:
(iv) Use atomic operation library (libatomic_ops) 
(http://www.hpl.hp.com/research/linux/atomic_ops/download.php4), 
which provides much more portability.

>random.c:10: error: thread-local storage not supported for this target
I guess you have to make PRNGs (pesudo random number generators) 
thread-safe _without_ TLS (thread-local storage) because GCC for 
PowerPC does not support TLS.

Hideki
-- 
Hideki Kato <mailto:hideki_katoh at ybb.ne.jp>



More information about the Computer-go mailing list