Error compiling FreeBSD 6.2

Hello all,

I am trying to compile Panda3D under FreeBSD 6.2 using PPREMAKE because ‘makepanda’
does not work. However, I have found a bizarre error:

 I have looked for the 'KW_SIZEOF' but I have not found it. In any case, I do not have a

lot of experience using FreeBSD.
Any idea?

This error is from interrogate, which is the program that is part of Panda and is used to generate the Python interfaces into Panda. Interrogate is capable of parsing standard C++ code and understanding the class definitions and function prototypes.

In this case, interrogate is having trouble parsing your system’s math.h file, which appear to contain some nonstandard syntax or keyword, somewhere near a sizeof keyword on line 232.

One solution is to shadow the system’s math.h file (probably interrogate doesn’t really need to read this file) with an empty file. Another solution is to discover the particular keyword that is causing grief, and define it to nothing with the SYS_IGATE_FLAGS variable.

Search the forums for parser-inc or interrogate for another post with more details on this subject.


Hi David,

It seems that these two definitions are incorrect (in math.h):

int     (isinf)(double) __pure2;
int     (isnan)(double) __pure2;

Well, in fact, they are duplicated in the math.h
By the way, the compiler is gcc 3.4.6
I have tried to shadow the file math.h, ‘interrogate’ program works however
the compiling process stoppes in the next step. So, I must do it step by step;
remove the file, run make, re-copy the file, re-run make.
Thanks for your help.

You shouldn’t have to repeat this process at every step. That will take forever.

Did you shadow math.h by putting an empty copy in the /usr/local/panda/parser-inc directory? This is a directory that interrogate looks for header files, but the compiler does not. If you put a shadow math.h anywhere else, it will interfere with the compiler.


I have just added a shadow math.h to the repository version of Panda, so that this step will be done automatically. You might come across additional header files that need to be shadowed.

Note that an alternative to shadowing these files would be to add __pure2 to the list of interrogate keywords, which is doubtless the cause of this particular problem.


Hi David,

I have created by my own the math.h (empty file) and I put it into the directory you

said. After that, I tried to compile panda and it did not work. There was a problem with
the OpenGL include directory. So, I included the variables GL_IPATH and GL_LPATH in
the file; Config.FreeBSD.pp

#define GL_IPATH  /usr/X11R6/include
#define GL_LPATH  /usr/X11R6/lib

Then, I tried again and it worked. I am able to compile; panda and direct. However, when
I try to compile the pandatool package, it does not work. The error is:

Any idea?

Are you building with version 1.3.2, or the latest version from cvs? I believe this particular build problem may have already been fixed on the cvs trunk. In particular, though, I think that it requires the addition of “pipeline:c” to the OTHER_LIBS list in pandatool/src/bam/Sources.pp. There are numerous other missing libraries that are also required in other directories. (FreeBSD is presumably fussier about explicitly naming every indirect library than Linux or Windows are. We found the same behavior on OSX.)

Note that the long string of warning messages is complaining that you haven’t added /usr/local/panda/lib to your LD_LIBRARY_PATH variable. Without that, you won’t be able to run any of the code you have compiled.


Hello David,

You are right, I am trying to compile panda 1.3.2. I am going to download the latest version of source code from the CVS and I will try to compile it 

(on FreeBSD 6.2).
On the other hand, I will check whether I had the LD_LIBRARY_PATH
defined when I was compiling.

Hi David,

I checked the LD_LIBRARY_PATH variable and it was set. I tried again and this time
the error is different.

I verified the '/usr/local/panda/lib' directory and all the libraries exist. So, I checked the

Makefile. The problem was there. I have patched the src/dcparse/Makefile (adding -lnet by
hand) and it seems it works. However, ‘make install’ does not work because
/usr/local/panda/lib/direct/xxxx directories do not exist. So, I created them by hand.

After that, I tried to compile ‘pandatool’ and I encountered the same kind of problems
as for ‘direct’. Then, I patched the makefiles:
* src/bam/Makefile; adding “-lpandabase -lpstatclient -lpipeline -lnet -lgsgbase -lgrutil -ltext -lcull -lpnmtext -ltform -ldevice -ldisplay -ldgraph”

* src/dxfprogs/Makefile; adding "-lpnmimage -lputil -lmathutil -lpipeline -lpandabase -levent" for first executable
  "-lpipeline -lpandabase" for second executable

* src/egg-mkfont/Makefile; adding "-lpandabase -lpgraph -levent -lmathutil -linterrogatedb -lcull -lgsgbase -lgobj -lpstatclient -llerp -ldownloader -lpipeline -lnet"

* src/egg-optchar/Makefile; adding "-lpandabase -lpipeline -ldisplay -lnet -lpstatclient -lgsgbase -lcull --lpgraph -lcull -lgsgbase -lgobj -llerp -ldownloader"

* src/egg-qtess/Makefile; adding "-lpandabase -lpstatclient -lpipeline -lnet -ldevice -lcull -lpnmtext"

* src/eggprogs/Makefile; adding "-lpandabase -lpipeline -lputil"   

* src/flgprogrs/Makefile; adding "-lpandabase -lpipeline -lputil"

* src/imageprogrs/Makefile; adding "-lpandabase -lpipeline -lputil -linterrogatedb -lmathutil -levent"

* src/lwoprogs/Makefile; adding "-lpandabase -lpipeline -lputil -lnet -levent -lmathutil"

* src/miscprogs/Makefile; adding "-lpandabase -lpipeline -lputil -linterrogatedb"

* src/softprogrs/Makefile; adding "-lpandabase -lpipeline -lputil -lmathutil -linterrogatedb -lpnmimage -levent"

* src/text-stats/Makefile; adding "-lpandabase -lpipeline -lputil -levent -lpnmimage -linterrogatedb -lnet -ldtool -lmathutil"

* src/vrmlprogs/Makefile; adding "-lpandabase -lpipeline -lputil -lmathutil -levent -lpnmimage"

* src/xfileprogs/Makefile; adding "-lpandabase -lpipeline -lputil -levent -lpnmimage -ldtool -ldtoolconfig -lmathutil"

Finally, I successfully compiled the 'pandatool' package.

However, after installing everything, there is something missing (or I made a mistake).

The file ‘ppython’ is not installed on ‘/usr/local/panda/bin’. If I copy the file by hand
and I try to execute an example, it does not work. The error is:

When I execute 'pview', I obtain the following:
Any idea?

Best regards.

PS: Now, I am using the latest version from Sourceforge CVS

Have you uninstalled the previous version entirely before compiling?


There was no version to uninstall because I am trying to compile
Panda 3D from scratch. Anyway, between compilations, I did “rm -fr
/usr/local/panda/*” and after that, I started the compilation process
again (from scratch).
With respect to ‘ppython’, I have verified that it is not installed
in ‘/usr/local/panda’ by default. I did it by hand.
In any case, thanks for the advice.

PS: There is no version of Panda for FreeBSD. I downloaded the
code from Sourceforge CVS and I was not able to compile and install
it successfully.

Hmm, let me see. Several different things going on here.

Note that this is just a warning. In fact, we get it too on OSX, but we never really noticed it amid all the other build noise. It’s true it’s easy to fix by adding -lnet (and the right way to do this is to add it to the Sources.pp file), so I’ll do that now–but as it turns out, this particular warning is ignorable anyway. (Sometimes, messages like this are actually errors, not warnings, and you have to fix them in order to build. That doesn’t appear to be the case in this particular situation.)

Hmm, this must be the directories that it is attempting to install the .py files into. Is that right? I’m surprised it doesn’t make them automatically during the build, it is supposed to do that. I’ll look into that.

This is strange because this is exactly the set of libraries we added to the Sources.pp (and hence the Makefiles) in the cvs version months ago. They’re still there in my build. Are you sure you checked out the latest Pandatool from cvs?

Sounds like your PYTHONPATH variable is not set up properly. You need to have /usr/local/panda/lib on your PYTHONPATH, so Python understands what you mean by “import direct”.

Yikes! This sounds like trouble. I can’t imagine what’s going on here, but one thing you might try might be to put:


in your Config.pp file and rebuild everything.

Hmm, seems you are explicitly requesting multisamples in your Config.prc file for some reason, and your graphics card can’t provide them. This is not surprising; this a fairly advanced framebuffer feature, and lots of graphics cards can’t do multisampling. You must have a line like this in your Config.prc file:

framebuffer-multisamples 1

or maybe you have a line like this:

framebuffer-mode rgb double-buffer multisample

If the former, comment out or delete the line; if the latter, remove the “multisample” keyword.