[Computer-go] pachi: how to build?

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


Petr Baudis: <20110415133748.GW3258 at machine.or.cz>:
>> Jay:pachi 2 jonathanchetwynd$  make MAC=1
>> [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:
>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) 
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 Kato <mailto:hideki_katoh at ybb.ne.jp>

More information about the Computer-go mailing list