Recompiling after editing shaderInput

Hello,

I am currently working on the shader* files in panda/src/pgraph, and I am trying to recompile the code with makepanda.py.
Everything’s fine except that the recompilation process start at 18%, and that means I have to wait 15 minutes each time.

Any idea how could I speed it up?

Thanks

If you edited the .cxx source files only, it won’t recompile all the way from that point. However, if you updated a .h header file (or .I inline function file), it will have to rebuild everything that depends on them, so that means almost the whole rest of Panda.

If you want more control over what to build when and what not to, use the ppremake build system. I use it for development as well.

So I am recompiling with ppremake everything goes fine until I
try to compile pandaed from the panda dir:

error while loading shared libraries: libinterrogatedb.so: cannot open shared object file: No such file or directory
make[1]: *** [Opt3-Linux/libexpress_igate.cxx] Error 127
make[1]: Leaving directory `/home/memecs/builds/panda3d-1.7.0/panda/src/express'
make: *** [express] Error 2

any help?

By the way is this the library supposed to build the python interface?

thanks a lot

Found the problem, spelling error when i exported LD_LIBRARY_PATH…

I am getting error this during compilation:

/usr/lib/gcc/i486-linux-gnu/4.4.1/../../../../lib/libCg.so: undefined reference to `pthread_getspecific'
/usr/lib/gcc/i486-linux-gnu/4.4.1/../../../../lib/libCg.so: undefined reference to `pthread_mutexattr_destroy'
/usr/lib/gcc/i486-linux-gnu/4.4.1/../../../../lib/libCg.so: undefined reference to `pthread_key_create'
/usr/lib/gcc/i486-linux-gnu/4.4.1/../../../../lib/libCg.so: undefined reference to `pthread_mutexattr_init'
/usr/lib/gcc/i486-linux-gnu/4.4.1/../../../../lib/libCg.so: undefined reference to `pthread_once'
/usr/lib/gcc/i486-linux-gnu/4.4.1/../../../../lib/libCg.so: undefined reference to `pthread_mutexattr_settype'
/usr/lib/gcc/i486-linux-gnu/4.4.1/../../../../lib/libCg.so: undefined reference to `pthread_setspecific'

I found the solution here:
nvnews.net/vbulletin/showthread.php?t=40228

but where and how do I edit to link against pthread?
It seems like I can’t do that directly in the makefile.

One more question: I had a problem before, the compiler could not find fmod.h, but I had fmod.h in /usr/local/include/fmodex/fmod.h. So what I did was copying all the fmod*.h in /usr/local/include. But I should have set up FMOD_IPATH right? And in this case I should have had to go through the entire process gain right?

thanks

I have something like this in Config.pp to fix that:

#define CG_LIBS Cg pthread

As for fmod, yes, it is indeed better to set FMOD_IPATH. (Note that the Panda3D PPA at launchpad also has .debs for fmod.)

Thanks a lot, you are always really helpful…
By the way I don’t quite understand how Config.pp works.
I mean I made my own Config.pp that is trying (unsuccessfully) to override dtool/Config.pp.

Example:
dtool/Config.pp defines:
#define SQUISH_IPATH /usr/local/include
#define SQUISH_LPATH /usr/local/lib
#define SQUISH_LIBS squish
#defer HAVE_SQUISH [libtest [SQUISH_LPATH],$[SQUISH_LIBS]]

say I want to get rid of this library,thus in my Config.pp I tried both:

#define HAVE_SQUISH
or
#defer HAVE_SQUISH

but when I run ppremake in dtool I still get +squish.
So it seems like it’s not overriding the default Config.pp.

Just for clarification:
a variable that is defined with #define cannot be changed in the middle of the compilation process as if it was deferred with #defer. Is my understanding correct?

Last question:
what would be the minimum configuration if what I need is only c++ and CG shaders support?

By the way I am sure it’s reading my own Config.pp because I get

Reading /home/memecs/builds/panda3d-1.7.0/Config.pp (referred to by PPREMAKE_CONFIG)

You should be able to use either #define or #defer to override HAVE_SQUISH, and either line should effectively disable it. If it is not working, perhaps it is not reading that line. One common mistake is not entering a newline character following the last line of the file, rendering that line unreadable; could this be the problem?

You have a slight misunderstanding about #define and #defer. Regardless of the way in which a variable is defined, you are free to override it in your own Config.pp file. The only difference between the two is the way the variable’s value is interpreted if you do not override it.

David

The newline character doesn’t seem to be problem.
To make it sure I copied doc/Config.pp.sample in panda3d/Config.pp and added #define HAVE_SQUISH in the middle of the file, but still, it’s loading squish

So when should I use #define and when #defer?

Thanks a lot
Federico

nevermind, problem founded.

thanks again

So at this point my compilation time with ppremake is 4 minutes if I edit one shader* file in /pgraph.
It is definitely acceptable but I was wondering if is there any way to further speed it up?

Note that if you made a change in pgraphnodes that does not affect any other parts of Panda, you can simply cd to the “panda/src/pgraphnodes” directory and call “make install” there, rather than calling “make install” in “panda”.

mmh, I have just noticed that I am missing some libraries.
I compiled with ppremake getting rid of:
FMODEX, OPENSSL, FFTW, DX8, DX9.

these are the missing libraries:
-lp3framework,-lp3dtoolconfig,-lp3dtool,-lp3pystub,-lp3direct.

Any idea what’s wrong?

The ppremake system does not use the p3 prefix for libraries. So it becomes something like this:
-lframework,-ldtoolconfig,-ldtool,-lpystub,-ldirect

yeah, I’ve figured that out, but anyway I don’t have libdirect

Did you perhaps forget to call “ppremake” and “make install” in the “direct” tree?

Yeah, I didn’t do it. But do I need it if I do not care about the python interface?
By the way if i try to compile a simple program (with all the libs except libdirect) at the moment I get this kind of linker error:

../lib/libframework.so: undefined reference to `NodePath::set_two_sided(bool, int)'

Should I load other libraries?
and when I call “make” in …/direct I get this error

interrogate: error while loading shared libraries: libinterrogatedb.so: cannot open shared object file: No such file or directory

The first issue is because you probably forgot to link libpanda.so.

As for the second issue - first make sure that the lib directory is on the library path, then call “sudo ldconfig” to update the LD cache. Then try again.

mmh, actually I am linking libpanda.so.

this is a wider selection of the errors…

/home/memecs/builds/013010/lib/libframework.so: undefined reference to `DeletedBufferChain::deallocate(void*, TypeHandle)'
/home/memecs/builds/013010/lib/libframework.so: undefined reference to `PGItem::_type_handle'
/home/memecs/builds/013010/lib/libframework.so: undefined reference to `ButtonThrower::_type_handle'
/home/memecs/builds/013010/lib/libdtoolconfig.so: undefined reference to `interrogate_type_is_wrapped'
/home/memecs/builds/013010/lib/libframework.so: undefined reference to `GeomVertexFormat::get_array_with(InternalName const*) const'
/home/memecs/builds/013010/lib/libframework.so: undefined reference to `Geom::_type_handle'
/home/memecs/builds/013010/lib/libdtoolconfig.so: undefined reference to `interrogate_manifest_name'
/home/memecs/builds/013010/lib/libdtoolconfig.so: undefined reference to `interrogate_type_has_destructor'
/home/memecs/builds/013010/lib/libframework.so: undefined reference to `FrameRateMeter::clear_window()'
/home/memecs/builds/013010/lib/libframework.so: undefined reference to `MouseButton::one()'
/home/memecs/builds/013010/lib/libdtoolconfig.so: undefined reference to `interrogate_type_is_pointer'
/home/memecs/builds/013010/lib/libdtoolconfig.so: undefined reference to `interrogate_type_get_cast'
/home/memecs/builds/013010/lib/libframework.so: undefined reference to `AsyncTaskManager::add(AsyncTask*)'
/home/memecs/builds/013010/lib/libframework.so: undefined reference to `GeomNode::GeomNode(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/home/memecs/builds/013010/lib/libframework.so: undefined reference to `GeomVertexData::CacheEntry::_type_handle'
/home/memecs/builds/013010/lib/libpanda.so: undefined reference to `libmovies_moddef'
/home/memecs/builds/013010/lib/libframework.so: undefined reference to `NodePath::output(std::basic_ostream<char, std::char_traits<char> >&) const'
/home/memecs/builds/013010/lib/libframework.so: undefined reference to `AnimInterface::CData::internal_set_rate(double, double)'
/home/memecs/builds/013010/lib/libdtoolconfig.so: undefined reference to `interrogate_get_element_by_name'
/home/memecs/builds/013010/lib/libframework.so: undefined reference to `ModifierButtons::add_button(ButtonHandle)'
/home/memecs/builds/013010/lib/libpandafx.so: undefined reference to `init_libdistort()'
/home/memecs/builds/013010/lib/libpanda.so: undefined reference to `librecorder_moddef'
/home/memecs/builds/013010/lib/libdtoolconfig.so: undefined reference to `interrogate_type_is_class'
/home/memecs/builds/013010/lib/libpandaexpress.so: undefined reference to `libexpress_moddef'
/home/memecs/builds/013010/lib/libframework.so: undefined reference to `BamFile::open_read(std::basic_istream<char, std::char_traits<char> >&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)'
/home/memecs/builds/013010/lib/libframework.so: undefined reference to `ShadeModelAttrib::make(ShadeModelAttrib::Mode)'
/home/memecs/builds/013010/lib/libframework.so: undefined reference to `EventHandler::remove_all_hooks()'
/home/memecs/builds/013010/lib/libframework.so: undefined reference to `InternalName::_root'
/home/memecs/builds/013010/lib/libframework.so: undefined reference to `NodePath::set_render_mode_wireframe(int)'
/home/memecs/builds/013010/lib/libframework.so: undefined reference to `PGSliderBar::PGSliderBar(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/home/memecs/builds/013010/lib/libframework.so: undefined reference to `TypedWritable::~TypedWritable()'
/home/memecs/builds/013010/lib/libframework.so: undefined reference to `GraphicsEngine::make_output(GraphicsPipe*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, FrameBufferProperties const&, WindowProperties const&, int, GraphicsStateGuardian*, GraphicsOutput*)'
/home/memecs/builds/013010/lib/libpanda.so: undefined reference to `libdisplay_moddef'
/home/memecs/builds/013010/lib/libframework.so: undefined reference to `GraphicsEngine::open_windows()'

Huh, are you sure you linked it correctly? I’ve checked some of these symbols, some are from libdtoolbase.so, some are from libpgui.so, some from libmovies.so, and those libraries are really picked up by linking libpanda.so.