Search Members Help

» Welcome Guest
[ Log In :: Register ]

Mini-ITX Boards Sale, Fanless BareBones Mini-ITX, Bootable 1G DSL USBs, 533MHz Fanless PC <-- SALE $200 each!
Get The Official Damn Small Linux Book. DSL Market , Great VPS hosting provided by Tektonic
Pages: (6) </ 1 2 3 [4] 5 6 >/

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Topic: More questions regarding compiling extensions, Yeah baby, you want it< Next Oldest | Next Newest >
lucky13 Offline





Group: Members
Posts: 1478
Joined: Feb. 2007
Posted: Sep. 10 2007,02:48 QUOTE

One more thing about the redundancy:
Quote
When I compile my libraries I have to tell them where the library is.

i.e ./configure --prefix=/opt/gnuplot --libdir=/opt/gnuplot

If that's what you're using for your libs (and not gnuplot), you're building a Makefile to install the lib in the parent prefix directory (e.g., /opt/gnuplot) rather than in lib directory (e.g., /opt/gnuplot/lib). There's really no practical reason to do that because you'll still have to link it (see below).

If you used that line to configure the Makefile for gnuplot, you're not telling it to LINK to existing libs in /opt/gnuplot, you're telling it to INSTALL gnuplot's libs (if it has any) there. That's what the libdir, mandir, bindir, etc., commands are for: to tell where to put those things.

If libgd is already in the system, it should be detected when you run configure. If it's there but not detected, modify the --with option below to suit your needs. If it's not already there, compile it first with the same prefix you'll use for your app. Leave the libdir option alone because libs should already install to /yourprefix/lib. Then when you compile gnuplot, link that --with-libgd=/prefix/lib (or however libgd is referenced -- there should be something in an INSTALL, README, or run ./configure --help | less).


--------------
"It felt kind of like having a pitbull terrier on my rear end."
-- meo (copyright(c)2008, all rights reserved)
Back to top
Profile PM WEB 
b1ackmai1er Offline





Group: Members
Posts: 115
Joined: June 2005
Posted: Sep. 10 2007,11:33 QUOTE

Hello Lucky13, I am glad you spoke up, I need all the help and advise I can get. Thanks for taking the time to do the research you did.

Yes, in principal I  realized that the --libdir was duplicating the --prefix option but I was trying everything I could do to force gnuplot to find the library I was compiling.

Basically compiling gnuplot out-of-the-box does not require this library. However, if I want to save a graph in jpeg, gif or png format I have to install the the "libgd" library and it's associated libraries that it uses.

i.e gnuplot-> libgd -> libpng, zlib, jpeg, freetype


DSL has the libpng, zlib, jpeg and freetype libraries built in, so I just need to compile the libgd library.

So I can compile the libgd with the standard ./configure --prefix=/opt/gnuplot/ and this will compile the libraries into /opt/gnuplot/lib without error

Then, I can compile gnuplot to /opt/gnuplot with ./configure --prefix=/opt/gnuplot --with-gd=/opt/gnu and it will recognize the switch and find the libraries and compile gnuplot into /opt/gnuplot/bin etc etc without error.

However, when I run the program it finds all standard libraries except the libgd one I just compiled. The --libdir stuff was just trying to find ways to get it recognize the library in /opt/gnuplot/lib.

The only two things that work are 1) adding /opt/gnuplot/lib to the library path via a script or 2) moving the libraries in /opt/gnuplot/lib to /opt/gnuplot.

So, I do have a solution that works but it is a compomise and accepting the compromise is hard to take.

Regards Phil
Back to top
Profile PM 
lucky13 Offline





Group: Members
Posts: 1478
Joined: Feb. 2007
Posted: Sep. 10 2007,12:53 QUOTE

Another possible solution is offered in gnuplot faq #3.6: you can exclude libgd and save output as encapsulated postscript and convert separately (they suggest ghostscript, but imagemagick also converts ps to whatever image format you want).
http://www.gnuplot.info/faq/faq.html#SECTION00056000000000000000


--------------
"It felt kind of like having a pitbull terrier on my rear end."
-- meo (copyright(c)2008, all rights reserved)
Back to top
Profile PM WEB 
^thehatsrule^ Offline





Group: Members
Posts: 3275
Joined: July 2006
Posted: Sep. 11 2007,16:47 QUOTE

It's not really a compromise to write a wrapper script -- many of the things used in a system are launched from another process.

I wonder why #2 works though...

For some configuration of apps, I've used `./configure --with-libs-from=<insert path(s)> ...` to hardcode the lib search path in the executable.  I'm not sure if this is similar to other flags?  It can be hard to understand so many options.  Essentially this will pass something like -Wl,"-R :<insert path(s)>:/usr/local/lib" to gcc.

edit: here's a snippet that might be helpful...
Quote
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use `-LLIBDIR'
flag during linking and do at least one of the following:
  - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
    during execution
  - add LIBDIR to the `LD_RUN_PATH' environment variable
    during linking
  - use the `-Wl,--rpath -Wl,LIBDIR' linker flag
  - have your system administrator add LIBDIR to `/etc/ld.so.conf'
Back to top
Profile PM 
mikshaw Offline





Group: Members
Posts: 4856
Joined: July 2004
Posted: Sep. 11 2007,17:57 QUOTE

Quote
  - add LIBDIR to the `LD_RUN_PATH' environment variable during linking
 - use the `-Wl,--rpath -Wl,LIBDIR' linker flag
hey now...that looks like a handy piece of info. I'm definitely going to need to try that next time I compile a uci


--------------
http://www.tldp.org/LDP/intro-linux/html/index.html
Back to top
Profile PM WEB 
28 replies since Sep. 07 2007,16:00 < Next Oldest | Next Newest >

[ Track this topic :: Email this topic :: Print this topic ]

Pages: (6) </ 1 2 3 [4] 5 6 >/
reply to topic new topic new poll
Quick Reply: More questions regarding compiling extensions

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code