On 3/8/2013 2:16 AM, Tejashri Kandolkar wrote:
> Thanks Christoph, thanks for the help.
>
> However I found the issue.
> The issue is that somehow matplotlib_release variant linked to the debug
> lib of libpng.
> And so on a non-developer machine, which dosent have msvcr90d.dll (debug
> crt), DLL Load fails.

Good to know. The zlib, png and freetype libraries should be built as 
"Release, Static Library, Multi-threaded DLL" to be compatible with 
CPython. See also <https://github.com/matplotlib/matplotlib/issues/1717>

>
> So now I have another question:
>
> I have built the static libs of freetype, libpng (and zlib which is
> required by libpng) from source
> And I mention the paths of these static libs in setupext.py (by
> modifying "basedir") while building matplotlib.

No need to modify the source code. You can add the directories 
containing the headers and libraries to the INCLUDE and LIB environment 
variables.

>
> Now when matplotlib builds, and generates a _png.pyd, will it still need
> the static libs to be present in the location where the _png.pyd is present?
> What I understand is that it shouldn't since it is a static library and
> should be built into the binary.

The static libs are not needed at runtime. They are part of the pyd binary.

>
> Why I am asking this is because I am unable to build the libpng DLLs
> (for some reason I dont know).
> So I have to go forward with the static lib approach.

The static approach is recommended. If you link to the DLLs instead you 
will need to ship those with the binaries, which is not done in setup.py.

Christoph

>
> Thanks,
> Regards,
> Tej.
>
> On Thu, Mar 7, 2013 at 10:53 PM, Christoph Gohlke <cgoh...@uci.edu
> <mailto:cgoh...@uci.edu>> wrote:
>
>     On 3/7/2013 8:39 AM, Christoph Gohlke wrote:
>     > On 3/7/2013 6:00 AM, Tejashri Kandolkar wrote:
>     >> Hi,
>     >>
>     >> I built matplotlib1.2.0 with python3.2 on Windows7 from source.
>     >> I built the libpng and freetype libs and linked them statically to
>     >> matplotlib.
>     >>
>     >> Everything works fine on my machine, I can run the matplotlib examples 
> etc
>     >> But on a new Win7 machine(with the exact same configuration as mine,
>     >> except a few softwares), I get the following error when i try to import
>     >> png module like this:
>     >>
>     >> import matplotlib._png
>     >>
>     >> ImportError: DLL load failed: The application has failed to start
>     >> because its side-by-side configuration is incorrect. Please see the
>     >> application event log or use the command-line sxstrace.exe tool for 
> more
>     >> detail.
>     >>
>     >>
>     >> I used the dependency walker and found that pyd_ DLL was indeed having
>     >> issues during load.
>     >>
>     >> What could be the reason. Surprisingly it works all fine on my machine.
>     >>
>     >>
>     >> Regards,
>     >> Tej
>     >>
>     >
>     > Assuming this is 32 bit Python, install the Microsoft Visual C++ 2008
>     > Redistributable Package (x86) <from
>     >http://www.microsoft.com/en-us/download/details.aspx?id=29>
>     >
>
>     Besides that, look for extra msvcp90.dll or msvcr90.dll files in PATH
>     (for example MikteX is known for that) and resolve conflicts.
>
>     Christoph
>
>     
> ------------------------------------------------------------------------------
>     Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester
>     Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the
>     endpoint security space. For insight on selecting the right partner to
>     tackle endpoint security challenges, access the full report.
>     http://p.sf.net/sfu/symantec-dev2dev
>     _______________________________________________
>     Matplotlib-users mailing list
>     matplotlib-us...@lists.sourceforge.net
>     <mailto:matplotlib-us...@lists.sourceforge.net>
>     https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>

------------------------------------------------------------------------------
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester  
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the  
endpoint security space. For insight on selecting the right partner to 
tackle endpoint security challenges, access the full report. 
http://p.sf.net/sfu/symantec-dev2dev
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to