### Executable name. Do not change
EXE = stockfish
+### Installation dir definitions
+PREFIX = /usr/local
+BINDIR = $(PREFIX)/bin
+
### ==========================================================================
### Compiler speed switches for both GCC and ICC. These settings are generally
@echo "make osx-icc64 > x86-Mac OS X 64 bit. Compiler = icpc"
@echo "make osx-icc32-profile > OSX 32 bit. Compiler = icpc + automatic pgo-build"
@echo "make osx-icc64-profile > OSX 64 bit. Compiler = icpc + automatic pgo-build"
+ @echo "make hpux > HP-UX. Compiler = aCC"
@echo "make strip > Strip executable"
@echo "make clean > Clean up"
@echo ""
all: $(EXE) .depend
+test check: default
+ @$(PGOBENCH)
+
clean:
- $(RM) *.o .depend *~ $(EXE)
+ $(RM) *.o .depend *~ $(EXE) core bench.txt
### Possible targets. You may add your own ones here
$(MAKE) osx-icc64-profile-use
@rm -rf profdir bench.txt
+hpux:
+ $(MAKE) \
+ CXX='/opt/aCC/bin/aCC -AA +hpxstd98 -DBIGENDIAN -mt +O3 -DNDEBUG' \
+ CXXFLAGS="" \
+ LDFLAGS="" \
+ all
strip:
$(EXE): $(OBJS)
$(CXX) $(LDFLAGS) -o $@ $(OBJS)
+### Installation
+install: default
+ -mkdir -p -m 755 $(BINDIR)
+ -cp $(EXE) $(BINDIR)
+ -strip $(BINDIR)/$(EXE)
### Dependencies. Do not change
.depend:
- $(CXX) -msse -MM $(OBJS:.o=.cpp) > $@
+ -@$(CXX) -msse -MM $(OBJS:.o=.cpp) > $@ 2> /dev/null
include .depend
/// Book::file_name() returns the file name of the currently active book,
/// or the empty string if no book is open.
-const string Book::file_name() const {
+const string Book::file_name() { // Not const to compile on HP-UX 11.X
return is_open() ? fileName : "";
}
~Book();
void open(const std::string& fName);
void close();
- const std::string file_name() const;
+ const std::string file_name();
Move get_move(const Position& pos);
private:
# include <sys/time.h>
# include <sys/types.h>
# include <unistd.h>
+# if defined(__hpux)
+# include <sys/pstat.h>
+# endif
#else
int cpu_count() {
return Min(sysconf(_SC_NPROCESSORS_ONLN), 8);
}
+# elif defined(__hpux)
+int cpu_count() {
+ struct pst_dynamic psd;
+ if (pstat_getdynamic(&psd, sizeof(psd), (size_t)1, 0) == -1)
+ return 1;
+
+ return Min(psd.psd_proc_cnt, 8);
+}
# else
int cpu_count() {
return 1;
#include <cassert>
#include <cmath>
#include <cstring>
-#include <xmmintrin.h>
+#if !defined(__hpux)
+# include <xmmintrin.h>
+#endif
#include "movegen.h"
#include "tt.h"
/// to be loaded from RAM, that can be very slow. When we will
/// subsequently call retrieve() the TT data will be already
/// quickly accessible in L1/L2 CPU cache.
+#if defined(__hpux)
+void TranspositionTable::prefetch(const Key) const {} // Not supported on HP UX
+#else
void TranspositionTable::prefetch(const Key posKey) const {
#if defined(__INTEL_COMPILER) || defined(__ICL)
- // This hack prevents prefetches to be optimized away by the
+ // This hack prevents prefetches to be optimized away by
// Intel compiler. Both MSVC and gcc seems not affected.
__asm__ ("");
#endif
_mm_prefetch(addr+64, _MM_HINT_T2); // 64 bytes ahead
}
+#endif
/// TranspositionTable::new_search() is called at the beginning of every new
/// search. It increments the "generation" variable, which is used to