svn commit: r503870 - in head/games: . leela-zero leela-zero/files
Yuri Victorovich
yuri at FreeBSD.org
Mon Jun 10 01:35:02 UTC 2019
Author: yuri
Date: Mon Jun 10 01:34:59 2019
New Revision: 503870
URL: https://svnweb.freebsd.org/changeset/ports/503870
Log:
New port: games/leela-zero: Go engine without human-provided knowledge based on AlphaGo Zero paper
Added:
head/games/leela-zero/
head/games/leela-zero/Makefile (contents, props changed)
head/games/leela-zero/distinfo (contents, props changed)
head/games/leela-zero/files/
head/games/leela-zero/files/patch-CMakeLists.txt (contents, props changed)
head/games/leela-zero/files/patch-src_Network.cpp (contents, props changed)
head/games/leela-zero/pkg-descr (contents, props changed)
head/games/leela-zero/pkg-message (contents, props changed)
Modified:
head/games/Makefile
Modified: head/games/Makefile
==============================================================================
--- head/games/Makefile Mon Jun 10 01:25:07 2019 (r503869)
+++ head/games/Makefile Mon Jun 10 01:34:59 2019 (r503870)
@@ -501,6 +501,7 @@
SUBDIR += lbreakout
SUBDIR += lbreakout2
SUBDIR += ldmud
+ SUBDIR += leela-zero
SUBDIR += legend-of-edgar
SUBDIR += legends
SUBDIR += legesmotus
Added: head/games/leela-zero/Makefile
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/games/leela-zero/Makefile Mon Jun 10 01:34:59 2019 (r503870)
@@ -0,0 +1,35 @@
+# $FreeBSD$
+
+PORTNAME= leela-zero
+DISTVERSIONPREFIX= v
+DISTVERSION= 0.17
+CATEGORIES= games
+
+MAINTAINER= yuri at FreeBSD.org
+COMMENT= Go engine without human-provided knowledge based on AlphaGo Zero paper
+
+LICENSE= GPLv2
+LICENSE_FILE= ${WRKSRC}/COPYING
+
+BUILD_DEPENDS= cblas>0:math/cblas \
+ opencl>0:devel/opencl
+LIB_DEPENDS= libboost_filesystem.so:devel/boost-libs \
+ libopenblas.so:math/openblas \
+ libOpenCL.so:devel/ocl-icd
+
+USES= cmake compiler:c++14-lang eigen:3 localbase qt:5
+USE_GITHUB= yes
+GH_TUPLE= google:googletest:cafa9e5:gtest/gtest
+USE_QT= core widgets buildtools_build qmake_build
+
+CMAKE_ON= USE_BLAS BUILD_TESTING
+CMAKE_ARGS= -DBLAS_INCLUDE_DIRS:STRING=${LOCALBASE}/include
+
+PLIST_FILES= bin/autogtp \
+ bin/leelaz \
+ bin/validation
+
+do-test:
+ @cd ${WRKSRC} && ${MKDIR} .build && ${CP} ../.build/tests .build && cd .build && ./tests
+
+.include <bsd.port.mk>
Added: head/games/leela-zero/distinfo
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/games/leela-zero/distinfo Mon Jun 10 01:34:59 2019 (r503870)
@@ -0,0 +1,5 @@
+TIMESTAMP = 1560127103
+SHA256 (leela-zero-leela-zero-v0.17_GH0.tar.gz) = fc2cc2ae9739aeab058dfceee8e4e67fdcfc0f7bfe2777e565a2ba17a5579267
+SIZE (leela-zero-leela-zero-v0.17_GH0.tar.gz) = 1740219
+SHA256 (google-googletest-cafa9e5_GH0.tar.gz) = de929d57b8da874976473421fe562eb33764c836228c58e6ed5695900e06b640
+SIZE (google-googletest-cafa9e5_GH0.tar.gz) = 970184
Added: head/games/leela-zero/files/patch-CMakeLists.txt
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/games/leela-zero/files/patch-CMakeLists.txt Mon Jun 10 01:34:59 2019 (r503870)
@@ -0,0 +1,36 @@
+--- CMakeLists.txt.orig 2019-04-04 06:38:39 UTC
++++ CMakeLists.txt
+@@ -20,6 +20,8 @@ include(GNUInstallDirs)
+ project(leelaz)
+ add_subdirectory(gtest EXCLUDE_FROM_ALL) # We don't want to install gtest, exclude it from `all`
+
++link_directories(${CMAKE_INSTALL_PREFIX}/lib)
++
+ # Required Packages
+ set(Boost_MIN_VERSION "1.58.0")
+ set(Boost_USE_MULTITHREADED ON)
+@@ -86,7 +88,7 @@ if(USE_HALF)
+ add_definitions(-DUSE_HALF)
+ endif()
+
+-set(IncludePath "${CMAKE_CURRENT_SOURCE_DIR}/src" "${CMAKE_CURRENT_SOURCE_DIR}/src/Eigen")
++set(IncludePath "${CMAKE_CURRENT_SOURCE_DIR}/src" "${CMAKE_INSTALL_PREFIX}/include/eigen3")
+ set(SrcPath "${CMAKE_CURRENT_SOURCE_DIR}/src")
+
+ include_directories(${IncludePath})
+@@ -130,6 +132,7 @@ else()
+ endif()
+
+ # Google Test below
++if (BUILD_TESTING)
+ file(GLOB tests_SRC "${SrcPath}/tests/*.cpp")
+
+ add_executable(tests ${tests_SRC} $<TARGET_OBJECTS:objs>)
+@@ -142,6 +145,7 @@ target_link_libraries(tests ${BLAS_LIBRARIES})
+ target_link_libraries(tests ${OpenCL_LIBRARIES})
+ target_link_libraries(tests ${ZLIB_LIBRARIES})
+ target_link_libraries(tests gtest_main ${CMAKE_THREAD_LIBS_INIT})
++endif(BUILD_TESTING)
+
+ include(GetGitRevisionDescription)
+ git_describe(VERSION --tags)
Added: head/games/leela-zero/files/patch-src_Network.cpp
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/games/leela-zero/files/patch-src_Network.cpp Mon Jun 10 01:34:59 2019 (r503870)
@@ -0,0 +1,11 @@
+--- src/Network.cpp.orig 2019-06-09 23:58:33 UTC
++++ src/Network.cpp
+@@ -475,7 +475,7 @@ void Network::select_precision(int channels) {
+
+ void Network::initialize(int playouts, const std::string & weightsfile) {
+ #ifdef USE_BLAS
+-#ifndef __APPLE__
++#if !defined(__APPLE__) && !defined(__FreeBSD__)
+ #ifdef USE_OPENBLAS
+ openblas_set_num_threads(1);
+ myprintf("BLAS Core: %s\n", openblas_get_corename());
Added: head/games/leela-zero/pkg-descr
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/games/leela-zero/pkg-descr Mon Jun 10 01:34:59 2019 (r503870)
@@ -0,0 +1,8 @@
+A Go program with no human provided knowledge. Using MCTS (but without Monte
+Carlo playouts) and a deep residual convolutional neural network stack.
+
+This is a fairly faithful reimplementation of the system described in the Alpha
+Go Zero paper "Mastering the Game of Go without Human Knowledge". For all
+intents and purposes, it is an open source AlphaGo Zero.
+
+WWW: https://github.com/leela-zero/leela-zero
Added: head/games/leela-zero/pkg-message
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/games/leela-zero/pkg-message Mon Jun 10 01:34:59 2019 (r503870)
@@ -0,0 +1,15 @@
+======================================================================
+You installed leela-zero: the Go engine.
+
+You need at least one OpenCL provider installed in order for leela-zero
+to run.
+
+To see the list of OpenCL providers, install the 'clinfo' package and run:
+$ clinfo
+
+If 'clinfo' shows zero providers, you need to install some providers,
+for example:
+* pocl: for a simple CPU provider
+* beignet: for the Intel GPU provider
+* etc.
+======================================================================
More information about the svn-ports-all
mailing list