You are not logged in.

Dear visitor, welcome to KDE-Forum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

KWTm

Beginner

  • "KWTm" started this thread

Posts: 3

Location: North America

  • Send private message

1

Sunday, March 6th 2005, 6:29am

How do I tell KDE programs where libraries are, to make startup faster?

Hello! For the longest time, I was frustrated by the sluggishness of KDE programs. After poring through the posts here, I learned to use "strace <KDE program>" to find that the reason it takes so long is that KDE programs such as Konqueror or KWrite are looking in all the wrong places for their libraries (.SO files). For example, "strace konqueror" shows (partial output):


open("/usr/lib/qt3/lib/i686/sse/libkdeinit_konqueror.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/qt3/lib/i686/mmx/libkdeinit_konqueror.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/qt3/lib/i686/libkdeinit_konqueror.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/qt3/lib/sse/mmx/libkdeinit_konqueror.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/qt3/lib/sse/libkdeinit_konqueror.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/qt3/lib/mmx/libkdeinit_konqueror.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/qt3/lib/libkdeinit_konqueror.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/X11R6/lib/tls/i686/sse/mmx/libkdeinit_konqueror.so", O_RDONLY) = -1 ENOENT (No such file or directory)
... (and so on, interspersed with "stat64()" calls)


We see here that Konqueror searches for the file "libkdeinit_konqueror.so" in a bazillion places; the complete output, not shown here, reveals that it checks about 20 locations before it finds it under "/usr/lib". The same is repeated for all sorts of other library files.

The same thing happens with other KDE programs, such as KWrite, etc.

Is there some way I can tell KDE programs where the library files are? I understand that there's this thing called LD_LIBRARY_PATH but I see people discouraging its use, partly because of security reasons but mostly because it's a kludge. Is there some other environment variable where I can specify where the KDE libraries are? Is there a setting under the KDE control centre?

If anyone can help me with this, I'd appreciate it. I've done some tinkering with Linux, but I find the average geek level here slightly above mine, so please go easy on me.

anda_skoa

Professional

Posts: 1,273

Location: Graz, Austria

Occupation: Software Developer

  • Send private message

2

Sunday, March 6th 2005, 11:02am

Check your /etc/ld.so.config file, perhaps it has a lot of paths in it and a bad ordering

Cheers,
_
Qt/KDE Developer
Debian User

KWTm

Beginner

  • "KWTm" started this thread

Posts: 3

Location: North America

  • Send private message

3

Sunday, March 6th 2005, 1:32pm

Quoted

Originally posted by anda_skoa
Check your /etc/ld.so.config file, perhaps it has a lot of paths in it and a bad ordering


Aha! A clue! What is this /etc/ld.so.config file you speak of? It does not exist on my system. I presume that a default is then used.

Would you have a sample /etc/ld.so.config file, perhaps from your own system, that you could post so I will know how to create my own? Is this file recognized by only KDE programs, or would it apply to any program that searches for a library?

anda_skoa

Professional

Posts: 1,273

Location: Graz, Austria

Occupation: Software Developer

  • Send private message

4

Sunday, March 6th 2005, 2:42pm

Quoted

Originally posted by KWTm

Quoted

Originally posted by anda_skoa
Check your /etc/ld.so.config file, perhaps it has a lot of paths in it and a bad ordering


Aha! A clue! What is this /etc/ld.so.config file you speak of? It does not exist on my system. I presume that a default is then used.

My mistake, it is called /etc/ld.so.conf
It contains a list of directories the runtime linker searches for libraries, usually it doesn't contain very much, on my system it only contains the X11 lib directory.

Your problem could also depend on how the applications and/or libraries were compiled or installed (libtool magic is beyond my level of knowledge)

Actually starting an application from the shell should be quite different than starting it from the menu or the panel, because in this case a KDE core application is usually launched as an instance of kdeinit and kdeinit already has the usual libraries open and linked.

Cheers,
_
Qt/KDE Developer
Debian User