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 # Compile Pachi with dcnn support ?
23 # You'll need to install Boost and Caffe libraries.
24 # If Caffe is in a custom directory you can set it here.
27 #CAFFE_LIB=/usr/local/lib
29 # By default, Pachi uses low-precision numbers within the game tree to
30 # conserve memory. This can become an issue with playout counts >1M,
31 # e.g. with extremely long thinking times or massive parallelization;
32 # 24 bits of floating_t mantissa become insufficient then.
36 # Enable performance profiling using gprof. Note that this also disables
37 # inlining, which allows more fine-grained profile, but may also distort
42 # Enable performance profiling using google-perftools. This is much
43 # more accurate, fine-grained and nicer than gprof and does not change
44 # the way the actual binary is compiled and runs.
49 # Target directories when running `make install`. Note that this is NOT
50 # quite supported yet - Pachi will work fine, but will always look for
51 # extra data files (such as pattern, joseki or fuseki database) only
52 # in the current directory, bundled database files will not be installed
53 # in a system directory or loaded from there.
57 # Generic compiler options. You probably do not really want to twiddle
59 # (N.B. -ffast-math breaks us; -fomit-frame-pointer is added below
60 # unless PROFILING=gprof.)
61 CUSTOM_CFLAGS?
=-Wall
-ggdb3
-O3
-std
=gnu99
-frename-registers
-pthread
-Wsign-compare
-D_GNU_SOURCE
62 CUSTOM_CXXFLAGS?
=-Wall
-ggdb3
-O3
70 SYS_LIBS?
=-lm
-lws2_32
72 ifdef WIN_HAVE_NO_REGEX_SUPPORT
73 SYS_CFLAGS
+= -DHAVE_NO_REGEX_SUPPORT
80 SYS_CFLAGS?
=-DNO_THREAD_LOCAL
81 SYS_LDFLAGS?
=-pthread
-rdynamic
84 SYS_CFLAGS?
=-march
=native
85 SYS_LDFLAGS?
=-pthread
-rdynamic
86 SYS_LIBS?
=-lm
-lrt
-ldl
91 SYS_LDFLAGS
+=-L
$(CAFFE_LIB
)
96 CUSTOM_CXXFLAGS
+=-DDCNN
97 SYS_LIBS
:=-lcaffe
-lboost_system
-lstdc
++ $(SYS_LIBS
)
101 CUSTOM_CFLAGS
+=-DDOUBLE
104 ifeq ($(PROFILING
), gprof
)
106 CUSTOM_CFLAGS
+=-pg
-fno-inline
108 # Whee, an extra register!
109 CUSTOM_CFLAGS
+=-fomit-frame-pointer
110 ifeq ($(PROFILING
), perftools
)
124 INSTALL
=/usr
/bin
/install
132 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
136 SUBDIRS
=random replay patternscan patternplay joseki montecarlo uct uct
/policy playout tactics t-unit distributed
138 all: all-recursive pachi
140 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
141 $(LOCALLIBS
): all-recursive
143 pachi
: $(OBJS
) pachi.o
$(LOCALLIBS
)
146 # Use runtime gcc profiling for extra optimization. This used to be a large
147 # bonus but nowadays, it's rarely worth the trouble.
148 .PHONY
: pachi-profiled
150 @make
clean all XLDFLAGS
=-fprofile-generate XCFLAGS
="-fprofile-generate -fomit-frame-pointer -frename-registers"
151 .
/pachi
-t
=5000 no_tbook
<tools
/genmove19.gtp
152 @make
clean all clean-profiled XLDFLAGS
=-fprofile-use XCFLAGS
="-fprofile-use -fomit-frame-pointer -frename-registers"
156 $(INSTALL
) .
/pachi
$(DESTDIR
)$(BINDIR
)
159 clean: clean-recursive
162 clean-profiled
: clean-profiled-recursive
165 -include Makefile.lib