Paul Martz wrote: > If you export OSG_NOTIFY_LEVEL=DEBUG_FP, OSG will display the paths it is > searching in its attempt to locate the OpenFlight plugin. > -Paul
Thanks for that trick, it is quite useful. Earlier in the day I was cursing the fact that I didn't know how to see what directories OSG was looking in to find the plugins. I went ahead and exported OSG_NOTIFY_LEVEL and ran my application in the two "ways" that I described in my original post. Previously when I would run my application without modifying LD_LIBRARY_PATH, the OpenFlight would NOT be rendered, OSG would print a message about not being able to find the plugin, and my application was gracefully allowed to continue running. Now that I've exported OSG_NOTIFY_LEVEL I get the same behavior and I'm able to see that OSG is looking for the plugin in several directories which don't contain the plugin... Code: Warning: Could not find plugin to read objects from file "MyOpenFlightFile.flt". RegisterWindowingSystemInterfaceProxy() X11WindowingSystemInterface() GraphicsContext::setWindowingSystemInterface() 0x21e8440 0x7f27af96ea50 Adding parent0x21cce20 Adding parent0x21cce20 Adding parent0x21cce20 Adding parent0x21cce20 Adding parent0x21cce20 Adding parent0x21cce20 CullSettings::readEnvironmentalVariables() Adding parent0x21cce20 Adding parent0x21cce20 DatabasePager::addDatabaseThread() HANDLE_NON_HTTP DatabasePager::addDatabaseThread() HANDLE_ONLY_HTTP Render::Render() 0x23e6d10 CullSettings::readEnvironmentalVariables() CullSettings::readEnvironmentalVariables() Adding parent0x21cce20 CullSettings::readEnvironmentalVariables() CullSettings::readEnvironmentalVariables() Adding parent0x21cce20 Adding parent0x21cce20 ShaderComposer::ShaderComposer() 0x23e88a0 CullSettings::readEnvironmentalVariables() Adding parent0x21cce20 Adding parent0x21cce20 Adding parent0x21cce20 Adding parent0x21cce20 ShaderComposer::ShaderComposer() 0x23ea830 Adding parent0x21cce20 Adding parent0x21cce20 Adding parent0x21cce20 _availableQueue.size()=2 GraphicsContext::registerGraphicsContext 0x243eb70 ShaderComposer::ShaderComposer() 0x243d7a0 GraphicsContext::createNewContextID() creating contextID=0 Updating the MaxNumberOfGraphicsContexts to 1 Adding parent0x21cce20 itr='/share/users/elafave/SWR/lib/so' FindFileInPath() : trying /share/users/elafave/SWR/lib/so/osgPlugins-2.9.9/osgdb_openflight.so ... itr='/share/users/elafave/SWR/lib/so/linux/x86_64' FindFileInPath() : trying /share/users/elafave/SWR/lib/so/linux/x86_64/osgPlugins-2.9.9/osgdb_openflight.so ... itr='/usr/bin/gcc-4.1/lib' FindFileInPath() : trying /usr/bin/gcc-4.1/lib/osgPlugins-2.9.9/osgdb_openflight.so ... itr='/share/users/elafave/jdk1.6.0_22/bin' FindFileInPath() : trying /share/users/elafave/jdk1.6.0_22/bin/osgPlugins-2.9.9/osgdb_openflight.so ... itr='/usr/X11R6/lib' FindFileInPath() : trying /usr/X11R6/lib/osgPlugins-2.9.9/osgdb_openflight.so ... itr='/work/tools/OpenSceneGraph-2.9.9/lib64/osgPlugins-2.9.9' FindFileInPath() : trying /work/tools/OpenSceneGraph-2.9.9/lib64/osgPlugins-2.9.9/osgPlugins-2.9.9/osgdb_openflight.so ... itr='/usr/lib/' FindFileInPath() : trying /usr/lib/osgPlugins-2.9.9/osgdb_openflight.so ... itr='/usr/lib64/' FindFileInPath() : trying /usr/lib64/osgPlugins-2.9.9/osgdb_openflight.so ... itr='/usr/local/lib/' FindFileInPath() : trying /usr/local/lib/osgPlugins-2.9.9/osgdb_openflight.so ... itr='/usr/local/lib64/' FindFileInPath() : trying /usr/local/lib64/osgPlugins-2.9.9/osgdb_openflight.so ... itr='/share/users/elafave/SWR/lib/so' FindFileInPath() : trying /share/users/elafave/SWR/lib/so/osgdb_openflight.so ... itr='/share/users/elafave/SWR/lib/so/linux/x86_64' FindFileInPath() : trying /share/users/elafave/SWR/lib/so/linux/x86_64/osgdb_openflight.so ... itr='/usr/bin/gcc-4.1/lib' FindFileInPath() : trying /usr/bin/gcc-4.1/lib/osgdb_openflight.so ... itr='/share/users/elafave/jdk1.6.0_22/bin' FindFileInPath() : trying /share/users/elafave/jdk1.6.0_22/bin/osgdb_openflight.so ... itr='/usr/X11R6/lib' FindFileInPath() : trying /usr/X11R6/lib/osgdb_openflight.so ... itr='/work/tools/OpenSceneGraph-2.9.9/lib64/osgPlugins-2.9.9' FindFileInPath() : trying /work/tools/OpenSceneGraph-2.9.9/lib64/osgPlugins-2.9.9/osgdb_openflight.so ... itr='/usr/lib/' FindFileInPath() : trying /usr/lib/osgdb_openflight.so ... itr='/usr/lib64/' FindFileInPath() : trying /usr/lib64/osgdb_openflight.so ... itr='/usr/local/lib/' FindFileInPath() : trying /usr/local/lib/osgdb_openflight.so ... itr='/usr/local/lib64/' FindFileInPath() : trying /usr/local/lib64/osgdb_openflight.so ... Warning: dynamic library 'osgPlugins-2.9.9/osgdb_openflight.so' does not exist (or isn't readable): osgPlugins-2.9.9/osgdb_openflight.so: cannot open shared object file: No such file or directory DynamicLibrary::failed loading "osgPlugins-2.9.9/osgdb_openflight.so" Previously when I would run my application after adding the OSG lib path to LD_LIBRARY_PATH my application would crash thanks to a segmentation fault. Now that I've exported OSG_NOTIFY_LEVEL I get the same behavior but I don't get any output that shows which directories OSG was looking in to find the plugin... Code: RegisterWindowingSystemInterfaceProxy() X11WindowingSystemInterface() GraphicsContext::setWindowingSystemInterface() 0x14864b0 0x7f834a91ca50 Adding parent0x146ae20 Adding parent0x146ae20 Adding parent0x146ae20 Adding parent0x146ae20 Adding parent0x146ae20 Adding parent0x146ae20 CullSettings::readEnvironmentalVariables() Adding parent0x146ae20 Adding parent0x146ae20 DatabasePager::addDatabaseThread() HANDLE_NON_HTTP DatabasePager::addDatabaseThread() HANDLE_ONLY_HTTP Render::Render() 0x1684e80 CullSettings::readEnvironmentalVariables() CullSettings::readEnvironmentalVariables() Adding parent0x146ae20 CullSettings::readEnvironmentalVariables() CullSettings::readEnvironmentalVariables() Adding parent0x146ae20 Adding parent0x146ae20 ShaderComposer::ShaderComposer() 0x1686a10 CullSettings::readEnvironmentalVariables() Adding parent0x146ae20 Adding parent0x146ae20 Adding parent0x146ae20 Adding parent0x146ae20 ShaderComposer::ShaderComposer() 0x16889a0 Adding parent0x146ae20 Adding parent0x146ae20 Adding parent0x146ae20 _availableQueue.size()=2 GraphicsContext::registerGraphicsContext 0x16dcce0 ShaderComposer::ShaderComposer() 0x16db910 GraphicsContext::createNewContextID() creating contextID=0 Updating the MaxNumberOfGraphicsContexts to 1 Adding parent0x146ae20 Segmentation fault (core dumped) So again I'm left feeling stuck. I'll preface my next few comments by pointing out that I'm very new to OSG and to a lesser extent CMake. So I don't have a complete understanding of either. Should I even be adding the path to OSG's lib directory to LD_LIBRARY_PATH? Doing this feels somewhat "hackish" (perhaps thats why it results in a crash) because I'd expect that OSG would be able to find its plugins without my help. I'm beginning to think my problem may be a result of how I'm telling CMake that my application is dependent on OSG? My original post has code snippets which show how I'm doing this. It may not be immediately obvious from reading those snippets but they are relying on the FindOpenSceneGraph.cmake module which comes with CMake. So that combined with the fact that it works in Windows gave me reason to feel confident that it would work but maybe I'm just misusing it. If I should be posting this question on a CMake forum then say the word and I'll take my problems over there.[/code] ------------------ Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=37869#37869 _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org