[Mesa-dev] [PATCH] scons: support for llvm 3.7.

2015-12-07 Thread olivier . pena . 80
From: Olivier Pena <op...@isagri.fr>

---
 scons/llvm.py | 14 +-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/scons/llvm.py b/scons/llvm.py
index c59b8cb..1fc8a3f 100644
--- a/scons/llvm.py
+++ b/scons/llvm.py
@@ -106,7 +106,19 @@ def generate(env):
 ])
 env.Prepend(LIBPATH = [os.path.join(llvm_dir, 'lib')])
 # LIBS should match the output of `llvm-config --libs engine mcjit 
bitwriter x86asmprinter`
-if llvm_version >= distutils.version.LooseVersion('3.6'):
+if llvm_version >= distutils.version.LooseVersion('3.7'):
+env.Prepend(LIBS = [
+'LLVMBitWriter', 'LLVMX86Disassembler', 'LLVMX86AsmParser',
+'LLVMX86CodeGen', 'LLVMSelectionDAG', 'LLVMAsmPrinter',
+'LLVMCodeGen', 'LLVMScalarOpts', 'LLVMProfileData',
+'LLVMInstCombine', 'LLVMInstrumentation', 
'LLVMTransformUtils', 'LLVMipa',
+'LLVMAnalysis', 'LLVMX86Desc', 'LLVMMCDisassembler',
+'LLVMX86Info', 'LLVMX86AsmPrinter', 'LLVMX86Utils',
+'LLVMMCJIT', 'LLVMTarget', 'LLVMExecutionEngine',
+'LLVMRuntimeDyld', 'LLVMObject', 'LLVMMCParser',
+'LLVMBitReader', 'LLVMMC', 'LLVMCore', 'LLVMSupport'
+])
+elif llvm_version >= distutils.version.LooseVersion('3.6'):
 env.Prepend(LIBS = [
 'LLVMBitWriter', 'LLVMX86Disassembler', 'LLVMX86AsmParser',
 'LLVMX86CodeGen', 'LLVMSelectionDAG', 'LLVMAsmPrinter',
-- 
2.6.3

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


[Mesa-dev] [PATCH] scons : Support LLVM 3.5 and 3.6 on windows.

2015-04-27 Thread olivier . pena . 80
From: Olivier Pena op...@isagri.fr

llvm/Config/llvm-config.h is parsed instead of llvm/Config/config.h for 
detecting LLVM version 
(http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-June/073707.html)
---
 scons/llvm.py | 33 ++---
 1 file changed, 26 insertions(+), 7 deletions(-)

diff --git a/scons/llvm.py b/scons/llvm.py
index be7df9f..6c6b733 100644
--- a/scons/llvm.py
+++ b/scons/llvm.py
@@ -72,18 +72,25 @@ def generate(env):
 return
 
 # Try to determine the LLVM version from llvm/Config/config.h
-llvm_config = os.path.join(llvm_dir, 'include/llvm/Config/config.h')
+llvm_config = os.path.join(llvm_dir, 
'include/llvm/Config/llvm-config.h')
 if not os.path.exists(llvm_config):
 print 'scons: could not find %s' % llvm_config
 return
-llvm_version_re = re.compile(r'^#define PACKAGE_VERSION ([^]*)')
+llvm_version_major_re = re.compile(r'^#define LLVM_VERSION_MAJOR 
([0-9]+)')
+llvm_version_minor_re = re.compile(r'^#define LLVM_VERSION_MINOR 
([0-9]+)')
 llvm_version = None
+llvm_version_major = None
+llvm_version_minor = None
 for line in open(llvm_config, 'rt'):
-mo = llvm_version_re.match(line)
+mo = llvm_version_major_re.match(line)
 if mo:
-llvm_version = mo.group(1)
-llvm_version = distutils.version.LooseVersion(llvm_version)
-break
+llvm_version_major = mo.group(1)
+mo = llvm_version_minor_re.match(line)
+if mo:
+llvm_version_minor = mo.group(1)
+if (llvm_version_major is not None) and (llvm_version_minor is not 
None):
+llvm_version = 
distutils.version.LooseVersion('{0}.{1}'.format(llvm_version_major, 
llvm_version_minor))
+
 if llvm_version is None:
 print 'scons: could not determine the LLVM version from %s' % 
llvm_config
 return
@@ -99,7 +106,19 @@ def generate(env):
 ])
 env.Prepend(LIBPATH = [os.path.join(llvm_dir, 'lib')])
 # LIBS should match the output of `llvm-config --libs engine mcjit 
bitwriter x86asmprinter`
-if llvm_version = distutils.version.LooseVersion('3.5'):
+if llvm_version = distutils.version.LooseVersion('3.6'):
+env.Prepend(LIBS = [
+'LLVMBitWriter', 'LLVMX86Disassembler', 'LLVMX86AsmParser',
+'LLVMX86CodeGen', 'LLVMSelectionDAG', 'LLVMAsmPrinter',
+'LLVMCodeGen', 'LLVMScalarOpts', 'LLVMProfileData',
+'LLVMInstCombine', 'LLVMTransformUtils', 'LLVMipa',
+'LLVMAnalysis', 'LLVMX86Desc', 'LLVMMCDisassembler',
+'LLVMX86Info', 'LLVMX86AsmPrinter', 'LLVMX86Utils',
+'LLVMMCJIT', 'LLVMTarget', 'LLVMExecutionEngine',
+'LLVMRuntimeDyld', 'LLVMObject', 'LLVMMCParser',
+'LLVMBitReader', 'LLVMMC', 'LLVMCore', 'LLVMSupport'
+])
+elif llvm_version = distutils.version.LooseVersion('3.5'):
 env.Prepend(LIBS = [
 'LLVMBitWriter', 'LLVMMCJIT', 'LLVMRuntimeDyld',
 'LLVMX86Disassembler', 'LLVMX86AsmParser', 'LLVMX86CodeGen',
-- 
1.9.4.msysgit.2

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


Re: [Mesa-dev] [PATCH] scons : Support LLVM 3.5 and 3.6 on windows.

2015-04-27 Thread Olivier PENA
Hi Jose,

It seems the minimum version is 3.3 (var required_llvm_version).
LLVM 3.3 already provided llvm-config.h.
So, that should be enough ?

I compiled and ran osmesa and libgl-gdi successfully with llvm 3.4.2, 3.5.0 and 
3.6.0 (msvc 2013 32 bits) with this patch.

It seems there is some changes in the library returned by llvm-config --libs 
engine mcjit bitwriter x86asmprinter (as commented in llvm.py) with llvm 3.6
   removed : LLVMJIT 
   added : LLVMProfileData, LLVMX86Desc, LLVMMCDisassembler



-Message d'origine-
De : mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] De la part de 
Jose Fonseca
Envoyé : lundi 27 avril 2015 16:28
À : olivier.pena...@gmail.com; mesa-dev@lists.freedesktop.org
Objet : Re: [Mesa-dev] [PATCH] scons : Support LLVM 3.5 and 3.6 on windows.

On 27/04/15 11:23, olivier.pena...@gmail.com wrote:
 From: Olivier Pena op...@isagri.fr

 llvm/Config/llvm-config.h is parsed instead of llvm/Config/config.h for 
 detecting LLVM version 
 (http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-June/073707.html)
 ---
   scons/llvm.py | 33 ++---
   1 file changed, 26 insertions(+), 7 deletions(-)

 diff --git a/scons/llvm.py b/scons/llvm.py
 index be7df9f..6c6b733 100644
 --- a/scons/llvm.py
 +++ b/scons/llvm.py
 @@ -72,18 +72,25 @@ def generate(env):
   return

   # Try to determine the LLVM version from llvm/Config/config.h
 -llvm_config = os.path.join(llvm_dir, 'include/llvm/Config/config.h')
 +llvm_config = os.path.join(llvm_dir, 
 'include/llvm/Config/llvm-config.h')

   if not os.path.exists(llvm_config):

We must keep supporting down to LLVM version 3.3, so the patch needs to 
be updated re-try with config.h (and the old regular expressions) when 
llvm-config.h does not exist.

   print 'scons: could not find %s' % llvm_config
   return
 -llvm_version_re = re.compile(r'^#define PACKAGE_VERSION ([^]*)')
 +llvm_version_major_re = re.compile(r'^#define LLVM_VERSION_MAJOR 
 ([0-9]+)')
 +llvm_version_minor_re = re.compile(r'^#define LLVM_VERSION_MINOR 
 ([0-9]+)')
   llvm_version = None
 +llvm_version_major = None
 +llvm_version_minor = None
   for line in open(llvm_config, 'rt'):
 -mo = llvm_version_re.match(line)
 +mo = llvm_version_major_re.match(line)
   if mo:
 -llvm_version = mo.group(1)
 -llvm_version = distutils.version.LooseVersion(llvm_version)
 -break
 +llvm_version_major = mo.group(1)
 +mo = llvm_version_minor_re.match(line)
 +if mo:
 +llvm_version_minor = mo.group(1)
 +if (llvm_version_major is not None) and (llvm_version_minor is not 
 None):
 +llvm_version = 
 distutils.version.LooseVersion('{0}.{1}'.format(llvm_version_major, 
 llvm_version_minor))
 +
   if llvm_version is None:
   print 'scons: could not determine the LLVM version from %s' % 
 llvm_config
   return
 @@ -99,7 +106,19 @@ def generate(env):
   ])
   env.Prepend(LIBPATH = [os.path.join(llvm_dir, 'lib')])
   # LIBS should match the output of `llvm-config --libs engine mcjit 
 bitwriter x86asmprinter`
 -if llvm_version = distutils.version.LooseVersion('3.5'):
 +if llvm_version = distutils.version.LooseVersion('3.6'):
 +env.Prepend(LIBS = [
 +'LLVMBitWriter', 'LLVMX86Disassembler', 'LLVMX86AsmParser',
 +'LLVMX86CodeGen', 'LLVMSelectionDAG', 'LLVMAsmPrinter',
 +'LLVMCodeGen', 'LLVMScalarOpts', 'LLVMProfileData',
 +'LLVMInstCombine', 'LLVMTransformUtils', 'LLVMipa',
 +'LLVMAnalysis', 'LLVMX86Desc', 'LLVMMCDisassembler',
 +'LLVMX86Info', 'LLVMX86AsmPrinter', 'LLVMX86Utils',
 +'LLVMMCJIT', 'LLVMTarget', 'LLVMExecutionEngine',
 +'LLVMRuntimeDyld', 'LLVMObject', 'LLVMMCParser',
 +'LLVMBitReader', 'LLVMMC', 'LLVMCore', 'LLVMSupport'

Is there any actual change in the LIBS content? Just for my info, what 
is it?

Jose

 +])
 +elif llvm_version = distutils.version.LooseVersion('3.5'):
   env.Prepend(LIBS = [
   'LLVMBitWriter', 'LLVMMCJIT', 'LLVMRuntimeDyld',
   'LLVMX86Disassembler', 'LLVMX86AsmParser', 'LLVMX86CodeGen',


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


 Click https://www.mailcontrol.com/sr/MZbqvYs5QwJvpeaetUwhCQ==  to report this 
email as spam.


-
Ce message a été traité contre les virus par quatre outils différents 
(Kaspersky, McAfee, Symantec et ThreatSeeker). 
This message has been scanned for viruses (by Kaspersky, McAfee

Re: [Mesa-dev] [PATCH] scons: add target gallium-osmesa

2015-04-22 Thread Olivier PENA
I setted up a virtual machine working on linux in order to reproduce (we only 
works on windows platform here).
The libraries order doesn't matter, a verbose compilation shows --start-group 
and --end-group linker flags.
It seems the def file is not well understood by the linker.
I workaround like in the libgl-gdi targets.

I'll send another patch, please tell me if something is wrong.


-Message d'origine-
De : Jose Fonseca [mailto:jfons...@vmware.com] 
Envoyé : mercredi 22 avril 2015 14:04
À : Olivier PENA; Emil Velikov
Cc : ML mesa-dev
Objet : Re: [Mesa-dev] [PATCH] scons: add target gallium-osmesa

Yes, it fails with Mingw (I only tried with Linux cross-compilation):

$ scons platform=windows osmesa
scons: Reading SConscript files ...
Checking for GCC ...  yes
Checking for Clang ...  no
scons: Using build cache in /home/jfonseca/.sconscache.
Checking for X11 (x11 xext xdamage xfixes glproto = 1.4.13)... no
Checking for XCB (x11-xcb xcb-glx = 1.8.1 xcb-dri2 = 1.8)... no
Checking for XF86VIDMODE (xxf86vm)... no
Checking for DRM (libdrm = 2.4.38)... no
Checking for UDEV (libudev = 151)... no
Checking for GCC ...  yes
Checking for Clang ...  no
scons: Using build cache in /home/jfonseca/.sconscache.
Checking for X11 (x11 xext xdamage xfixes glproto = 1.4.13)... yes
Checking for XCB (x11-xcb xcb-glx = 1.8.1 xcb-dri2 = 1.8)... yes
Checking for XF86VIDMODE (xxf86vm)... yes
Checking for DRM (libdrm = 2.4.38)... yes
Checking for UDEV (libudev = 151)... yes
warning: LLVM disabled: not building llvmpipe
scons: done reading SConscript files.
scons: Building targets ...
   Linking build/windows-x86-debug/gallium/targets/osmesa/osmesa.dll ...
Cannot export OSMesaColorClamp: symbol not defined
Cannot export OSMesaCreateContext: symbol not defined
Cannot export OSMesaCreateContextExt: symbol not defined
Cannot export OSMesaDestroyContext: symbol not defined
Cannot export OSMesaGetColorBuffer: symbol not defined
Cannot export OSMesaGetCurrentContext: symbol not defined
Cannot export OSMesaGetDepthBuffer: symbol not defined
Cannot export OSMesaGetIntegerv: symbol not defined
Cannot export OSMesaGetProcAddress: symbol not defined
Cannot export OSMesaMakeCurrent: symbol not defined
Cannot export OSMesaPixelStore: symbol not defined
Cannot export OSMesaPostprocess: symbol not defined
collect2: ld returned 1 exit status
scons: *** [build/windows-x86-debug/gallium/targets/osmesa/osmesa.dll] 
Error 1
scons: building terminated because of errors.


I suspect the order that libries is set is wrong (because GNU linker is 
sensitve to the order of libaries.)

But I haven;t had time to figure it out.

My recommendatino would be to match what 
src/gallium/targets/libgl-gdi/SConscript does. It's known to work. (Yes, 
that basically means go back on Emil's suggestion.)

Jose


On 22/04/15 08:39, Olivier PENA wrote:
 Hi,
 Something wrong with the corrected patch I sent ?


 -Message d'origine-
 De : mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] De la part de 
 Olivier PENA
 Envoyé : vendredi 10 avril 2015 11:38
 À : Jose Fonseca; Emil Velikov; olivier.pena...@gmail.com
 Cc : ML mesa-dev
 Objet : Re: [Mesa-dev] [PATCH] scons: add target gallium-osmesa

 Hi,
 I treated your requests and I'm going to send another patch.
 Thanks

 -Message d'origine-
 De : mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] De la part de 
 Jose Fonseca
 Envoyé : mercredi 8 avril 2015 21:55
 À : Emil Velikov; olivier.pena...@gmail.com
 Cc : ML mesa-dev
 Objet : Re: [Mesa-dev] [PATCH] scons: add target gallium-osmesa

 Besides the issue Emil mentioned,  one minor request: lets call the
 target just osmesa.  As we don't plan to have any other osmesa target.

 Jose

 On 08/04/15 18:18, Emil Velikov wrote:
 Hi Olivier

 Thanks for the patch !

 Adding Jose to the Cc list as I believe he'll have some input on the topic.

 On 3 April 2015 at 15:06,  olivier.pena...@gmail.com wrote:
 From: Olivier Pena op...@isagri.fr

 ---
src/gallium/SConscript   |  5 
src/gallium/state_trackers/osmesa/SConscript | 25 +
src/gallium/state_trackers/osmesa/osmesa.def | 16 +++
src/gallium/targets/osmesa/SConscript| 41 
 
4 files changed, 87 insertions(+)
create mode 100644 src/gallium/state_trackers/osmesa/SConscript
create mode 100644 src/gallium/state_trackers/osmesa/osmesa.def
create mode 100644 src/gallium/targets/osmesa/SConscript

 Can you add the three new files into the EXTRA_DIST variable in the
 relevant Makefile.am ? This way one we can build scons gallium-osmesa
 from a release tarball :-)

 diff --git a/src/gallium/SConscript b/src/gallium/SConscript
 index 680ad92..eeb1c78 100644
 --- a/src/gallium/SConscript
 +++ b/src/gallium/SConscript
 @@ -60,6 +60,11 @@ SConscript([
])

if not env['embedded']:
 +SConscript([
 +'state_trackers/osmesa/SConscript',
 +'targets/osmesa/SConscript

[Mesa-dev] [PATCH] scons: add target osmesa using gallium state tracker.

2015-04-22 Thread olivier . pena . 80
From: Olivier Pena op...@isagri.fr

---
 src/gallium/SConscript|  5 
 src/gallium/state_trackers/osmesa/Makefile.am |  2 ++
 src/gallium/state_trackers/osmesa/SConscript  | 26 
 src/gallium/targets/osmesa/Makefile.am|  6 +++-
 src/gallium/targets/osmesa/SConscript | 43 +++
 src/gallium/targets/osmesa/osmesa.def | 16 ++
 src/gallium/targets/osmesa/osmesa.mingw.def   | 13 
 7 files changed, 110 insertions(+), 1 deletion(-)
 create mode 100644 src/gallium/state_trackers/osmesa/SConscript
 create mode 100644 src/gallium/targets/osmesa/SConscript
 create mode 100644 src/gallium/targets/osmesa/osmesa.def
 create mode 100644 src/gallium/targets/osmesa/osmesa.mingw.def

diff --git a/src/gallium/SConscript b/src/gallium/SConscript
index 680ad92..eeb1c78 100644
--- a/src/gallium/SConscript
+++ b/src/gallium/SConscript
@@ -60,6 +60,11 @@ SConscript([
 ])
 
 if not env['embedded']:
+SConscript([
+'state_trackers/osmesa/SConscript',
+'targets/osmesa/SConscript',
+])
+
 if env['x11']:
 SConscript([
 'state_trackers/glx/xlib/SConscript',
diff --git a/src/gallium/state_trackers/osmesa/Makefile.am 
b/src/gallium/state_trackers/osmesa/Makefile.am
index 4ba6c20..22e65c8 100644
--- a/src/gallium/state_trackers/osmesa/Makefile.am
+++ b/src/gallium/state_trackers/osmesa/Makefile.am
@@ -39,3 +39,5 @@ AM_CPPFLAGS = \
 noinst_LTLIBRARIES = libosmesa.la
 
 libosmesa_la_SOURCES = $(C_SOURCES)
+
+EXTRA_DIST = SConscript
diff --git a/src/gallium/state_trackers/osmesa/SConscript 
b/src/gallium/state_trackers/osmesa/SConscript
new file mode 100644
index 000..f5519f1
--- /dev/null
+++ b/src/gallium/state_trackers/osmesa/SConscript
@@ -0,0 +1,26 @@
+import os
+
+Import('*')
+
+env = env.Clone()
+
+env.Append(CPPPATH = [
+'#src/mapi',
+'#src/mesa',
+'.',
+])
+
+if env['platform'] == 'windows':
+env.AppendUnique(CPPDEFINES = [
+'BUILD_GL32', # declare gl* as __declspec(dllexport) in Mesa headers
+'WIN32_LEAN_AND_MEAN', # 
http://msdn2.microsoft.com/en-us/library/6dwk3a1z.aspx
+])
+if not env['gles']:
+# prevent _glapi_* from being declared __declspec(dllimport)
+env.Append(CPPDEFINES = ['_GLAPI_NO_EXPORTS'])
+
+st_osmesa = env.ConvenienceLibrary(
+target ='st_osmesa',
+source = env.ParseSourceList('Makefile.sources', 'C_SOURCES'),
+)
+Export('st_osmesa')
diff --git a/src/gallium/targets/osmesa/Makefile.am 
b/src/gallium/targets/osmesa/Makefile.am
index f53823a..2c09736 100644
--- a/src/gallium/targets/osmesa/Makefile.am
+++ b/src/gallium/targets/osmesa/Makefile.am
@@ -76,7 +76,11 @@ lib@OSMESA_LIB@_la_LIBADD += 
$(top_builddir)/src/gallium/drivers/llvmpipe/libllv
 endif
 
 EXTRA_lib@OSMESA_LIB@_la_DEPENDENCIES = osmesa.sym
-EXTRA_DIST = osmesa.sym
+EXTRA_DIST = \
+   osmesa.sym \
+   osmesa.def \
+   osmesa.mingw.def \
+   SConscript
 
 include $(top_srcdir)/install-gallium-links.mk
 
diff --git a/src/gallium/targets/osmesa/SConscript 
b/src/gallium/targets/osmesa/SConscript
new file mode 100644
index 000..4a9115b
--- /dev/null
+++ b/src/gallium/targets/osmesa/SConscript
@@ -0,0 +1,43 @@
+Import('*')
+
+env = env.Clone()
+
+env.Prepend(CPPPATH = [
+'#src/mapi',
+'#src/mesa',
+#Dir('../../../mapi'), # src/mapi build path for python-generated GL API 
files/headers
+])
+
+env.Prepend(LIBS = [
+st_osmesa,
+ws_null,
+glapi,
+mesa,
+gallium,
+trace,
+glsl,
+mesautil,
+softpipe
+])
+
+env.Append(CPPDEFINES = ['GALLIUM_TRACE', 'GALLIUM_SOFTPIPE'])
+
+sources = ['target.c']
+
+if env['llvm']:
+env.Append(CPPDEFINES = 'GALLIUM_LLVMPIPE')
+env.Prepend(LIBS = [llvmpipe])
+
+if env['platform'] == 'windows':
+if env['gcc'] and env['machine'] != 'x86_64':
+sources += ['osmesa.mingw.def']
+else:
+sources += ['osmesa.def']
+
+gallium_osmesa = env.SharedLibrary(
+target ='osmesa',
+source = sources,
+LIBS = env['LIBS'],
+)
+
+env.Alias('osmesa', gallium_osmesa)
diff --git a/src/gallium/targets/osmesa/osmesa.def 
b/src/gallium/targets/osmesa/osmesa.def
new file mode 100644
index 000..e2a31ab
--- /dev/null
+++ b/src/gallium/targets/osmesa/osmesa.def
@@ -0,0 +1,16 @@
+;DESCRIPTION 'Mesa OSMesa lib for Win32'
+VERSION 4.1
+
+EXPORTS
+   OSMesaCreateContext
+   OSMesaCreateContextExt
+   OSMesaDestroyContext
+   OSMesaMakeCurrent
+   OSMesaGetCurrentContext
+   OSMesaPixelStore
+   OSMesaGetIntegerv
+   OSMesaGetDepthBuffer
+   OSMesaGetColorBuffer
+   OSMesaGetProcAddress
+   OSMesaColorClamp
+   OSMesaPostprocess
diff --git a/src/gallium/targets/osmesa/osmesa.mingw.def 
b/src/gallium/targets/osmesa/osmesa.mingw.def
new file mode 100644
index 000..874ac54
--- /dev/null
+++ b/src/gallium/targets/osmesa/osmesa.mingw.def
@@ -0,0 +1,13 @@
+EXPORTS
+   OSMesaCreateContext

Re: [Mesa-dev] [PATCH] scons: add target gallium-osmesa

2015-04-22 Thread Olivier PENA
Hi,
Something wrong with the corrected patch I sent ?


-Message d'origine-
De : mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] De la part de 
Olivier PENA
Envoyé : vendredi 10 avril 2015 11:38
À : Jose Fonseca; Emil Velikov; olivier.pena...@gmail.com
Cc : ML mesa-dev
Objet : Re: [Mesa-dev] [PATCH] scons: add target gallium-osmesa

Hi,
I treated your requests and I'm going to send another patch.
Thanks

-Message d'origine-
De : mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] De la part de 
Jose Fonseca
Envoyé : mercredi 8 avril 2015 21:55
À : Emil Velikov; olivier.pena...@gmail.com
Cc : ML mesa-dev
Objet : Re: [Mesa-dev] [PATCH] scons: add target gallium-osmesa

Besides the issue Emil mentioned,  one minor request: lets call the 
target just osmesa.  As we don't plan to have any other osmesa target.

Jose

On 08/04/15 18:18, Emil Velikov wrote:
 Hi Olivier

 Thanks for the patch !

 Adding Jose to the Cc list as I believe he'll have some input on the topic.

 On 3 April 2015 at 15:06,  olivier.pena...@gmail.com wrote:
 From: Olivier Pena op...@isagri.fr

 ---
   src/gallium/SConscript   |  5 
   src/gallium/state_trackers/osmesa/SConscript | 25 +
   src/gallium/state_trackers/osmesa/osmesa.def | 16 +++
   src/gallium/targets/osmesa/SConscript| 41 
 
   4 files changed, 87 insertions(+)
   create mode 100644 src/gallium/state_trackers/osmesa/SConscript
   create mode 100644 src/gallium/state_trackers/osmesa/osmesa.def
   create mode 100644 src/gallium/targets/osmesa/SConscript

 Can you add the three new files into the EXTRA_DIST variable in the
 relevant Makefile.am ? This way one we can build scons gallium-osmesa
 from a release tarball :-)

 diff --git a/src/gallium/SConscript b/src/gallium/SConscript
 index 680ad92..eeb1c78 100644
 --- a/src/gallium/SConscript
 +++ b/src/gallium/SConscript
 @@ -60,6 +60,11 @@ SConscript([
   ])

   if not env['embedded']:
 +SConscript([
 +'state_trackers/osmesa/SConscript',
 +'targets/osmesa/SConscript',
 +])
 +
   if env['x11']:
   SConscript([
   'state_trackers/glx/xlib/SConscript',
 diff --git a/src/gallium/state_trackers/osmesa/SConscript 
 b/src/gallium/state_trackers/osmesa/SConscript
 new file mode 100644
 index 000..fa7c968
 --- /dev/null
 +++ b/src/gallium/state_trackers/osmesa/SConscript
 @@ -0,0 +1,25 @@
 +import os
 +
 +Import('*')
 +
 +env = env.Clone()
 +
 +env.Append(CPPPATH = [
 +'#src/mapi',
 +'#src/mesa',
 +'.',
 +])
 +
 +env.AppendUnique(CPPDEFINES = [
 +'BUILD_GL32', # declare gl* as __declspec(dllexport) in Mesa headers
 +'WIN32_LEAN_AND_MEAN', # 
 https://urldefense.proofpoint.com/v2/url?u=http-3A__msdn2.microsoft.com_en-2Dus_library_6dwk3a1z.aspxd=AwIBaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=zfmBZnnVGHeYde45pMKNnVyzeaZbdIqVLprmZCM2zzEm=V7sOetAjivzNtMiJzzOh63AXslqGWPwHWPoxHrHKbGss=2ddtnvnyotNzbqM7WTXS_y4myuI1d-lxwzZA9RPX34oe=
 +])
 +if not env['gles']:
 +# prevent _glapi_* from being declared __declspec(dllimport)
 +env.Append(CPPDEFINES = ['_GLAPI_NO_EXPORTS'])
 +
 Shouldn't these be used when building for windows only ?

 +st_osmesa = env.ConvenienceLibrary(
 +target ='st_osmesa',
 +source = env.ParseSourceList('Makefile.sources', 'C_SOURCES'),
 +)
 +Export('st_osmesa')
 diff --git a/src/gallium/state_trackers/osmesa/osmesa.def 
 b/src/gallium/state_trackers/osmesa/osmesa.def
 new file mode 100644
 index 000..e2a31ab
 --- /dev/null
 +++ b/src/gallium/state_trackers/osmesa/osmesa.def
 Can we move this file next to it's only user - i.e. into targets/osmesa/ ?

 @@ -0,0 +1,16 @@
 +;DESCRIPTION 'Mesa OSMesa lib for Win32'
 +VERSION 4.1
 +
 +EXPORTS
 +   OSMesaCreateContext
 +   OSMesaCreateContextExt
 +   OSMesaDestroyContext
 +   OSMesaMakeCurrent
 +   OSMesaGetCurrentContext
 +   OSMesaPixelStore
 +   OSMesaGetIntegerv
 +   OSMesaGetDepthBuffer
 +   OSMesaGetColorBuffer
 +   OSMesaGetProcAddress
 +   OSMesaColorClamp
 +   OSMesaPostprocess
 diff --git a/src/gallium/targets/osmesa/SConscript 
 b/src/gallium/targets/osmesa/SConscript
 new file mode 100644
 index 000..2c936cf
 --- /dev/null
 +++ b/src/gallium/targets/osmesa/SConscript
 @@ -0,0 +1,41 @@
 +Import('*')
 +
 +env = env.Clone()
 +
 +env.Prepend(CPPPATH = [
 +'#src/mapi',
 +'#src/mesa',
 +#Dir('../../../mapi'), # src/mapi build path for python-generated GL 
 API files/headers
 +])
 +
 +sources = [
 +'target.c',
 +]
 +sources += ['#src/gallium/state_trackers/osmesa/osmesa.def']
 +
 Afaict this should be included only if the target is Windows.

 +drivers = []
 +
 +if env['llvm']:
 +env.Append(CPPDEFINES = 'GALLIUM_LLVMPIPE')
 +env.Append(CPPDEFINES = 'GALLIUM_TRACE')
 +drivers += [llvmpipe]
 +else:
 +env.Append(CPPDEFINES = 'GALLIUM_SOFTPIPE')
 +env.Append(CPPDEFINES = 'GALLIUM_TRACE

Re: [Mesa-dev] Problem with LLVM on Windows with MSVC

2015-04-09 Thread Olivier PENA
Hi,
Try use llvm cmake options :
LLVM_USE_CRT_DEBUG=MTd
LLVM_USE_CRT_RELEASE =MT


De : mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] De la part de 
Shervin Sharifi
Envoyé : jeudi 9 avril 2015 01:57
À : mesa-dev@lists.freedesktop.org
Objet : [Mesa-dev] Problem with LLVM on Windows with MSVC

Hi,

 I'm trying to build mesa on windows (MSVC) with gles support and with llvm.
 Here are the keys I'm using:
scons.py gles=yes llvm=yes platform=windows libgl-gd

 I'm getting a bunch of errors like this:

LLVMCore.lib(ValueSymbolTable.obj) : error LNK2038: mismatch detected for 
'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 
'MTd_StaticDebug' in mesa.lib(uniform_query.obj)

I understand that this is due to mismatch between the runtime libraries, but I 
don't know how to fix it.
Should I change the CRT in llvm or in mesa? How should I do that?

 Thanks,
 Shervin







Click herehttps://www.mailcontrol.com/sr/MZbqvYs5QwJvpeaetUwhCQ== to report 
this email as spam.


-
Ce message a été traité contre les virus par quatre outils différents 
(Kaspersky, McAfee, Symantec et ThreatSeeker). 
This message has been scanned for viruses (by Kaspersky, McAfee, Symantec and 
ThreatSeeker).
-
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] osmesa with gallium

2015-04-03 Thread Olivier PENA
Hi,
I successfully build osmesa with gallium state tracker on windows by adding a 
new target (gallium-osmesa) in the scons build system. Both llvmpipe and 
softpipe works.
May I send a patch ?



-
Ce message a été traité contre les virus par quatre outils différents 
(Kaspersky, McAfee, Symantec et ThreatSeeker). 
This message has been scanned for viruses (by Kaspersky, McAfee, Symantec and 
ThreatSeeker).
-
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] scons: add target gallium-osmesa

2015-04-03 Thread olivier . pena . 80
From: Olivier Pena op...@isagri.fr

---
 src/gallium/SConscript   |  5 
 src/gallium/state_trackers/osmesa/SConscript | 25 +
 src/gallium/state_trackers/osmesa/osmesa.def | 16 +++
 src/gallium/targets/osmesa/SConscript| 41 
 4 files changed, 87 insertions(+)
 create mode 100644 src/gallium/state_trackers/osmesa/SConscript
 create mode 100644 src/gallium/state_trackers/osmesa/osmesa.def
 create mode 100644 src/gallium/targets/osmesa/SConscript

diff --git a/src/gallium/SConscript b/src/gallium/SConscript
index 680ad92..eeb1c78 100644
--- a/src/gallium/SConscript
+++ b/src/gallium/SConscript
@@ -60,6 +60,11 @@ SConscript([
 ])
 
 if not env['embedded']:
+SConscript([
+'state_trackers/osmesa/SConscript',
+'targets/osmesa/SConscript',
+])
+
 if env['x11']:
 SConscript([
 'state_trackers/glx/xlib/SConscript',
diff --git a/src/gallium/state_trackers/osmesa/SConscript 
b/src/gallium/state_trackers/osmesa/SConscript
new file mode 100644
index 000..fa7c968
--- /dev/null
+++ b/src/gallium/state_trackers/osmesa/SConscript
@@ -0,0 +1,25 @@
+import os
+
+Import('*')
+
+env = env.Clone()
+
+env.Append(CPPPATH = [
+'#src/mapi',
+'#src/mesa',
+'.',
+])
+
+env.AppendUnique(CPPDEFINES = [
+'BUILD_GL32', # declare gl* as __declspec(dllexport) in Mesa headers 
+'WIN32_LEAN_AND_MEAN', # 
http://msdn2.microsoft.com/en-us/library/6dwk3a1z.aspx
+])
+if not env['gles']:
+# prevent _glapi_* from being declared __declspec(dllimport)
+env.Append(CPPDEFINES = ['_GLAPI_NO_EXPORTS'])
+
+st_osmesa = env.ConvenienceLibrary(
+target ='st_osmesa',
+source = env.ParseSourceList('Makefile.sources', 'C_SOURCES'),
+)
+Export('st_osmesa')
diff --git a/src/gallium/state_trackers/osmesa/osmesa.def 
b/src/gallium/state_trackers/osmesa/osmesa.def
new file mode 100644
index 000..e2a31ab
--- /dev/null
+++ b/src/gallium/state_trackers/osmesa/osmesa.def
@@ -0,0 +1,16 @@
+;DESCRIPTION 'Mesa OSMesa lib for Win32'
+VERSION 4.1
+
+EXPORTS
+   OSMesaCreateContext
+   OSMesaCreateContextExt
+   OSMesaDestroyContext
+   OSMesaMakeCurrent
+   OSMesaGetCurrentContext
+   OSMesaPixelStore
+   OSMesaGetIntegerv
+   OSMesaGetDepthBuffer
+   OSMesaGetColorBuffer
+   OSMesaGetProcAddress
+   OSMesaColorClamp
+   OSMesaPostprocess
diff --git a/src/gallium/targets/osmesa/SConscript 
b/src/gallium/targets/osmesa/SConscript
new file mode 100644
index 000..2c936cf
--- /dev/null
+++ b/src/gallium/targets/osmesa/SConscript
@@ -0,0 +1,41 @@
+Import('*')
+
+env = env.Clone()
+
+env.Prepend(CPPPATH = [
+'#src/mapi',
+'#src/mesa',
+#Dir('../../../mapi'), # src/mapi build path for python-generated GL API 
files/headers
+])
+
+sources = [
+'target.c',
+]
+sources += ['#src/gallium/state_trackers/osmesa/osmesa.def']
+
+drivers = []
+
+if env['llvm']:
+env.Append(CPPDEFINES = 'GALLIUM_LLVMPIPE')
+env.Append(CPPDEFINES = 'GALLIUM_TRACE')
+drivers += [llvmpipe]
+else:
+env.Append(CPPDEFINES = 'GALLIUM_SOFTPIPE')
+env.Append(CPPDEFINES = 'GALLIUM_TRACE')
+drivers += [softpipe]
+
+if env['platform'] == 'windows':
+env.AppendUnique(CPPDEFINES = [
+'BUILD_GL32', # declare gl* as __declspec(dllexport) in Mesa headers 
+])
+if not env['gles']:
+# prevent _glapi_* from being declared __declspec(dllimport)
+env.Append(CPPDEFINES = ['_GLAPI_NO_EXPORTS'])
+
+gallium_osmesa = env.SharedLibrary(
+target ='osmesa',
+source = sources,
+LIBS = drivers + st_osmesa + ws_null + glapi + mesa + gallium + trace 
+ glsl + mesautil + env['LIBS'],
+)
+
+env.Alias('gallium-osmesa', gallium_osmesa)
-- 
1.9.4.msysgit.2

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


Re: [Mesa-dev] osmesa with gallium

2015-04-03 Thread Olivier PENA
Hello Emil
Thanks for your quick reply.

We commercialize windows softwares containing mapping component. Maps are 
drawed using opengl.
We use mesa libgl-gdi as software fallback renderer in case of buggy windows 
old drivers.
osmesa is used as maps offscreen rendering in non-windowed context.

I'll forward the patch with git send-email, I hope it will be correctly 
formatted, I had hard time configuring git and msmtp under windows.

-Message d'origine-
De : Emil Velikov [mailto:emil.l.veli...@gmail.com] 
Envoyé : vendredi 3 avril 2015 15:09
À : Olivier PENA; mesa-dev@lists.freedesktop.org
Cc : emil.l.veli...@gmail.com
Objet : Re: [Mesa-dev] osmesa with gallium

Hello Olivier,
On 03/04/15 11:27, Olivier PENA wrote:
 Hi,
 
 I successfully build osmesa with gallium state tracker on windows by
 adding a new target (gallium-osmesa) in the scons build system. Both
 llvmpipe and softpipe works.
 
 May I send a patch ?
 
That would be great thank you. I'm pretty sure that Jose won't mind ;-)

May I ask what is your usecase for osmesa - is it a public/open-source
project or something in house that'll be using it ?

Regarding the patch in question - please use git send-email to send it
to the mailing list.


Thanks
Emil



 Click https://www.mailcontrol.com/sr/MZbqvYs5QwJvpeaetUwhCQ==  to report this 
email as spam.


-
Ce message a été traité contre les virus par quatre outils différents 
(Kaspersky, McAfee, Symantec et ThreatSeeker). 
This message has been scanned for viruses (by Kaspersky, McAfee, Symantec and 
ThreatSeeker).
-
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev