From owner-svn-ports-head@freebsd.org Fri May 12 17:08:28 2017 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84A6CD69866; Fri, 12 May 2017 17:08:28 +0000 (UTC) (envelope-from rezny@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 mx1.freebsd.org (Postfix) with ESMTPS id 5021B1B61; Fri, 12 May 2017 17:08:28 +0000 (UTC) (envelope-from rezny@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4CH8Ro5031944; Fri, 12 May 2017 17:08:27 GMT (envelope-from rezny@FreeBSD.org) Received: (from rezny@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4CH8Qtv031936; Fri, 12 May 2017 17:08:26 GMT (envelope-from rezny@FreeBSD.org) Message-Id: <201705121708.v4CH8Qtv031936@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rezny set sender to rezny@FreeBSD.org using -f From: Matthew Rezny Date: Fri, 12 May 2017 17:08:26 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r440691 - in head/lang/pocl: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.23 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: Fri, 12 May 2017 17:08:28 -0000 Author: rezny Date: Fri May 12 17:08:26 2017 New Revision: 440691 URL: https://svnweb.freebsd.org/changeset/ports/440691 Log: Update to 0.14 and switch to llvm40 by default PR: 218332 Reviewed by: jbeich Approved by: swills (mentor), maintainer (timeout) Differential Revision: https://reviews.freebsd.org/D10508 Added: head/lang/pocl/files/patch-CMakeLists.txt (contents, props changed) head/lang/pocl/files/patch-config.h.in.cmake (contents, props changed) head/lang/pocl/files/patch-lib_CL_pocl__binary.c (contents, props changed) head/lang/pocl/files/patch-tests_regression_test__issue__445.cpp (contents, props changed) Deleted: head/lang/pocl/files/patch-Makefile.in head/lang/pocl/files/patch-scripts_Makefile.in Modified: head/lang/pocl/Makefile head/lang/pocl/distinfo head/lang/pocl/files/patch-lib_CL_devices_cpuinfo.c head/lang/pocl/pkg-plist Modified: head/lang/pocl/Makefile ============================================================================== --- head/lang/pocl/Makefile Fri May 12 17:04:06 2017 (r440690) +++ head/lang/pocl/Makefile Fri May 12 17:08:26 2017 (r440691) @@ -1,8 +1,7 @@ # $FreeBSD$ PORTNAME= pocl -PORTVERSION= 0.13 -PORTREVISION= 1 +PORTVERSION= 0.14 CATEGORIES= lang MASTER_SITES= SF/pocl \ http://portablecl.org/downloads/ @@ -10,7 +9,7 @@ MASTER_SITES= SF/pocl \ MAINTAINER= ohartman@zedat.fu-berlin.de COMMENT= POrtable Computing Language (POCL) -LICENSE= GPLv3 +LICENSE= MIT LICENSE_FILE= ${WRKSRC}/LICENSE BUILD_DEPENDS= llvm${LLVM_VERSION}>=0:devel/llvm${LLVM_VERSION} \ @@ -20,46 +19,28 @@ LIB_DEPENDS= libhwloc.so:devel/hwloc \ libltdl.so:devel/libltdl RUN_DEPENDS= llvm${LLVM_VERSION}>=0:devel/llvm${LLVM_VERSION} -CONFLICTS= freeocl[0-9]* - BROKEN_FreeBSD_10= pocl is not supported on 10.x -ONLY_FOR_ARCHS= amd64 -ONLY_FOR_ARCHS_REASON_amd64= only tested on amd64 +ONLY_FOR_ARCHS= i386 amd64 +ONLY_FOR_ARCHS_REASON= only tested on x86 -LLVM_VERSION= 38 +LLVM_VERSION= ${MESA_LLVM_VER:U40} -GNU_CONFIGURE= yes USE_LDCONFIG= yes -USE_GL= yes -USES= gmake localbase ncurses pathfix pkgconfig libtool:keepla - -INSTALL_TARGET= install-strip - -MAKE_ARGS+= PKGCONFIGDIR=${PREFIX}/libdata/pkgconfig - -CONFIGURE_ENV= LLVM_CONFIG="${LOCALBASE}/llvm${LLVM_VERSION}/bin/llvm-config" \ - CLANGXX_FLAGS=-std=gnu++11 -# needed for the libltdl configure check -LDFLAGS+= -L${LOCALBASE}/lib -PLIST_SUB= OPSYS=${OPSYS:tl} ARCH=${ARCH} - -ALL_TARGET= all - -OCL_ICD_VENDORS?= ${PREFIX}/etc/OpenCL/vendors - -OPTIONS_DEFINE= DEBUG - -OPTIONS_GROUP= TEST -OPTIONS_GROUP_TEST= OCLBOOK - -OCLBOOK_DESC= Tests from the OpenCL book -DEBUG_DESC= Debug build of pocl - -OCLBOOK_CONFIGURE_ENABLE= enable_testsuites="opencl-book-samples,cloverleaf,opencl_book_samples,halide,vexcl" -OCLBOOK_ALL_TARGET= check +USE_CXXSTD= gnu++11 +USES= cmake localbase:ldflags ncurses pkgconfig -DEBUG_CONFIGURE_ENABLE= debug +CMAKE_ARGS= -DWITH_LLVM_CONFIG="${LOCALBASE}/llvm${LLVM_VERSION}/bin/llvm-config" \ + -DPOCL_INSTALL_PKGCONFIG_DIR="${PREFIX}/libdata/pkgconfig" \ + -DKERNELLIB_HOST_CPU_VARIANTS="distro" +PLIST_SUB= OPSYS=${OPSYS:tl} ARCH=${ARCH:S/amd64/x86_64/} + +OPTIONS_DEFINE= TEST + +TEST_DESC= Tests from the OpenCL book +TEST_CMAKE_OFF= -DENABLE_TESTSUITES="" +TEST_CMAKE_ON= -DENABLE_TESTSUITES="all" +TEST_TARGET= test -TEST_TARGET= check +pre-install-TEST-on: do-test .include Modified: head/lang/pocl/distinfo ============================================================================== --- head/lang/pocl/distinfo Fri May 12 17:04:06 2017 (r440690) +++ head/lang/pocl/distinfo Fri May 12 17:08:26 2017 (r440691) @@ -1,3 +1,3 @@ -TIMESTAMP = 1479738879 -SHA256 (pocl-0.13.tar.gz) = a17f37d8f26819c0c8efc6de2b57f67a0c8a81514fc9cd5005434e49d67499f9 -SIZE (pocl-0.13.tar.gz) = 1901208 +TIMESTAMP = 1491868935 +SHA256 (pocl-0.14.tar.gz) = 2127bf925a91fbbe3daf2f1bac0da5c8aceb16e2a9434977a3057eade974106a +SIZE (pocl-0.14.tar.gz) = 1231630 Added: head/lang/pocl/files/patch-CMakeLists.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lang/pocl/files/patch-CMakeLists.txt Fri May 12 17:08:26 2017 (r440691) @@ -0,0 +1,21 @@ +--- CMakeLists.txt.orig 2017-04-05 14:15:40 UTC ++++ CMakeLists.txt +@@ -70,7 +70,7 @@ elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "a + set(ARMV6 1) + elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64") + set(ARM64 1) +-elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "(i.86|AMD64|x86_64)") ++elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "(i.86|amd64|AMD64|x86_64)") + if(POCL_DEVICE_ADDRESS_BITS MATCHES "32") + set(I386 1) + else() +@@ -318,6 +318,9 @@ include(CheckFunctionExists) + check_function_exists(fork HAVE_FORK) + check_function_exists(vfork HAVE_VFORK) + ++include(CheckIncludeFiles) ++check_include_files("sys/types.h;sys/sysctl.h" HAVE_SYSCTL_H) ++ + ###################################################################################### + + if(NOT DEFINED DEFAULT_USE_VECMATHLIB) Added: head/lang/pocl/files/patch-config.h.in.cmake ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lang/pocl/files/patch-config.h.in.cmake Fri May 12 17:08:26 2017 (r440691) @@ -0,0 +1,11 @@ +--- config.h.in.cmake.orig 2017-04-05 14:15:40 UTC ++++ config.h.in.cmake +@@ -44,6 +44,8 @@ + + #cmakedefine HAVE_VFORK + ++#cmakedefine HAVE_SYSCTL_H ++ + #cmakedefine HAVE_CLOCK_GETTIME + + #cmakedefine HAVE_LTTNG_UST Modified: head/lang/pocl/files/patch-lib_CL_devices_cpuinfo.c ============================================================================== --- head/lang/pocl/files/patch-lib_CL_devices_cpuinfo.c Fri May 12 17:04:06 2017 (r440690) +++ head/lang/pocl/files/patch-lib_CL_devices_cpuinfo.c Fri May 12 17:08:26 2017 (r440691) @@ -1,90 +1,121 @@ ---- lib/CL/devices/cpuinfo.c.orig 2016-11-20 11:31:19.521203000 +0100 -+++ lib/CL/devices/cpuinfo.c 2016-11-20 11:29:24.502817000 +0100 -@@ -31,9 +31,13 @@ - # include "vccompat.hpp" - #endif - -+#include -+#include -+ +--- lib/CL/devices/cpuinfo.c.orig 2017-04-05 14:15:40 UTC ++++ lib/CL/devices/cpuinfo.c +@@ -34,6 +34,12 @@ #include "config.h" #include "cpuinfo.h" -+#if 0 - const char* cpuinfo = "/proc/cpuinfo"; ++#ifdef HAVE_SYSCTL_H ++# include ++# include ++#endif ++ ++#ifdef __linux__ + static const char* cpuinfo = "/proc/cpuinfo"; #define MAX_CPUINFO_SIZE 64*1024 //#define DEBUG_POCL_CPUINFO -@@ -152,8 +156,29 @@ pocl_cpuinfo_detect_max_clock_frequency( +@@ -153,8 +159,51 @@ pocl_cpuinfo_detect_max_clock_frequency( } return -1; } -+#endif -+ ++#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) +/** -+ * Detects the number of parallel hardware threads supported by -+ * the CPU. ++ * Detects the maximum clock frequency of the CPU. + * -+ * @return The number of hardware threads. ++ * Assumes all cores have the same max clock freq. ++ * ++ * @return The clock frequency in MHz. ++ */ ++int ++pocl_cpuinfo_detect_max_clock_frequency() ++{ ++ const char mib1[] = "dev.cpu.0.freq_levels"; ++ const char mib2[] = "hw.clockrate"; ++ int clockrate = 0; ++ size_t size = 0; ++ char *value = NULL; + ++ if (!sysctlbyname(mib1, NULL, &size, NULL, 0) && ++ (value = (char*)malloc(++size)) && ++ !sysctlbyname(mib1, (void*)value, &size, NULL, 0)) ++ { ++ value[size] = '\0'; ++ sscanf(value, "%d/%*d", &clockrate); ++ } ++ else ++ { ++ size = sizeof(clockrate); ++ sysctlbyname(mib2, (void*)&clockrate, &size, NULL, 0); ++ } ++ if (value) ++ free(value); ++ return clockrate; ++} ++#else ++/** ++ * Unimplemented for other platforms. + */ + int -+pocl_cpuinfo_detect_compute_unit_count() ++pocl_cpuinfo_detect_max_clock_frequency() +{ -+ int mib[2], nocpus; -+ size_t len; - -+ mib[0] = CTL_HW; -+ mib[1] = HW_NCPU; -+ len = sizeof(nocpus); -+ sysctl(mib, 2, &nocpus, &len, NULL, 0); - -+ return nocpus; ++ return 0; +} -+ -+#if 0 ++#endif + ++#ifdef __linux__ /** * Detects the number of parallel hardware threads supported by * the CPU by parsing the cpuinfo. -@@ -231,6 +256,27 @@ pocl_cpuinfo_detect_compute_unit_count() +@@ -232,6 +281,19 @@ pocl_cpuinfo_detect_compute_unit_count() } return -1; } -+#endif -+ ++#else +/** -+ * Detects the maximum clock frequency of the CPU. -+ * -+ * Assumes all cores have the same max clock freq. ++ * Detects the number of parallel hardware threads supported by ++ * the CPU. + * -+ * @return The clock frequency in MHz. ++ * @return The number of hardware threads. + */ -+int -+pocl_cpuinfo_detect_max_clock_frequency() ++ int ++pocl_cpuinfo_detect_compute_unit_count() +{ -+ //XXX PLEASE NOTE, THIS IS NOT TOO PORTABLE (AND/OR ACCURATE)! -+ const char mib[] = "hw.clockrate"; -+ size_t size = sizeof(int); -+ int clockrate; -+ -+ sysctlbyname(mib, (void *)&clockrate, &size, NULL, 0); -+ -+ return clockrate; -+ } ++ return sysconf(_SC_NPROCESSORS_ONLN); ++} ++#endif #ifdef POCL_ANDROID -@@ -269,6 +315,7 @@ pocl_cpuinfo_get_cpu_name_and_vendor(cl_ +@@ -270,6 +332,7 @@ pocl_cpuinfo_get_cpu_name_and_vendor(cl_ * short_name is in the .data anyways.*/ device->long_name = device->short_name; -+#if 0 ++#ifdef __linux__ /* default vendor and vendor_id, in case it cannot be found by other means */ device->vendor = cpuvendor_default; if (device->vendor_id == 0) -@@ -317,6 +364,7 @@ pocl_cpuinfo_get_cpu_name_and_vendor(cl_ +@@ -318,7 +381,25 @@ pocl_cpuinfo_get_cpu_name_and_vendor(cl_ char *new_name = (char*)malloc (len); snprintf (new_name, len, "%s-%s", device->short_name, start); device->long_name = new_name; -+#endif ++#elif defined(HAVE_SYSCTL_H) ++ int mib[2]; ++ size_t len = 0; ++ char *model; ++ mib[0] = CTL_HW; ++ mib[1] = HW_MODEL; ++ if (sysctl(mib, 2, NULL, &len, NULL, 0)) ++ return; ++ if (!(model = (char*)malloc(++len))) ++ return; ++ if (sysctl(mib, 2, (void*)model, &len, NULL, 0)) ++ free(model); ++ else ++ { ++ model[len] = '\0'; ++ device->long_name = model; ++ } ++#endif } + void Added: head/lang/pocl/files/patch-lib_CL_pocl__binary.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lang/pocl/files/patch-lib_CL_pocl__binary.c Fri May 12 17:08:26 2017 (r440691) @@ -0,0 +1,11 @@ +--- lib/CL/pocl_binary.c.orig 2017-04-05 14:15:40 UTC ++++ lib/CL/pocl_binary.c +@@ -36,7 +36,7 @@ + #include + + #ifndef __APPLE__ +- #include ++ #include + #else + #include + #define htole16(x) OSSwapHostToLittleInt16(x) Added: head/lang/pocl/files/patch-tests_regression_test__issue__445.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lang/pocl/files/patch-tests_regression_test__issue__445.cpp Fri May 12 17:08:26 2017 (r440691) @@ -0,0 +1,11 @@ +--- tests/regression/test_issue_445.cpp.orig 2017-04-05 14:15:40 UTC ++++ tests/regression/test_issue_445.cpp +@@ -29,7 +29,7 @@ private_local_array(__global int *__rest + } + )CLC"; + +-int main(int, char *) ++int main(int, char **) + { + try { + int N = 9; Modified: head/lang/pocl/pkg-plist ============================================================================== --- head/lang/pocl/pkg-plist Fri May 12 17:04:06 2017 (r440690) +++ head/lang/pocl/pkg-plist Fri May 12 17:08:26 2017 (r440691) @@ -1,27 +1,25 @@ -bin/pocl-standalone +bin/poclcc etc/OpenCL/vendors/pocl.icd include/poclu.h -lib/libpocl.a -lib/libpocl.la lib/libpocl.so lib/libpocl.so.1 -lib/libpocl.so.1.6.0 -lib/libpoclu.a -lib/libpoclu.la +lib/libpocl.so.1.7.0 lib/libpoclu.so lib/libpoclu.so.1 -lib/libpoclu.so.1.6.0 -lib/pocl/llvmopencl.a -lib/pocl/llvmopencl.la -lib/pocl/llvmopencl.so -lib/pocl/llvmopencl.so.7 -lib/pocl/llvmopencl.so.7.0.0 +lib/libpoclu.so.1.7.0 +lib/pocl/libllvmopencl.so libdata/pkgconfig/pocl.pc +%%DATADIR%%/include/_enable_all_exts.h %%DATADIR%%/include/_kernel.h %%DATADIR%%/include/_kernel_c.h %%DATADIR%%/include/_kernel_constants.h %%DATADIR%%/include/pocl.h %%DATADIR%%/include/pocl_device.h -%%DATADIR%%/include/pocl_tests.h %%DATADIR%%/include/pocl_types.h -%%DATADIR%%/kernel-%%ARCH%%-portbld-%%OPSYS%%%%OSREL%%.bc +%%DATADIR%%/kernel-%%ARCH%%-unknown-%%OPSYS%%%%OSREL%%-avx.bc +%%DATADIR%%/kernel-%%ARCH%%-unknown-%%OPSYS%%%%OSREL%%-avx2.bc +%%DATADIR%%/kernel-%%ARCH%%-unknown-%%OPSYS%%%%OSREL%%-avx512.bc +%%DATADIR%%/kernel-%%ARCH%%-unknown-%%OPSYS%%%%OSREL%%-avx_fma4.bc +%%DATADIR%%/kernel-%%ARCH%%-unknown-%%OPSYS%%%%OSREL%%-sse2.bc +%%DATADIR%%/kernel-%%ARCH%%-unknown-%%OPSYS%%%%OSREL%%-sse41.bc +%%DATADIR%%/kernel-%%ARCH%%-unknown-%%OPSYS%%%%OSREL%%-ssse3.bc