[Pachi] Makefile Problem and Solution

Chin-Chang Yang chin.chang.yang at gmail.com
Sat Nov 19 14:38:50 CET 2011

Hi All:

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

Chin-Chang Yang, 2011/11/19
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rover.ms.mff.cuni.cz/pipermail/pachi/attachments/20111119/bf47a00d/attachment.html>

More information about the Pachi mailing list