[Mesa-dev] Building Mesa for Windows using Visual Studio

2015-03-24 Thread Shervin Sharifi
Hi,
 I'm new to Mesa.
 I'm trying to build Mesa for Windows using Visual Studio, but couldn't
find instructions for that. The related threads on this mailing list also
seem outdated.
 Could anyone give me some hint or point me to instructions if there is
any?

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


Re: [Mesa-dev] Building Mesa for Windows using Visual Studio

2015-03-25 Thread Jose Fonseca

See

  http://www.mesa3d.org/install.html

or docs/install.html from Mesa tree.


If you want to build with llvmpipe support, you'll also need to read and 
follow


  http://www.mesa3d.org/llvmpipe.html


I'm also experimenting on automated Windows builds with AppVeyor.  You 
can see the build logs on


  https://ci.appveyor.com/project/jrfonseca/mesa


Jose

On 25/03/15 01:00, Shervin Sharifi wrote:

Hi,
  I'm new to Mesa.
  I'm trying to build Mesa for Windows using Visual Studio, but couldn't
find instructions for that. The related threads on this mailing list
also seem outdated.
  Could anyone give me some hint or point me to instructions if there is
any?

  Thanks,
  Shervin



___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.freedesktop.org_mailman_listinfo_mesa-2Ddev&d=AwIGaQ&c=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEs&r=zfmBZnnVGHeYde45pMKNnVyzeaZbdIqVLprmZCM2zzE&m=KwlxC7fWLwmVmiUUTznYf2r7emIl5UqECVgWWjHL0dA&s=cfjvYkqjebZsPUkVyHAtSlKGP4Y12qExxEQPEqFLoWI&e=



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


Re: [Mesa-dev] Building Mesa for Windows using Visual Studio

2015-04-03 Thread Predut, Marius
How I build mesa on windows:

1.install Microsoft vs 2013(not 2012 or less).

2.install last python 2.7 : https://www.python.org/downloads/
install pywin32 from 
http://heanet.dl.sourceforge.net/project/pywin32/pywin32/Build%20219/pywin32-219.win32-py2.7.exe
download win flex-bison from http://sourceforge.net/projects/winflexbison/
and unzip into c:\win_flex_bison

3.Environment settings.
Add these near the top of your PATH:
C:\Python27
C:\Python27\Scripts
c:\win_flex_bison
if you use proxy add FTP_PROXY and HTTP_PROXY env. variables.


4.install pip by downloading get-pip.py file from:
 https://pip.pypa.io/en/latest/installing.html
and then run:
python get-pip.py --proxy="[user:passwd@]proxy.server:port"

5.Add mako, lxml and NumPy python modules by pip
pip install Mako
pip install lxml
pip install NumPy (not mandatory I think)

6.install scons from http://sourceforge.net/projects/scons/?source=typ_redirect


7.Build mesa:
scons build=release machine=x86 platform=windows libgl-gdi
or simple run: scons.
This should create an opengl32.dll in 
build\windows-x86\gallium\targets\libgl-gdi


OBS:

Why vs 2013 and not vs 2012:
the VS 2012  partially implement C++ TR1 C99 standard library already used into 
the  latest upstream mesa.
(http://blogs.msdn.com/b/vcblog/archive/2013/07/19/c99-library-support-in-visual-studio-2013.aspx)
In vs 2012 the math.h don't include rint, rintf, rintl library support used in 
mesa even if the MSDN say contrary :
https://msdn.microsoft.com/nl-nl/dn465165.)
Mesa uses those API in mesa\src\util\rounding.h.

marius

From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On Behalf Of 
Shervin Sharifi
Sent: Wednesday, March 25, 2015 3:01 AM
To: mesa-dev@lists.freedesktop.org
Subject: [Mesa-dev] Building Mesa for Windows using Visual Studio

Hi,
 I'm new to Mesa.
 I'm trying to build Mesa for Windows using Visual Studio, but couldn't find 
instructions for that. The related threads on this mailing list also seem 
outdated.
 Could anyone give me some hint or point me to instructions if there is any?

 Thanks,
 Shervin

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


Re: [Mesa-dev] Building Mesa for Windows using Visual Studio

2015-04-03 Thread Emil Velikov
Hi Marius.

Thank you for the write-up.

On 03/04/15 12:34, Predut, Marius wrote:
> How I build mesa on windows:
> 
>  
> 
> 1.install Microsoft vs 2013(not 2012 or less).
> 
>  
> 
> 2.install last python 2.7 : https://www.python.org/downloads/
> 
> install pywin32 from
> http://heanet.dl.sourceforge.net/project/pywin32/pywin32/Build%20219/pywin32-219.win32-py2.7.exe
> 
> download win flex-bison from http://sourceforge.net/projects/winflexbison/
> 
> and unzip into c:\win_flex_bison
> 
>  
> 
> 3.Environment settings.
> 
> Add these near the top of your PATH:
> 
> C:\Python27
> 
> C:\Python27\Scripts
> 
> c:\win_flex_bison
> 
> if you use proxy add FTP_PROXY and HTTP_PROXY env. variables.
> 
>  
> 
>  
> 
> 4.install pip by downloading get-pip.py file from:
> 
>  https://pip.pypa.io/en/latest/installing.html
> 
> and then run:
> 
> python get-pip.py --proxy="[user:passwd@]proxy.server:port"
> 
>  
> 
> 5.Add mako, lxml and NumPy python modules by pip
> 
> pip install Mako
> 
> pip install lxml
> 
> pip install NumPy (not mandatory I think)
> 
>  
> 
> 6.install scons from
> http://sourceforge.net/projects/scons/?source=typ_redirect
> 
>  
> 
>  
> 
> 7.Build mesa:
> 
> scons build=release machine=x86 platform=windows libgl-gdi
> 
> or simple run: scons.
> 
> This should create an opengl32.dll in
> build\windows-x86\gallium\targets\libgl-gdi
> 
>  
> 
>  
> 
> OBS:
> 
>  
> 
> Why vs 2013 and not vs 2012:
> 
> the VS 2012  partially implement C++ TR1 C99 standard library already
> used into the  latest upstream mesa.
> 
> (http://blogs.msdn.com/b/vcblog/archive/2013/07/19/c99-library-support-in-visual-studio-2013.aspx)
> 
> In vs 2012 the math.h don't include rint, rintf, rintl library support
> used in mesa even if the MSDN say contrary :
> 
> https://msdn.microsoft.com/nl-nl/dn465165.)
> 
> Mesa uses those API in mesa\src\util\rounding.h.
> 
Just a couple of small details - mesa has a fall-back for the mentioned
functions (plus others) in $(top)/include/*h.

That said, I believe that the overall consensus is that building mesa
with MSVC 2008, is the bare minimum, with MSVC 2013 strongly
recommended. Afaik, as the VMWare guys give us the go ahead we'll drop
all the workarounds for pre-2013 versions and bump the requirement.

Cheers,
Emil

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


Re: [Mesa-dev] Building Mesa for Windows using Visual Studio

2015-04-03 Thread Predut, Marius
>  
> Just a couple of small details - mesa has a fall-back for the mentioned 
> functions (plus others) in $(top)/include/*h.
> 
> That said, I believe that the overall consensus is that building mesa with 
> MSVC 2008, is the bare minimum, with MSVC 2013 strongly recommended. Afaik, 
> as the VMWare guys give us the go ahead > > > we'll drop all the workarounds 
> for pre-2013 versions and bump the requirement.
>
> Cheers,
> Emil
Hmm, nice to know, 
but in this case the build system have to take in consideration and this is a 
bug or ,
 by hand we should copy headers?

Thanks for this info
marius
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] Building Mesa for Windows using Visual Studio

2015-04-03 Thread Emil Velikov
On 3 April 2015 at 14:43, Predut, Marius  wrote:
>>
>> Just a couple of small details - mesa has a fall-back for the mentioned 
>> functions (plus others) in $(top)/include/*h.
>>
>> That said, I believe that the overall consensus is that building mesa with 
>> MSVC 2008, is the bare minimum, with MSVC 2013 strongly recommended. Afaik, 
>> as the VMWare guys give us the go ahead > > > we'll drop all the workarounds 
>> for pre-2013 versions and bump the requirement.
>>
>> Cheers,
>> Emil
> Hmm, nice to know,
> but in this case the build system have to take in consideration and this is a 
> bug or ,
>  by hand we should copy headers?
>
Not sure I fully understand your statement here. Currently there are
two types of headers - A) provide official (like) implementation, and
B) that wrap around existing ones.
Example:
 A) include/c99/* provides stdint.h & co for MSVC 2012 and older as
they lack the headers.
 B) include/c99_math.h provides compat wrapper, as MSVC 2013's math.h
is not in C99 land yet.

About using those - everything is handled already. Where needed the
extra include is added by the build (for A) and where the code is
known to be build with MSVC a header from B is used rather than the
system one.

Hope that clears things up.
Emil
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] Building Mesa for Windows using Visual Studio

2015-04-03 Thread Shervin Sharifi
Thank you for useful information.
I was able to build Mesa with VS 2013 with a similar scheme with scons.

Thanks,
   Shervin


On Fri, Apr 3, 2015 at 7:01 AM, Emil Velikov 
wrote:

> On 3 April 2015 at 14:43, Predut, Marius  wrote:
> >>
> >> Just a couple of small details - mesa has a fall-back for the mentioned
> functions (plus others) in $(top)/include/*h.
> >>
> >> That said, I believe that the overall consensus is that building mesa
> with MSVC 2008, is the bare minimum, with MSVC 2013 strongly recommended.
> Afaik, as the VMWare guys give us the go ahead > > > we'll drop all the
> workarounds for pre-2013 versions and bump the requirement.
> >>
> >> Cheers,
> >> Emil
> > Hmm, nice to know,
> > but in this case the build system have to take in consideration and this
> is a bug or ,
> >  by hand we should copy headers?
> >
> Not sure I fully understand your statement here. Currently there are
> two types of headers - A) provide official (like) implementation, and
> B) that wrap around existing ones.
> Example:
>  A) include/c99/* provides stdint.h & co for MSVC 2012 and older as
> they lack the headers.
>  B) include/c99_math.h provides compat wrapper, as MSVC 2013's math.h
> is not in C99 land yet.
>
> About using those - everything is handled already. Where needed the
> extra include is added by the build (for A) and where the code is
> known to be build with MSVC a header from B is used rather than the
> system one.
>
> Hope that clears things up.
> Emil
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] Building Mesa for Windows using Visual Studio

2015-04-13 Thread Shervin Sharifi
Hi,
  I tried to use Mesa (compiled with MSVC) to run OpenGL ES content on
Windows . I ran into a few problems.
  I don't know if this is the right way of reporting issues, but thought
people may be interested to know.

 Here's a piece of code in functions _mesa_dlopen(const char*, int) in
src\mesa\main\dlopen.h  (same problem happens with function
_mesa_dlsym(void *, const char *) in the same file).

 The original code returns NULL and doesn't load the library if the code is
compiled with Visual Studio.

 #if defined(HAVE_DLOPEN)
   flags = RTLD_LAZY | RTLD_GLOBAL; /* Overriding flags at this time */
   return dlopen(libname, flags);
#elif defined(__MINGW32__)
   return LoadLibraryA(libname);
#else
   return NULL;
#endif

 Adding the following lines to the code resolves the problem:

#elif defined(_WIN32)
   return LoadLibraryA(libname);

 Thanks,
 Shervin




On Fri, Apr 3, 2015 at 5:38 PM, Shervin Sharifi  wrote:

> Thank you for useful information.
> I was able to build Mesa with VS 2013 with a similar scheme with scons.
>
> Thanks,
>Shervin
>
>
> On Fri, Apr 3, 2015 at 7:01 AM, Emil Velikov 
> wrote:
>
>> On 3 April 2015 at 14:43, Predut, Marius  wrote:
>> >>
>> >> Just a couple of small details - mesa has a fall-back for the
>> mentioned functions (plus others) in $(top)/include/*h.
>> >>
>> >> That said, I believe that the overall consensus is that building mesa
>> with MSVC 2008, is the bare minimum, with MSVC 2013 strongly recommended.
>> Afaik, as the VMWare guys give us the go ahead > > > we'll drop all the
>> workarounds for pre-2013 versions and bump the requirement.
>> >>
>> >> Cheers,
>> >> Emil
>> > Hmm, nice to know,
>> > but in this case the build system have to take in consideration and
>> this is a bug or ,
>> >  by hand we should copy headers?
>> >
>> Not sure I fully understand your statement here. Currently there are
>> two types of headers - A) provide official (like) implementation, and
>> B) that wrap around existing ones.
>> Example:
>>  A) include/c99/* provides stdint.h & co for MSVC 2012 and older as
>> they lack the headers.
>>  B) include/c99_math.h provides compat wrapper, as MSVC 2013's math.h
>> is not in C99 land yet.
>>
>> About using those - everything is handled already. Where needed the
>> extra include is added by the build (for A) and where the code is
>> known to be build with MSVC a header from B is used rather than the
>> system one.
>>
>> Hope that clears things up.
>> Emil
>>
>
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] Building Mesa for Windows using Visual Studio

2015-04-14 Thread Emil Velikov
Hi Shervin,

On 14 April 2015 at 00:22, Shervin Sharifi  wrote:
> Hi,
>   I tried to use Mesa (compiled with MSVC) to run OpenGL ES content on
> Windows . I ran into a few problems.
>   I don't know if this is the right way of reporting issues, but thought
> people may be interested to know.
>
Another thing would be to file a bug report, although most people
appreciate patches (send via git send-email) even more :-)

>  Here's a piece of code in functions _mesa_dlopen(const char*, int) in
> src\mesa\main\dlopen.h  (same problem happens with function _mesa_dlsym(void
> *, const char *) in the same file).
>
>  The original code returns NULL and doesn't load the library if the code is
> compiled with Visual Studio.
>
True but is the library, that is to be opened, there in the first
place ? Last time I've looked nothing seriously bad was happening
(apart from the missing EXT_texture_compression_s3tc and
ANGLE_texture_compression_dxt extensions) when we fail to open the
dxtn library.

Cheers,
Emil

>  #if defined(HAVE_DLOPEN)
>flags = RTLD_LAZY | RTLD_GLOBAL; /* Overriding flags at this time */
>return dlopen(libname, flags);
> #elif defined(__MINGW32__)
>return LoadLibraryA(libname);
> #else
>return NULL;
> #endif
>
>  Adding the following lines to the code resolves the problem:
>
> #elif defined(_WIN32)
>return LoadLibraryA(libname);
>
>  Thanks,
>  Shervin
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] Building Mesa for Windows using Visual Studio

2015-04-14 Thread Jose Fonseca



On 14/04/15 13:41, Emil Velikov wrote:

Hi Shervin,

On 14 April 2015 at 00:22, Shervin Sharifi  wrote:

Hi,
   I tried to use Mesa (compiled with MSVC) to run OpenGL ES content on
Windows . I ran into a few problems.
   I don't know if this is the right way of reporting issues, but thought
people may be interested to know.


Another thing would be to file a bug report, although most people
appreciate patches (send via git send-email) even more :-)


  Here's a piece of code in functions _mesa_dlopen(const char*, int) in
src\mesa\main\dlopen.h  (same problem happens with function _mesa_dlsym(void
*, const char *) in the same file).

  The original code returns NULL and doesn't load the library if the code is
compiled with Visual Studio.


True but is the library, that is to be opened, there in the first
place ? Last time I've looked nothing seriously bad was happening
(apart from the missing EXT_texture_compression_s3tc and
ANGLE_texture_compression_dxt extensions) when we fail to open the
dxtn library.

Cheers,
Emil


  #if defined(HAVE_DLOPEN)
flags = RTLD_LAZY | RTLD_GLOBAL; /* Overriding flags at this time */
return dlopen(libname, flags);
#elif defined(__MINGW32__)
return LoadLibraryA(libname);
#else
return NULL;
#endif

  Adding the following lines to the code resolves the problem:

#elif defined(_WIN32)
return LoadLibraryA(libname);

  Thanks,
  Shervin




Yep, the C-pre-processor logic is wrong.

But as Emil said, unless you actually have a Windows build of the 
libtxc_dxtn library it won't make any difference in practice.


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