View | Details | Raw Unified | Return to bug 271159
Collapse All | Expand All

(-)b/lang/pocl/Makefile (-14 / +12 lines)
Lines 1-11 Link Here
1
PORTNAME=	pocl
1
PORTNAME=	pocl
2
PORTVERSION=	1.8
2
DISTVERSIONPREFIX=	v
3
DISTVERSIONPREFIX=v
3
DISTVERSION=	3.1
4
CATEGORIES=	lang
4
CATEGORIES=	lang
5
5
6
MAINTAINER=	ohartmann@freebsd-de.org
6
MAINTAINER=	ohartmann@walstatt.org
7
COMMENT=	POrtable Computing Language (POCL)
7
COMMENT=	POrtable Computing Language (POCL)
8
WWW=		http://portablecl.org/
8
WWW=	http://portablecl.org/
9
9
10
LICENSE=	MIT
10
LICENSE=	MIT
11
LICENSE_FILE=	${WRKSRC}/LICENSE
11
LICENSE_FILE=	${WRKSRC}/LICENSE
Lines 14-29 ONLY_FOR_ARCHS= aarch64 amd64 i386 powerpc64 powerpc64le Link Here
14
ONLY_FOR_ARCHS_REASON=	only tested on ${ONLY_FOR_ARCHS:tW:S/ /, /g}
14
ONLY_FOR_ARCHS_REASON=	only tested on ${ONLY_FOR_ARCHS:tW:S/ /, /g}
15
BROKEN_i386=	Unable to access file /wrkdirs/usr/ports/lang/pocl/work/stage/usr/local/share/pocl/kernel-i386-portbld-freebsd13.0-avx.bc:No such file or directory
15
BROKEN_i386=	Unable to access file /wrkdirs/usr/ports/lang/pocl/work/stage/usr/local/share/pocl/kernel-i386-portbld-freebsd13.0-avx.bc:No such file or directory
16
16
17
BUILD_DEPENDS=	llvm${LLVM_VERSION}>=10:devel/llvm${LLVM_VERSION} \
17
BUILD_DEPENDS=	llvm${LLVM_VERSION}>=14:devel/llvm${LLVM_VERSION} \
18
		opencl>=2.2:devel/opencl
18
		opencl>=3:devel/opencl
19
LIB_DEPENDS=	libhwloc.so:devel/hwloc2 libOpenCL.so:devel/ocl-icd
19
LIB_DEPENDS=	libhwloc.so:devel/hwloc2 libOpenCL.so:devel/ocl-icd
20
RUN_DEPENDS=	${BUILD_DEPENDS}
21
20
22
USES=		cmake localbase:ldflags ncurses pkgconfig
21
USES=		cmake localbase:ldflags ncurses pkgconfig
23
USE_GITHUB=	yes
22
USE_GITHUB=	yes
24
USE_LDCONFIG=	yes
23
USE_LDCONFIG=	yes
25
24
26
LLVM_VERSION=	${MESA_LLVM_VER:U13}
25
LLVM_VERSION=	${MESA_LLVM_VER:U15}
27
CMAKE_ARGS=	-DWITH_LLVM_CONFIG="${LOCALBASE}/llvm${LLVM_VERSION}/bin/llvm-config" \
26
CMAKE_ARGS=	-DWITH_LLVM_CONFIG="${LOCALBASE}/llvm${LLVM_VERSION}/bin/llvm-config" \
28
		-DPOCL_INSTALL_PKGCONFIG_DIR="${PREFIX}/libdata/pkgconfig" \
27
		-DPOCL_INSTALL_PKGCONFIG_DIR="${PREFIX}/libdata/pkgconfig" \
29
		-DSINGLE_LLVM_LIB=ON \
28
		-DSINGLE_LLVM_LIB=ON \
Lines 38-58 PLIST_SUB= CONFIGURE_TARGET=${CONFIGURE_TARGET:S/amd64/x86_64/} Link Here
38
37
39
OPTIONS_DEFINE=	DOCS
38
OPTIONS_DEFINE=	DOCS
40
39
41
DOCS_DESC=	Build documentation (needs sphinx)
40
DOCS_DESC=	Build documentation (needs textproc/py-sphinx)
42
DOCS_CMAKE_OFF=	-DENABLE_DOCS=OFF
43
DOCS_CMAKE_ON=	-DENABLE_DOCS=ON
41
DOCS_CMAKE_ON=	-DENABLE_DOCS=ON
42
DOCS_CMAKE_OFF=	-DENABLE_DOCS=OFF
44
DOCS_USES=	python:3.6+
43
DOCS_USES=	python:3.6+
45
DOCS_BUILD_DEPENDS=	${PYTHON_PKGNAMEPREFIX}sphinx>=0,1:textproc/py-sphinx@${PY_FLAVOR}
44
DOCS_BUILD_DEPENDS=	${PYTHON_PKGNAMEPREFIX}sphinx>=0:textproc/py-sphinx@${PY_FLAVOR}
46
45
47
.include <bsd.port.options.mk>
46
.include <bsd.port.options.mk>
48
47
49
.if ${ARCH} == aarch64
48
.if ${ARCH} == aarch64
50
PLIST_SUB+=     AARCH64=""
49
PLIST_SUB+=	AARCH64=""
51
PLIST_SUB+=	PPC64="@comment "
50
PLIST_SUB+=	PPC64="@comment "
52
PLIST_SUB+=	PPC64LE="@comment "
51
PLIST_SUB+=	PPC64LE="@comment "
53
PLIST_SUB+=	X86="@comment "
52
PLIST_SUB+=	X86="@comment "
54
.elif ${ARCH} == amd64 || ${ARCH} == i386
53
.elif ${ARCH} == amd64 || ${ARCH} == i386
55
PLIST_SUB+=     AARCH64="@comment "
54
PLIST_SUB+=	AARCH64="@comment "
56
PLIST_SUB+=	PPC64="@comment "
55
PLIST_SUB+=	PPC64="@comment "
57
PLIST_SUB+=	PPC64LE="@comment "
56
PLIST_SUB+=	PPC64LE="@comment "
58
PLIST_SUB+=	X86=""
57
PLIST_SUB+=	X86=""
Lines 67-72 PLIST_SUB+= PPC64="@comment " Link Here
67
PLIST_SUB+=	PPC64LE=""
66
PLIST_SUB+=	PPC64LE=""
68
PLIST_SUB+=	X86="@comment "
67
PLIST_SUB+=	X86="@comment "
69
.endif
68
.endif
70
PLIST_SUB+=	CONFIGURE_TARGET=${CONFIGURE_TARGET:S/amd64/x86_64/}
71
69
72
.include <bsd.port.mk>
70
.include <bsd.port.mk>
(-)b/lang/pocl/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1634367852
1
TIMESTAMP = 1670346593
2
SHA256 (pocl-pocl-v1.8_GH0.tar.gz) = 0f63377ae1826e16e90038fc8e7f65029be4ff6f9b059f6907174b5c0d1f8ab2
2
SHA256 (pocl-pocl-v3.1_GH0.tar.gz) = 82314362552e050aff417318dd623b18cf0f1d0f84f92d10a7e3750dd12d3a9a
3
SIZE (pocl-pocl-v1.8_GH0.tar.gz) = 1614545
3
SIZE (pocl-pocl-v3.1_GH0.tar.gz) = 1928607
(-)b/lang/pocl/files/patch-CMakeLists.txt (-5 / +5 lines)
Lines 1-12 Link Here
1
--- CMakeLists.txt.orig	2020-12-16 13:02:13 UTC
1
--- CMakeLists.txt.orig	2022-06-10 10:09:05 UTC
2
+++ CMakeLists.txt
2
+++ CMakeLists.txt
3
@@ -398,6 +398,9 @@ endif()
3
@@ -394,6 +394,9 @@ find_package(Hwloc)
4
 
4
       set(ENABLE_HWLOC ON CACHE BOOL "Hwloc" FORCE)
5
 
5
   endif()
6
 
6
 
7
+include(CheckIncludeFiles)
7
+include(CheckIncludeFiles)
8
+check_include_files("sys/types.h;sys/sysctl.h" HAVE_SYSCTL_H)
8
+check_include_files("sys/types.h;sys/sysctl.h" HAVE_SYSCTL_H)
9
+
9
+
10
 
10
 
11
 ######################################################################################
11
 include(sanitizers)
12
 
12
 
(-)b/lang/pocl/files/patch-config.h.in.cmake (-2 / +2 lines)
Lines 1-6 Link Here
1
--- config.h.in.cmake.orig	2020-12-16 13:02:13 UTC
1
--- config.h.in.cmake.orig	2022-06-10 10:09:05 UTC
2
+++ config.h.in.cmake
2
+++ config.h.in.cmake
3
@@ -39,6 +39,8 @@
3
@@ -57,6 +57,8 @@
4
 
4
 
5
 #cmakedefine HAVE_VFORK
5
 #cmakedefine HAVE_VFORK
6
 
6
 
(-)b/lang/pocl/files/patch-lib_CL_devices_cpuinfo.c (-8 / +8 lines)
Lines 1-5 Link Here
1
--- lib/CL/devices/cpuinfo.c.orig	2021-10-12 16:33:15.000000000 +0200
1
--- lib/CL/devices/cpuinfo.c.orig	2022-06-10 10:09:05 UTC
2
+++ lib/CL/devices/cpuinfo.c	2021-10-16 09:29:13.414668000 +0200
2
+++ lib/CL/devices/cpuinfo.c
3
@@ -34,6 +34,12 @@
3
@@ -34,6 +34,12 @@
4
 #include "config.h"
4
 #include "config.h"
5
 #include "cpuinfo.h"
5
 #include "cpuinfo.h"
Lines 13-19 Link Here
13
 static const char* cpuinfo = "/proc/cpuinfo";
13
 static const char* cpuinfo = "/proc/cpuinfo";
14
 #define MAX_CPUINFO_SIZE 64*1024
14
 #define MAX_CPUINFO_SIZE 64*1024
15
 //#define DEBUG_POCL_CPUINFO
15
 //#define DEBUG_POCL_CPUINFO
16
@@ -41,9 +47,6 @@
16
@@ -41,9 +47,6 @@ static const char* cpufreq_file="/sys/devices/system/c
17
 //Linux' cpufrec interface
17
 //Linux' cpufrec interface
18
 static const char* cpufreq_file="/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq";
18
 static const char* cpufreq_file="/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq";
19
 
19
 
Lines 23-29 Link Here
23
 /* Strings to parse in /proc/cpuinfo. Else branch is for x86, x86_64 */
23
 /* Strings to parse in /proc/cpuinfo. Else branch is for x86, x86_64 */
24
 #if   defined  __powerpc__
24
 #if   defined  __powerpc__
25
  #define FREQSTRING "clock"
25
  #define FREQSTRING "clock"
26
@@ -156,8 +159,51 @@
26
@@ -156,8 +159,51 @@ pocl_cpuinfo_detect_max_clock_frequency()
27
     } 
27
     } 
28
   return -1;  
28
   return -1;  
29
 }
29
 }
Lines 75-81 Link Here
75
 /**
75
 /**
76
  * Detects the number of parallel hardware threads supported by
76
  * Detects the number of parallel hardware threads supported by
77
  * the CPU by parsing the cpuinfo.
77
  * the CPU by parsing the cpuinfo.
78
@@ -235,6 +281,19 @@
78
@@ -235,6 +281,19 @@ pocl_cpuinfo_detect_compute_unit_count()
79
     } 
79
     } 
80
   return -1;  
80
   return -1;  
81
 }
81
 }
Lines 95-101 Link Here
95
 
95
 
96
 #if __arm__ || __aarch64__
96
 #if __arm__ || __aarch64__
97
 enum
97
 enum
98
@@ -302,6 +361,7 @@
98
@@ -302,6 +361,7 @@ pocl_cpuinfo_get_cpu_name_and_vendor(cl_device_id devi
99
    * short_name is in the .data anyways.*/
99
    * short_name is in the .data anyways.*/
100
   device->long_name = device->short_name;
100
   device->long_name = device->short_name;
101
 
101
 
Lines 103-109 Link Here
103
   /* default vendor and vendor_id, in case it cannot be found by other means */
103
   /* default vendor and vendor_id, in case it cannot be found by other means */
104
   device->vendor = cpuvendor_default;
104
   device->vendor = cpuvendor_default;
105
   if (device->vendor_id == 0)
105
   if (device->vendor_id == 0)
106
@@ -404,7 +464,26 @@
106
@@ -404,7 +464,26 @@ pocl_cpuinfo_get_cpu_name_and_vendor(cl_device_id devi
107
   char *new_name = (char*)malloc (len);
107
   char *new_name = (char*)malloc (len);
108
   snprintf (new_name, len, "%s-%s", device->short_name, start);
108
   snprintf (new_name, len, "%s-%s", device->short_name, start);
109
   device->long_name = new_name;
109
   device->long_name = new_name;
Lines 130-136 Link Here
130
   /* If the vendor_id field is still empty, we should get the PCI ID associated
130
   /* If the vendor_id field is still empty, we should get the PCI ID associated
131
    * with the CPU vendor (if there is one), to be ready for the (currently
131
    * with the CPU vendor (if there is one), to be ready for the (currently
132
    * provisional) OpenCL 3.0 specification that has finally clarified the
132
    * provisional) OpenCL 3.0 specification that has finally clarified the
133
@@ -415,13 +494,23 @@
133
@@ -415,13 +494,23 @@ pocl_cpuinfo_get_cpu_name_and_vendor(cl_device_id devi
134
    */
134
    */
135
   if (!device->vendor_id)
135
   if (!device->vendor_id)
136
     {
136
     {
(-)b/lang/pocl/files/patch-lib_CL_pocl__timing.c (+13 lines)
Added Link Here
1
--- lib/CL/pocl_timing.c.orig	2022-06-10 10:09:05 UTC
2
+++ lib/CL/pocl_timing.c
3
@@ -69,8 +69,8 @@ uint64_t pocl_gettimemono_ns() {
4
   struct timespec timespec;
5
 # ifdef CLOCK_MONOTONIC_RAW /* Linux */
6
   clock_gettime(CLOCK_MONOTONIC_RAW, &timespec);
7
-# elif defined(CLOCK_UPTIME_FAST) /* FreeBSD, DragonFlyBSD, etc */
8
-  clock_gettime(CLOCK_UPTIME_FAST, &timespec);
9
+# elif defined(CLOCK_MONOTONIC_FAST) /* FreeBSD, DragonFlyBSD, etc */
10
+  clock_gettime(CLOCK_MONOTONIC_FAST, &timespec);
11
 # elif defined(CLOCK_MONOTONIC) /* POSIX 2008, NetBSD, etc */
12
   clock_gettime(CLOCK_MONOTONIC, &timespec);
13
 # else /* older POSIX didn't define CLOCK_MONOTONIC */
(-)b/lang/pocl/pkg-descr (-5 / +16 lines)
Lines 1-17 Link Here
1
Portable OpenCL aims to be an efficient open source (MIT-licensed)
1
[
2
implementation of the OpenCL 1.2 standard.
2
{	type: install
3
	message: <<EOM
4
Portable OpenCL (pocl)
5
----------------------
6
7
Portable OpenCL (>= 3.0) aims to be an efficient open source
8
(MIT-licensed) implementation of the OpenCL 2.X standard with
9
adaptions of OpenCL 3.0.
3
10
4
In addition to producing an easily portable open source OpenCL
11
In addition to producing an easily portable open source OpenCL
5
implementation, another major goal of the project is improving
12
implementation, another major goal of the project is improving
6
performance portability of OpenCL programs with compiler
13
performance portability of OpenCL programs with compiler
7
optimizations, reducing the need for target-dependent manual
14
optimizations, reducing the need for target-dependent manual
8
optimizations. At the core of POCL is a set of LLVM passes used
15
optimizations. At the core of pocl is a set of LLVM passes
9
to statically parallelize multiple work-items with the kernel
16
used to statically parallelize multiple work-items with the kernel
10
compiler, even in the presence of work-group barriers. This enables
17
compiler, even in the presence of work-group barriers. This enables
11
parallelization of the fine-grained static concurrency in the work
18
parallelization of the fine-grained static concurrency in the work
12
groups in multiple ways (SIMD, VLIW, superscalar, ...).
19
groups in multiple ways (SIMD, VLIW, superscalar,...).
13
20
14
The code base is modularized to allow easy adding of new "device drivers"
21
The code base is modularized to allow easy adding of new "device drivers"
15
in the host-device layer. A generic multithreaded "target driver" is
22
in the host-device layer. A generic multithreaded "target driver" is
16
included. It allows running OpenCL applications on a host that supports
23
included. It allows running OpenCL applications on a host that supports
17
the pthread library with multithreading at the work group granularity.
24
the pthread library with multithreading at the work group granularity.
25
26
EOM
27
}
28
]
(-)b/lang/pocl/pkg-message (+18 lines)
Added Link Here
1
[
2
{ 	type:	install
3
	message: <<EOM
4
5
Deadlocks (freezes) on FreeBSD:
6
7
OpenCL applications using pocl on FreeBSD must be compiled with 
8
options CFLAGS+=-pthread or CXXFLAGS+=-pthread, otherwise someone risk
9
that a library may not initialize the threading on BSD independently, 
10
even if an ICD loader is used.
11
12
See: 
13
	http://www.freebsd.org/cgi/query-pr.cgi?pr=163512
14
15
(Source: http://portablecl.org/docs/html/faq.html?highlight=freebsd)
16
EOM
17
}
18
]
(-)b/lang/pocl/pkg-plist (-3 / +1 lines)
Lines 2-9 bin/poclcc Link Here
2
etc/OpenCL/vendors/pocl.icd
2
etc/OpenCL/vendors/pocl.icd
3
lib/libpocl.so
3
lib/libpocl.so
4
lib/libpocl.so.2
4
lib/libpocl.so.2
5
lib/libpocl.so.2.8.0
5
lib/libpocl.so.2.10.0
6
lib/pocl/libllvmopencl.so
7
lib/pocl/libpocl-devices-basic.so
6
lib/pocl/libpocl-devices-basic.so
8
lib/pocl/libpocl-devices-pthread.so
7
lib/pocl/libpocl-devices-pthread.so
9
libdata/pkgconfig/pocl.pc
8
libdata/pkgconfig/pocl.pc
10
- 

Return to bug 271159