Author Topic: Problems running compiled client on Debian testing  (Read 1324 times)

Gilrond

  • Hydlaa Notable
  • *
  • Posts: 764
    • View Profile
Problems running compiled client on Debian testing
« on: October 24, 2011, 04:07:29 am »
I tried to compile PS client on current Debian testing following instructions here:
https://planeshift.svn.sf.net/svnroot/planeshift/trunk/docs/compiling.html

Compilation worked, but running psclient even with all needed settings in LD_LIBRARY_PATH fails:

Code: [Select]
DLERROR (.../build/cs/xwin.so): .../build/cs/xwin.so: undefined symbol: libgtk_x11_2_0_is_present
SCF_WARNING: factory returned a null instance for crystalspace.window.x
        if error messages are not self explanatory, recompile CS with CS_DEBUG
WARNING: could not load plugin ‘crystalspace.window.x’
Could not create an instance of crystalspace.window.x!
WARNING: failed to initialize plugin ‘crystalspace.graphics2d.glx’
Error loading Graphics2D plugin.
WARNING: failed to initialize plugin ‘crystalspace.graphics3d.opengl’
DLERROR (.../build/cs/sndsysopenal.so): .../build/cs/sndsysopenal.so: undefined symbol: libopenal_is_present
SCF_WARNING: factory returned a null instance for crystalspace.sndsys.renderer.openal
        if error messages are not self explanatory, recompile CS with CS_DEBUG
WARNING: could not load plugin ‘crystalspace.sndsys.renderer.openal’
DLERROR (.../build/cs/xwin.so): .../build/cs/xwin.so: undefined symbol: libgtk_x11_2_0_is_present
SCF_WARNING: factory returned a null instance for crystalspace.window.x
        if error messages are not self explanatory, recompile CS with CS_DEBUG
WARNING: could not load plugin ‘crystalspace.window.x’
Could not create an instance of crystalspace.window.x!
WARNING: failed to initialize plugin ‘crystalspace.graphics2d.glx’
Error loading Graphics2D plugin.

Is there anything needed so it could find  libgtk_x11_2_0_is_present? I have libgtk2.0-dev and libx11-dev installed.

Also, how can one make psclient.bin with statically linked libs? The client which is produced doesn't look like the one shipped with PS. At least it'll remove the need to set that LD_LIBRARY_PATH all the time.

weltall

  • Moderator
  • Veteran
  • *
  • Posts: 1671
    • View Profile
    • http://weltall.heliohost.org
Re: Problems running compiled client on Debian testing
« Reply #1 on: October 24, 2011, 02:57:07 pm »
you've to tell gcc to link .a files instead of letting it pick the library it sees more fit

Gilrond

  • Hydlaa Notable
  • *
  • Posts: 764
    • View Profile
Re: Problems running compiled client on Debian testing
« Reply #2 on: October 24, 2011, 03:33:06 pm »
I know I can tell gcc that :) Is there a configure or jam option for it? The prescribed procedure doesn't match obviously the one used for ps release. You don't do it calling gcc by hand, or modifying jamfiles by hand every time your build, don't you? I thought it should be fairly simple since PS produces these binaries all the time.
« Last Edit: October 24, 2011, 03:39:22 pm by Gilrond »

Aiwendil

  • Hydlaa Citizen
  • *
  • Posts: 463
    • View Profile
Re: Problems running compiled client on Debian testing
« Reply #3 on: October 24, 2011, 08:17:18 pm »
Tried the commands for the static build in the building guide? Following the Linux/Gcc/User/Static guide? The main difference I see right now is "jam -aq client_static" instead of "jam -aq client"...but there are maybe other differences as well.

For your errors...what did you do with your CS build? ;) Really no clue there at all...for example why does it use ".../build/cs/xwin.so" instead of "../build/cs/xwin.so" (three dots instead of two)?. I guess first I would check if all needed environment variables are setup correctly (like CRYSTAL). And then I would try to build CS again...seeing if during configuration something was messed up.

Edit: Oh..and just noticed there is a a gentoo specific build guide also...but as described there it won't work. Gentoo's latest cg-toolkit is version 2.1..which won't work with current CS. So in gentoo people have to download the latest CG themself. I used to install it locally for my user folder along with CS, cal3d and PS...and then complie CS giving it the right path in ./configure. Just in case there is actually someone still updating that build guide.
« Last Edit: October 24, 2011, 08:29:24 pm by Aiwendil »

Gilrond

  • Hydlaa Notable
  • *
  • Posts: 764
    • View Profile
Re: Problems running compiled client on Debian testing
« Reply #4 on: October 24, 2011, 08:27:33 pm »
Oh, thanks for the pointer. I completely missed the UI selection on top, which shows static option. Now I see - jam -aq client_static  does the trick.

Dots are just a manual thing where I removed the whole path while posting here, that's not the problem
« Last Edit: October 24, 2011, 08:30:35 pm by Gilrond »

Aiwendil

  • Hydlaa Citizen
  • *
  • Posts: 463
    • View Profile
Re: Problems running compiled client on Debian testing
« Reply #5 on: October 24, 2011, 08:40:23 pm »
I see...okay. but still looks a lot like something went wrong with your CS build. "libgtk_x11_2_0_is_present" is defined in a automatic generated source file in CS ("out/linux/optimize/plugins/video/canvas/xwindow/libgtk-x11-2.0.so.0.stub.c"). It's then used by a "extern" declaration within the code from CS. That this reference is missing in your case indicates something went wrong during the CS build and the usually automatic generated file wasn't generated. Not that I really have much of a clue of CS...that's only how it looks to me.

Gilrond

  • Hydlaa Notable
  • *
  • Posts: 764
    • View Profile
Re: Problems running compiled client on Debian testing
« Reply #6 on: October 24, 2011, 09:18:25 pm »
Thanks, I'm trying to redo it step by step in case I missed something. Also, when configuring CS, I get the following results:
Code: [Select]
Optional Dependencies
---------------------
Found
  alsa                 (audio)
  cairo                (image)
  cal3d                (models)
  cg                   (rendering)
  curl                 (other)
  freetype2            (other)
  linux-joystick       (other)
  ogg                  (audio)
  openal               (audio)
  opengl               (rendering)
  oss                  (audio)
  png                  (image)
  speex                (audio)
  vorbis               (audio)
  x11                  (rendering)
  zlib                 (other)

Missing
  3ds                  (models)
  assimp               (models)
  bullet               (physics)
  cairomm              (image)
  cegui                (gui)
  gtk                  (other)
  jackasyn             (audio)
  java                 (bindings)
  jpeg                 (image)
  lcms                 (image)
  mng                  (image)
  ode                  (physics)
  perl                 (bindings)
  python               (bindings)
  vgvm                 (image)
  wxwidgets            (gui)

Which ones of these are critical to install?
« Last Edit: October 24, 2011, 09:21:15 pm by Gilrond »

Aiwendil

  • Hydlaa Citizen
  • *
  • Posts: 463
    • View Profile
Re: Problems running compiled client on Debian testing
« Reply #7 on: October 24, 2011, 09:36:23 pm »
Can really only make a educated guess there:

  • alsa - Ugh...sorry, not really sure. PS uses openAL for sound...so maybe alsa isn't needed...on the other hand openAL depends in most cases on alsa...so really no clue.
  • cairo - Interesting question...don't think PS needs any vector graphics library...so should be safe to go without.
  • cal3d - This one is definitively needed for character animation in PS.
  • cg - needed for shader support in PS (at least I think they still uses CG instead of GLSL shaders)
  • curl - needed for the PS updater and bugreporter I think.
  • freetype2 - ahm...not sure again but hard to imagine to do any text rendering in openGL without it...so probably needed.
  • linux-joystick - No joystick support in PS so not needed.
  • ogg - PS plays a lot of ogg sound files...so needed.
  • openal - needed for the (3d) sound of PS.
  • opengl - pretty sure that you want that one...as you probably want 3d graphics
  • oss - shouldn't be needed. Old linux sound system..and as far as I know not supported in PS at all anymore.
  • png - Ugh...again no real clue. Oh..wait..PS writes screenshots at least as .png files...so at least needed for that. No idea about textures...I think PS prefers direct draw surfaces for those...but haven't seen the PS data in some time now...so maybe there are some png image files in it also. In the end..yes, pretty sure you want it.
  • speex - Mhh...sorry, you have to try it out. No clue if the PS NPC voices are in speex format...doubt it but could be. My guess it's not needed for PS.
  • x11 - As I guess CS and PS want to open a window in xorg somehow this one should be needed.
  • zlib - Good question...not aware PS uses it...but the "compiled" maps might be compressed. So have to try it out.

  • 3ds - Not needed for PS. 3d studio max exporter for CS.
  • assimp - I have not the slightest clue what assimp is...but as it's a missing dependency for me also PS shouldn't need it. (or it was added in the last year)
  • bullet  physic system not needed by PS
  • cairomm - C++ bindings for cairo...shouldn't be needed either
  • cegui - GUI system...not used by PS (PS uses PAWS)
  • gtk - I don't think gtk is needed for PS
  • jackasyn - jack sound system...not used by PS
  • java - Not needed by PS
  • jpeg - ugh...I thought PS needs that one (screenshots can be written in jpeg). But maybe PS does the image file writing itself and doesn't use CS for it.
  • lcms - color management system...don't think PS uses it.
  • mng - another (animated) image format...don't think PS uses it.
  • ode - And more physics...seeing the non-existent physic system in PS I doubt it's needed.
  • perl - not needed by PS.
  • python - not needed by PS.
  • vgvm - No clue what it even is...doubt PS makes uses of it.
  • wxwidgets - Multiplatform GUI toolkit...not used by PS.

Edit:Okay...I'm seriously too stupid to read code blocks completely ;) Modifying post. Oh..and lists in the new forum version really suck!
« Last Edit: October 24, 2011, 10:04:05 pm by Aiwendil »

Gilrond

  • Hydlaa Notable
  • *
  • Posts: 764
    • View Profile
Re: Problems running compiled client on Debian testing
« Reply #8 on: October 25, 2011, 01:37:44 am »
Well, I tried to build the client with static linking, and got up to this:

---------
ResponseFile1 ./out/linux/optimize/src/client/static/_cs_static_use.cpp
C++ ./out/linux/optimize/src/client/static/_cs_static_use.o
Archive ./out/linux/optimize/libs/libplaneshift_database_staticplugins-0.5.a
ar: ./out/linux/optimize/src/plugins/common/bgloader/static/bgloader_loader_objects.o: No such file or directory

ar ruc ./out/linux/optimize/libs/libplaneshift_database_staticplugins-0.5.a ./out/linux/optimize/src/plugins/common/bgloader/static/bgloader_loader_objects.o ./out/linux/optimize/src/plugins/common/bgloader/static/bgloader_manipulate.o ./out/linux/optimize/src/plugins/common/bgloader/static/bgloader_loader.o ./out/linux/optimize/src/plugins/common/bgloader/static/bgloader_parser_mesh.o ./out/linux/optimize/src/plugins/common/bgloader/static/bgloader_parser.o ./out/linux/optimize/src/plugins/database/_bgloader_static_reg.o ./out/linux/optimize/src/plugins/common/recast/static/recast_celhpf.o ./out/linux/optimize/src/plugins/common/recast/static/recast_celnavmesh.o ./out/linux/optimize/src/plugins/common/recast/static/recastnavigation/recast_RecastRasterization.o ./out/linux/optimize/src/plugins/common/recast/static/recastnavigation/recast_DebugDraw.o ./out/linux/optimize/src/plugins/common/recast/static/recastnavigation/recast_RecastDump.o ./out/linux/optimize/src/plugins/common/recast/static/recastnavigation/recast_DetourNode.o ./out/linux/optimize/src/plugins/common/recast/static/recastnavigation/recast_RecastArea.o ./out/linux/optimize/src/plugins/common/recast/static/recastnavigation/recast_DetourCommon.o ./out/linux/optimize/src/plugins/common/recast/static/recastnavigation/recast_Recast.o ./out/linux/optimize/src/plugins/common/recast/static/recastnavigation/recast_RecastMeshDetail.o ./out/linux/optimize/src/plugins/common/recast/static/recastnavigation/recast_RecastTimer.o ./out/linux/optimize/src/plugins/common/recast/static/recastnavigation/recast_RecastLog.o ./out/linux/optimize/src/plugins/common/recast/static/recastnavigation/recast_RecastFilter.o ./out/linux/optimize/src/plugins/common/recast/static/recastnavigation/recast_DetourNavMeshBuilder.o ./out/linux/optimize/src/plugins/common/recast/static/recastnavigation/recast_RecastAlloc.o ./out/linux/optimize/src/plugins/common/recast/static/recastnavigation/recast_RecastMesh.o ./out/linux/optimize/src/plugins/common/recast/static/recastnavigation/recast_RecastDebugDraw.o ./out/linux/optimize/src/plugins/common/recast/static/recastnavigation/recast_InputGeom.o ./out/linux/optimize/src/plugins/common/recast/static/recastnavigation/recast_DetourAlloc.o ./out/linux/optimize/src/plugins/common/recast/static/recastnavigation/recast_MeshLoaderObj.o ./out/linux/optimize/src/plugins/common/recast/static/recastnavigation/recast_DetourNavMesh.o ./out/linux/optimize/src/plugins/common/recast/static/recastnavigation/recast_RecastRegion.o ./out/linux/optimize/src/plugins/common/recast/static/recastnavigation/recast_DetourDebugDraw.o ./out/linux/optimize/src/plugins/common/recast/static/recastnavigation/recast_RecastContour.o ./out/linux/optimize/src/plugins/common/recast/static/recastnavigation/recast_ChunkyTriMesh.o ./out/linux/optimize/src/plugins/database/_recast_static_reg.o ./out/linux/optimize/src/plugins/common/celgraph/static/celgraph_celgraph.o ./out/linux/optimize/src/plugins/database/_celgraph_static_reg.o ./out/linux/optimize/src/plugins/common/soundmanager/static/soundmngr_data.o ./out/linux/optimize/src/plugins/common/soundmanager/static/soundmngr_soundctrl.o ./out/linux/optimize/src/plugins/common/soundmanager/static/soundmngr_psentity.o ./out/linux/optimize/src/plugins/common/soundmanager/static/soundmngr_songstream.o ./out/linux/optimize/src/plugins/common/soundmanager/static/soundmngr_soundmanager.o ./out/linux/optimize/src/plugins/common/soundmanager/static/soundmngr_psmusic.o ./out/linux/optimize/src/plugins/common/soundmanager/static/soundmngr_queue.o ./out/linux/optimize/src/plugins/common/soundmanager/static/soundmngr_handle.o ./out/linux/optimize/src/plugins/common/soundmanager/static/soundmngr_instrumentmngr.o ./out/linux/optimize/src/plugins/common/soundmanager/static/soundmngr_songdata.o ./out/linux/optimize/src/plugins/common/soundmanager/static/soundmngr_instrument.o ./out/linux/optimize/src/plugins/common/soundmanager/static/soundmngr_manager.o ./out/linux/optimize/src/plugins/common/soundmanager/static/soundmngr_pssoundsector.o ./out/linux/optimize/src/plugins/common/soundmanager/static/soundmngr_psemitter.o ./out/linux/optimize/src/plugins/common/soundmanager/static/soundmngr_songhandle.o ./out/linux/optimize/src/plugins/common/soundmanager/static/soundmngr_system.o ./out/linux/optimize/src/plugins/database/_soundmngr_static_reg.o ./out/linux/optimize/src/plugins/common/dummysndmngr/static/dummysndmngr_dummysndmngr.o ./out/linux/optimize/src/plugins/common/dummysndmngr/static/dummysndmngr_dummysndctrl.o ./out/linux/optimize/src/plugins/database/_dummysndmngr_static_reg.o

...failed Archive ./out/linux/optimize/libs/libplaneshift_database_staticplugins-0.5.a ...
...skipped psclient_static for lack of planeshift_database_staticplugins...
...failed updating 1 target(s)...
...skipped 1 target(s)...
...updated 324 target(s)...

Used command:
jam -j2 -aq client_static

It builds alright like this (dynamic linking):
jam -j2 -aq client

My guess something is messed up with jamfiles. It doesn't build plugins when client_static rule is executed...
« Last Edit: October 25, 2011, 01:44:10 am by Gilrond »

Aiwendil

  • Hydlaa Citizen
  • *
  • Posts: 463
    • View Profile
Re: Problems running compiled client on Debian testing
« Reply #9 on: October 25, 2011, 01:45:01 am »
Did the "jam -aq libs staticplugins cs-config walktest_static" for CS?

Edit: Just for testing...
« Last Edit: October 31, 2011, 12:35:32 pm by Aiwendil »

Gilrond

  • Hydlaa Notable
  • *
  • Posts: 764
    • View Profile
Re: Problems running compiled client on Debian testing
« Reply #10 on: October 25, 2011, 02:40:25 am »
Yes, I did that.