Visual C++ Toolkit 2003+makepanda.bat+python 2.4

I’m trying to build Panda3d from source, on windows, using makepanda.py and the Visual C++ Toolkit 2003 which is downloadable from Microsoft for free.

This toolkit provides a command line, optimizing compiler but it is missing some parts that you might expect, such as nmake, dumpbin, cvtres, some libraries, etc. I’ve managed to find all of these components from within other Microsoft distributions such as the platform SDK and the .NET sdk, apart from one lib msvcprt.lib, which I did find on the web (though I’m uncertain as to the legality of using it).

Halfway through my process, I found this thread here https://discourse.panda3d.org/viewtopic.php?t=326 which was helpful in locating that missing lib, and allowed me to continue.

So I installed the C++ toolkit. Then I installed the .NET sdk to obtain msvcrt.lib. I installed the Core part of the platform sdk (including the Win64 tools) to get cvtres.exe, lib.exe, and some other utils. I copied the needed parts into my toolkit’s directory structure, but you could simply add to your path and lib/include vars.

I also installed the Dx9 sdk and added it to my vars. I can run makepanda.bat and it progresses quite far now, but it dies because I am missing DirectX 8. I am utterly unfamiliar with directx, so I’m not sure what would be involved in altering the code to use Dx9 SDK instead. So, I searched for the DX8 sdk…I’ve been unable to find it from Microsoft, only Dx9.

I did find the required .lib file in an update package available on MS’s website, however that doesn’t give me the header files I need.

Update:

I did not find the DX8 sdk, however by editing makepanda.py such that it did not include dxgsg7 and dxgsg8 in the win32 build process, I did get makepanda to complete. I did not use helix, maya5, maya6, maya65, or miles.

After building, I’ve tested the samples and they seem to work just fine. So it appears that you CAN use the free Visual C++ toolkit 2003 and makepanda.bat to build Panda3d from the cmd prompt.

My big concern now is using msvcprt.lib which I found on the web (http://root.cern.ch/root/Procedure/Procedure%20to%20install%20the%20free%20Microsoft%20Visual%20C.htm), thanks to HughPerkins nice little wiki. I am uncertain as to whether this pollutes the method such that it is not truly “free”.

Further update:

Tonight I repeated the process on a clean machine, from scratch, but this time I replaced the version of python distributed with the source with 2.4.1 and built it using my modified makepanda.py. It seems to have worked fine. So far the samples seem to work. Time for bed.

So now I have what I wanted…a free way to build panda 3d from source with python 2.4.1. Now I just need to replace FMOD =)

-price

It may be wishful thinking, but this seems a bit snappier with python 2.4.

Maybe I overused my brain. I’ll try to do some tests tomorrow.

Congratulations on getting the build going!

I do believe that Python 2.4 is indeed supposed to be a bit faster than Python 2.2. I’d be little bit surprised if you can tell the difference visually, though, but I guess it depends on the application.

I’m not completely sure why we haven’t upgraded to Python 2.4 with the distribution, but I imagine it’s just that there are so many other more important things to do first. :slight_smile:

David

In the light of day, a side-by-side comparison of the shipping python and 2.4-built versions, I can’t see a real difference running greetingcard.py.

However, I have the feeling that the 2.4 version gets the window on the screen a bit faster, especially on sequential runs.

At any rate, I feel better with 2.4 under my feet. I’ll be sure to share any gotcha’s I encounter.

-stampson

My big concern now is using msvcprt.lib which I found on the web (root.cern.ch/root/Procedure/Proc … al%20C.htm), thanks to HughPerkins nice little wiki.

Hey, I’m glad the wiki was useful to you!

I’m unsure about the use of this library too; if someone could get the method using lib /dump /all msvcp71.dll, pipe to sed blahblahblah, redirect to exports file, etc to work then that would probably be more certainly ok?

In any case, I dont think Microsoft are going to try to block people getting hold of msvcprt.lib to do development on Windows? I think the only reason they dont distribute it is something to do with not wanting people to reverse engineer it etc for use on other platforms? Like, if you look at the EULA for the DirectX SDK, they’re really into the whole “you cant use our example programs on any platform other than Windows” thing.

Re: DirectX 8, I couldnt get it either; in the ppremake I just disabled DirectX altogether, though it seemed to want some DirectX headers anyway :-/, but the DirectX 9 headers were good enough, so that was ok.

Question to David: what is makepanda.py? Two weeks ago, the instructions only mentioned ppremake.exe I think? Is makepanda.py the new version of ppremake.exe?

Hugh

In the source dist in the doc dir there is a file called INSTALL-MK that explains it…gotta run help the missus clean the house now, before I can mess with panda on my Saturday…but check out that file =)

As for makepanda - many months ago, when I started working on panda, I felt that one of the things holding it back is that it’s just kinda hard to get it to compile. So I started working on a build system that’s geared to “out-of-the-box” compilation. That’s makepanda. It’s completely separate from ppremake. In the “doc” directory of the source code, there’s a README file that tells about both build systems, and two INSTALL documents that explain the two in depth.

Well, wtih makepanda.py, I just commented out the parts that do the compilation for the dx7 and dx8 code, and let it build the dx9 part using the sdk.

I’ve tested gl and dx9 and both work with my panda3d built with vc++ toolkit and python 2.4

Hmmm, this is very cool :smiley:

Things that rock about this are:

  • its cross-platform, since Python is interpreted; no need to bootstrap somehow
  • no need to use Cygwin at all on Windows; this is definitely a bonus, since Cygwin works very badly under high fork loads
  • much faster than ppremake
  • its fairly easy to modify, since things are all in one place

I’ve tweaked it a little as follows, to run with the Microsoft Visual C++ Toolkit 2003, and to work with the current CVS Panda code.

New options for Microsoft Visual C++ Toolkit 2003:

–msplatformsdk X points to Microosft Platform SDK; necessary for Microsfot Visual C++ Toolkit 2003 builds
–vcpptoolkit X points to Microsoft Visual C++ Toolkit 2003
–no-resource-compiler (since the toolkit doesnt have one)
–no-dx8 (Microsoft no longer makes dx8 SDK available for download)
–no-interrogate Optional, basically saves a lot of build time if you dont need the Python interfaces during development

Added new option to make --help screen:
–advancedoptions , displays the above options, and also --directx-sdk X, for DirectX SDK directory

Added new advanced option (not even in --advancedoptions help):
–force-agressive-no-optimize This is for impatient developers with the Toolkit. It disables optimizations whilst continuing to use the release runtime libraries (since we dont have the debug runtime libraries). This might disable Python interface functionality, so use it at your own risk.

  • link.exe /lib used instead of lib.exe, since lib.exe doesnt exist in the Toolkit (link /lib does the same thing however)

Tweaked to build with current CVS

  • CopyFile for include files replaced with a treewalk
  • parser-inc and cppparser are excluded, since there are naming conflicts with panda include files
  • started to look at facilitating interrogate command maintainability:
    • added new function getheaderfilesin( directory ), which returns a list containing all the .h files in directory
    • modified the interrogate for pgraph and for gobj to use this function to obtain the list of header files, then append the appropriate composite .cxx files
    • not fully tested, since I added --no-interrogate switch to save time; interrogate runs very slowly on my machine

Tolerance for missing optional directories

  • In the status screen, each required directory is tested, producing output like:
    Checking directories:
    +pandatool
    +doc
    +dtool
    Warning: pandaapp not found

  • then, during the build, certain directories are if os.path.exists’d so that the absence of the directory doesnt crash the build

Build Results

  • pview built and ran correctly
  • python interfaces untested

Obtaining the new makepanda.py file

The full makepanda.py and the makepanda.py.patch file are available at:

How does this sound?

Hugh

Edit to say, here is the script I made, called runmakepanda.bat, to run makepanda.bat:


cd /D "%~dp0"
makepanda\makepanda --compiler MSVC7 --optimize 3 --thirdparty f:\dev\pandacvspymake\thirdparty --nothing --no-dx8 --force-agressive-no-optimize --directx-sdk "F:\Program Files\Microsoft DirectX 9.0 SDK" --vcpptoolkit2003 "F:\Program Files\Microsoft Visual C++ Toolkit 2003" --msplatformsdk "F:\Program Files\Microsoft SDK" --no-resource-compiler --no-interrogate

Obviously these paths are specific to my system, but it shows the options that I tested against.

Great info and script…I haven’t tried the cvs yet myself, I’ll have to try it out!

The resource compiler and some of the other missing .exe’s are available in the platform sdk…All I used was the core install, but including the 64-bit platform stuff. So I just copied the utils to my vc toolkit dir since that’s where I wanted them to be.

Ok, good info on the 64-bit files; I’ll check that out.

Btw, what things are you thinking of working on on Panda3D?

Hugh

Man, that’s a lot of changes. I’ll try to integrate them into the distribution on Monday, but wow.

This is some good stuff. I should point out though that greetingcard.py isn’t really a good test to see if it runs faster with Python 2.4 since it should be spending very little time interpreting python code.

Try the tasks tutorial (asteroids). I used an N^2 collision check there which is written entirely in Python. It’s slow but it seemed to be fine for teaching purposes, and, when there are a lot of bullets and asteroids on the screen things can really lag down. If you’re going to see a noticable improvement with 2.4, that’s where you would see it.