3 # Uncomment one of the options below to change the way Pachi is built.
4 # Alternatively, you can pass the option to make itself, like:
8 # Do you compile on MacOS/X instead of Linux? Please note that the
9 # performance may not be optimal.
10 # (XXX: We are looking for volunteers contributing support for other
11 # targets, like mingw/Windows.)
15 # By default, Pachi uses low-precision numbers within the game tree to
16 # conserve memory. This can become an issue with playout counts >1M,
17 # e.g. with extremely long thinking times or massive parallelization;
18 # 24 bits of floating_t mantissa become insufficient then.
22 # Enable performance profiling using gprof. Note that this also disables
23 # inlining, which allows more fine-grained profile, but may also distort
29 # Target directories when running `make install`. Note that this is NOT
30 # quite supported yet - Pachi will work fine, but will always look for
31 # extra data files (such as pattern, joseki or fuseki database) only
32 # in the current directory, bundled database files will not be installed
33 # in a system directory or loaded from there.
37 # Generic compiler options. You probably do not really want to twiddle
39 # (N.B. -ffast-math breaks us; -fomit-frame-pointer is added below
40 # unless PROFILING=1.)
41 CUSTOM_CFLAGS
=-Wall
-ggdb3
-O3
-std
=gnu99
-frename-registers
-pthread
-Wsign-compare
-D_GNU_SOURCE
47 SYS_CFLAGS
=-DNO_THREAD_LOCAL
48 LDFLAGS
=-lm
-pthread
-ldl
-rdynamic
50 SYS_CFLAGS
=-march
=native
51 LDFLAGS
=-lm
-pthread
-lrt
-ldl
-rdynamic
55 CUSTOM_CFLAGS
+=-DDOUBLE
60 CUSTOM_CFLAGS
+=-pg
-fno-inline
62 # Whee, an extra register!
63 CUSTOM_CFLAGS
+=-fomit-frame-pointer
75 INSTALL
=/usr
/bin
/install
83 OBJS
=board.o gtp.o move.o ownermap.o pattern3.o playout.o probdist.o random.o stone.o timeinfo.o network.o fbook.o
84 SUBDIRS
=random replay joseki montecarlo uct uct
/policy playout tactics t-unit distributed
86 all: all-recursive pachi
88 LOCALLIBS
=random
/random.a replay
/replay.a joseki
/joseki.a montecarlo
/montecarlo.a uct
/uct.a uct
/policy
/uctpolicy.a playout
/playout.a tactics
/tactics.a t-unit
/test.a distributed
/distributed.a
89 $(LOCALLIBS
): all-recursive
91 pachi
: $(OBJS
) pachi.o
$(LOCALLIBS
)
94 # Use runtime gcc profiling for extra optimization. This used to be a large
95 # bonus but nowadays, it's rarely worth the trouble.
96 .PHONY
: pachi-profiled
98 @make
clean all XLDFLAGS
=-fprofile-generate XCFLAGS
="-fprofile-generate -fomit-frame-pointer -frename-registers"
99 .
/pachi
-t
=5000 no_tbook
<tools
/genmove19.gtp
100 @make
clean all clean-profiled XLDFLAGS
=-fprofile-use XCFLAGS
="-fprofile-use -fomit-frame-pointer -frename-registers"
104 $(INSTALL
) .
/pachi
$(DESTDIR
)$(BINDIR
)
107 clean: clean-recursive
110 clean-profiled
: clean-profiled-recursive
113 -include Makefile.lib