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 Windows instead of Linux? Please note that the
9 # performance may not be optimal.
10 # (XXX: For now, only the mingw target is supported on Windows.
11 # Patches for others are welcome!)
15 # Do you compile on MacOS/X instead of Linux? Please note that the
16 # performance may not be optimal.
17 # (XXX: We are looking for volunteers contributing support for other
18 # targets, like mingw/Windows.)
22 # By default, Pachi uses low-precision numbers within the game tree to
23 # conserve memory. This can become an issue with playout counts >1M,
24 # e.g. with extremely long thinking times or massive parallelization;
25 # 24 bits of floating_t mantissa become insufficient then.
29 # Enable performance profiling using gprof. Note that this also disables
30 # inlining, which allows more fine-grained profile, but may also distort
35 # Enable performance profiling using google-perftools. This is much
36 # more accurate, fine-grained and nicer than gprof and does not change
37 # the way the actual binary is compiled and runs.
42 # Target directories when running `make install`. Note that this is NOT
43 # quite supported yet - Pachi will work fine, but will always look for
44 # extra data files (such as pattern, joseki or fuseki database) only
45 # in the current directory, bundled database files will not be installed
46 # in a system directory or loaded from there.
50 # Generic compiler options. You probably do not really want to twiddle
52 # (N.B. -ffast-math breaks us; -fomit-frame-pointer is added below
53 # unless PROFILING=gprof.)
54 CUSTOM_CFLAGS
=-Wall
-ggdb3
-O3
-std
=gnu99
-frename-registers
-pthread
-Wsign-compare
-D_GNU_SOURCE
62 LIBS
=-lm
-lws2_32
-lregex
65 SYS_CFLAGS
=-DNO_THREAD_LOCAL
66 LDFLAGS
=-pthread
-rdynamic
69 SYS_CFLAGS
=-march
=native
70 LDFLAGS
=-pthread
-rdynamic
76 CUSTOM_CFLAGS
+=-DDOUBLE
79 ifeq ($(PROFILING
), gprof
)
81 CUSTOM_CFLAGS
+=-pg
-fno-inline
83 # Whee, an extra register!
84 CUSTOM_CFLAGS
+=-fomit-frame-pointer
85 ifeq ($(PROFILING
), perftools
)
99 INSTALL
=/usr
/bin
/install
107 OBJS
=board.o gtp.o move.o ownermap.o pattern3.o pattern.o patternsp.o patternprob.o playout.o probdist.o random.o stone.o timeinfo.o network.o fbook.o chat.o
108 SUBDIRS
=random replay patternscan patternplay joseki montecarlo uct uct
/policy playout tactics t-unit distributed
110 all: all-recursive pachi
112 LOCALLIBS
=random
/random.a replay
/replay.a patternscan
/patternscan.a patternplay
/patternplay.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
113 $(LOCALLIBS
): all-recursive
115 pachi
: $(OBJS
) pachi.o
$(LOCALLIBS
)
118 # Use runtime gcc profiling for extra optimization. This used to be a large
119 # bonus but nowadays, it's rarely worth the trouble.
120 .PHONY
: pachi-profiled
122 @make
clean all XLDFLAGS
=-fprofile-generate XCFLAGS
="-fprofile-generate -fomit-frame-pointer -frename-registers"
123 .
/pachi
-t
=5000 no_tbook
<tools
/genmove19.gtp
124 @make
clean all clean-profiled XLDFLAGS
=-fprofile-use XCFLAGS
="-fprofile-use -fomit-frame-pointer -frename-registers"
128 $(INSTALL
) .
/pachi
$(DESTDIR
)$(BINDIR
)
131 clean: clean-recursive
134 clean-profiled
: clean-profiled-recursive
137 -include Makefile.lib