On 03-06-2015 00:51, Brice Goglin wrote:
Le 02/06/2015 23:27, Fabricio Cannini a écrit :
Hello there

Is there a way to link 'libcudart.so' and 'libnvidia-ml.so' solely to
their respective plugin .so files, not the main libraries/executables?

This is the './configure' line i'm using:

./configure --enable-shared --enable-static --enable-pci --enable-cuda
--enable-nvml --enable-cairo --enable-plugins='nvml,cuda'


Software details:
- Centos 6.5
- gcc 4.4.7
- hwloc 1.10.1
- cuda 6.5-14
- nvidia driver 340.29

Hello

Your configure line should do exactly what you want, and that's the
whole point of plugins:

$ ldd src/.libs/libhwloc.so
        linux-vdso.so.1 (0x00007fff5579b000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fd11e23c000)
        libnuma.so.1 => /usr/lib/x86_64-linux-gnu/libnuma.so.1 
(0x00007fd11e031000)
        libltdl.so.7 => /usr/lib/x86_64-linux-gnu/libltdl.so.7 
(0x00007fd11de26000)
        libpciaccess.so.0 => /usr/lib/x86_64-linux-gnu/libpciaccess.so.0 
(0x00007fd11dc1c000)
        libOpenCL.so.1 => /usr/lib/x86_64-linux-gnu/libOpenCL.so.1 
(0x00007fd11da12000)
        libXNVCtrl.so.0 => /usr/lib/libXNVCtrl.so.0 (0x00007fd11d80c000)
        libXext.so.6 => /usr/lib/x86_64-linux-gnu/libXext.so.6 
(0x00007fd11d5fa000)
        libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 
(0x00007fd11d2b7000)
        libxml2.so.2 => /usr/lib/x86_64-linux-gnu/libxml2.so.2 
(0x00007fd11cf4f000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fd11cba6000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fd11e786000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fd11c9a2000)
        libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fd11c786000)
        libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 
(0x00007fd11c564000)
        liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007fd11c341000)
        libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 
(0x00007fd11c13c000)
        libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 
(0x00007fd11bf37000)
(X librairies above are for the GL component here, but there's no libcudart or 
libnvidia-ml)
$ ldd src/.libs/hwloc_nvml.so
        linux-vdso.so.1 (0x00007fffe27ce000)
        libltdl.so.7 => /usr/lib/x86_64-linux-gnu/libltdl.so.7 
(0x00007fdafc92f000)
        libnvidia-ml.so.1 => /usr/lib/x86_64-linux-gnu/libnvidia-ml.so.1 
(0x00007fdafc643000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fdafc299000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fdafc095000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 
(0x00007fdafbe78000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fdafcd4c000)
$ ldd src/.libs/hwloc_cuda.so
        linux-vdso.so.1 (0x00007fff19375000)
        libltdl.so.7 => /usr/lib/x86_64-linux-gnu/libltdl.so.7 
(0x00007f54c481f000)
        libcudart.so.6.0 => /usr/lib/x86_64-linux-gnu/libcudart.so.6.0 
(0x00007f54c45ce000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f54c4224000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f54c4020000)
        libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 
(0x00007f54c3d15000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 
(0x00007f54c3af7000)
        librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f54c38ef000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f54c4c3c000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f54c35ee000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 
(0x00007f54c33d7000)

If ldd shows libcudart and libnvidia-ml dependencies in libhwloc.so, you
may use "make V=1" to verify the link command-line that built these
libs, and then find the relevant link line/options in Makefile, and then
in Makefile.am

Hi Brice, thanks for answering.

Strangely, xml_libxml and pci works fine as plugins, but nvml and cuda not. I had no trouble making the 'pci' and 'xml_libxml' plugins link to their respective libraries, leaving 'libhwloc.so' alone, but no dice with 'nvml' or 'cuda'.

I've managed to find the offending link line:
========================================================================
libtool: link: gcc -shared -fPIC -DPIC .libs/topology.o .libs/traversal.o .libs/distances.o .libs/components.o .libs/bind.o .libs/bitmap.o .libs/pci-common.o .libs/diff.o .libs/misc.o .libs/base64.o .libs/topology-noos.o .libs/topology-synthetic.o .libs/topology-custom.o .libs/topology-xml.o .libs/topology-xml-nolibxml.o .libs/topology-xml-libxml.o .libs/topology-pci.o .libs/topology-linux.o .libs/topology-x86.o -lm -lnuma -lltdl -lpciaccess -lxml2 -L/usr/local/cuda-6.5/lib64 -lcudart -L/usr/src/gdk/nvml/lib -lnvidia-ml -O2 -Wl,-soname -Wl,libhwloc.so.5 -o .libs/libhwloc.so.5.6.1
=========================================================================

'-L/usr/local/cuda-6.5/lib64 -lcudart -L/usr/src/gdk/nvml/lib -lnvidia-ml' should not be here, right ?

Inside 'src/Makefile', the commenting mechanism of 'hwloc_xml_libxml_la_*', 'hwloc_cuda_la_*', 'hwloc_nvml_la_*', 'hwloc_pci_la_*' seems to be working fine ( uncommenting when set to be made as plugins ).

Any clues ?

[ ]'s

Reply via email to