Re: [Mesa-dev] [PATCH] opencl: improved auto-gen .icd

2014-01-13 Thread Igor Gnatenko
On Mon, 2014-01-13 at 15:17 -0800, Matt Turner wrote:
> On Mon, Jan 13, 2014 at 11:12 AM, Tom Stellard  wrote:
> > On Sun, Jan 12, 2014 at 03:08:56AM +0400, Igor Gnatenko wrote:
> >> From 5b2bf87f1238e44150492a39f5db0ae90d59459b Mon Sep 17 00:00:00 2001
> >> From: Igor Gnatenko 
> >> Date: Sun, 12 Jan 2014 02:09:16 +0400
> >> Subject: [PATCH] opencl: improved auto-gen .icd
> >>
> >> v2: Use @OPENCL_VERSION@:0 for library
> >> replace /etc with @sysconfdir@ macros
> >>
> >> Reported-by: Fabian Deutsch 
> >> Reference: https://bugs.freedesktop.org/show_bug.cgi?id=73512
> >> Signed-off-by: Igor Gnatenko 
> >> ---
> >>  configure.ac   | 3 +++
> >>  src/gallium/targets/opencl/Makefile.am | 4 ++--
> >>  src/gallium/targets/opencl/mesa.icd| 1 -
> >>  src/gallium/targets/opencl/mesa.icd.in | 1 +
> >>  4 files changed, 6 insertions(+), 3 deletions(-)
> >>  delete mode 100644 src/gallium/targets/opencl/mesa.icd
> >>  create mode 100644 src/gallium/targets/opencl/mesa.icd.in
> >>
> >> diff --git a/configure.ac b/configure.ac
> >> index 4b55140..3452e15 100644
> >> --- a/configure.ac
> >> +++ b/configure.ac
> >> @@ -25,6 +25,8 @@ m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
> >>  dnl Set internal versions
> >>  OSMESA_VERSION=8
> >>  AC_SUBST([OSMESA_VERSION])
> >> +OPENCL_VERSION=1
> >> +AC_SUBST([OPENCL_VERSION])
> >>
> >>  dnl Versions for external dependencies
> >>  LIBDRM_REQUIRED=2.4.24
> >> @@ -2023,6 +2025,7 @@ AC_CONFIG_FILES([Makefile
> >>   src/gallium/targets/egl-static/Makefile
> >>   src/gallium/targets/gbm/Makefile
> >>   src/gallium/targets/opencl/Makefile
> >> + src/gallium/targets/opencl/mesa.icd
> >>   src/gallium/targets/osmesa/Makefile
> >>   src/gallium/targets/osmesa/osmesa.pc
> >>   src/gallium/targets/pipe-loader/Makefile
> >> diff --git a/src/gallium/targets/opencl/Makefile.am 
> >> b/src/gallium/targets/opencl/Makefile.am
> >> index 653302c..923316c 100644
> >> --- a/src/gallium/targets/opencl/Makefile.am
> >> +++ b/src/gallium/targets/opencl/Makefile.am
> >> @@ -4,7 +4,7 @@ lib_LTLIBRARIES = lib@OPENCL_LIBNAME@.la
> >>
> >>  lib@OPENCL_LIBNAME@_la_LDFLAGS = \
> >>   $(LLVM_LDFLAGS) \
> >> - -version-number 1:0
> >> + -version-number @OPENCL_VERSION@:0
> >>
> >>  lib@OPENCL_LIBNAME@_la_LIBADD = \
> >>   $(top_builddir)/src/gallium/auxiliary/pipe-loader/libpipe_loader.la \
> >> @@ -34,7 +34,7 @@ lib@OPENCL_LIBNAME@_la_SOURCES =
> >>  nodist_EXTRA_lib@OPENCL_LIBNAME@_la_SOURCES = dummy.cpp
> >>
> >>  if HAVE_CLOVER_ICD
> >> -icddir = /etc/OpenCL/vendors/
> >> +icddir = @sysconfdir@/OpenCL/vendors/
> >
> > As I mentioned in the bug report, the ICD spec says that OpenCL/vendors/
> > should be in /etc/  I don't think we can change this and still be spec
> > compliant.  Why do you want to install the *.icd files in sysconfdir?
> 
> sysconfdir basically is etc. This hunk would allow you to install into
> a prefix and not have this file installed into /etc outside of your
> prefix.
Unfortunately ocl-icd HARDLY defined /etc. Resending new patch.

-- 
-Igor Gnatenko

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] opencl: improved auto-gen .icd

2014-01-13 Thread Matt Turner
On Mon, Jan 13, 2014 at 11:12 AM, Tom Stellard  wrote:
> On Sun, Jan 12, 2014 at 03:08:56AM +0400, Igor Gnatenko wrote:
>> From 5b2bf87f1238e44150492a39f5db0ae90d59459b Mon Sep 17 00:00:00 2001
>> From: Igor Gnatenko 
>> Date: Sun, 12 Jan 2014 02:09:16 +0400
>> Subject: [PATCH] opencl: improved auto-gen .icd
>>
>> v2: Use @OPENCL_VERSION@:0 for library
>> replace /etc with @sysconfdir@ macros
>>
>> Reported-by: Fabian Deutsch 
>> Reference: https://bugs.freedesktop.org/show_bug.cgi?id=73512
>> Signed-off-by: Igor Gnatenko 
>> ---
>>  configure.ac   | 3 +++
>>  src/gallium/targets/opencl/Makefile.am | 4 ++--
>>  src/gallium/targets/opencl/mesa.icd| 1 -
>>  src/gallium/targets/opencl/mesa.icd.in | 1 +
>>  4 files changed, 6 insertions(+), 3 deletions(-)
>>  delete mode 100644 src/gallium/targets/opencl/mesa.icd
>>  create mode 100644 src/gallium/targets/opencl/mesa.icd.in
>>
>> diff --git a/configure.ac b/configure.ac
>> index 4b55140..3452e15 100644
>> --- a/configure.ac
>> +++ b/configure.ac
>> @@ -25,6 +25,8 @@ m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
>>  dnl Set internal versions
>>  OSMESA_VERSION=8
>>  AC_SUBST([OSMESA_VERSION])
>> +OPENCL_VERSION=1
>> +AC_SUBST([OPENCL_VERSION])
>>
>>  dnl Versions for external dependencies
>>  LIBDRM_REQUIRED=2.4.24
>> @@ -2023,6 +2025,7 @@ AC_CONFIG_FILES([Makefile
>>   src/gallium/targets/egl-static/Makefile
>>   src/gallium/targets/gbm/Makefile
>>   src/gallium/targets/opencl/Makefile
>> + src/gallium/targets/opencl/mesa.icd
>>   src/gallium/targets/osmesa/Makefile
>>   src/gallium/targets/osmesa/osmesa.pc
>>   src/gallium/targets/pipe-loader/Makefile
>> diff --git a/src/gallium/targets/opencl/Makefile.am 
>> b/src/gallium/targets/opencl/Makefile.am
>> index 653302c..923316c 100644
>> --- a/src/gallium/targets/opencl/Makefile.am
>> +++ b/src/gallium/targets/opencl/Makefile.am
>> @@ -4,7 +4,7 @@ lib_LTLIBRARIES = lib@OPENCL_LIBNAME@.la
>>
>>  lib@OPENCL_LIBNAME@_la_LDFLAGS = \
>>   $(LLVM_LDFLAGS) \
>> - -version-number 1:0
>> + -version-number @OPENCL_VERSION@:0
>>
>>  lib@OPENCL_LIBNAME@_la_LIBADD = \
>>   $(top_builddir)/src/gallium/auxiliary/pipe-loader/libpipe_loader.la \
>> @@ -34,7 +34,7 @@ lib@OPENCL_LIBNAME@_la_SOURCES =
>>  nodist_EXTRA_lib@OPENCL_LIBNAME@_la_SOURCES = dummy.cpp
>>
>>  if HAVE_CLOVER_ICD
>> -icddir = /etc/OpenCL/vendors/
>> +icddir = @sysconfdir@/OpenCL/vendors/
>
> As I mentioned in the bug report, the ICD spec says that OpenCL/vendors/
> should be in /etc/  I don't think we can change this and still be spec
> compliant.  Why do you want to install the *.icd files in sysconfdir?

sysconfdir basically is etc. This hunk would allow you to install into
a prefix and not have this file installed into /etc outside of your
prefix.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] opencl: improved auto-gen .icd

2014-01-13 Thread Tom Stellard
On Sun, Jan 12, 2014 at 03:08:56AM +0400, Igor Gnatenko wrote:
> From 5b2bf87f1238e44150492a39f5db0ae90d59459b Mon Sep 17 00:00:00 2001
> From: Igor Gnatenko 
> Date: Sun, 12 Jan 2014 02:09:16 +0400
> Subject: [PATCH] opencl: improved auto-gen .icd
> 
> v2: Use @OPENCL_VERSION@:0 for library
> replace /etc with @sysconfdir@ macros
> 
> Reported-by: Fabian Deutsch 
> Reference: https://bugs.freedesktop.org/show_bug.cgi?id=73512
> Signed-off-by: Igor Gnatenko 
> ---
>  configure.ac   | 3 +++
>  src/gallium/targets/opencl/Makefile.am | 4 ++--
>  src/gallium/targets/opencl/mesa.icd| 1 -
>  src/gallium/targets/opencl/mesa.icd.in | 1 +
>  4 files changed, 6 insertions(+), 3 deletions(-)
>  delete mode 100644 src/gallium/targets/opencl/mesa.icd
>  create mode 100644 src/gallium/targets/opencl/mesa.icd.in
> 
> diff --git a/configure.ac b/configure.ac
> index 4b55140..3452e15 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -25,6 +25,8 @@ m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
>  dnl Set internal versions
>  OSMESA_VERSION=8
>  AC_SUBST([OSMESA_VERSION])
> +OPENCL_VERSION=1
> +AC_SUBST([OPENCL_VERSION])
>  
>  dnl Versions for external dependencies
>  LIBDRM_REQUIRED=2.4.24
> @@ -2023,6 +2025,7 @@ AC_CONFIG_FILES([Makefile
>   src/gallium/targets/egl-static/Makefile
>   src/gallium/targets/gbm/Makefile
>   src/gallium/targets/opencl/Makefile
> + src/gallium/targets/opencl/mesa.icd
>   src/gallium/targets/osmesa/Makefile
>   src/gallium/targets/osmesa/osmesa.pc
>   src/gallium/targets/pipe-loader/Makefile
> diff --git a/src/gallium/targets/opencl/Makefile.am 
> b/src/gallium/targets/opencl/Makefile.am
> index 653302c..923316c 100644
> --- a/src/gallium/targets/opencl/Makefile.am
> +++ b/src/gallium/targets/opencl/Makefile.am
> @@ -4,7 +4,7 @@ lib_LTLIBRARIES = lib@OPENCL_LIBNAME@.la
>  
>  lib@OPENCL_LIBNAME@_la_LDFLAGS = \
>   $(LLVM_LDFLAGS) \
> - -version-number 1:0
> + -version-number @OPENCL_VERSION@:0
>  
>  lib@OPENCL_LIBNAME@_la_LIBADD = \
>   $(top_builddir)/src/gallium/auxiliary/pipe-loader/libpipe_loader.la \
> @@ -34,7 +34,7 @@ lib@OPENCL_LIBNAME@_la_SOURCES =
>  nodist_EXTRA_lib@OPENCL_LIBNAME@_la_SOURCES = dummy.cpp
>  
>  if HAVE_CLOVER_ICD
> -icddir = /etc/OpenCL/vendors/
> +icddir = @sysconfdir@/OpenCL/vendors/

As I mentioned in the bug report, the ICD spec says that OpenCL/vendors/
should be in /etc/  I don't think we can change this and still be spec
compliant.  Why do you want to install the *.icd files in sysconfdir?

>  icd_DATA = mesa.icd
>  endif
>  
> diff --git a/src/gallium/targets/opencl/mesa.icd 
> b/src/gallium/targets/opencl/mesa.icd
> deleted file mode 100644
> index 6a6a870..000
> --- a/src/gallium/targets/opencl/mesa.icd
> +++ /dev/null
> @@ -1 +0,0 @@
> -libMesaOpenCL.so
> diff --git a/src/gallium/targets/opencl/mesa.icd.in 
> b/src/gallium/targets/opencl/mesa.icd.in
> new file mode 100644
> index 000..a0b6489
> --- /dev/null
> +++ b/src/gallium/targets/opencl/mesa.icd.in
> @@ -0,0 +1 @@
> +@libdir@/lib@OPENCL_LIBNAME@.so.@OPENCL_VERSION@

Again, the spec says only the library name should go here and not the full
path.

-Tom

> -- 
> 1.8.4.2
> 
> -- 
> -Igor Gnatenko
> 
> 
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] opencl: improved auto-gen .icd

2014-01-11 Thread Igor Gnatenko
>From 5b2bf87f1238e44150492a39f5db0ae90d59459b Mon Sep 17 00:00:00 2001
From: Igor Gnatenko 
Date: Sun, 12 Jan 2014 02:09:16 +0400
Subject: [PATCH] opencl: improved auto-gen .icd

v2: Use @OPENCL_VERSION@:0 for library
replace /etc with @sysconfdir@ macros

Reported-by: Fabian Deutsch 
Reference: https://bugs.freedesktop.org/show_bug.cgi?id=73512
Signed-off-by: Igor Gnatenko 
---
 configure.ac   | 3 +++
 src/gallium/targets/opencl/Makefile.am | 4 ++--
 src/gallium/targets/opencl/mesa.icd| 1 -
 src/gallium/targets/opencl/mesa.icd.in | 1 +
 4 files changed, 6 insertions(+), 3 deletions(-)
 delete mode 100644 src/gallium/targets/opencl/mesa.icd
 create mode 100644 src/gallium/targets/opencl/mesa.icd.in

diff --git a/configure.ac b/configure.ac
index 4b55140..3452e15 100644
--- a/configure.ac
+++ b/configure.ac
@@ -25,6 +25,8 @@ m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
 dnl Set internal versions
 OSMESA_VERSION=8
 AC_SUBST([OSMESA_VERSION])
+OPENCL_VERSION=1
+AC_SUBST([OPENCL_VERSION])
 
 dnl Versions for external dependencies
 LIBDRM_REQUIRED=2.4.24
@@ -2023,6 +2025,7 @@ AC_CONFIG_FILES([Makefile
src/gallium/targets/egl-static/Makefile
src/gallium/targets/gbm/Makefile
src/gallium/targets/opencl/Makefile
+   src/gallium/targets/opencl/mesa.icd
src/gallium/targets/osmesa/Makefile
src/gallium/targets/osmesa/osmesa.pc
src/gallium/targets/pipe-loader/Makefile
diff --git a/src/gallium/targets/opencl/Makefile.am 
b/src/gallium/targets/opencl/Makefile.am
index 653302c..923316c 100644
--- a/src/gallium/targets/opencl/Makefile.am
+++ b/src/gallium/targets/opencl/Makefile.am
@@ -4,7 +4,7 @@ lib_LTLIBRARIES = lib@OPENCL_LIBNAME@.la
 
 lib@OPENCL_LIBNAME@_la_LDFLAGS = \
$(LLVM_LDFLAGS) \
-   -version-number 1:0
+   -version-number @OPENCL_VERSION@:0
 
 lib@OPENCL_LIBNAME@_la_LIBADD = \
$(top_builddir)/src/gallium/auxiliary/pipe-loader/libpipe_loader.la \
@@ -34,7 +34,7 @@ lib@OPENCL_LIBNAME@_la_SOURCES =
 nodist_EXTRA_lib@OPENCL_LIBNAME@_la_SOURCES = dummy.cpp
 
 if HAVE_CLOVER_ICD
-icddir = /etc/OpenCL/vendors/
+icddir = @sysconfdir@/OpenCL/vendors/
 icd_DATA = mesa.icd
 endif
 
diff --git a/src/gallium/targets/opencl/mesa.icd 
b/src/gallium/targets/opencl/mesa.icd
deleted file mode 100644
index 6a6a870..000
--- a/src/gallium/targets/opencl/mesa.icd
+++ /dev/null
@@ -1 +0,0 @@
-libMesaOpenCL.so
diff --git a/src/gallium/targets/opencl/mesa.icd.in 
b/src/gallium/targets/opencl/mesa.icd.in
new file mode 100644
index 000..a0b6489
--- /dev/null
+++ b/src/gallium/targets/opencl/mesa.icd.in
@@ -0,0 +1 @@
+@libdir@/lib@OPENCL_LIBNAME@.so.@OPENCL_VERSION@
-- 
1.8.4.2

-- 
-Igor Gnatenko


___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev