[opencl-utils] Initial import (#810059).
Jeremy Newton
mystro256 at fedoraproject.org
Tue Jun 26 17:14:04 UTC 2012
commit 78bdbe4c711a68805f5328c487ee875d2b159545
Author: alexjnewt at hotmail.com <alexjnewt at hotmail.com>
Date: Tue Jun 26 13:14:31 2012 -0400
Initial import (#810059).
.gitignore | 1 +
opencl-utils-README.fedora | 10 +++
opencl-utils-fixupmakefile.patch | 30 +++++++++
opencl-utils.pc | 8 +++
opencl-utils.spec | 123 ++++++++++++++++++++++++++++++++++++++
sources | 1 +
6 files changed, 173 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..b13e901 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/opencl-utils.tar.xz
diff --git a/opencl-utils-README.fedora b/opencl-utils-README.fedora
new file mode 100644
index 0000000..66066d3
--- /dev/null
+++ b/opencl-utils-README.fedora
@@ -0,0 +1,10 @@
+------------------------------
+How to compile CLRun on Fedora
+------------------------------
+
+Just simpily move into the clrun source folder and run:
+
+ make clean
+ env CFLAGS="%{optflags} -fPIC -Wl,-soname=libclrun.so.%{version}.%{svnversion}" make
+
+with %{version} replaced by the version and %{svnversion} replaced by the subversion of CLRun
diff --git a/opencl-utils-fixupmakefile.patch b/opencl-utils-fixupmakefile.patch
new file mode 100644
index 0000000..d6b0d44
--- /dev/null
+++ b/opencl-utils-fixupmakefile.patch
@@ -0,0 +1,30 @@
+diff -rupN src/clrun/Makefile src-patched/clrun/Makefile
+--- src/clrun/Makefile 2012-03-25 17:21:36.000000000 -0400
++++ src-patched/clrun/Makefile 2012-04-06 11:52:03.227832491 -0400
+@@ -1,16 +1,15 @@
+-all: compile
++all: libclrun.so
+
+-compile: genclrun gencl.c genclgl.c
+- gcc -Wall -c gencl.c -o gencl.o
+- gcc -Wall -c genclgl.c -o genclgl.o
+- gcc -Wall -c clrun.c -o clrun.o -I../include
+- gcc -Wall --shared dynamiclib.c clrun.o gencl.o genclgl.o -o libclrun.so -ldl
+- strip libclrun.so
++CFLAGS += -I../include -Wall -fPIC
+
+-genclrun: ../include/CL/cl.h ../include/CL/cl_gl.h
+- ./generateClRun.pl ../include/CL/cl.h > gencl.c
+- ./generateClRun.pl ../include/CL/cl_gl.h > genclgl.c
++libclrun.so : gencl.o genclgl.o clrun.o dynamiclib.o
++ gcc $(CFLAGS) --shared -ldl $? -o $@
+
++gencl.c: ../include/CL/cl.h
++ ./generateClRun.pl $? > $@
++
++genclgl.c: ../include/CL/cl_gl.h
++ ./generateClRun.pl $? > $@
+
+ clean:
+- rm -rf *~ *.o
++ rm -rf *~ *.o gencl.c genclgl.c
diff --git a/opencl-utils.pc b/opencl-utils.pc
new file mode 100644
index 0000000..d69cc98
--- /dev/null
+++ b/opencl-utils.pc
@@ -0,0 +1,8 @@
+prefix=/usr
+includedir=${prefix}/include
+
+Name: opencl-utils
+Description: OpenCL tools and utilities.
+Version: 0
+Libs: -lclrun
+Cflags: -I${includedir}/opencl-utils
diff --git a/opencl-utils.spec b/opencl-utils.spec
new file mode 100644
index 0000000..3f107bb
--- /dev/null
+++ b/opencl-utils.spec
@@ -0,0 +1,123 @@
+%global svnversion 16
+%global soname libclrun.so.%{version}.%{svnversion}
+
+Name: opencl-utils
+Version: 0
+Release: 7.svn%{svnversion}%{?dist}
+Summary: Useful OpenCL tools and utilities
+
+License: MIT
+Url: http://code.google.com/p/%{name}
+###Commands to grab source from svn:
+#svn co -r 16 http://opencl-utils.googlecode.com/svn/trunk/ opencl-utils
+#tar -Jcv --exclude-vcs -f opencl-utils.tar.xz opencl-utils
+#rm -f -r opencl-utils
+Source0: %{name}.tar.xz
+Source1: %{name}-README.fedora
+Source2: %{name}.pc
+#Kudos to Alec Leamas: http://code.google.com/p/opencl-utils/issues/detail?id=2
+Patch0: %{name}-fixupmakefile.patch
+
+BuildRequires: mesa-libGL-devel
+
+%package devel
+Summary: Devel files for OpenCL Utils
+Requires: %{name}%{?_isa} = %{version}-%{release}
+Requires: pkgconfig
+
+%description
+#Modified from the homepage
+OpenCL Utils is a project that aims to create various tools and utilities to
+make the use of OpenCL more useful and efficient, such as: useful functions,
+optimization hints and common kernel templates. This package currently only
+contains CLRun, which allows for dynamic loading of OpenCL.
+
+%description devel
+This package includes the headers files for OpenCL Utils.
+OpenCL Utils is a project that aims to create various tools and utilities to
+make the use of OpenCL more useful and efficient, such as: useful functions,
+optimization hints and common kernel templates.
+
+%prep
+%setup -q -n %{name}
+%patch0 -p0
+cp -a %{SOURCE1} ./README.fedora
+#Fixes for Example compiling
+sed -i -e 's/@version@/%{version}/' -e 's|@prefix@|%{_prefix}|' %{SOURCE2}
+sed -i 's/\r//' examples/clrun-example/example2.cpp
+sed -i '/ldl/c\\tgcc $(pkg-config --cflags --libs opencl-utils) example1.c' examples/clrun-example/Makefile
+sed -i '/lclrun/c\\tg++ $(pkg-config --cflags --libs opencl-utils) example2.cpp' examples/clrun-example/Makefile
+#To avoid copying a windows build file later on
+rm -f examples/OCLUtilsExamples.vcproj
+#Clean the generated files before compiling
+cd src/clrun/
+make clean
+
+%build
+cd src/clrun/
+env CFLAGS="%{optflags} -fPIC -Wl,-soname=%{soname}" make
+
+%install
+mkdir -p %{buildroot}%{_libdir} %{buildroot}%{_includedir}/%{name}/clrun/include/C
+cp -a src/clrun/*.h %{buildroot}%{_includedir}/%{name}/clrun/
+cp -a src/clrun/*.c %{buildroot}%{_includedir}/%{name}/clrun/
+cp -r src/include %{buildroot}%{_includedir}/%{name}/
+install -m 0644 -D %{SOURCE2} %{buildroot}%{_libdir}/pkgconfig/%{name}.pc
+#install the library and the links
+soname=%{soname}
+install -p -D -m 0755 src/clrun/${soname%%.*.*} %{buildroot}%{_libdir}/%{soname}
+cd %{buildroot}%{_libdir}
+ln -sf $soname ${soname%%.*}
+ln -sf $soname ${soname%%.*.*}
+
+%files
+%{_libdir}/*.so.*
+
+%files devel
+%doc examples/* README.fedora
+%{_includedir}/%{name}/include/CL
+%{_includedir}/%{name}/clrun/
+%{_includedir}/%{name}/include/clrun.h
+%{_libdir}/*.so
+%{_libdir}/pkgconfig/*.pc
+
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
+%changelog
+* Sun Jun 24 2012 Jeremy Newton <alexjnewt at hotmail.com> - 0-7.svn16
+- Reverted reorganizing of source files due to compilation problems
+
+* Sun Jun 24 2012 Jeremy Newton <alexjnewt at hotmail.com> - 0-6.svn16
+- Silenced an rpmlint mixed-use-of-spaces-and-tabs warning
+- Implimented reserving timestamps
+- Renamed README source file with prefix
+- Added bug report for patch0
+
+* Sun Jun 24 2012 Jeremy Newton <alexjnewt at hotmail.com> - 0-5.svn16
+- Various simplications and fixes of the package structure
+- Added cleaning of generated files to prep
+- Reorganizing of source files
+- Added compiling README and added examples as documentation
+- Fixed up examples, included packagecfg
+
+* Sun Apr 8 2012 Jeremy Newton <alexjnewt at hotmail.com> - 0-4.svn16
+- Removed all non headers from devel excluding examples
+- More tweaks to the makefile (clrun)
+- Various improvements/cleanups
+- OpenCLpointers patch dropped due to compiling issues (functions fine without)
+- trimwhitespace patch dropped due to little purpose
+
+* Thu Apr 5 2012 Jeremy Newton <alexjnewt at hotmail.com> - 0-3.svn16
+- Fixed soname/ldconfig issue
+- Typo in the date of the last changelog
+
+* Thu Apr 5 2012 Jeremy Newton <alexjnewt at hotmail.com> - 0-2.svn16
+- Changed sub-packages to something more suitable
+- Patched the makefile a little more
+- Fixed requirements
+
+* Sun Mar 25 2012 Jeremy Newton <alexjnewt at hotmail.com> - 0-1.svn16
+- Initial package SPEC created
+
diff --git a/sources b/sources
index e69de29..11a2da5 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+a570d13082b9f25e67b8d75ccb6aef4d opencl-utils.tar.xz
More information about the scm-commits
mailing list