From owner-svn-ports-head@freebsd.org Mon Jun 10 01:35:02 2019 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30DF915B05A6; Mon, 10 Jun 2019 01:35:02 +0000 (UTC) (envelope-from yuri@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C87308D4A4; Mon, 10 Jun 2019 01:35:01 +0000 (UTC) (envelope-from yuri@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A108DB477; Mon, 10 Jun 2019 01:35:01 +0000 (UTC) (envelope-from yuri@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5A1Z121051910; Mon, 10 Jun 2019 01:35:01 GMT (envelope-from yuri@FreeBSD.org) Received: (from yuri@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5A1YxQU051890; Mon, 10 Jun 2019 01:34:59 GMT (envelope-from yuri@FreeBSD.org) Message-Id: <201906100134.x5A1YxQU051890@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yuri set sender to yuri@FreeBSD.org using -f From: Yuri Victorovich Date: Mon, 10 Jun 2019 01:34:59 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r503870 - in head/games: . leela-zero leela-zero/files X-SVN-Group: ports-head X-SVN-Commit-Author: yuri X-SVN-Commit-Paths: in head/games: . leela-zero leela-zero/files X-SVN-Commit-Revision: 503870 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C87308D4A4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Jun 2019 01:35:02 -0000 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@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 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} $) +@@ -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. +======================================================================