]> git.sesse.net Git - stockfish/blobdiff - src/Makefile
Use THREAD_MAX instead of hardcoded 8
[stockfish] / src / Makefile
index 5fa29c0a01a35226c421de301a134210be264c1d..d5a72b66f5a5a829c98ca7270687e26a1a906c06 100644 (file)
@@ -25,8 +25,11 @@ EXE = stockfish
 ### ==========================================================================
 ### Compiler speed switches for both GCC and ICC. These settings are generally
 ### fast on a broad range of systems, but may be changed experimentally
+###
+### NOTE: Some versions of gcc miscompile value.h with -O2 or -O3, this is the
+### safe setup, try changing to -O3 or -O2 and verify it works for you.
 ### ==========================================================================
-GCCFLAGS = -O3 -msse
+GCCFLAGS = -O1 -msse
 ICCFLAGS = -fast -msse
 ICCFLAGS-OSX = -fast -mdynamic-no-pic
 
@@ -40,11 +43,11 @@ ICCFLAGS-OSX += -DNDEBUG
 
 
 ### ==========================================================================
-### Enable/disable compile for a big-endian CPU, disabled by default
+### Remove below comments to compile for a big-endian machine
 ### ==========================================================================
-GCCFLAGS += -DNBIGENDIAN
-ICCFLAGS += -DNBIGENDIAN
-ICCFLAGS-OSX += -DNBIGENDIAN
+#GCCFLAGS += -DBIGENDIAN
+#ICCFLAGS += -DBIGENDIAN
+#ICCFLAGS-OSX += -DBIGENDIAN
 
 
 ### ==========================================================================
@@ -82,6 +85,7 @@ help:
        @echo "make                >  Default: Compiler = g++"
        @echo "make icc            >  Compiler = icpc"
        @echo "make icc-profile    >  Compiler = icpc + automatic pgo-build"
+       @echo "make icc-profile-popcnt >  Compiler = icpc + automatic pgo-build + popcnt-support"
        @echo "make osx-ppc32      >  PPC-Mac OS X 32 bit. Compiler = g++"
        @echo "make osx-ppc64      >  PPC-Mac OS X 64 bit. Compiler = g++"
        @echo "make osx-x86        >  x86-Mac OS X 32 bit. Compiler = g++"
@@ -141,6 +145,40 @@ icc-profile:
        $(MAKE) icc-profile-use
        @rm -rf profdir bench.txt
 
+icc-profile-make-with-popcnt:
+       $(MAKE) \
+       CXX='icpc' \
+       CXXFLAGS="$(ICCFLAGS) -DUSE_POPCNT" \
+       CXXFLAGS+='-prof-gen=srcpos -prof_dir ./profdir' \
+       all
+
+icc-profile-use-with-popcnt:
+       $(MAKE) \
+       CXX='icpc' \
+       CXXFLAGS="$(ICCFLAGS) -DUSE_POPCNT" \
+       CXXFLAGS+='-prof_use -prof_dir ./profdir' \
+       all
+
+icc-profile-popcnt:
+       @rm -rf profdir
+       @mkdir profdir
+       @touch *.cpp *.h
+       $(MAKE) icc-profile-make
+       @echo ""
+       @echo "Running benchmark for pgo-build (popcnt disabled)..."
+       @$(PGOBENCH) > /dev/null
+       @touch *.cpp *.h
+       $(MAKE) icc-profile-make-with-popcnt
+       @echo ""
+       @echo "Running benchmark for pgo-build (popcnt enabled)..."
+       @$(PGOBENCH) > /dev/null
+       @echo "Benchmarks finished. Build final executable now ..."
+       @echo ""
+       @touch *.cpp *.h
+       $(MAKE) icc-profile-use-with-popcnt
+       @rm -rf profdir bench.txt
+
+
 osx-ppc32:
        $(MAKE) \
        CXX='g++' \