shared libraries - Libtool: Maintain library dependencies in header files -
i using libtool , other gnu autotools (autoconf, automake, etc.) build shared library. library has dependency on library (hwloc). allow user specify custom path hwloc @ configuration (the following in configure.ac
):
# check hwloc ac_arg_with([hwloc], [as_help_string([--with-hwloc[[=dir]]], [location of hwloc library])]) as_if([test "x$with_hwloc" != x], [cppflags="-i$with_hwloc/include $cppflags" ldflags="-l$with_hwloc/lib $ldflags"]) ac_check_headers([hwloc.h], [], [ac_msg_error([hwloc required library])]) ac_search_libs([hwloc_topology_init], [hwloc], [], [ac_msg_error([hwloc required library])])
after doing build process (./configure --with-hwloc=...
; make
; make install
), shared library file links hwloc (ldd libmylib.so
):
linux-vdso.so.1 => (0x00007ffff331c000) librt.so.1 => /lib64/librt.so.1 (0x00007fa225c63000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fa225a46000) libhwloc.so.5 => /home/brooks8/bin/hwloc-1.8.1/lib/libhwloc.so.5 (0x00007fa225816000) libm.so.6 => /lib64/libm.so.6 (0x00007fa225591000) libxml2.so.2 => /usr/lib64/libxml2.so.2 (0x00007fa22523f000) libc.so.6 => /lib64/libc.so.6 (0x00007fa224eab000) /lib64/ld-linux-x86-64.so.2 (0x0000003532000000) libdl.so.2 => /lib64/libdl.so.2 (0x00007fa224ca6000) libz.so.1 => /lib64/libz.so.1 (0x00007fa224a90000)
however, 1 of header files includes hwloc. causes problems when try , test library , hwloc in non-standard location:
mpicc test.c -i/home/brooks8/bin/mylib/include -l/home/brooks8/bin/mylib/lib -lmylib -o test/test -std=c99 -o3 -g3
:
/home/brooks8/bin/mylib/include/include/util.h:14:21: fatal error: hwloc.h: no such file or directory #include <hwloc.h> ^
is there way solve issue without needing link hwloc when use library?
thank in advance, , please let me know if should provide more information regarding situation.
Comments
Post a Comment