Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 126083 - graphviz-1.16-r1: LDPATH not set
Summary: graphviz-1.16-r1: LDPATH not set
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: Normal minor (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-13 14:46 UTC by Vincent Zoonekynd
Modified: 2006-04-02 11:32 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vincent Zoonekynd 2006-03-13 14:46:48 UTC
Shouldn't the ebuild create a file in /etc/env.d/ containing 
  LDPATH=/usr/lib/graphviz
so that the applications that use the shared libraries in this 
directory can find it? (In my case, I had the problem after installing 
(myself, it is not in the portage tree) the Bioconductor Rgraphviz
package, for the R statistical environment).
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2006-04-02 03:56:40 UTC
Erm, no. The installed pkgconfig files take care of this. You need to fix your app to use them. See the example:

libagraph.pc
<snip>
prefix=/usr
exec_prefix=${prefix}
libdir=${exec_prefix}/lib/graphviz
includedir=${prefix}/include/graphviz
                                                                                       
Name: libagraph
Description: Graph library (file i/o, dot language parsing, graph, subgraph, node, edge, attribute, data structure manipulation)
Version: 1.16
Libs: -L${libdir} -lagraph -lcdt
Cflags: -I${includedir}
</snip>
Comment 2 Vincent Zoonekynd 2006-04-02 11:32:03 UTC
I might not have given enough details.

(1) I would agree with you if the problem was that the
computer was not finding the *.a or *.h files while
_compiling_ an application. This is not the case: the
application does compiles. The problem is that is does not
run.

If you need mode details, the application in question was
compiled as follows.

  wget http://www.bioconductor.org/packages/bioc/1.7/src/contrib/Source/Rgraphviz_1.8.0.tar.gz
  R CMD INSTALL Rgraphviz_1.8.0.tar.gz
  # This compiles and installs the Rgraphviz package
  # It runs things like this (it infers the location of
  # the graphviz library by running dotneato-config)
  #   gcc -I/usr/local/lib/R/include -I/usr/include/graphviz -DGRAPHVIZGT_1_16 -I/usr/local/include   -fPIC -g -O2 -c Rgraphviz.c -o Rgraphviz.o
  #   gcc -I/usr/local/lib/R/include -I/usr/include/graphviz -DGRAPHVIZGT_1_16 -I/usr/local/include   -fPIC -g -O2 -c RgraphvizInit.c -o RgraphvizInit.o
  #  gcc -shared -L/usr/local/lib -o Rgraphviz.so Rgraphviz.o RgraphvizInit.o -L/usr/lib/graphviz -ldotneato -lm  -L/usr/local/lib/R/lib -lR
  # It actually creates a shared library that will
  # dynamically loaded, but that shared library uses 
  # the libdotneato.so shared library (provided by
  # graphviz): it has to be found at _run time_.

And when I try to run it: 

  zoonek@gentoo /tmp $ R
  R : Copyright 2005, The R Foundation for Statistical Computing
  Version 2.2.1  (2005-12-20 r36812)
  ISBN 3-900051-07-0
  R is free software and comes with ABSOLUTELY NO WARRANTY.
  You are welcome to redistribute it under certain conditions.
  Type 'license()' or 'licence()' for distribution details.
  > library(Rgraphviz)
  Loading required package: graph
  Loading required package: cluster
  Loading required package: Ruuid
  Error in dyn.load(x, as.logical(local), as.logical(now)) :
          unable to load shared library '/usr/local/lib/R/library/Rgraphviz/libs/Rgraphviz.so':
    libdotneato.so.0: cannot open shared object file: No such file or directory
  Error: .onLoad failed in 'loadNamespace' for 'Rgraphviz'
  Error: package/namespace load failed for 'Rgraphviz'

Here, Rgraphviz.so if the shared library that uses
graphiviz, that was successfully compiled, but that cannot
be used unless the computer knows where to find
libdotneato.so...

(2) If I look at other packages that can be used as a shared
library, most seem to explicitely add the directory
containing the shared libraries -- otherwise, third party
applications can be compiled, but not used...

Examples (there are many, many others): 

  $ locate .ebuild | xargs grep LDPATH
  /var/db/pkg/x11-libs/openmotif-2.2.3-r9/openmotif-2.2.3-r9.ebuild:      echo "LDPATH=/usr/lib/openmotif-2.2" > ${D}/etc/env.d/15openmotif-2.2
  /usr/portage/sci-mathematics/octave/octave-2.1.57-r1.ebuild:    echo "LDPATH=/usr/lib/octave-${PV}" > ${D}/etc/env.d/99octave
...

I still think that it should be the same with graphviz. 
Am I really wrong? 
If so, why are other applications ask their directories to
be added to /etc/ld.so.conf? And how other programs, willing
to use such a shared library, be compiled: should the path
to the shared libraries they use be hard-coded?

Thanks,

-- Vincent