[Pachi] Makefile Problem and Solution

Petr Baudis pasky at ucw.cz
Sat Nov 19 15:15:17 CET 2011


On Sat, Nov 19, 2011 at 09:38:50PM +0800, Chin-Chang Yang wrote:
> Problem:
> I tried building pachi-9.01 (
> http://repo.or.cz/w/pachi.git/snapshot/pachi-9.01-hakugen.tar.gz) with gcc
> (Ubuntu/Linaro 4.6.1-9ubuntu3) 4.6.1, but I got an error message:
> uct/uct.a(uct.o): In function `uct_genmove_setup':
> /home/ccy/pachi-origin/uct/uct.c:414: undefined reference to `floorf'
> ......
> collect2: ld returned 1 exit status
> make: *** [pachi] Error 1
> Solution:
> According to "comp.lang.c FAQ list · Question 14.3" (
> http://www.c-faq.com/fp/libm.html), we need to use an explicit -lm flag, at
> the *end* of the command line, when compiling/linking. The Makefile.lib at
> Line 36 should be modified as the follows.
> cmd_link = $(LINK) -o $@ $^ $(LDFLAGS)
> In this way, the -lm flag is at the *end* of the command line, and then I
> can successfully build pachi-9.01.

  Thanks for the report - this problem has been recently proliferated
with gcc-4.6, it's already fixed in the git. I think I will release
Pachi-9.02 with this fix.

				Petr "Pasky" Baudis
	The goal of Computer Science is to build something that will
	last at least until we've finished building it.

More information about the Pachi mailing list