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

Collapse All | Expand All

(-)lang/pocl/Makefile (-22 / +21 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
5
DISTVERSIONSUFFIX=-rc1
6
CATEGORIES=	lang
6
CATEGORIES=	lang
7
MASTER_SITES=	SF/pocl \
7
MASTER_SITES=	SF/pocl \
8
		http://portablecl.org/downloads/
8
		http://portablecl.org/downloads/
Lines 20-47 Link Here
20
		libltdl.so:devel/libltdl
20
		libltdl.so:devel/libltdl
21
RUN_DEPENDS=	llvm${LLVM_VERSION}>=0:devel/llvm${LLVM_VERSION}
21
RUN_DEPENDS=	llvm${LLVM_VERSION}>=0:devel/llvm${LLVM_VERSION}
22
22
23
CONFLICTS=		freeocl[0-9]*
24
25
BROKEN_FreeBSD_10=	pocl is not supported on 10.x
23
BROKEN_FreeBSD_10=	pocl is not supported on 10.x
26
ONLY_FOR_ARCHS=	amd64
24
ONLY_FOR_ARCHS=	i386 amd64
27
ONLY_FOR_ARCHS_REASON_amd64=	only tested on amd64
25
ONLY_FOR_ARCHS_REASON=	only tested on x86
28
26
29
LLVM_VERSION=	38
27
LLVM_VERSION=	${MESA_LLVM_VER:U40}
30
28
31
GNU_CONFIGURE=	yes
32
USE_LDCONFIG=	yes
29
USE_LDCONFIG=	yes
33
USE_GL=		yes
30
USE_GL=		yes
34
USES=		gmake localbase ncurses pathfix pkgconfig libtool:keepla
31
USE_CXXSTD=	gnu++11
32
USES=		cmake gmake localbase ncurses pathfix pkgconfig libtool:keepla
33
WRKSRC=		${WRKDIR}/${PORTNAME}-${DISTVERSION}
35
34
36
INSTALL_TARGET= install-strip
35
CMAKE_ARGS=	-DWITH_LLVM_CONFIG="${LOCALBASE}/llvm${LLVM_VERSION}/bin/llvm-config" \
37
36
		-DPOCL_INSTALL_PKGCONFIG_DIR="${PREFIX}/libdata/pkgconfig" \
38
MAKE_ARGS+=	PKGCONFIGDIR=${PREFIX}/libdata/pkgconfig
37
		-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
38
# needed for the libltdl configure check
43
LDFLAGS+=	-L${LOCALBASE}/lib
39
LDFLAGS+=	-L${LOCALBASE}/lib
44
PLIST_SUB=	OPSYS=${OPSYS:tl} ARCH=${ARCH}
40
PLIST_SUB=	OPSYS=${OPSYS:tl} ARCH=${ARCH:C/amd64/x86_64/}
45
41
46
ALL_TARGET=	all
42
ALL_TARGET=	all
47
43
Lines 48-65 Link Here
48
OCL_ICD_VENDORS?=	${PREFIX}/etc/OpenCL/vendors
44
OCL_ICD_VENDORS?=	${PREFIX}/etc/OpenCL/vendors
49
45
50
OPTIONS_DEFINE=		DEBUG
46
OPTIONS_DEFINE=		DEBUG
51
52
OPTIONS_GROUP=		TEST
47
OPTIONS_GROUP=		TEST
53
OPTIONS_GROUP_TEST=	OCLBOOK
48
OPTIONS_GROUP_TEST=	OCLBOOK
54
49
55
OCLBOOK_DESC=	Tests from the OpenCL book
50
OCLBOOK_DESC=	Tests from the OpenCL book
56
DEBUG_DESC=	Debug build of pocl 
57
51
58
OCLBOOK_CONFIGURE_ENABLE= enable_testsuites="opencl-book-samples,cloverleaf,opencl_book_samples,halide,vexcl"
52
DEBUG_CMAKE_BOOL_ON=	WITH_DEBUG
59
OCLBOOK_ALL_TARGET=	check
60
53
61
DEBUG_CONFIGURE_ENABLE=	debug
54
OCLBOOK_CMAKE_OFF=	-DENABLE_TESTSUITES=""
55
OCLBOOK_CMAKE_ON=	-DENABLE_TESTSUITES="all"
56
OCLBOOK_ALL_TARGET=	test
62
57
63
TEST_TARGET=	check
58
TEST_TARGET=	test
64
59
60
post-patch:
61
	@${REINPLACE_CMD} -e 's/AMD64/amd64/' -e 's/i\.86/i386/' \
62
		${WRKSRC}/CMakeLists.txt
63
65
.include <bsd.port.mk>
64
.include <bsd.port.mk>
(-)lang/pocl/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1479738879
1
TIMESTAMP = 1490755247
2
SHA256 (pocl-0.13.tar.gz) = a17f37d8f26819c0c8efc6de2b57f67a0c8a81514fc9cd5005434e49d67499f9
2
SHA256 (pocl-0.14-rc1.tar.gz) = 2f2727167690718f86348c75aedf9c3706365c45741b1d135497e77258612159
3
SIZE (pocl-0.13.tar.gz) = 1901208
3
SIZE (pocl-0.14-rc1.tar.gz) = 1227953
(-)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 (-15 / +16 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-02-21 02:36:37 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
+#endif
21
+#endif
22
+
22
 
23
+/**
23
+/**
24
+ * Detects the number of parallel hardware threads supported by
24
+ * Detects the number of parallel hardware threads supported by
25
+ * the CPU.
25
+ * the CPU.
Lines 31-54 Link Here
31
+{
31
+{
32
+  int mib[2], nocpus;
32
+  int mib[2], nocpus;
33
+  size_t len;
33
+  size_t len;
34
 
34
+
35
+  mib[0] = CTL_HW;
35
+  mib[0] = CTL_HW;
36
+  mib[1] = HW_NCPU;
36
+  mib[1] = HW_NCPU;
37
+  len = sizeof(nocpus);
37
+  len = sizeof(nocpus);
38
+  sysctl(mib, 2, &nocpus, &len, NULL, 0);
38
+  sysctl(mib, 2, &nocpus, &len, NULL, 0);
39
 
39
+
40
+  return nocpus;
40
+  return nocpus;
41
+}
41
+}
42
+
42
 
43
+#if 0
43
+#ifdef __linux__
44
 /**
44
 /**
45
  * Detects the number of parallel hardware threads supported by
45
  * Detects the number of parallel hardware threads supported by
46
  * the CPU by parsing the cpuinfo.
46
  * the CPU by parsing the cpuinfo.
47
@@ -231,6 +256,27 @@ pocl_cpuinfo_detect_compute_unit_count()
47
@@ -232,6 +257,28 @@ pocl_cpuinfo_detect_compute_unit_count()
48
     } 
48
     } 
49
   return -1;  
49
   return -1;  
50
 }
50
 }
51
+#endif
51
+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
52
+
52
+
53
+/**
53
+/**
54
+ * Detects the maximum clock frequency of the CPU.
54
+ * Detects the maximum clock frequency of the CPU.
Lines 69-86 Link Here
69
+  
69
+  
70
+  return clockrate;
70
+  return clockrate;
71
+ }
71
+ }
72
+#endif
72
 
73
 
73
 #ifdef POCL_ANDROID
74
 #ifdef POCL_ANDROID
74
 
75
 
75
@@ -269,6 +315,7 @@ pocl_cpuinfo_get_cpu_name_and_vendor(cl_
76
@@ -270,6 +317,7 @@ pocl_cpuinfo_get_cpu_name_and_vendor(cl_
76
    * short_name is in the .data anyways.*/
77
    * short_name is in the .data anyways.*/
77
   device->long_name = device->short_name;
78
   device->long_name = device->short_name;
78
 
79
 
79
+#if 0
80
+#ifdef __linux__ 
80
   /* default vendor and vendor_id, in case it cannot be found by other means */
81
   /* default vendor and vendor_id, in case it cannot be found by other means */
81
   device->vendor = cpuvendor_default;
82
   device->vendor = cpuvendor_default;
82
   if (device->vendor_id == 0)
83
   if (device->vendor_id == 0)
83
@@ -317,6 +364,7 @@ pocl_cpuinfo_get_cpu_name_and_vendor(cl_
84
@@ -318,6 +366,7 @@ pocl_cpuinfo_get_cpu_name_and_vendor(cl_
84
   char *new_name = (char*)malloc (len);
85
   char *new_name = (char*)malloc (len);
85
   snprintf (new_name, len, "%s-%s", device->short_name, start);
86
   snprintf (new_name, len, "%s-%s", device->short_name, start);
86
   device->long_name = new_name;
87
   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-02-21 02:36:37 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/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