Loading ...
Sorry, an error occurred while loading the content.

Where to define LD_LIBRARY_PATH and PKG_CONFIG_PATH variables?

Expand Messages
  • Chris
    I just installed twinkle the other day and it is running on my ss7 Asterisk box. It works great but I had to export LD_LIBRARY_PATH=/usr/local/lib/ and export
    Message 1 of 2 , Mar 13, 2012
    • 0 Attachment
      I just installed twinkle the other day and it is running on my ss7 Asterisk box. It works great but I had to export LD_LIBRARY_PATH=/usr/local/lib/ and export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ while doing the ./configure in order to get everything to work.

      I have noticed that when I run twinkle the first time after installing, it runs great. Then, when I go to use twinkle later, it has an issue trying to find a library that I can't recall off the top of my head. If I recompile, export the two paths above, and then reinstall all is well.

      I did not run ldconfig after installing commoncpp2. Is this the cause of needing to do the export so the installer can find the library paths? Is there a place where these variables can be defined/hardcoded so that this issues does not arise again?

      Thanks!
    • Christian Jaeger
      This is a general reply, because I haven t run into the problem (at least currently, I m using the Debian package). 2012/3/13 Chris ...
      Message 2 of 2 , Mar 28, 2012
      • 0 Attachment
        This is a general reply, because I haven't run into the problem (at least currently, I'm using the Debian package).

        2012/3/13 Chris <ctwombly@...>

        I did not run ldconfig after installing commoncpp2. Is this the cause of needing to do the export so the installer can find the library paths?


        It's not the installer that cares about LD_LIBRARY_PATH, but the dynamic linker. The dynamic linker might be run after some compilation steps (during "make"), but definitely it is run every time you're starting the program. It probably works for you immediately after installation just because you're starting twinkle from the same shell where you defined the environment variables.

        So the solution is to either make the libraries be found globally without needing LD_LIBRARY_PATH, by running ldconfig and perhaps first fixing /etc/ld.so.conf, or to always set the environment variable(s) in the process that is starting twinkle. You could do the latter by creating a wrapper script (save as "twinklewrapper", run "chmod +x twinklewrapper"), 

        #!/bin/sh
        export LD_LIBRARY_PATH=/usr/local/lib/
        export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/  # probably not needed
        /your/path/to/twinkle

        Christian.

      Your message has been successfully submitted and would be delivered to recipients shortly.