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

(-)lang/pocl/Makefile (-9 / +5 lines)
Lines 1-14 Link Here
1
# $FreeBSD$
1
# $FreeBSD$
2
2
3
PORTNAME=			pocl
3
PORTNAME=			pocl
4
PORTVERSION=		1.5
4
PORTVERSION=		1.6
5
DISTVERSIONPREFIX=	v
5
DISTVERSIONPREFIX=	v
6
PORTREVISION=			1
7
CATEGORIES=			lang
6
CATEGORIES=			lang
8
7
9
PATCH_SITES=			https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/commit/
10
PATCHFILES+=			9ba33d2a570c.patch:-p1 # https://github.com/pocl/pocl/pull/879
11
12
MAINTAINER=			ohartmann@walstatt.org
8
MAINTAINER=			ohartmann@walstatt.org
13
COMMENT=			POrtable Computing Language (POCL)
9
COMMENT=			POrtable Computing Language (POCL)
14
10
Lines 19-30 Link Here
19
ONLY_FOR_ARCHS_REASON=	only tested on x86
15
ONLY_FOR_ARCHS_REASON=	only tested on x86
20
16
21
BUILD_DEPENDS=	llvm${LLVM_VERSION}>=0:devel/llvm${LLVM_VERSION} \
17
BUILD_DEPENDS=	llvm${LLVM_VERSION}>=0:devel/llvm${LLVM_VERSION} \
22
				opencl>=2.1:devel/opencl
18
				opencl>=2.2:devel/opencl
23
LIB_DEPENDS=	libhwloc.so:devel/hwloc \
19
LIB_DEPENDS=	libhwloc.so:devel/hwloc \
24
				libOpenCL.so:devel/ocl-icd
20
				libOpenCL.so:devel/ocl-icd
25
RUN_DEPENDS=	${BUILD_DEPENDS}
21
RUN_DEPENDS=	${BUILD_DEPENDS}
26
22
27
LLVM_VERSION=	${MESA_LLVM_VER:U10}
23
LLVM_VERSION=	${MESA_LLVM_VER:U11}
28
24
29
USES=			cmake localbase:ldflags ncurses pkgconfig
25
USES=			cmake localbase:ldflags ncurses pkgconfig
30
26
Lines 34-40 Link Here
34
CMAKE_ARGS=		-DWITH_LLVM_CONFIG="${LOCALBASE}/llvm${LLVM_VERSION}/bin/llvm-config" \
30
CMAKE_ARGS=		-DWITH_LLVM_CONFIG="${LOCALBASE}/llvm${LLVM_VERSION}/bin/llvm-config" \
35
				-DPOCL_INSTALL_PKGCONFIG_DIR="${PREFIX}/libdata/pkgconfig" \
31
				-DPOCL_INSTALL_PKGCONFIG_DIR="${PREFIX}/libdata/pkgconfig" \
36
				-DKERNELLIB_HOST_CPU_VARIANTS="distro" \
32
				-DKERNELLIB_HOST_CPU_VARIANTS="distro" \
37
				-DSINGLE_LLVM_LIB=OFF
33
				-DSINGLE_LLVM_LIB=ON
38
34
39
PLIST_SUB=		CONFIGURE_TARGET=${CONFIGURE_TARGET:S/amd64/x86_64/}
35
PLIST_SUB=		CONFIGURE_TARGET=${CONFIGURE_TARGET:S/amd64/x86_64/}
40
36
Lines 44-49 Link Here
44
DOCS_CMAKE_OFF=	-DENABLE_DOCS=OFF
40
DOCS_CMAKE_OFF=	-DENABLE_DOCS=OFF
45
DOCS_CMAKE_ON=	-DENABLE_DOCS=ON
41
DOCS_CMAKE_ON=	-DENABLE_DOCS=ON
46
DOCS_USES=		python
42
DOCS_USES=		python
47
DOCS_BUILD_DEPENDS=	${PY_SPHINX}
43
DOCS_BUILD_DEPENDS=	${PY_FLAVOR}-sphinx>0:textproc/py-sphinx@${PY_FLAVOR}
48
44
49
.include <bsd.port.mk>
45
.include <bsd.port.mk>
(-)lang/pocl/distinfo (-5 / +3 lines)
Lines 1-5 Link Here
1
TIMESTAMP = 1585922230
1
TIMESTAMP = 1608358712
2
SHA256 (pocl-pocl-v1.5_GH0.tar.gz) = 4fcf4618171727d165fc044d465a66e3119217bb4577a97374f94fcd8aed330e
2
SHA256 (pocl-pocl-v1.6_GH0.tar.gz) = b0a4c0c056371b6f0db726b88fbb76bbee94948fb2abd4dbc8d958f7c42f766c
3
SIZE (pocl-pocl-v1.5_GH0.tar.gz) = 1575635
3
SIZE (pocl-pocl-v1.6_GH0.tar.gz) = 1595212
4
SHA256 (9ba33d2a570c.patch) = ebbf503a5e1b9e6676d66c8839a785bcd26667a0aa881fb68b74883e07e3a139
5
SIZE (9ba33d2a570c.patch) = 744
(-)lang/pocl/files/patch-lib_CL_devices_cpuinfo.c (-11 / +45 lines)
Lines 1-5 Link Here
1
--- lib/CL/devices/cpuinfo.c.orig	2019-04-04 12:06:59 UTC
1
--- lib/CL/devices/cpuinfo.c.orig	2020-12-16 14:02:13.000000000 +0100
2
+++ lib/CL/devices/cpuinfo.c
2
+++ lib/CL/devices/cpuinfo.c	2020-12-19 10:46:13.846666000 +0100
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
@@ -153,8 +159,51 @@ pocl_cpuinfo_detect_max_clock_frequency()
16
@@ -41,9 +47,6 @@
17
 //Linux' cpufrec interface
18
 static const char* cpufreq_file="/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq";
19
 
20
-// Vendor of PCI root bus
21
-static const char *pci_bus_root_vendor_file = "/sys/bus/pci/devices/0000:00:00.0/vendor";
22
-
23
 /* Strings to parse in /proc/cpuinfo. Else branch is for x86, x86_64 */
24
 #if   defined  __powerpc__
25
  #define FREQSTRING "clock"
26
@@ -156,8 +159,51 @@
17
     } 
27
     } 
18
   return -1;  
28
   return -1;  
19
 }
29
 }
Lines 54-60 Link Here
54
+/**
64
+/**
55
+ * Unimplemented for other platforms.
65
+ * Unimplemented for other platforms.
56
+ */
66
+ */
57
+ int
67
+int
58
+pocl_cpuinfo_detect_max_clock_frequency()
68
+pocl_cpuinfo_detect_max_clock_frequency()
59
+{
69
+{
60
+  return 0;
70
+  return 0;
Lines 65-71 Link Here
65
 /**
75
 /**
66
  * Detects the number of parallel hardware threads supported by
76
  * Detects the number of parallel hardware threads supported by
67
  * the CPU by parsing the cpuinfo.
77
  * the CPU by parsing the cpuinfo.
68
@@ -232,6 +281,19 @@ pocl_cpuinfo_detect_compute_unit_count()
78
@@ -235,6 +281,19 @@
69
     } 
79
     } 
70
   return -1;  
80
   return -1;  
71
 }
81
 }
Lines 83-91 Link Here
83
+}
93
+}
84
+#endif
94
+#endif
85
 
95
 
86
 #ifdef POCL_ANDROID
96
 #if __arm__ || __aarch64__
87
 
97
 enum
88
@@ -326,6 +388,7 @@ pocl_cpuinfo_get_cpu_name_and_vendor(cl_device_id devi
98
@@ -302,6 +361,7 @@
89
    * short_name is in the .data anyways.*/
99
    * short_name is in the .data anyways.*/
90
   device->long_name = device->short_name;
100
   device->long_name = device->short_name;
91
 
101
 
Lines 93-99 Link Here
93
   /* 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 */
94
   device->vendor = cpuvendor_default;
104
   device->vendor = cpuvendor_default;
95
   if (device->vendor_id == 0)
105
   if (device->vendor_id == 0)
96
@@ -425,6 +488,25 @@ pocl_cpuinfo_get_cpu_name_and_vendor(cl_device_id devi
106
@@ -404,7 +464,26 @@
97
   char *new_name = (char*)malloc (len);
107
   char *new_name = (char*)malloc (len);
98
   snprintf (new_name, len, "%s-%s", device->short_name, start);
108
   snprintf (new_name, len, "%s-%s", device->short_name, start);
99
   device->long_name = new_name;
109
   device->long_name = new_name;
Lines 101-107 Link Here
101
+  int mib[2];
111
+  int mib[2];
102
+  size_t len = 0;
112
+  size_t len = 0;
103
+  char *model;
113
+  char *model;
104
+
114
 
105
+  mib[0] = CTL_HW;
115
+  mib[0] = CTL_HW;
106
+  mib[1] = HW_MODEL;
116
+  mib[1] = HW_MODEL;
107
+  if (sysctl(mib, 2, NULL, &len, NULL, 0))
117
+  if (sysctl(mib, 2, NULL, &len, NULL, 0))
Lines 116-121 Link Here
116
+      device->long_name = model;
126
+      device->long_name = model;
117
+    }
127
+    }
118
+#endif
128
+#endif
129
+
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
132
    * provisional) OpenCL 3.0 specification that has finally clarified the
133
@@ -415,10 +494,20 @@
134
    */
135
   if (!device->vendor_id)
136
     {
137
-      f = fopen (pci_bus_root_vendor_file, "r");
138
-      num_read = fscanf (f, "%x", &device->vendor_id);
139
+#if 	defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
140
+			/*
141
+			 * Future work: try to extract vendor ID from PCI root bus from MIB
142
+			*/
143
+#elif	defined(__linux__)
144
+      FILE *f = fopen (pci_bus_root_vendor_file, "r");
145
+      int num_read = fscanf (f, "%x", &device->vendor_id);
146
       fclose (f);
147
       /* no error checking, if it failed we just won't have the info */
148
+#else
149
+			/*
150
+			 *	Other aliens ...
151
+			*/
152
+#endif
153
     }
119
 }
154
 }
120
 
155
 
121
 /*
(-)lang/pocl/pkg-plist (-1 / +4 lines)
Lines 2-9 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.5.0
5
lib/libpocl.so.2.6.0
6
lib/pocl/libllvmopencl.so
6
lib/pocl/libllvmopencl.so
7
lib/pocl/libpocl-devices-basic.so
8
lib/pocl/libpocl-devices-pthread.so
7
libdata/pkgconfig/pocl.pc
9
libdata/pkgconfig/pocl.pc
8
%%DATADIR%%/include/_builtin_renames.h
10
%%DATADIR%%/include/_builtin_renames.h
9
%%DATADIR%%/include/_clang_opencl.h
11
%%DATADIR%%/include/_clang_opencl.h
Lines 11-16 Link Here
11
%%DATADIR%%/include/_kernel.h
13
%%DATADIR%%/include/_kernel.h
12
%%DATADIR%%/include/_kernel_c.h
14
%%DATADIR%%/include/_kernel_c.h
13
%%DATADIR%%/include/_kernel_constants.h
15
%%DATADIR%%/include/_kernel_constants.h
16
%%DATADIR%%/include/_libclang_versions_checks.h
14
%%DATADIR%%/include/opencl-c-base.h
17
%%DATADIR%%/include/opencl-c-base.h
15
%%DATADIR%%/include/opencl-c.h
18
%%DATADIR%%/include/opencl-c.h
16
%%DATADIR%%/include/pocl.h
19
%%DATADIR%%/include/pocl.h

Return to bug 251958