WIN32 worked for the last matplotlib release build I did, but I agree this patch is harmless. Thanks for looking into it this much.
- Charlie On 10/16/07, Michael Droettboom <[EMAIL PROTECTED]> wrote: > Thanks. Sorry about the syntax errors -- I don't use the preprocessor > much either. > > I think this patch seems reasonable (or at least reasonably harmless), > so I'll go ahead and commit it. > > Cheers, > Mike > > Martin Spacek wrote: > > Michael Droettboom wrote: > >> Hmmm... Well, I think we've reached the limit of my MSVC knowledge > >> (which doesn't go very far.) I presume that for your local copy, you > >> can just hard code it to : > >> > >> #ifdef 1 || WIN32 || _MSC_VER > > > > Actually, I just tried that, and it didn't work. Again, I don't really > > know anything about preprocessing in C, but it seems you can't put more > > than one MACRO in an #ifdef statement. Instead, it looks like you need > > to do: > > > > #if defined(WIN32) || defined(_MSC_VER) > > > > This *does* work for me. So it seems WIN32 isn't defined on my MSVC7.1, > > but _MSC_VER is (I've discovered that _WIN32 is defined as well). > > Anyways, I'm not sure if this is the ideal way to have it, but I've > > attached a patch against the latest rev. > > > > Cheers, > > > > Martin > > > > > >> > >> and at least get it working for yourself. But I think someone with > >> more MSVC experience on this list may have to look into this and have > >> more to offer. > >> > >> Cheers, > >> Mike > >> > >> Martin Spacek wrote: > >>> Sorry for the delay. I gave that a try, but it didn't help. Seems that > >>> _MSC_VER is undefined as well... > >>> > >>> Martin > >>> > >>> Michael Droettboom wrote: > >>>> Martin Spacek wrote: > >>>>> It's been a few months since I've updated and compiled from svn. I got > >>>>> this error today from rev 3926 (in winxp using msvc71): > >>>>> > >>>>>> python setup.py build_ext --inplace --force > >>>>> ============================================================================ > >>>>> > >>>>> BUILDING MATPLOTLIB > >>>>> matplotlib: 0.90.1 > >>>>> python: 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) > >>>>> [MSC > >>>>> v.1310 32 bit (Intel)] > >>>>> platform: win32 > >>>>> Windows version: (5, 1, 2600, 2, 'Service Pack 2') > >>>>> > >>>>> REQUIRED DEPENDENCIES > >>>>> numpy: 1.0.4.dev4155 > >>>>> freetype2: found, but unknown version (no pkg-config) > >>>>> > >>>>> OPTIONAL DEPENDENCIES > >>>>> Gtk+: no > >>>>> * Building for Gtk+ requires pygtk; you > >>>>> must be > >>>>> able > >>>>> * to "import gtk" in your build/install > >>>>> environment > >>>>> Tkinter: Tkinter: 50704, Tk: 8.4, Tcl: 8.4 > >>>>> wxPython: 2.8.4.0 > >>>>> * WxAgg extension not required for wxPython > >>>>>> = 2.8 > >>>>> Qt: no > >>>>> Qt4: no > >>>>> Cairo: no > >>>>> libpng: found, but unknown version (no pkg-config) > >>>>> > >>>>> [Edit setup.cfg to suppress the above messages] > >>>>> ============================================================================ > >>>>> > >>>>> running build_ext > >>>>> No module named msvccompiler in numpy.distutils; trying from distutils > >>>>> building 'matplotlib.ft2font' extension > >>>>> C:\bin\Microsoft Visual Studio .NET 2003\Vc7\bin\cl.exe /c /nologo /Ox > >>>>> /MD /W3 /GX /DNDEBUG -Iwin32_static\include -I. - > >>>>> Iwin32_static\include\freetype2 -I.\freetype2 > >>>>> -IC:\bin\Python25\include > >>>>> -IC:\bin\Python25\PC /Tpsrc/ft2font.cpp /Fobuild > >>>>> \temp.win32-2.5\Release\src/ft2font.obj > >>>>> Found executable C:\bin\Microsoft Visual Studio .NET > >>>>> 2003\Vc7\bin\cl.exe > >>>>> C:\bin\Microsoft Visual Studio .NET 2003\Vc7\bin\cl.exe /c /nologo /Ox > >>>>> /MD /W3 /GX /DNDEBUG -Iwin32_static\include -I. - > >>>>> Iwin32_static\include\freetype2 -I.\freetype2 > >>>>> -IC:\bin\Python25\include > >>>>> -IC:\bin\Python25\PC /Tpsrc/mplutils.cpp /Fobuil > >>>>> d\temp.win32-2.5\Release\src/mplutils.obj > >>>>> C:\bin\Microsoft Visual Studio .NET 2003\Vc7\bin\cl.exe /c /nologo /Ox > >>>>> /MD /W3 /GX /DNDEBUG -Iwin32_static\include -I. - > >>>>> Iwin32_static\include\freetype2 -I.\freetype2 > >>>>> -IC:\bin\Python25\include > >>>>> -IC:\bin\Python25\PC /TpCXX\cxxsupport.cxx /Fobu > >>>>> ild\temp.win32-2.5\Release\CXX\cxxsupport.obj > >>>>> C:\bin\Microsoft Visual Studio .NET 2003\Vc7\bin\cl.exe /c /nologo /Ox > >>>>> /MD /W3 /GX /DNDEBUG -Iwin32_static\include -I. - > >>>>> Iwin32_static\include\freetype2 -I.\freetype2 > >>>>> -IC:\bin\Python25\include > >>>>> -IC:\bin\Python25\PC /TpCXX\cxx_extensions.cxx / > >>>>> Fobuild\temp.win32-2.5\Release\CXX\cxx_extensions.obj > >>>>> C:\bin\Microsoft Visual Studio .NET 2003\Vc7\bin\cl.exe /c /nologo /Ox > >>>>> /MD /W3 /GX /DNDEBUG -Iwin32_static\include -I. - > >>>>> Iwin32_static\include\freetype2 -I.\freetype2 > >>>>> -IC:\bin\Python25\include > >>>>> -IC:\bin\Python25\PC /TpCXX\IndirectPythonInterf > >>>>> ace.cxx > >>>>> /Fobuild\temp.win32-2.5\Release\CXX\IndirectPythonInterface.obj > >>>>> C:\bin\Microsoft Visual Studio .NET 2003\Vc7\bin\cl.exe /c /nologo /Ox > >>>>> /MD /W3 /GX /DNDEBUG -Iwin32_static\include -I. - > >>>>> Iwin32_static\include\freetype2 -I.\freetype2 > >>>>> -IC:\bin\Python25\include > >>>>> -IC:\bin\Python25\PC /TcCXX\cxxextensions.c /Fob > >>>>> uild\temp.win32-2.5\Release\CXX\cxxextensions.obj > >>>>> C:\bin\Microsoft Visual Studio .NET 2003\Vc7\bin\link.exe /DLL /nologo > >>>>> /INCREMENTAL:NO /LIBPATH:win32_static\lib /LIBPAT > >>>>> H:C:\bin\Python25\libs /LIBPATH:C:\bin\Python25\PCBuild freetype.lib > >>>>> z.lib /EXPORT:initft2font build\temp.win32-2.5\Rele > >>>>> ase\src/ft2font.obj build\temp.win32-2.5\Release\src/mplutils.obj > >>>>> build\temp.win32-2.5\Release\CXX\cxxsupport.obj build\ > >>>>> temp.win32-2.5\Release\CXX\cxx_extensions.obj > >>>>> build\temp.win32-2.5\Release\CXX\IndirectPythonInterface.obj > >>>>> build\temp.wi > >>>>> n32-2.5\Release\CXX\cxxextensions.obj /OUT:lib\matplotlib\ft2font.pyd > >>>>> /IMPLIB:build\temp.win32-2.5\Release\src\ft2font.l > >>>>> ib > >>>>> Found executable C:\bin\Microsoft Visual Studio .NET > >>>>> 2003\Vc7\bin\link.exe > >>>>> building 'matplotlib.ttconv' extension > >>>>> C:\bin\Microsoft Visual Studio .NET 2003\Vc7\bin\cl.exe /c /nologo /Ox > >>>>> /MD /W3 /GX /DNDEBUG -Iwin32_static\include -I. - > >>>>> IC:\bin\Python25\include -IC:\bin\Python25\PC /Tpsrc/_ttconv.cpp > >>>>> /Fobuild\temp.win32-2.5\Release\src/_ttconv.obj > >>>>> C:\bin\Microsoft Visual Studio .NET 2003\Vc7\bin\cl.exe /c /nologo /Ox > >>>>> /MD /W3 /GX /DNDEBUG -Iwin32_static\include -I. - > >>>>> IC:\bin\Python25\include -IC:\bin\Python25\PC /Tpttconv/pprdrv_tt.cpp > >>>>> /Fobuild\temp.win32-2.5\Release\ttconv/pprdrv_tt.o > >>>>> bj > >>>>> C:\bin\Microsoft Visual Studio .NET 2003\Vc7\bin\cl.exe /c /nologo /Ox > >>>>> /MD /W3 /GX /DNDEBUG -Iwin32_static\include -I. - > >>>>> IC:\bin\Python25\include -IC:\bin\Python25\PC /Tpttconv/pprdrv_tt2.cpp > >>>>> /Fobuild\temp.win32-2.5\Release\ttconv/pprdrv_tt2 > >>>>> .obj > >>>>> C:\bin\Microsoft Visual Studio .NET 2003\Vc7\bin\cl.exe /c /nologo /Ox > >>>>> /MD /W3 /GX /DNDEBUG -Iwin32_static\include -I. - > >>>>> IC:\bin\Python25\include -IC:\bin\Python25\PC /Tpttconv/ttutil.cpp > >>>>> /Fobuild\temp.win32-2.5\Release\ttconv/ttutil.obj > >>>>> ttutil.cpp > >>>>> ttconv\ttutil.cpp(38) : error C3861: 'vsnprintf': identifier not > >>>>> found, > >>>>> even with argument-dependent lookup > >>>>> ttconv\ttutil.cpp(45) : error C3861: 'vsnprintf': identifier not > >>>>> found, > >>>>> even with argument-dependent lookup > >>>>> error: Command "C:\bin\Microsoft Visual Studio .NET > >>>>> 2003\Vc7\bin\cl.exe > >>>>> /c /nologo /Ox /MD /W3 /GX /DNDEBUG -Iwin32_stat > >>>>> ic\include -I. -IC:\bin\Python25\include -IC:\bin\Python25\PC > >>>>> /Tpttconv/ttutil.cpp /Fobuild\temp.win32-2.5\Release\ttcon > >>>>> v/ttutil.obj" failed with exit status 2 > >>>>> > >>>>> > >>>>> > >>>>> The latest change for ttutil.cpp was: > >>>>> > >>>>> Revision: 3696 > >>>>> Author: cmoad > >>>>> Date: 5:53:21 AM, Friday, August 10, 2007 > >>>>> Message: > >>>>> added win32 checks for vsnprintf which is _vsnprintf on windows > >>>>> ---- > >>>>> Modified : /trunk/matplotlib/ttconv/ttutil.cpp > >>>>> > >>>>> So it looks like both the lines that check #ifdef WIN32 are evaluating > >>>>> as false, even though I'm in win32. I don't know much about C++. As a > >>>>> hack, replacing vsnprintf with _vsnprintf in the else clauses gives > >>>>> me a > >>>>> successful build. > >>>> Hmm... I wonder if the WIN32 symbol is a Mingw32 thing and not a MS > >>>> Visual Studio thing. One thing I have seen elsewhere is the use of > >>>> _MSC_VER to do this. Would you mind trying: > >>>> > >>>> #ifdef WIN32 || _MSC_VER > >>>> > >>>> instead of > >>>> > >>>> #ifdef WIN32 > >>>> > >>>> (I don't have a MS Visual Studio to test with myself). Maybe one of > >>>> the Windows guys on this list has another idea as well. > >>>> > >>> > >>> > > -- > Michael Droettboom > Science Software Branch > Operations and Engineering Division > Space Telescope Science Institute > Operated by AURA for NASA > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Matplotlib-devel mailing list > Matplotlib-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/matplotlib-devel > ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel