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
28 # Enable performance profiling using google-perftools. This is much
29 # more accurate, fine-grained and nicer than gprof and does not change
30 # the way the actual binary is compiled and runs.
35 # Target directories when running `make install`. Note that this is NOT
36 # quite supported yet - Pachi will work fine, but will always look for
37 # extra data files (such as pattern, joseki or fuseki database) only
38 # in the current directory, bundled database files will not be installed
39 # in a system directory or loaded from there.
43 # Generic compiler options. You probably do not really want to twiddle
45 # (N.B. -ffast-math breaks us; -fomit-frame-pointer is added below
46 # unless PROFILING=gprof.)
47 CUSTOM_CFLAGS
=-Wall
-ggdb3
-O3
-std
=gnu99
-frename-registers
-pthread
-Wsign-compare
-D_GNU_SOURCE
53 SYS_CFLAGS
=-DNO_THREAD_LOCAL
54 LDFLAGS
=-pthread
-rdynamic
57 SYS_CFLAGS
=-march
=native
58 LDFLAGS
=-pthread
-rdynamic
63 CUSTOM_CFLAGS
+=-DDOUBLE
66 ifeq ($(PROFILING
), gprof
)
68 CUSTOM_CFLAGS
+=-pg
-fno-inline
70 # Whee, an extra register!
71 CUSTOM_CFLAGS
+=-fomit-frame-pointer
72 ifeq ($(PROFILING
), perftools
)
86 INSTALL
=/usr
/bin
/install
94 OBJS
=board.o gtp.o move.o ownermap.o pattern3.o pattern.o patternsp.o playout.o probdist.o random.o stone.o timeinfo.o network.o fbook.o
95 SUBDIRS
=random replay patternscan joseki montecarlo uct uct
/policy playout tactics t-unit distributed
97 all: all-recursive pachi
99 LOCALLIBS
=random
/random.a replay
/replay.a patternscan
/patternscan.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
100 $(LOCALLIBS
): all-recursive
102 pachi
: $(OBJS
) pachi.o
$(LOCALLIBS
)
105 # Use runtime gcc profiling for extra optimization. This used to be a large
106 # bonus but nowadays, it's rarely worth the trouble.
107 .PHONY
: pachi-profiled
109 @make
clean all XLDFLAGS
=-fprofile-generate XCFLAGS
="-fprofile-generate -fomit-frame-pointer -frename-registers"
110 .
/pachi
-t
=5000 no_tbook
<tools
/genmove19.gtp
111 @make
clean all clean-profiled XLDFLAGS
=-fprofile-use XCFLAGS
="-fprofile-use -fomit-frame-pointer -frename-registers"
115 $(INSTALL
) .
/pachi
$(DESTDIR
)$(BINDIR
)
118 clean: clean-recursive
121 clean-profiled
: clean-profiled-recursive
124 -include Makefile.lib