[Computer-go] pachi: how to build?

Petr Baudis pasky at ucw.cz
Fri Apr 15 12:00:48 PDT 2011


On Sat, Apr 16, 2011 at 12:23:53AM +0900, Hideki Kato wrote:
> 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.

  Yes, but surely it supports these atomic operations? The point of
these intrinsics should be to provide processor-indepentent interface
(originally, they were Intel-specified IA64 intrinsics).

  (But maybe you are right if you mean that gcc may not have these
implemented for ppc in the version shipped along MacOS/X - but which
version of MacOSX are we talking about again anyway?)

> 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.

  If we care only about gcc, ideally the __sync_*() primitives should
work on all supported targets in new enough versions; also, this would
add another extra dependency. So it's a tradeoff. If someone is willing
to contribute patches that won't make building Pachi on Linux more
difficult and will add support for more targets, I'll be very happy. :-)

> >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.

  This particular problem we have already solved in our tree, it was
just the issue with forgotten MAC=1. We have to make the build system
more friendly for newcomers. :-)

				Petr "Pasky" Baudis
UNIX is user friendly, it's just picky about who its friends are.

More information about the Computer-go mailing list