From owner-freebsd-ports-bugs@FreeBSD.ORG Sun May 26 00:50:01 2013 Return-Path: Delivered-To: freebsd-ports-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0932CEBC for ; Sun, 26 May 2013 00:50:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id DF3FA14B for ; Sun, 26 May 2013 00:50:00 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id r4Q0o0hE004569 for ; Sun, 26 May 2013 00:50:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.7/8.14.7/Submit) id r4Q0o0ff004567; Sun, 26 May 2013 00:50:00 GMT (envelope-from gnats) Resent-Date: Sun, 26 May 2013 00:50:00 GMT Resent-Message-Id: <201305260050.r4Q0o0ff004567@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, "O. Hartmann" Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 37087D53 for ; Sun, 26 May 2013 00:43:27 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from oldred.FreeBSD.org (oldred.freebsd.org [8.8.178.121]) by mx1.freebsd.org (Postfix) with ESMTP id 283C5122 for ; Sun, 26 May 2013 00:43:27 +0000 (UTC) Received: from oldred.FreeBSD.org ([127.0.1.6]) by oldred.FreeBSD.org (8.14.5/8.14.5) with ESMTP id r4Q0hQPE020906 for ; Sun, 26 May 2013 00:43:26 GMT (envelope-from nobody@oldred.FreeBSD.org) Received: (from nobody@localhost) by oldred.FreeBSD.org (8.14.5/8.14.5/Submit) id r4Q0hQBN020905; Sun, 26 May 2013 00:43:26 GMT (envelope-from nobody) Message-Id: <201305260043.r4Q0hQBN020905@oldred.FreeBSD.org> Date: Sun, 26 May 2013 00:43:26 GMT From: "O. Hartmann" To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: ports/178982: devel/opencl: Update and patch Makefile X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 May 2013 00:50:01 -0000 >Number: 178982 >Category: ports >Synopsis: devel/opencl: Update and patch Makefile >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sun May 26 00:50:00 UTC 2013 >Closed-Date: >Last-Modified: >Originator: O. Hartmann >Release: >Organization: FU Berlin >Environment: >Description: Since Khronos doesn't provide a tarball, patching the headers according to new ports in spe (devel/pocl, devel/opencl-icd, devel/ocl-icd, devel/ocltools) which will require devel/opencl as a dependency needs to be done in a convenient way. - remove CONFLICT pocl* for this port since devel/pocl will require devel/opencl - add a patch provided by POCL patching the Khronos OpenCL 1.2 CL/cl.hpp C++ header file - install and patch source files (headers) in a WRKSRC folder for further treatment (patching) This patch can be postponed until port devel/pocl becomes available through the port system. >How-To-Repeat: >Fix: Patch attached with submission follows: Index: files/patch-cl.hpp =================================================================== --- files/patch-cl.hpp (revision 0) +++ files/patch-cl.hpp (revision 654) @@ -0,0 +1,72 @@ +--- cl.hpp.orig 2013-05-26 02:27:11.000000000 +0200 ++++ cl.hpp 2013-05-26 02:28:08.000000000 +0200 +@@ -212,8 +212,6 @@ + #if defined(linux) || defined(__APPLE__) || defined(__MACOSX) + #include + +-#include +-#include + #endif // linux + + #include +@@ -1035,7 +1033,7 @@ + #endif // !_WIN32 + } + +- inline void fence() { _mm_mfence(); } ++ inline void fence() { __sync_synchronize(); } + }; // namespace detail + + +@@ -1114,23 +1112,7 @@ + template + struct GetInfoHelper > + { +- static cl_int get(Func f, cl_uint name, VECTOR_CLASS* param) +- { +- ::size_t required; +- cl_int err = f(name, 0, NULL, &required); +- if (err != CL_SUCCESS) { +- return err; +- } +- +- cl_device_id* value = (cl_device_id*) alloca(required); +- err = f(name, required, value, NULL); +- if (err != CL_SUCCESS) { +- return err; +- } +- +- param->assign(&value[0], &value[required/sizeof(cl_device_id)]); +- return CL_SUCCESS; +- } ++ static cl_int get(Func f, cl_uint name, VECTOR_CLASS* param); + }; + + // Specialized for getInfo +@@ -1990,6 +1972,26 @@ + #endif // #if defined(CL_VERSION_1_1) + }; + ++template ++cl_int detail::GetInfoHelper >:: ++ get(Func f, cl_uint name, VECTOR_CLASS* param) ++ { ++ ::size_t required; ++ cl_int err = f(name, 0, NULL, &required); ++ if (err != CL_SUCCESS) { ++ return err; ++ } ++ ++ cl_device_id* value = (cl_device_id*) alloca(required); ++ err = f(name, required, value, NULL); ++ if (err != CL_SUCCESS) { ++ return err; ++ } ++ ++ param->assign(&value[0], &value[required/sizeof(cl_device_id)]); ++ return CL_SUCCESS; ++ } ++ + /*! \brief Class interface for cl_platform_id. + * + * \note Copies of these objects are inexpensive, since they don't 'own' Index: Makefile =================================================================== --- Makefile (revision 613) +++ Makefile (working copy) @@ -3,30 +3,38 @@ PORTNAME= opencl PORTVERSION= 1.2 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= devel MASTER_SITES= http://www.khronos.org/registry/cl/api/${PORTVERSION}/ DISTFILES= opencl.h cl_platform.h cl.h cl_ext.h cl_dx9_media_sharing.h \ cl_d3d10.h cl_d3d11.h cl_gl.h cl_gl_ext.h cl.hpp DIST_SUBDIR= ${PORTNAME} EXTRACT_ONLY= +WRKSRC= ${WRKDIR}/${DIST_SUBDIR} MAINTAINER= ohartman@zedat.fu-berlin.de COMMENT= Open Computing Language (OpenCL) specifications V1.2 (header files) -CONFLICTS= opencl-1.[0-1] pocl* +CONFLICTS= opencl-1.[0-1] NO_BUILD= yes NO_WRKSUBDIR= yes -PLIST_DIRS= include/CL +PLIST_DIRS+= include/CL .for f in ${DISTFILES} PLIST_FILES+=include/CL/$f .endfor +pre-patch: + @${MKDIR} ${WRKSRC} +.for f in ${DISTFILES} + @${INSTALL_DATA} ${DISTDIR}/${DIST_SUBDIR}/$f ${WRKSRC}/ +.endfor + do-install: - ${MKDIR} ${PREFIX}/include/CL - ${INSTALL_DATA} ${DISTDIR}/${DIST_SUBDIR}/*.h ${PREFIX}/include/CL - ${INSTALL_DATA} ${DISTDIR}/${DIST_SUBDIR}/*.hpp ${PREFIX}/include/CL + @${MKDIR} ${PREFIX}/include/CL +.for f in ${DISTFILES} + @${INSTALL_DATA} ${DISTDIR}/${DIST_SUBDIR}/$f ${PREFIX}/include/CL +.endfor .include >Release-Note: >Audit-Trail: >Unformatted: