Darwin2K Frequently Asked Questions for installation, use, etc.
1. Installation Troubleshooting
1.1 General
Q1.1.1: My problem isn't covered in this document! What do I do?
A: Tell us about it. Send email to darwin2k-devel@lists.sourceforge.net, including as many of the following files as you're able to locate: (they'll be either in the top-level source directory or the top-level build directory)
- the output of the 'configure' command
- your config.log file
- your config.cache file
- your configure script
1.2 Configuring Darwin2k
Q 1.2.1: I have a library and/or header files in an unusual place. How do I get the configure script to recognize them?A: You can set the LDFLAGS, CFLAGS, CXXFLAGS, and CPPFLAGS environment variables before running the configure script, and they'll get used. The cfg-scripts/ directory has example scripts that set some of these environment variables for several common cases; you can usually start with one of these scripts and modify them as appropriate. See Sections 3a and "Compliers and Options" under Section 5 in the INSTALL file.
If you still can't get Darwin2K to find/use your library, you can look at the file 'config.log', which contains the output of the commands used by the configure script. config.log is usually pretty big, but if you search for the library in question (e.g. -lGL or -lforms) you should be able to see what the problem is. If you can't figure it out, see Q1 above.
Q 1.2.1a: I tried that, and it didn't work!
A: Oops. We must've messed up the configure script. Please mail the following to darwin2k-devel@lists.sourceforge.net (see Q 1.1.1 above)
Q 1.2.2: I can't get the configure script to locate GL (or MesaGL)
A: On some systems, you must link with -lm in order to link with -lGL. Unfortunately, automake/autoconf doesn't always know this. To see if this is your problem, search through config.log. [This problem should be fixed in Darwin2K 0.89.]
A: Your OpenGL/MesaGL installation may be messed up. Make sure that your GL/MesaGL libraries and headers are configured correctly. If you have libGL.so* in both /usr/lib/ and /usr/X11R6/lib, for example, make sure that the GL (or Mesa) libraries in /usr/lib are symlinks to those in /usr/X11R6/lib or vice versa. Make sure that the directory containing your libGL.so* libraries is in /etc/ld.so.conf (or equivalent for your system), or in your LD_LIBRARY_PATH environment variable. Also, it's a good idea to make sure that libMesaGL.so is a symlink to the appropriate libGL.so, or vice versa--it's a bad idea to have separate copies of the libraries lying around.
If you don't have root access on your machine, you can also add the paths to the GL headers and libraries through the LDFLAGS and CPPFLAGS environment variables; see the example scripts in the cfg-scripts/ for information on how to do this.
If you've done all of the above and still have problems, please email the following to darwin2k-devel@lists.sourceforge.net:
- the output of the 'configure' command
- your config.log file
- your config.cache file
- your configure script
- the output of the 'glxinfo' command
- the output of 'ls -l /usr/lib/lib*GL*' (or wherever your GL libraries are)
- the output of 'ls -l /usr/X11R6/lib*GL*' (if you have /usr/X11R6/lib)
Q 1.2.3: I have Xforms installed, but the 'configure' script says it's unable to locate -lforms and it's not configured to build Xforms/GL targets.
A5. There are two main causes for this problem. One, the configure script can't figure out where your Xforms libraries or headers are; and two, the libraries and headers were found but there's a problem linking with them.
(1) Examine the config.log file, and search for '-lforms'. If you see a message like "Cannot locate library -lforms", then you'll need to explicity tell the configure/autogen script where your XForms library is by adding "-L
" to the LDFLAGS environment variable. Make sure that libforms.so exists, and if it's a symlink to another library (e.g. libforms.so.0.89), make sure that library exists. If you don't see that problem, but you see "Can't find forms.h" or a similar message, then you'll need to add "-I
" to the CPPFLAGS environment variable. (Also make sure you actually have forms.h installed--you may need the xforms-devel RPM in some cases under linux.) Note: if you're using linux and have installed xforms from an RPM, DEB, or similar package, you may also need to install xforms-devel in order to get the header files. In any case, you can get the complete xforms package from http://world.std.com/~xforms/
In either of these cases, see the sample scripts in the cfg-scripts/ directory for examples of how to modify the appropriate environment variables.
(2) [This problem should be fixed in Darwin2K 0.89] The other common problem is that there are linker errors when linking to libforms. Again, look at the 'config.log' file and search for -lforms. If you see undefined symbol errors after the link line, then you probably have some sort of library version mismatch. In particular, different versions of XForms seem to depend on different sets (or versions) of libraries. I've used version 0.88 and 0.89, though for 0.89 you'll need libXpm installed as well.
In summary, try using a different version of xforms or try adding -lXpm to LDFLAGS if you've got it, and let us know what the problem is if you either give up or get things working (See Q1/A1 above).
Q 1.2.4: I can't get the configure script to find and use RTC, even though I've specified the location of RTC using the --with-rtc=
flag.
A6. This is usually due to the broken logic we used in the autogen/configure scripts. Starting with Darwin2K 0.88, we've made things a little easier; the RTC tarballs now have a link from the appropriate library architecture subdir to
/lib/default, and if this link exists then the configure script should use it. For older versions, you may have to explicitly make this link:
cdWherecd lib ln -s default is the top-level RTC directory and is the subdirectory of lib/ that corresponds to your system. If you're using RTC 1.6 on Linux machine using the 2.2.x kernel, then you should try making a link from linux22 to linux24 in the
/lib directory. This shouldn't be necessary in later versions of Darwin2K. Send us email (see Q1.1.1 above) if you still can't figure it out.
2 Using Darwin2K
2.1 Building application-specific libraries
Q 2.1.1: I get the following error when running a darwin2k program:
**************************************** ERROR: loadDynamicLib, line 22 in file /home/cleger/darwin2k/src/d2k/misc/dynamicLibs.cxx: ****************************************dlopen failed for library libsyn[your-library].so: undefined symbol: [your-class-name].staticClassID
A: You need to use the DEFINE_CLASS_ID(your-class-name) macro in one of your source files.
Q 2.1.2: I get the following error when running a darwin2k program:
**************************************** ERROR: loadDynamicLib, line 22 in file /home/cleger/darwin2k/src/d2k/misc/dynamicLibs.cxx: ****************************************A: You've defined a new class that has a component dependency ptrList as a static member, but you haven't defined the list anywhere. You need to add "ptrList [your-class-name]::depTab" in one of your source files.dlopen failed for library libsyn[your-library].so: undefined symbol: [your-class-name-mangled].depTab
Q 2.1.3: I've defined a new module class, but I when I try to make a configuration that uses the module I get the following error:
A: You need to use the ADD_DB_TYPE() macro in initializeUserPMDB() or initializeUserEvalDB(), depending on which library (PM or Eval) you're creating. See darwin2k/src/d2k/apl/ff/ffEval.cxx and darwin2k/src/d2k/apl/ff/ffModules.cxx for examples. Briefly, this macro should be used like this:**************************************** ERROR: dbClassList::createByName, line 88 in file /home/cleger/darwin2k/src/d2k/db/synDB.cxx: ****************************************
unknown module type [your-module-type]
int initializeUserPMDB(void) { ... ADD_DB_TYPE(module, yourModuleClassName, yourStaticInitializationFunction); ... }
Q 2.1.4: I've created a new base module that's supposed to move around, but no matter what I do, it stays in the same place during simulation!
A: Make sure you include 'baseType = FREE_BASE' or 'baseType = PLANAR_BASE' in the createGeometry() method for your new base class.
2.2 General usage questions
Q 2.2.1: I've made some changes and recompiled, but the changes don't seem to be in there.
A: For some reason, you have to actually remove the old binaries in the build directory in order to force them to get rebuilt. A 'make clean' will do this; however, this may be a bit drastic in many cases, and given the compilation time for Darwin2K you might try just removing the binaries you're interested in by hand--again, in the build directory, not the installation directory.
Q 2.2.2: How can I create animations of Darwin2K simulations?
A. You have to set the p-file variable 'recordFrames' to 1 (it's usually in the #evaluator section, though you should be able to put it at the very top of the file:
int recordFrames = 1;You also need to specify the animBaseName variable, e.g.:char animBaseName[80] = "/home/cleger/movie/inf";This will cause pgm (or is it ppm? I forget) images to be written out for each frame of the simulation. I think that if you pause the simulation, you can move the viewpoint around and it won't record more frames until you un-pause it. Anyway, given the animBaseName specified above, the images would be named:
/home/cleger/movie/inf00000.pgm /home/cleger/movie/inf00001.pgmetc.
You'll have to use another program to turn these into a movie. Gimp will make mpegs if you've got mpeg_encode installed. I think there are some other packages available on sourceforge.net for making mpegs; I usually use an SGI for it, 'cause that's easiest for me. You may also be able to find something to do it under Windows. (Or you can just use mpeg_encode directly, though I've found it sort of awkward to use.) I think you may need to convert the images to jpegs or gifs; for that, use the ppmConvert.pl script in the darwin2k/scripts directory. (You need to have ppmquant and ppmtogif installed for this).
Alphabetic index Hierarchy of classes