Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Feb 2017 00:23:05 +0000 (UTC)
From:      Johannes M Dieterich <jmd@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r433780 - in head/devel: . oclgrind oclgrind/files
Message-ID:  <201702100023.v1A0N5Sj047579@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jmd
Date: Fri Feb 10 00:23:05 2017
New Revision: 433780
URL: https://svnweb.freebsd.org/changeset/ports/433780

Log:
  Add oclgrind port. Oclgrind is the OpenCL equivalent of valgrind and useful to debug OpenCL kernels and OpenCL enabled codes.
  
  Reviewed by:	swills (mentor)
  Approved by:	swills (mentor)
  Differential Revision:	https://reviews.freebsd.org/D9467

Added:
  head/devel/oclgrind/
  head/devel/oclgrind/Makefile   (contents, props changed)
  head/devel/oclgrind/distinfo   (contents, props changed)
  head/devel/oclgrind/files/
  head/devel/oclgrind/files/patch-CMakeLists.txt   (contents, props changed)
  head/devel/oclgrind/files/patch-src_runtime_oclgrind.cpp   (contents, props changed)
  head/devel/oclgrind/pkg-descr   (contents, props changed)
  head/devel/oclgrind/pkg-plist   (contents, props changed)
Modified:
  head/devel/Makefile

Modified: head/devel/Makefile
==============================================================================
--- head/devel/Makefile	Fri Feb 10 00:13:51 2017	(r433779)
+++ head/devel/Makefile	Fri Feb 10 00:23:05 2017	(r433780)
@@ -1702,6 +1702,7 @@
     SUBDIR += ocaml-xstr
     SUBDIR += ocaml-xstrp4
     SUBDIR += ocl-icd
+    SUBDIR += oclgrind
     SUBDIR += ode
     SUBDIR += ois
     SUBDIR += okteta

Added: head/devel/oclgrind/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/oclgrind/Makefile	Fri Feb 10 00:23:05 2017	(r433780)
@@ -0,0 +1,32 @@
+# Created by: Johannes Dieterich <jmd@freebsd.org>
+# $FreeBSD$
+
+PORTNAME=	oclgrind
+PORTVERSION=	20170122
+DISTVERSIONPREFIX=	v
+CATEGORIES=	devel
+
+MAINTAINER=	jmd@freebsd.org
+COMMENT=	SPIR interpreter and virtual OpenCL device simulator
+
+LICENSE=	BSD3CLAUSE
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+BUILD_DEPENDS=	opencl>=0:devel/opencl \
+		llvm-config40:devel/llvm40
+LIB_DEPENDS=	libOpenCL.so:devel/ocl-icd
+RUN_DEPENDS=	opencl>=0:devel/opencl
+
+BROKEN_FreeBSD_10=	oclgrind is only supported on FreeBSD 11.0 and newer, crashes LLVM 3.4
+
+USE_GITHUB=	yes
+GH_ACCOUNT=	jrprice
+GH_PROJECT=	Oclgrind
+GH_TAGNAME=	b777367
+
+USE_LDCONFIG=	yes
+USES=		cmake
+
+CMAKE_ARGS+=	-DLLVM_DIR=${LOCALBASE}/llvm40/share/llvm/cmake
+
+.include <bsd.port.mk>

Added: head/devel/oclgrind/distinfo
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/oclgrind/distinfo	Fri Feb 10 00:23:05 2017	(r433780)
@@ -0,0 +1,3 @@
+TIMESTAMP = 1486354287
+SHA256 (jrprice-Oclgrind-v20170122-b777367_GH0.tar.gz) = 0c72e1d82498bc3659990c8c3b5cd43fdf8a00f812c5a7dc8aa735f86c31a320
+SIZE (jrprice-Oclgrind-v20170122-b777367_GH0.tar.gz) = 192908

Added: head/devel/oclgrind/files/patch-CMakeLists.txt
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/oclgrind/files/patch-CMakeLists.txt	Fri Feb 10 00:23:05 2017	(r433780)
@@ -0,0 +1,11 @@
+--- CMakeLists.txt.orig	2017-01-22 12:14:21 UTC
++++ CMakeLists.txt
+@@ -151,7 +151,7 @@ endif()
+ # Check for library directory suffixes
+ set(_LIBDIR_SUFFIX "")
+ get_property(USING_LIB64 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS)
+-if (USING_LIB64 AND NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
++if (USING_LIB64 AND NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin" AND NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD")
+   set(_LIBDIR_SUFFIX "64")
+ endif()
+ set(LIBDIR_SUFFIX "${_LIBDIR_SUFFIX}"

Added: head/devel/oclgrind/files/patch-src_runtime_oclgrind.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/oclgrind/files/patch-src_runtime_oclgrind.cpp	Fri Feb 10 00:23:05 2017	(r433780)
@@ -0,0 +1,13 @@
+--- src/runtime/oclgrind.cpp.orig       2017-01-22 12:14:21 UTC
++++ src/runtime/oclgrind.cpp
+@@ -364,6 +364,10 @@ static string getLibDirPath()
+ #if defined(__APPLE__)
+   uint32_t sz = PATH_MAX;
+   if (_NSGetExecutablePath(exepath, &sz))
++#elif defined(__FreeBSD__)
++  char temp[PATH_MAX];
++  snprintf(temp, sizeof(temp), "/proc/%d/file", getpid());
++  if (readlink(temp, exepath, PATH_MAX) == -1)
+ #else // not apple
+   if (readlink("/proc/self/exe", exepath, PATH_MAX) == -1)
+ #endif

Added: head/devel/oclgrind/pkg-descr
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/oclgrind/pkg-descr	Fri Feb 10 00:23:05 2017	(r433780)
@@ -0,0 +1,12 @@
+Oclgrind
+
+SPIR interpreter and virtual OpenCL device simulator
+
+Oclgrind implements a virtual OpenCL device simulator, including an OpenCL 
+runtime with ICD support. The goal is to provide a platform for creating tools 
+to aid OpenCL development. In particular, this project currently implements 
+utilities for debugging memory access errors, detecting data-races and barrier 
+divergence, collecting instruction histograms, and for interactive OpenCL 
+kernel debugging. The simulator is built on an interpreter for LLVM IR.
+
+WWW: https://github.com/jrprice/Oclgrind

Added: head/devel/oclgrind/pkg-plist
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/oclgrind/pkg-plist	Fri Feb 10 00:23:05 2017	(r433780)
@@ -0,0 +1,19 @@
+bin/oclgrind
+bin/oclgrind-kernel
+include/oclgrind/Context.h
+include/oclgrind/Kernel.h
+include/oclgrind/KernelInvocation.h
+include/oclgrind/Memory.h
+include/oclgrind/Plugin.h
+include/oclgrind/Program.h
+include/oclgrind/Queue.h
+include/oclgrind/WorkGroup.h
+include/oclgrind/WorkItem.h
+include/oclgrind/clc.h
+include/oclgrind/clc32.pch
+include/oclgrind/clc64.pch
+include/oclgrind/common.h
+include/oclgrind/half.h
+lib/liboclgrind-rt-icd.so
+lib/liboclgrind-rt.so
+lib/liboclgrind.so



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201702100023.v1A0N5Sj047579>