Re: [Mesa-dev] [PATCH v3 3/4] meson: build clover

2018-01-07 Thread Jan Vesely
On Sat, 2018-01-06 at 15:48 -0800, Dylan Baker wrote:
> Quoting Jan Vesely (2018-01-06 15:18:54)
> > On Fri, 2018-01-05 at 15:26 -0800, Dylan Baker wrote:
> > > Quoting Jan Vesely (2018-01-05 14:16:41)
> > > > Hi,
> > > > 
> > > > 
> > > > sorry for the delay. I was mostly traveling during the holidays.
> > > 
> > > No worries, I was also away over the holidays and didn't look at this 
> > > until
> > > today.
> > > 
> > > > 
> > > > On Fri, 2017-12-15 at 10:54 -0800, Dylan Baker wrote:
> > > > > This has only been compile tested.
> > > > > 
> > > > > v2: - Have a single option for opencl (Eric E)
> > > > > - fix typo "tgis" -> "tgsi" (Curro)
> > > > > - Don't add "lib" to pipe loader libraries, which matches the
> > > > >   autotools behavior
> > > > > v3: - Remove trailing whitespace
> > > > > - Make PIPE_SEARCH_DIR an absolute path
> > > > > 
> > > > > cc: Curro Jerez 
> > > > > cc: Jan Vesely 
> > > > > cc: Aaron Watry 
> > > > > Signed-off-by: Dylan Baker 
> > > > > ---
> > > > >  include/meson.build   |  19 
> > > > >  meson.build   |  29 +-
> > > > >  meson_options.txt |   7 ++
> > > > >  src/gallium/auxiliary/pipe-loader/meson.build |   3 +-
> > > > >  src/gallium/meson.build   |  12 ++-
> > > > >  src/gallium/state_trackers/clover/meson.build | 122 
> > > > > ++
> > > > >  src/gallium/targets/opencl/meson.build|  73 +++
> > > > >  src/gallium/targets/pipe-loader/meson.build   |  77 
> > > > >  8 files changed, 336 insertions(+), 6 deletions(-)
> > > > >  create mode 100644 src/gallium/state_trackers/clover/meson.build
> > > > >  create mode 100644 src/gallium/targets/opencl/meson.build
> > > > >  create mode 100644 src/gallium/targets/pipe-loader/meson.build
> > > > > 
> > > > > diff --git a/include/meson.build b/include/meson.build
> > > > > index e4dae91cede..a2e7ce6580e 100644
> > > > > --- a/include/meson.build
> > > > > +++ b/include/meson.build
> > > > > @@ -78,3 +78,22 @@ if with_gallium_st_nine
> > > > >  subdir : 'd3dadapter',
> > > > >)
> > > > >  endif
> > > > > +
> > > > > +# Only install the headers if we are building a stand alone 
> > > > > implementation and
> > > > > +# not an ICD enabled implementation
> > > > > +if with_gallium_opencl and not with_opencl_icd
> > > > > +  install_headers(
> > > > > +'CL/cl.h',
> > > > > +'CL/cl.hpp',
> > > > > +'CL/cl_d3d10.h',
> > > > > +'CL/cl_d3d11.h',
> > > > > +'CL/cl_dx9_media_sharing.h',
> > > > > +'CL/cl_egl.h',
> > > > > +'CL/cl_ext.h',
> > > > > +'CL/cl_gl.h',
> > > > > +'CL/cl_gl_ext.h',
> > > > > +'CL/cl_platform.h',
> > > > > +'CL/opencl.h',
> > > > > +subdir: 'CL'
> > > > > +  )
> > > > > +endif
> > > > > diff --git a/meson.build b/meson.build
> > > > > index 842d441199e..74b2d5c49dc 100644
> > > > > --- a/meson.build
> > > > > +++ b/meson.build
> > > > > @@ -583,6 +583,22 @@ if with_gallium_st_nine
> > > > >endif
> > > > >  endif
> > > > >  
> > > > > +_opencl = get_option('gallium-opencl')
> > > > > +if _opencl !=' disabled'
> > > > > +  if not with_gallium
> > > > > +error('OpenCL Clover implementation requires at least one 
> > > > > gallium driver.')
> > > > > +  endif
> > > > > +
> > > > > +  # TODO: alitvec?
> > > > > +  dep_clc = dependency('libclc')
> > > > > +  with_gallium_opencl = true
> > > > > +  with_opencl_icd = _opencl == 'icd'
> > > > > +else
> > > > > +  dep_clc = []
> > > > > +  with_gallium_opencl = false
> > > > > +  with_gallium_icd = false
> > > > > +endif
> > > > > +
> > > > >  gl_pkgconfig_c_flags = []
> > > > >  if with_platform_x11
> > > > >if with_any_vk or (with_glx == 'dri' and with_dri_platform == 
> > > > > 'drm')
> > > > > @@ -930,7 +946,7 @@ dep_thread = dependency('threads')
> > > > >  if dep_thread.found() and host_machine.system() != 'windows'
> > > > >pre_args += '-DHAVE_PTHREAD'
> > > > >  endif
> > > > > -if with_amd_vk or with_gallium_radeonsi or with_gallium_r600 # TODO: 
> > > > > clover
> > > > > +if with_amd_vk or with_gallium_radeonsi or with_gallium_r600 or 
> > > > > with_gallium_opencl
> > > > >dep_elf = dependency('libelf', required : false)
> > > > >if not dep_elf.found()
> > > > >  dep_elf = cc.find_library('elf')
> > > > > @@ -972,12 +988,19 @@ if with_amd_vk or with_gallium_radeonsi or 
> > > > > with_gallium_r600
> > > > >  llvm_modules += 'asmparser'
> > > > >endif
> > > > >  endif
> > > > > +if with_gallium_opencl
> > > > > +  llvm_modules += [
> > > > > +'all-targets', 'linker', 'coverage', 'instrumentation', 'ipo', 
> > > > > 'irreader',
> > > > > +'lto', 'option', 'objcarcopts', 'profiledata',
> > > > > +  ]
> > > > > +  # TODO: optional modules
> > > > > +endif
> > > > >  
> > > > >  _llvm = 

Re: [Mesa-dev] [PATCH v3 3/4] meson: build clover

2018-01-06 Thread Dylan Baker
Quoting Jan Vesely (2018-01-06 15:18:54)
> On Fri, 2018-01-05 at 15:26 -0800, Dylan Baker wrote:
> > Quoting Jan Vesely (2018-01-05 14:16:41)
> > > Hi,
> > > 
> > > 
> > > sorry for the delay. I was mostly traveling during the holidays.
> > 
> > No worries, I was also away over the holidays and didn't look at this until
> > today.
> > 
> > > 
> > > On Fri, 2017-12-15 at 10:54 -0800, Dylan Baker wrote:
> > > > This has only been compile tested.
> > > > 
> > > > v2: - Have a single option for opencl (Eric E)
> > > > - fix typo "tgis" -> "tgsi" (Curro)
> > > > - Don't add "lib" to pipe loader libraries, which matches the
> > > >   autotools behavior
> > > > v3: - Remove trailing whitespace
> > > > - Make PIPE_SEARCH_DIR an absolute path
> > > > 
> > > > cc: Curro Jerez 
> > > > cc: Jan Vesely 
> > > > cc: Aaron Watry 
> > > > Signed-off-by: Dylan Baker 
> > > > ---
> > > >  include/meson.build   |  19 
> > > >  meson.build   |  29 +-
> > > >  meson_options.txt |   7 ++
> > > >  src/gallium/auxiliary/pipe-loader/meson.build |   3 +-
> > > >  src/gallium/meson.build   |  12 ++-
> > > >  src/gallium/state_trackers/clover/meson.build | 122 
> > > > ++
> > > >  src/gallium/targets/opencl/meson.build|  73 +++
> > > >  src/gallium/targets/pipe-loader/meson.build   |  77 
> > > >  8 files changed, 336 insertions(+), 6 deletions(-)
> > > >  create mode 100644 src/gallium/state_trackers/clover/meson.build
> > > >  create mode 100644 src/gallium/targets/opencl/meson.build
> > > >  create mode 100644 src/gallium/targets/pipe-loader/meson.build
> > > > 
> > > > diff --git a/include/meson.build b/include/meson.build
> > > > index e4dae91cede..a2e7ce6580e 100644
> > > > --- a/include/meson.build
> > > > +++ b/include/meson.build
> > > > @@ -78,3 +78,22 @@ if with_gallium_st_nine
> > > >  subdir : 'd3dadapter',
> > > >)
> > > >  endif
> > > > +
> > > > +# Only install the headers if we are building a stand alone 
> > > > implementation and
> > > > +# not an ICD enabled implementation
> > > > +if with_gallium_opencl and not with_opencl_icd
> > > > +  install_headers(
> > > > +'CL/cl.h',
> > > > +'CL/cl.hpp',
> > > > +'CL/cl_d3d10.h',
> > > > +'CL/cl_d3d11.h',
> > > > +'CL/cl_dx9_media_sharing.h',
> > > > +'CL/cl_egl.h',
> > > > +'CL/cl_ext.h',
> > > > +'CL/cl_gl.h',
> > > > +'CL/cl_gl_ext.h',
> > > > +'CL/cl_platform.h',
> > > > +'CL/opencl.h',
> > > > +subdir: 'CL'
> > > > +  )
> > > > +endif
> > > > diff --git a/meson.build b/meson.build
> > > > index 842d441199e..74b2d5c49dc 100644
> > > > --- a/meson.build
> > > > +++ b/meson.build
> > > > @@ -583,6 +583,22 @@ if with_gallium_st_nine
> > > >endif
> > > >  endif
> > > >  
> > > > +_opencl = get_option('gallium-opencl')
> > > > +if _opencl !=' disabled'
> > > > +  if not with_gallium
> > > > +error('OpenCL Clover implementation requires at least one gallium 
> > > > driver.')
> > > > +  endif
> > > > +
> > > > +  # TODO: alitvec?
> > > > +  dep_clc = dependency('libclc')
> > > > +  with_gallium_opencl = true
> > > > +  with_opencl_icd = _opencl == 'icd'
> > > > +else
> > > > +  dep_clc = []
> > > > +  with_gallium_opencl = false
> > > > +  with_gallium_icd = false
> > > > +endif
> > > > +
> > > >  gl_pkgconfig_c_flags = []
> > > >  if with_platform_x11
> > > >if with_any_vk or (with_glx == 'dri' and with_dri_platform == 'drm')
> > > > @@ -930,7 +946,7 @@ dep_thread = dependency('threads')
> > > >  if dep_thread.found() and host_machine.system() != 'windows'
> > > >pre_args += '-DHAVE_PTHREAD'
> > > >  endif
> > > > -if with_amd_vk or with_gallium_radeonsi or with_gallium_r600 # TODO: 
> > > > clover
> > > > +if with_amd_vk or with_gallium_radeonsi or with_gallium_r600 or 
> > > > with_gallium_opencl
> > > >dep_elf = dependency('libelf', required : false)
> > > >if not dep_elf.found()
> > > >  dep_elf = cc.find_library('elf')
> > > > @@ -972,12 +988,19 @@ if with_amd_vk or with_gallium_radeonsi or 
> > > > with_gallium_r600
> > > >  llvm_modules += 'asmparser'
> > > >endif
> > > >  endif
> > > > +if with_gallium_opencl
> > > > +  llvm_modules += [
> > > > +'all-targets', 'linker', 'coverage', 'instrumentation', 'ipo', 
> > > > 'irreader',
> > > > +'lto', 'option', 'objcarcopts', 'profiledata',
> > > > +  ]
> > > > +  # TODO: optional modules
> > > > +endif
> > > >  
> > > >  _llvm = get_option('llvm')
> > > >  if _llvm == 'auto'
> > > >dep_llvm = dependency(
> > > >  'llvm', version : '>= 3.9.0', modules : llvm_modules,
> > > > -required : with_amd_vk or with_gallium_radeonsi or 
> > > > with_gallium_swr,
> > > > +required : with_amd_vk or with_gallium_radeonsi or 
> > > > 

Re: [Mesa-dev] [PATCH v3 3/4] meson: build clover

2018-01-06 Thread Jan Vesely
On Fri, 2018-01-05 at 15:26 -0800, Dylan Baker wrote:
> Quoting Jan Vesely (2018-01-05 14:16:41)
> > Hi,
> > 
> > 
> > sorry for the delay. I was mostly traveling during the holidays.
> 
> No worries, I was also away over the holidays and didn't look at this until
> today.
> 
> > 
> > On Fri, 2017-12-15 at 10:54 -0800, Dylan Baker wrote:
> > > This has only been compile tested.
> > > 
> > > v2: - Have a single option for opencl (Eric E)
> > > - fix typo "tgis" -> "tgsi" (Curro)
> > > - Don't add "lib" to pipe loader libraries, which matches the
> > >   autotools behavior
> > > v3: - Remove trailing whitespace
> > > - Make PIPE_SEARCH_DIR an absolute path
> > > 
> > > cc: Curro Jerez 
> > > cc: Jan Vesely 
> > > cc: Aaron Watry 
> > > Signed-off-by: Dylan Baker 
> > > ---
> > >  include/meson.build   |  19 
> > >  meson.build   |  29 +-
> > >  meson_options.txt |   7 ++
> > >  src/gallium/auxiliary/pipe-loader/meson.build |   3 +-
> > >  src/gallium/meson.build   |  12 ++-
> > >  src/gallium/state_trackers/clover/meson.build | 122 
> > > ++
> > >  src/gallium/targets/opencl/meson.build|  73 +++
> > >  src/gallium/targets/pipe-loader/meson.build   |  77 
> > >  8 files changed, 336 insertions(+), 6 deletions(-)
> > >  create mode 100644 src/gallium/state_trackers/clover/meson.build
> > >  create mode 100644 src/gallium/targets/opencl/meson.build
> > >  create mode 100644 src/gallium/targets/pipe-loader/meson.build
> > > 
> > > diff --git a/include/meson.build b/include/meson.build
> > > index e4dae91cede..a2e7ce6580e 100644
> > > --- a/include/meson.build
> > > +++ b/include/meson.build
> > > @@ -78,3 +78,22 @@ if with_gallium_st_nine
> > >  subdir : 'd3dadapter',
> > >)
> > >  endif
> > > +
> > > +# Only install the headers if we are building a stand alone 
> > > implementation and
> > > +# not an ICD enabled implementation
> > > +if with_gallium_opencl and not with_opencl_icd
> > > +  install_headers(
> > > +'CL/cl.h',
> > > +'CL/cl.hpp',
> > > +'CL/cl_d3d10.h',
> > > +'CL/cl_d3d11.h',
> > > +'CL/cl_dx9_media_sharing.h',
> > > +'CL/cl_egl.h',
> > > +'CL/cl_ext.h',
> > > +'CL/cl_gl.h',
> > > +'CL/cl_gl_ext.h',
> > > +'CL/cl_platform.h',
> > > +'CL/opencl.h',
> > > +subdir: 'CL'
> > > +  )
> > > +endif
> > > diff --git a/meson.build b/meson.build
> > > index 842d441199e..74b2d5c49dc 100644
> > > --- a/meson.build
> > > +++ b/meson.build
> > > @@ -583,6 +583,22 @@ if with_gallium_st_nine
> > >endif
> > >  endif
> > >  
> > > +_opencl = get_option('gallium-opencl')
> > > +if _opencl !=' disabled'
> > > +  if not with_gallium
> > > +error('OpenCL Clover implementation requires at least one gallium 
> > > driver.')
> > > +  endif
> > > +
> > > +  # TODO: alitvec?
> > > +  dep_clc = dependency('libclc')
> > > +  with_gallium_opencl = true
> > > +  with_opencl_icd = _opencl == 'icd'
> > > +else
> > > +  dep_clc = []
> > > +  with_gallium_opencl = false
> > > +  with_gallium_icd = false
> > > +endif
> > > +
> > >  gl_pkgconfig_c_flags = []
> > >  if with_platform_x11
> > >if with_any_vk or (with_glx == 'dri' and with_dri_platform == 'drm')
> > > @@ -930,7 +946,7 @@ dep_thread = dependency('threads')
> > >  if dep_thread.found() and host_machine.system() != 'windows'
> > >pre_args += '-DHAVE_PTHREAD'
> > >  endif
> > > -if with_amd_vk or with_gallium_radeonsi or with_gallium_r600 # TODO: 
> > > clover
> > > +if with_amd_vk or with_gallium_radeonsi or with_gallium_r600 or 
> > > with_gallium_opencl
> > >dep_elf = dependency('libelf', required : false)
> > >if not dep_elf.found()
> > >  dep_elf = cc.find_library('elf')
> > > @@ -972,12 +988,19 @@ if with_amd_vk or with_gallium_radeonsi or 
> > > with_gallium_r600
> > >  llvm_modules += 'asmparser'
> > >endif
> > >  endif
> > > +if with_gallium_opencl
> > > +  llvm_modules += [
> > > +'all-targets', 'linker', 'coverage', 'instrumentation', 'ipo', 
> > > 'irreader',
> > > +'lto', 'option', 'objcarcopts', 'profiledata',
> > > +  ]
> > > +  # TODO: optional modules
> > > +endif
> > >  
> > >  _llvm = get_option('llvm')
> > >  if _llvm == 'auto'
> > >dep_llvm = dependency(
> > >  'llvm', version : '>= 3.9.0', modules : llvm_modules,
> > > -required : with_amd_vk or with_gallium_radeonsi or with_gallium_swr,
> > > +required : with_amd_vk or with_gallium_radeonsi or with_gallium_swr 
> > > or with_gallium_opencl,
> > >)
> > >with_llvm = dep_llvm.found()
> > >  elif _llvm == 'true'
> > > @@ -1154,8 +1177,6 @@ else
> > >dep_lmsensors = []
> > >  endif
> > >  
> > > -# TODO: clover
> > > -
> > >  # TODO: gallium tests
> > >  
> > >  # TODO: various libdirs
> > > diff --git 

Re: [Mesa-dev] [PATCH v3 3/4] meson: build clover

2018-01-05 Thread Dylan Baker
Quoting Jan Vesely (2018-01-05 14:16:41)
> Hi,
> 
> 
> sorry for the delay. I was mostly traveling during the holidays.

No worries, I was also away over the holidays and didn't look at this until
today.

> 
> On Fri, 2017-12-15 at 10:54 -0800, Dylan Baker wrote:
> > This has only been compile tested.
> > 
> > v2: - Have a single option for opencl (Eric E)
> > - fix typo "tgis" -> "tgsi" (Curro)
> > - Don't add "lib" to pipe loader libraries, which matches the
> >   autotools behavior
> > v3: - Remove trailing whitespace
> > - Make PIPE_SEARCH_DIR an absolute path
> > 
> > cc: Curro Jerez 
> > cc: Jan Vesely 
> > cc: Aaron Watry 
> > Signed-off-by: Dylan Baker 
> > ---
> >  include/meson.build   |  19 
> >  meson.build   |  29 +-
> >  meson_options.txt |   7 ++
> >  src/gallium/auxiliary/pipe-loader/meson.build |   3 +-
> >  src/gallium/meson.build   |  12 ++-
> >  src/gallium/state_trackers/clover/meson.build | 122 
> > ++
> >  src/gallium/targets/opencl/meson.build|  73 +++
> >  src/gallium/targets/pipe-loader/meson.build   |  77 
> >  8 files changed, 336 insertions(+), 6 deletions(-)
> >  create mode 100644 src/gallium/state_trackers/clover/meson.build
> >  create mode 100644 src/gallium/targets/opencl/meson.build
> >  create mode 100644 src/gallium/targets/pipe-loader/meson.build
> > 
> > diff --git a/include/meson.build b/include/meson.build
> > index e4dae91cede..a2e7ce6580e 100644
> > --- a/include/meson.build
> > +++ b/include/meson.build
> > @@ -78,3 +78,22 @@ if with_gallium_st_nine
> >  subdir : 'd3dadapter',
> >)
> >  endif
> > +
> > +# Only install the headers if we are building a stand alone implementation 
> > and
> > +# not an ICD enabled implementation
> > +if with_gallium_opencl and not with_opencl_icd
> > +  install_headers(
> > +'CL/cl.h',
> > +'CL/cl.hpp',
> > +'CL/cl_d3d10.h',
> > +'CL/cl_d3d11.h',
> > +'CL/cl_dx9_media_sharing.h',
> > +'CL/cl_egl.h',
> > +'CL/cl_ext.h',
> > +'CL/cl_gl.h',
> > +'CL/cl_gl_ext.h',
> > +'CL/cl_platform.h',
> > +'CL/opencl.h',
> > +subdir: 'CL'
> > +  )
> > +endif
> > diff --git a/meson.build b/meson.build
> > index 842d441199e..74b2d5c49dc 100644
> > --- a/meson.build
> > +++ b/meson.build
> > @@ -583,6 +583,22 @@ if with_gallium_st_nine
> >endif
> >  endif
> >  
> > +_opencl = get_option('gallium-opencl')
> > +if _opencl !=' disabled'
> > +  if not with_gallium
> > +error('OpenCL Clover implementation requires at least one gallium 
> > driver.')
> > +  endif
> > +
> > +  # TODO: alitvec?
> > +  dep_clc = dependency('libclc')
> > +  with_gallium_opencl = true
> > +  with_opencl_icd = _opencl == 'icd'
> > +else
> > +  dep_clc = []
> > +  with_gallium_opencl = false
> > +  with_gallium_icd = false
> > +endif
> > +
> >  gl_pkgconfig_c_flags = []
> >  if with_platform_x11
> >if with_any_vk or (with_glx == 'dri' and with_dri_platform == 'drm')
> > @@ -930,7 +946,7 @@ dep_thread = dependency('threads')
> >  if dep_thread.found() and host_machine.system() != 'windows'
> >pre_args += '-DHAVE_PTHREAD'
> >  endif
> > -if with_amd_vk or with_gallium_radeonsi or with_gallium_r600 # TODO: clover
> > +if with_amd_vk or with_gallium_radeonsi or with_gallium_r600 or 
> > with_gallium_opencl
> >dep_elf = dependency('libelf', required : false)
> >if not dep_elf.found()
> >  dep_elf = cc.find_library('elf')
> > @@ -972,12 +988,19 @@ if with_amd_vk or with_gallium_radeonsi or 
> > with_gallium_r600
> >  llvm_modules += 'asmparser'
> >endif
> >  endif
> > +if with_gallium_opencl
> > +  llvm_modules += [
> > +'all-targets', 'linker', 'coverage', 'instrumentation', 'ipo', 
> > 'irreader',
> > +'lto', 'option', 'objcarcopts', 'profiledata',
> > +  ]
> > +  # TODO: optional modules
> > +endif
> >  
> >  _llvm = get_option('llvm')
> >  if _llvm == 'auto'
> >dep_llvm = dependency(
> >  'llvm', version : '>= 3.9.0', modules : llvm_modules,
> > -required : with_amd_vk or with_gallium_radeonsi or with_gallium_swr,
> > +required : with_amd_vk or with_gallium_radeonsi or with_gallium_swr or 
> > with_gallium_opencl,
> >)
> >with_llvm = dep_llvm.found()
> >  elif _llvm == 'true'
> > @@ -1154,8 +1177,6 @@ else
> >dep_lmsensors = []
> >  endif
> >  
> > -# TODO: clover
> > -
> >  # TODO: gallium tests
> >  
> >  # TODO: various libdirs
> > diff --git a/meson_options.txt b/meson_options.txt
> > index 4f4db5b7d26..894378985fd 100644
> > --- a/meson_options.txt
> > +++ b/meson_options.txt
> > @@ -120,6 +120,13 @@ option(
> >value : false,
> >description : 'build gallium "nine" Direct3D 9.x state tracker.',
> >  )
> > +option(
> > +  'gallium-opencl',
> > +  type : 'combo',
> > +  

Re: [Mesa-dev] [PATCH v3 3/4] meson: build clover

2018-01-05 Thread Jan Vesely
Hi,


sorry for the delay. I was mostly traveling during the holidays.

On Fri, 2017-12-15 at 10:54 -0800, Dylan Baker wrote:
> This has only been compile tested.
> 
> v2: - Have a single option for opencl (Eric E)
> - fix typo "tgis" -> "tgsi" (Curro)
> - Don't add "lib" to pipe loader libraries, which matches the
>   autotools behavior
> v3: - Remove trailing whitespace
> - Make PIPE_SEARCH_DIR an absolute path
> 
> cc: Curro Jerez 
> cc: Jan Vesely 
> cc: Aaron Watry 
> Signed-off-by: Dylan Baker 
> ---
>  include/meson.build   |  19 
>  meson.build   |  29 +-
>  meson_options.txt |   7 ++
>  src/gallium/auxiliary/pipe-loader/meson.build |   3 +-
>  src/gallium/meson.build   |  12 ++-
>  src/gallium/state_trackers/clover/meson.build | 122 
> ++
>  src/gallium/targets/opencl/meson.build|  73 +++
>  src/gallium/targets/pipe-loader/meson.build   |  77 
>  8 files changed, 336 insertions(+), 6 deletions(-)
>  create mode 100644 src/gallium/state_trackers/clover/meson.build
>  create mode 100644 src/gallium/targets/opencl/meson.build
>  create mode 100644 src/gallium/targets/pipe-loader/meson.build
> 
> diff --git a/include/meson.build b/include/meson.build
> index e4dae91cede..a2e7ce6580e 100644
> --- a/include/meson.build
> +++ b/include/meson.build
> @@ -78,3 +78,22 @@ if with_gallium_st_nine
>  subdir : 'd3dadapter',
>)
>  endif
> +
> +# Only install the headers if we are building a stand alone implementation 
> and
> +# not an ICD enabled implementation
> +if with_gallium_opencl and not with_opencl_icd
> +  install_headers(
> +'CL/cl.h',
> +'CL/cl.hpp',
> +'CL/cl_d3d10.h',
> +'CL/cl_d3d11.h',
> +'CL/cl_dx9_media_sharing.h',
> +'CL/cl_egl.h',
> +'CL/cl_ext.h',
> +'CL/cl_gl.h',
> +'CL/cl_gl_ext.h',
> +'CL/cl_platform.h',
> +'CL/opencl.h',
> +subdir: 'CL'
> +  )
> +endif
> diff --git a/meson.build b/meson.build
> index 842d441199e..74b2d5c49dc 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -583,6 +583,22 @@ if with_gallium_st_nine
>endif
>  endif
>  
> +_opencl = get_option('gallium-opencl')
> +if _opencl !=' disabled'
> +  if not with_gallium
> +error('OpenCL Clover implementation requires at least one gallium 
> driver.')
> +  endif
> +
> +  # TODO: alitvec?
> +  dep_clc = dependency('libclc')
> +  with_gallium_opencl = true
> +  with_opencl_icd = _opencl == 'icd'
> +else
> +  dep_clc = []
> +  with_gallium_opencl = false
> +  with_gallium_icd = false
> +endif
> +
>  gl_pkgconfig_c_flags = []
>  if with_platform_x11
>if with_any_vk or (with_glx == 'dri' and with_dri_platform == 'drm')
> @@ -930,7 +946,7 @@ dep_thread = dependency('threads')
>  if dep_thread.found() and host_machine.system() != 'windows'
>pre_args += '-DHAVE_PTHREAD'
>  endif
> -if with_amd_vk or with_gallium_radeonsi or with_gallium_r600 # TODO: clover
> +if with_amd_vk or with_gallium_radeonsi or with_gallium_r600 or 
> with_gallium_opencl
>dep_elf = dependency('libelf', required : false)
>if not dep_elf.found()
>  dep_elf = cc.find_library('elf')
> @@ -972,12 +988,19 @@ if with_amd_vk or with_gallium_radeonsi or 
> with_gallium_r600
>  llvm_modules += 'asmparser'
>endif
>  endif
> +if with_gallium_opencl
> +  llvm_modules += [
> +'all-targets', 'linker', 'coverage', 'instrumentation', 'ipo', 
> 'irreader',
> +'lto', 'option', 'objcarcopts', 'profiledata',
> +  ]
> +  # TODO: optional modules
> +endif
>  
>  _llvm = get_option('llvm')
>  if _llvm == 'auto'
>dep_llvm = dependency(
>  'llvm', version : '>= 3.9.0', modules : llvm_modules,
> -required : with_amd_vk or with_gallium_radeonsi or with_gallium_swr,
> +required : with_amd_vk or with_gallium_radeonsi or with_gallium_swr or 
> with_gallium_opencl,
>)
>with_llvm = dep_llvm.found()
>  elif _llvm == 'true'
> @@ -1154,8 +1177,6 @@ else
>dep_lmsensors = []
>  endif
>  
> -# TODO: clover
> -
>  # TODO: gallium tests
>  
>  # TODO: various libdirs
> diff --git a/meson_options.txt b/meson_options.txt
> index 4f4db5b7d26..894378985fd 100644
> --- a/meson_options.txt
> +++ b/meson_options.txt
> @@ -120,6 +120,13 @@ option(
>value : false,
>description : 'build gallium "nine" Direct3D 9.x state tracker.',
>  )
> +option(
> +  'gallium-opencl',
> +  type : 'combo',
> +  choices : ['icd', 'standalone', 'disabled'],
> +  value : 'disabled',
> +  description : 'build gallium "clover" OpenCL state tracker.',
> +)
>  option(
>'d3d-drivers-path',
>type : 'string',
> diff --git a/src/gallium/auxiliary/pipe-loader/meson.build 
> b/src/gallium/auxiliary/pipe-loader/meson.build
> index 9b12432aea0..869a2935149 100644
> --- a/src/gallium/auxiliary/pipe-loader/meson.build
> +++ 

Re: [Mesa-dev] [PATCH v3 3/4] meson: build clover

2018-01-03 Thread Francisco Jerez
Dylan Baker  writes:

> This has only been compile tested.
>
> v2: - Have a single option for opencl (Eric E)
> - fix typo "tgis" -> "tgsi" (Curro)
> - Don't add "lib" to pipe loader libraries, which matches the
>   autotools behavior
> v3: - Remove trailing whitespace
> - Make PIPE_SEARCH_DIR an absolute path
>
> cc: Curro Jerez 
> cc: Jan Vesely 
> cc: Aaron Watry 
> Signed-off-by: Dylan Baker 

Acked-by: Francisco Jerez 

> ---
>  include/meson.build   |  19 
>  meson.build   |  29 +-
>  meson_options.txt |   7 ++
>  src/gallium/auxiliary/pipe-loader/meson.build |   3 +-
>  src/gallium/meson.build   |  12 ++-
>  src/gallium/state_trackers/clover/meson.build | 122 
> ++
>  src/gallium/targets/opencl/meson.build|  73 +++
>  src/gallium/targets/pipe-loader/meson.build   |  77 
>  8 files changed, 336 insertions(+), 6 deletions(-)
>  create mode 100644 src/gallium/state_trackers/clover/meson.build
>  create mode 100644 src/gallium/targets/opencl/meson.build
>  create mode 100644 src/gallium/targets/pipe-loader/meson.build
>
> diff --git a/include/meson.build b/include/meson.build
> index e4dae91cede..a2e7ce6580e 100644
> --- a/include/meson.build
> +++ b/include/meson.build
> @@ -78,3 +78,22 @@ if with_gallium_st_nine
>  subdir : 'd3dadapter',
>)
>  endif
> +
> +# Only install the headers if we are building a stand alone implementation 
> and
> +# not an ICD enabled implementation
> +if with_gallium_opencl and not with_opencl_icd
> +  install_headers(
> +'CL/cl.h',
> +'CL/cl.hpp',
> +'CL/cl_d3d10.h',
> +'CL/cl_d3d11.h',
> +'CL/cl_dx9_media_sharing.h',
> +'CL/cl_egl.h',
> +'CL/cl_ext.h',
> +'CL/cl_gl.h',
> +'CL/cl_gl_ext.h',
> +'CL/cl_platform.h',
> +'CL/opencl.h',
> +subdir: 'CL'
> +  )
> +endif
> diff --git a/meson.build b/meson.build
> index 842d441199e..74b2d5c49dc 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -583,6 +583,22 @@ if with_gallium_st_nine
>endif
>  endif
>  
> +_opencl = get_option('gallium-opencl')
> +if _opencl !=' disabled'
> +  if not with_gallium
> +error('OpenCL Clover implementation requires at least one gallium 
> driver.')
> +  endif
> +
> +  # TODO: alitvec?
> +  dep_clc = dependency('libclc')
> +  with_gallium_opencl = true
> +  with_opencl_icd = _opencl == 'icd'
> +else
> +  dep_clc = []
> +  with_gallium_opencl = false
> +  with_gallium_icd = false
> +endif
> +
>  gl_pkgconfig_c_flags = []
>  if with_platform_x11
>if with_any_vk or (with_glx == 'dri' and with_dri_platform == 'drm')
> @@ -930,7 +946,7 @@ dep_thread = dependency('threads')
>  if dep_thread.found() and host_machine.system() != 'windows'
>pre_args += '-DHAVE_PTHREAD'
>  endif
> -if with_amd_vk or with_gallium_radeonsi or with_gallium_r600 # TODO: clover
> +if with_amd_vk or with_gallium_radeonsi or with_gallium_r600 or 
> with_gallium_opencl
>dep_elf = dependency('libelf', required : false)
>if not dep_elf.found()
>  dep_elf = cc.find_library('elf')
> @@ -972,12 +988,19 @@ if with_amd_vk or with_gallium_radeonsi or 
> with_gallium_r600
>  llvm_modules += 'asmparser'
>endif
>  endif
> +if with_gallium_opencl
> +  llvm_modules += [
> +'all-targets', 'linker', 'coverage', 'instrumentation', 'ipo', 
> 'irreader',
> +'lto', 'option', 'objcarcopts', 'profiledata',
> +  ]
> +  # TODO: optional modules
> +endif
>  
>  _llvm = get_option('llvm')
>  if _llvm == 'auto'
>dep_llvm = dependency(
>  'llvm', version : '>= 3.9.0', modules : llvm_modules,
> -required : with_amd_vk or with_gallium_radeonsi or with_gallium_swr,
> +required : with_amd_vk or with_gallium_radeonsi or with_gallium_swr or 
> with_gallium_opencl,
>)
>with_llvm = dep_llvm.found()
>  elif _llvm == 'true'
> @@ -1154,8 +1177,6 @@ else
>dep_lmsensors = []
>  endif
>  
> -# TODO: clover
> -
>  # TODO: gallium tests
>  
>  # TODO: various libdirs
> diff --git a/meson_options.txt b/meson_options.txt
> index 4f4db5b7d26..894378985fd 100644
> --- a/meson_options.txt
> +++ b/meson_options.txt
> @@ -120,6 +120,13 @@ option(
>value : false,
>description : 'build gallium "nine" Direct3D 9.x state tracker.',
>  )
> +option(
> +  'gallium-opencl',
> +  type : 'combo',
> +  choices : ['icd', 'standalone', 'disabled'],
> +  value : 'disabled',
> +  description : 'build gallium "clover" OpenCL state tracker.',
> +)
>  option(
>'d3d-drivers-path',
>type : 'string',
> diff --git a/src/gallium/auxiliary/pipe-loader/meson.build 
> b/src/gallium/auxiliary/pipe-loader/meson.build
> index 9b12432aea0..869a2935149 100644
> --- a/src/gallium/auxiliary/pipe-loader/meson.build
> +++ 

Re: [Mesa-dev] [PATCH v3 3/4] meson: build clover

2018-01-02 Thread Dylan Baker
ping.

Quoting Dylan Baker (2017-12-15 10:54:18)
> This has only been compile tested.
> 
> v2: - Have a single option for opencl (Eric E)
> - fix typo "tgis" -> "tgsi" (Curro)
> - Don't add "lib" to pipe loader libraries, which matches the
>   autotools behavior
> v3: - Remove trailing whitespace
> - Make PIPE_SEARCH_DIR an absolute path
> 
> cc: Curro Jerez 
> cc: Jan Vesely 
> cc: Aaron Watry 
> Signed-off-by: Dylan Baker 
> ---
>  include/meson.build   |  19 
>  meson.build   |  29 +-
>  meson_options.txt |   7 ++
>  src/gallium/auxiliary/pipe-loader/meson.build |   3 +-
>  src/gallium/meson.build   |  12 ++-
>  src/gallium/state_trackers/clover/meson.build | 122 
> ++
>  src/gallium/targets/opencl/meson.build|  73 +++
>  src/gallium/targets/pipe-loader/meson.build   |  77 
>  8 files changed, 336 insertions(+), 6 deletions(-)
>  create mode 100644 src/gallium/state_trackers/clover/meson.build
>  create mode 100644 src/gallium/targets/opencl/meson.build
>  create mode 100644 src/gallium/targets/pipe-loader/meson.build
> 
> diff --git a/include/meson.build b/include/meson.build
> index e4dae91cede..a2e7ce6580e 100644
> --- a/include/meson.build
> +++ b/include/meson.build
> @@ -78,3 +78,22 @@ if with_gallium_st_nine
>  subdir : 'd3dadapter',
>)
>  endif
> +
> +# Only install the headers if we are building a stand alone implementation 
> and
> +# not an ICD enabled implementation
> +if with_gallium_opencl and not with_opencl_icd
> +  install_headers(
> +'CL/cl.h',
> +'CL/cl.hpp',
> +'CL/cl_d3d10.h',
> +'CL/cl_d3d11.h',
> +'CL/cl_dx9_media_sharing.h',
> +'CL/cl_egl.h',
> +'CL/cl_ext.h',
> +'CL/cl_gl.h',
> +'CL/cl_gl_ext.h',
> +'CL/cl_platform.h',
> +'CL/opencl.h',
> +subdir: 'CL'
> +  )
> +endif
> diff --git a/meson.build b/meson.build
> index 842d441199e..74b2d5c49dc 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -583,6 +583,22 @@ if with_gallium_st_nine
>endif
>  endif
>  
> +_opencl = get_option('gallium-opencl')
> +if _opencl !=' disabled'
> +  if not with_gallium
> +error('OpenCL Clover implementation requires at least one gallium 
> driver.')
> +  endif
> +
> +  # TODO: alitvec?
> +  dep_clc = dependency('libclc')
> +  with_gallium_opencl = true
> +  with_opencl_icd = _opencl == 'icd'
> +else
> +  dep_clc = []
> +  with_gallium_opencl = false
> +  with_gallium_icd = false
> +endif
> +
>  gl_pkgconfig_c_flags = []
>  if with_platform_x11
>if with_any_vk or (with_glx == 'dri' and with_dri_platform == 'drm')
> @@ -930,7 +946,7 @@ dep_thread = dependency('threads')
>  if dep_thread.found() and host_machine.system() != 'windows'
>pre_args += '-DHAVE_PTHREAD'
>  endif
> -if with_amd_vk or with_gallium_radeonsi or with_gallium_r600 # TODO: clover
> +if with_amd_vk or with_gallium_radeonsi or with_gallium_r600 or 
> with_gallium_opencl
>dep_elf = dependency('libelf', required : false)
>if not dep_elf.found()
>  dep_elf = cc.find_library('elf')
> @@ -972,12 +988,19 @@ if with_amd_vk or with_gallium_radeonsi or 
> with_gallium_r600
>  llvm_modules += 'asmparser'
>endif
>  endif
> +if with_gallium_opencl
> +  llvm_modules += [
> +'all-targets', 'linker', 'coverage', 'instrumentation', 'ipo', 
> 'irreader',
> +'lto', 'option', 'objcarcopts', 'profiledata',
> +  ]
> +  # TODO: optional modules
> +endif
>  
>  _llvm = get_option('llvm')
>  if _llvm == 'auto'
>dep_llvm = dependency(
>  'llvm', version : '>= 3.9.0', modules : llvm_modules,
> -required : with_amd_vk or with_gallium_radeonsi or with_gallium_swr,
> +required : with_amd_vk or with_gallium_radeonsi or with_gallium_swr or 
> with_gallium_opencl,
>)
>with_llvm = dep_llvm.found()
>  elif _llvm == 'true'
> @@ -1154,8 +1177,6 @@ else
>dep_lmsensors = []
>  endif
>  
> -# TODO: clover
> -
>  # TODO: gallium tests
>  
>  # TODO: various libdirs
> diff --git a/meson_options.txt b/meson_options.txt
> index 4f4db5b7d26..894378985fd 100644
> --- a/meson_options.txt
> +++ b/meson_options.txt
> @@ -120,6 +120,13 @@ option(
>value : false,
>description : 'build gallium "nine" Direct3D 9.x state tracker.',
>  )
> +option(
> +  'gallium-opencl',
> +  type : 'combo',
> +  choices : ['icd', 'standalone', 'disabled'],
> +  value : 'disabled',
> +  description : 'build gallium "clover" OpenCL state tracker.',
> +)
>  option(
>'d3d-drivers-path',
>type : 'string',
> diff --git a/src/gallium/auxiliary/pipe-loader/meson.build 
> b/src/gallium/auxiliary/pipe-loader/meson.build
> index 9b12432aea0..869a2935149 100644
> --- a/src/gallium/auxiliary/pipe-loader/meson.build
> +++ b/src/gallium/auxiliary/pipe-loader/meson.build
> @@ -60,7 +60,8 @@ 

[Mesa-dev] [PATCH v3 3/4] meson: build clover

2017-12-15 Thread Dylan Baker
This has only been compile tested.

v2: - Have a single option for opencl (Eric E)
- fix typo "tgis" -> "tgsi" (Curro)
- Don't add "lib" to pipe loader libraries, which matches the
  autotools behavior
v3: - Remove trailing whitespace
- Make PIPE_SEARCH_DIR an absolute path

cc: Curro Jerez 
cc: Jan Vesely 
cc: Aaron Watry 
Signed-off-by: Dylan Baker 
---
 include/meson.build   |  19 
 meson.build   |  29 +-
 meson_options.txt |   7 ++
 src/gallium/auxiliary/pipe-loader/meson.build |   3 +-
 src/gallium/meson.build   |  12 ++-
 src/gallium/state_trackers/clover/meson.build | 122 ++
 src/gallium/targets/opencl/meson.build|  73 +++
 src/gallium/targets/pipe-loader/meson.build   |  77 
 8 files changed, 336 insertions(+), 6 deletions(-)
 create mode 100644 src/gallium/state_trackers/clover/meson.build
 create mode 100644 src/gallium/targets/opencl/meson.build
 create mode 100644 src/gallium/targets/pipe-loader/meson.build

diff --git a/include/meson.build b/include/meson.build
index e4dae91cede..a2e7ce6580e 100644
--- a/include/meson.build
+++ b/include/meson.build
@@ -78,3 +78,22 @@ if with_gallium_st_nine
 subdir : 'd3dadapter',
   )
 endif
+
+# Only install the headers if we are building a stand alone implementation and
+# not an ICD enabled implementation
+if with_gallium_opencl and not with_opencl_icd
+  install_headers(
+'CL/cl.h',
+'CL/cl.hpp',
+'CL/cl_d3d10.h',
+'CL/cl_d3d11.h',
+'CL/cl_dx9_media_sharing.h',
+'CL/cl_egl.h',
+'CL/cl_ext.h',
+'CL/cl_gl.h',
+'CL/cl_gl_ext.h',
+'CL/cl_platform.h',
+'CL/opencl.h',
+subdir: 'CL'
+  )
+endif
diff --git a/meson.build b/meson.build
index 842d441199e..74b2d5c49dc 100644
--- a/meson.build
+++ b/meson.build
@@ -583,6 +583,22 @@ if with_gallium_st_nine
   endif
 endif
 
+_opencl = get_option('gallium-opencl')
+if _opencl !=' disabled'
+  if not with_gallium
+error('OpenCL Clover implementation requires at least one gallium driver.')
+  endif
+
+  # TODO: alitvec?
+  dep_clc = dependency('libclc')
+  with_gallium_opencl = true
+  with_opencl_icd = _opencl == 'icd'
+else
+  dep_clc = []
+  with_gallium_opencl = false
+  with_gallium_icd = false
+endif
+
 gl_pkgconfig_c_flags = []
 if with_platform_x11
   if with_any_vk or (with_glx == 'dri' and with_dri_platform == 'drm')
@@ -930,7 +946,7 @@ dep_thread = dependency('threads')
 if dep_thread.found() and host_machine.system() != 'windows'
   pre_args += '-DHAVE_PTHREAD'
 endif
-if with_amd_vk or with_gallium_radeonsi or with_gallium_r600 # TODO: clover
+if with_amd_vk or with_gallium_radeonsi or with_gallium_r600 or 
with_gallium_opencl
   dep_elf = dependency('libelf', required : false)
   if not dep_elf.found()
 dep_elf = cc.find_library('elf')
@@ -972,12 +988,19 @@ if with_amd_vk or with_gallium_radeonsi or 
with_gallium_r600
 llvm_modules += 'asmparser'
   endif
 endif
+if with_gallium_opencl
+  llvm_modules += [
+'all-targets', 'linker', 'coverage', 'instrumentation', 'ipo', 'irreader',
+'lto', 'option', 'objcarcopts', 'profiledata',
+  ]
+  # TODO: optional modules
+endif
 
 _llvm = get_option('llvm')
 if _llvm == 'auto'
   dep_llvm = dependency(
 'llvm', version : '>= 3.9.0', modules : llvm_modules,
-required : with_amd_vk or with_gallium_radeonsi or with_gallium_swr,
+required : with_amd_vk or with_gallium_radeonsi or with_gallium_swr or 
with_gallium_opencl,
   )
   with_llvm = dep_llvm.found()
 elif _llvm == 'true'
@@ -1154,8 +1177,6 @@ else
   dep_lmsensors = []
 endif
 
-# TODO: clover
-
 # TODO: gallium tests
 
 # TODO: various libdirs
diff --git a/meson_options.txt b/meson_options.txt
index 4f4db5b7d26..894378985fd 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -120,6 +120,13 @@ option(
   value : false,
   description : 'build gallium "nine" Direct3D 9.x state tracker.',
 )
+option(
+  'gallium-opencl',
+  type : 'combo',
+  choices : ['icd', 'standalone', 'disabled'],
+  value : 'disabled',
+  description : 'build gallium "clover" OpenCL state tracker.',
+)
 option(
   'd3d-drivers-path',
   type : 'string',
diff --git a/src/gallium/auxiliary/pipe-loader/meson.build 
b/src/gallium/auxiliary/pipe-loader/meson.build
index 9b12432aea0..869a2935149 100644
--- a/src/gallium/auxiliary/pipe-loader/meson.build
+++ b/src/gallium/auxiliary/pipe-loader/meson.build
@@ -60,7 +60,8 @@ libpipe_loader_dynamic = static_library(
   ],
   c_args : [
 c_vis_args, libpipe_loader_defines, '-DHAVE_PIPE_LOADER_DRI',
-'-DPIPE_SEARCH_DIR="@0@"'.format(join_paths(get_option('libdir'), 
'gallium-pipe')
+'-DPIPE_SEARCH_DIR="@0@"'.format(
+  join_paths(get_option('prefix'), get_option('libdir'), 'gallium-pipe')
 )
   ],
   link_with :