View | Details | Raw Unified | Return to bug 218332 | Differences between
and this patch

Collapse All | Expand All

(-)lang/pocl/Makefile (-22 / +20 lines)
Lines 1-8 Link Here
1
# $FreeBSD$
1
# $FreeBSD$
2
2
3
PORTNAME=	pocl
3
PORTNAME=	pocl
4
PORTVERSION=	0.13
4
PORTVERSION=	0.14
5
PORTREVISION=	1
6
CATEGORIES=	lang
5
CATEGORIES=	lang
7
MASTER_SITES=	SF/pocl \
6
MASTER_SITES=	SF/pocl \
8
		http://portablecl.org/downloads/
7
		http://portablecl.org/downloads/
Lines 20-47 Link Here
20
		libltdl.so:devel/libltdl
19
		libltdl.so:devel/libltdl
21
RUN_DEPENDS=	llvm${LLVM_VERSION}>=0:devel/llvm${LLVM_VERSION}
20
RUN_DEPENDS=	llvm${LLVM_VERSION}>=0:devel/llvm${LLVM_VERSION}
22
21
23
CONFLICTS=		freeocl[0-9]*
24
25
BROKEN_FreeBSD_10=	pocl is not supported on 10.x
22
BROKEN_FreeBSD_10=	pocl is not supported on 10.x
26
ONLY_FOR_ARCHS=	amd64
23
ONLY_FOR_ARCHS=	i386 amd64
27
ONLY_FOR_ARCHS_REASON_amd64=	only tested on amd64
24
ONLY_FOR_ARCHS_REASON=	only tested on x86
28
25
29
LLVM_VERSION=	38
26
LLVM_VERSION=	${MESA_LLVM_VER:U40}
30
27
31
GNU_CONFIGURE=	yes
32
USE_LDCONFIG=	yes
28
USE_LDCONFIG=	yes
33
USE_GL=		yes
29
USE_GL=		yes
34
USES=		gmake localbase ncurses pathfix pkgconfig libtool:keepla
30
USE_CXXSTD=	gnu++11
31
USES=		cmake gmake localbase ncurses pathfix pkgconfig libtool:keepla
32
WRKSRC=		${WRKDIR}/${PORTNAME}-${DISTVERSION}
35
33
36
INSTALL_TARGET= install-strip
34
CMAKE_ARGS=	-DWITH_LLVM_CONFIG="${LOCALBASE}/llvm${LLVM_VERSION}/bin/llvm-config" \
37
35
		-DPOCL_INSTALL_PKGCONFIG_DIR="${PREFIX}/libdata/pkgconfig" \
38
MAKE_ARGS+=	PKGCONFIGDIR=${PREFIX}/libdata/pkgconfig
36
		-DKERNELLIB_HOST_CPU_VARIANTS="distro"
39
40
CONFIGURE_ENV=	LLVM_CONFIG="${LOCALBASE}/llvm${LLVM_VERSION}/bin/llvm-config" \
41
		CLANGXX_FLAGS=-std=gnu++11
42
# needed for the libltdl configure check
37
# needed for the libltdl configure check
43
LDFLAGS+=	-L${LOCALBASE}/lib
38
LDFLAGS+=	-L${LOCALBASE}/lib
44
PLIST_SUB=	OPSYS=${OPSYS:tl} ARCH=${ARCH}
39
PLIST_SUB=	OPSYS=${OPSYS:tl} ARCH=${ARCH:C/amd64/x86_64/}
45
40
46
ALL_TARGET=	all
41
ALL_TARGET=	all
47
42
Lines 48-65 Link Here
48
OCL_ICD_VENDORS?=	${PREFIX}/etc/OpenCL/vendors
43
OCL_ICD_VENDORS?=	${PREFIX}/etc/OpenCL/vendors
49
44
50
OPTIONS_DEFINE=		DEBUG
45
OPTIONS_DEFINE=		DEBUG
51
52
OPTIONS_GROUP=		TEST
46
OPTIONS_GROUP=		TEST
53
OPTIONS_GROUP_TEST=	OCLBOOK
47
OPTIONS_GROUP_TEST=	OCLBOOK
54
48
55
OCLBOOK_DESC=	Tests from the OpenCL book
49
OCLBOOK_DESC=	Tests from the OpenCL book
56
DEBUG_DESC=	Debug build of pocl 
57
50
58
OCLBOOK_CONFIGURE_ENABLE= enable_testsuites="opencl-book-samples,cloverleaf,opencl_book_samples,halide,vexcl"
51
DEBUG_CMAKE_BOOL_ON=	WITH_DEBUG
59
OCLBOOK_ALL_TARGET=	check
60
52
61
DEBUG_CONFIGURE_ENABLE=	debug
53
OCLBOOK_CMAKE_OFF=	-DENABLE_TESTSUITES=""
54
OCLBOOK_CMAKE_ON=	-DENABLE_TESTSUITES="all"
55
OCLBOOK_ALL_TARGET=	test
62
56
63
TEST_TARGET=	check
57
TEST_TARGET=	test
64
58
59
post-patch:
60
	@${REINPLACE_CMD} -e 's/AMD64/amd64/' -e 's/i\.86/i386/' \
61
		${WRKSRC}/CMakeLists.txt
62
65
.include <bsd.port.mk>
63
.include <bsd.port.mk>
(-)lang/pocl/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1479738879
1
TIMESTAMP = 1491868935
2
SHA256 (pocl-0.13.tar.gz) = a17f37d8f26819c0c8efc6de2b57f67a0c8a81514fc9cd5005434e49d67499f9
2
SHA256 (pocl-0.14.tar.gz) = 2127bf925a91fbbe3daf2f1bac0da5c8aceb16e2a9434977a3057eade974106a
3
SIZE (pocl-0.13.tar.gz) = 1901208
3
SIZE (pocl-0.14.tar.gz) = 1231630
(-)lang/pocl/files/patch-Makefile.in (-25 lines)
Lines 1-25 Link Here
1
First part: this is false, this was due to a libtool bug, which is fixed now
2
Second part: cmp --quiet is long for the -s option, use that since FreeBSD
3
cmp doesn't have the long option.
4
5
--- Makefile.in.orig	2016-09-13 22:57:13.327123000 +0200
6
+++ Makefile.in	2016-09-13 23:01:18.738696000 +0200
7
@@ -116,8 +116,7 @@
8
 @POCL_ANDROID_FALSE@am__append_1 = scripts examples tests
9
 
10
 #TODO: this naming scheme is used on other platforms (primarly BSDs?) too
11
-@BUILD_ICD_TRUE@@FREEBSD_HOST_OS_TRUE@am__append_2 = -e 's,so.VER,so.$(LIB_CURRENT_VERSION),g'
12
-@BUILD_ICD_TRUE@@FREEBSD_HOST_OS_FALSE@am__append_3 = -e 's,so.VER,so.$(LIB_FIRST_VERSION).$(LIB_AGE_VERSION).$(LIB_REVISION_VERSION),g'
13
+@BUILD_ICD_TRUE@am__append_3 = -e 's,so.VER,so.$(LIB_FIRST_VERSION).$(LIB_AGE_VERSION).$(LIB_REVISION_VERSION),g'
14
 @BUILD_ICD_TRUE@am__append_4 = pocl.icd
15
 @BUILD_ICD_TRUE@am__append_5 = pocl.icd
16
 subdir = .
17
@@ -1076,7 +1075,7 @@
18
 	echo "#define PKGDATADIR \"${pkgdatadir}\"" > $@.new
19
 	echo "#define PKGLIBEXECDIR \"${pkglibexecdir}\"" >> $@.new
20
 	echo "#define PKGINCLUDEDIR \"${pkgincludedir}\"" >> $@.new
21
-	@if cmp --quiet $@.new $@ ; then \
22
+	@if cmp -s $@.new $@ ; then \
23
 		: "Paths not changed" ;\
24
 		$(RM) $@.new ;\
25
 	else \
(-)lang/pocl/files/patch-lib_CL_devices_cpuinfo.c (-40 / +40 lines)
Lines 1-5 Link Here
1
--- lib/CL/devices/cpuinfo.c.orig	2016-11-20 11:31:19.521203000 +0100
1
--- lib/CL/devices/cpuinfo.c.orig	2017-04-05 14:15:40 UTC
2
+++ lib/CL/devices/cpuinfo.c	2016-11-20 11:29:24.502817000 +0100
2
+++ lib/CL/devices/cpuinfo.c
3
@@ -31,9 +31,13 @@
3
@@ -31,9 +31,13 @@
4
 #  include "vccompat.hpp"
4
 #  include "vccompat.hpp"
5
 #endif
5
 #endif
Lines 10-25 Link Here
10
 #include "config.h"
10
 #include "config.h"
11
 #include "cpuinfo.h"
11
 #include "cpuinfo.h"
12
 
12
 
13
+#if 0
13
+#ifdef __linux__
14
 const char* cpuinfo = "/proc/cpuinfo";
14
 static const char* cpuinfo = "/proc/cpuinfo";
15
 #define MAX_CPUINFO_SIZE 64*1024
15
 #define MAX_CPUINFO_SIZE 64*1024
16
 //#define DEBUG_POCL_CPUINFO
16
 //#define DEBUG_POCL_CPUINFO
17
@@ -152,8 +156,29 @@ pocl_cpuinfo_detect_max_clock_frequency(
17
@@ -153,8 +157,29 @@ pocl_cpuinfo_detect_max_clock_frequency(
18
     } 
18
     } 
19
   return -1;  
19
   return -1;  
20
 }
20
 }
21
+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
22
+/**
23
+ * Detects the maximum clock frequency of the CPU.
24
+ *
25
+ * Assumes all cores have the same max clock freq.
26
+ *
27
+ * @return The clock frequency in MHz.
28
+ */
29
+int
30
+pocl_cpuinfo_detect_max_clock_frequency()
31
+{
32
+  //XXX PLEASE NOTE, THIS IS NOT TOO PORTABLE (AND/OR ACCURATE)!
33
+  const char mib[] = "hw.clockrate";
34
+  int clockrate;
35
+  size_t size = sizeof(clockrate);
36
+
37
+  sysctlbyname(mib, (void *)&clockrate, &size, NULL, 0);
38
 
39
+  return clockrate;
40
+ }
21
+#endif
41
+#endif
22
+
42
 
43
+#ifdef __linux__
44
 /**
45
  * Detects the number of parallel hardware threads supported by
46
  * the CPU by parsing the cpuinfo.
47
@@ -232,6 +257,27 @@ pocl_cpuinfo_detect_compute_unit_count()
48
     } 
49
   return -1;  
50
 }
51
+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
23
+/**
52
+/**
24
+ * Detects the number of parallel hardware threads supported by
53
+ * Detects the number of parallel hardware threads supported by
25
+ * the CPU.
54
+ * the CPU.
Lines 31-86 Link Here
31
+{
60
+{
32
+  int mib[2], nocpus;
61
+  int mib[2], nocpus;
33
+  size_t len;
62
+  size_t len;
34
 
63
+  
35
+  mib[0] = CTL_HW;
64
+  mib[0] = CTL_HW;
36
+  mib[1] = HW_NCPU;
65
+  mib[1] = HW_NCPU;
37
+  len = sizeof(nocpus);
66
+  len = sizeof(nocpus);
38
+  sysctl(mib, 2, &nocpus, &len, NULL, 0);
67
+  sysctl(mib, 2, &nocpus, &len, NULL, 0);
39
 
68
+ 
40
+  return nocpus;
69
+  return nocpus;
41
+}
70
+}
42
+
43
+#if 0
44
 /**
45
  * Detects the number of parallel hardware threads supported by
46
  * the CPU by parsing the cpuinfo.
47
@@ -231,6 +256,27 @@ pocl_cpuinfo_detect_compute_unit_count()
48
     } 
49
   return -1;  
50
 }
51
+#endif
71
+#endif
52
+
53
+/**
54
+ * Detects the maximum clock frequency of the CPU.
55
+ *
56
+ * Assumes all cores have the same max clock freq.
57
+ *
58
+ * @return The clock frequency in MHz.
59
+ */
60
+int
61
+pocl_cpuinfo_detect_max_clock_frequency()
62
+{
63
+  //XXX PLEASE NOTE, THIS IS NOT TOO PORTABLE (AND/OR ACCURATE)!
64
+  const char mib[] = "hw.clockrate";
65
+  size_t size = sizeof(int);
66
+  int clockrate;
67
+
68
+  sysctlbyname(mib, (void *)&clockrate, &size, NULL, 0);
69
+  
70
+  return clockrate;
71
+ }
72
 
72
 
73
 #ifdef POCL_ANDROID
73
 #ifdef POCL_ANDROID
74
 
74
 
75
@@ -269,6 +315,7 @@ pocl_cpuinfo_get_cpu_name_and_vendor(cl_
75
@@ -270,6 +316,7 @@ pocl_cpuinfo_get_cpu_name_and_vendor(cl_
76
    * short_name is in the .data anyways.*/
76
    * short_name is in the .data anyways.*/
77
   device->long_name = device->short_name;
77
   device->long_name = device->short_name;
78
 
78
 
79
+#if 0
79
+#ifdef __linux__ 
80
   /* default vendor and vendor_id, in case it cannot be found by other means */
80
   /* default vendor and vendor_id, in case it cannot be found by other means */
81
   device->vendor = cpuvendor_default;
81
   device->vendor = cpuvendor_default;
82
   if (device->vendor_id == 0)
82
   if (device->vendor_id == 0)
83
@@ -317,6 +364,7 @@ pocl_cpuinfo_get_cpu_name_and_vendor(cl_
83
@@ -318,6 +365,7 @@ pocl_cpuinfo_get_cpu_name_and_vendor(cl_
84
   char *new_name = (char*)malloc (len);
84
   char *new_name = (char*)malloc (len);
85
   snprintf (new_name, len, "%s-%s", device->short_name, start);
85
   snprintf (new_name, len, "%s-%s", device->short_name, start);
86
   device->long_name = new_name;
86
   device->long_name = new_name;
(-)lang/pocl/files/patch-lib_CL_pocl__binary.c (+11 lines)
Line 0 Link Here
1
--- lib/CL/pocl_binary.c.orig	2017-04-05 14:15:40 UTC
2
+++ lib/CL/pocl_binary.c
3
@@ -36,7 +36,7 @@
4
 #include <libgen.h>
5
 
6
 #ifndef __APPLE__
7
-  #include <endian.h>
8
+  #include <sys/endian.h>
9
 #else
10
   #include <libkern/OSByteOrder.h>
11
   #define htole16(x) OSSwapHostToLittleInt16(x)
(-)lang/pocl/files/patch-scripts_Makefile.in (-21 lines)
Lines 1-21 Link Here
1
dirty hack, pocl-standalone will be installed into stage with
2
r-xr-xr-x permissions. So writing to it is problemetic. give the file write
3
permission and take it away after.
4
5
Upstream (pre 0.14) will be using cmake so this hack is only temporary.
6
7
--- scripts/Makefile.in.orig	2016-09-13 22:10:48.091956000 +0200
8
+++ scripts/Makefile.in	2016-09-13 22:13:33.388168000 +0200
9
@@ -651,10 +651,11 @@
10
 
11
 install-exec-hook: $(bin_SCRIPTS) 
12
 	for f in $(bin_SCRIPTS) ; do \
13
+		chmod +w "$(DESTDIR)$(bindir)/$$f" ; \
14
 		sed -e '/^# BEGIN REMOVE ONCE INSTALLED$$/,/^# END REMOVE ONCE INSTALLED$$/d' \
15
 			> "$(DESTDIR)$(bindir)/$$f" \
16
 			< "$$f" && \
17
-		chmod +x "$(DESTDIR)$(bindir)/$$f" ; \
18
+		chmod +x-w "$(DESTDIR)$(bindir)/$$f" ; \
19
 	done
20
 
21
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
(-)lang/pocl/files/patch-tests_regression_test__issue__445.cpp (+11 lines)
Line 0 Link Here
1
--- tests/regression/test_issue_445.cpp.orig	2017-04-05 14:15:40 UTC
2
+++ tests/regression/test_issue_445.cpp
3
@@ -29,7 +29,7 @@ private_local_array(__global int *__rest
4
 }
5
 )CLC";
6
 
7
-int main(int, char *)
8
+int main(int, char **)
9
 {
10
   try {
11
     int N = 9;
(-)lang/pocl/pkg-plist (-14 / +12 lines)
Lines 1-27 Link Here
1
bin/pocl-standalone
1
bin/poclcc
2
etc/OpenCL/vendors/pocl.icd
2
etc/OpenCL/vendors/pocl.icd
3
include/poclu.h
3
include/poclu.h
4
lib/libpocl.a
5
lib/libpocl.la
6
lib/libpocl.so
4
lib/libpocl.so
7
lib/libpocl.so.1
5
lib/libpocl.so.1
8
lib/libpocl.so.1.6.0
6
lib/libpocl.so.1.7.0
9
lib/libpoclu.a
10
lib/libpoclu.la
11
lib/libpoclu.so
7
lib/libpoclu.so
12
lib/libpoclu.so.1
8
lib/libpoclu.so.1
13
lib/libpoclu.so.1.6.0
9
lib/libpoclu.so.1.7.0
14
lib/pocl/llvmopencl.a
10
lib/pocl/libllvmopencl.so
15
lib/pocl/llvmopencl.la
16
lib/pocl/llvmopencl.so
17
lib/pocl/llvmopencl.so.7
18
lib/pocl/llvmopencl.so.7.0.0
19
libdata/pkgconfig/pocl.pc
11
libdata/pkgconfig/pocl.pc
12
%%DATADIR%%/include/_enable_all_exts.h
20
%%DATADIR%%/include/_kernel.h
13
%%DATADIR%%/include/_kernel.h
21
%%DATADIR%%/include/_kernel_c.h
14
%%DATADIR%%/include/_kernel_c.h
22
%%DATADIR%%/include/_kernel_constants.h
15
%%DATADIR%%/include/_kernel_constants.h
23
%%DATADIR%%/include/pocl.h
16
%%DATADIR%%/include/pocl.h
24
%%DATADIR%%/include/pocl_device.h
17
%%DATADIR%%/include/pocl_device.h
25
%%DATADIR%%/include/pocl_tests.h
26
%%DATADIR%%/include/pocl_types.h
18
%%DATADIR%%/include/pocl_types.h
27
%%DATADIR%%/kernel-%%ARCH%%-portbld-%%OPSYS%%%%OSREL%%.bc
19
%%DATADIR%%/kernel-%%ARCH%%-unknown-%%OPSYS%%%%OSREL%%-avx.bc
20
%%DATADIR%%/kernel-%%ARCH%%-unknown-%%OPSYS%%%%OSREL%%-avx2.bc
21
%%DATADIR%%/kernel-%%ARCH%%-unknown-%%OPSYS%%%%OSREL%%-avx512.bc
22
%%DATADIR%%/kernel-%%ARCH%%-unknown-%%OPSYS%%%%OSREL%%-avx_fma4.bc
23
%%DATADIR%%/kernel-%%ARCH%%-unknown-%%OPSYS%%%%OSREL%%-sse2.bc
24
%%DATADIR%%/kernel-%%ARCH%%-unknown-%%OPSYS%%%%OSREL%%-sse41.bc
25
%%DATADIR%%/kernel-%%ARCH%%-unknown-%%OPSYS%%%%OSREL%%-ssse3.bc

Return to bug 218332