libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

inter-library-dependency, how?


From: Christian Rössel
Subject: inter-library-dependency, how?
Date: Fri, 9 Sep 2011 17:56:36 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.21) Gecko/20110831 Thunderbird/3.1.13

Dear all,

I want to build a program that depends on a libtool library that depends
on a non-libtool library that needs rpath information to be found a runtime.

My Makefile.am looks like this:
lib_LTLIBRARIES    = libfoo.la
libfoo_la_SOURCES  = libfoo.c  libfoo.h
libfoo_la_CPPFLAGS = -I/opt/packages/papi/4.1.2.1/include
libfoo_la_LDFLAGS  = -L/opt/packages/papi/4.1.2.1/lib
libfoo_la_LIBADD   = -lpapi

bin_PROGRAMS = foo
foo_SOURCES  = foo.c
foo_LDADD    = libfoo.la

Here is my configure.ac:
AC_INIT([foo],[42])
AM_INIT_AUTOMAKE([foreign])
LT_INIT([disable-shared])
AC_CONFIG_MACRO_DIR([m4])
AC_PROG_CC
AC_CONFIG_FILES([Makefile])
AC_OUTPUT

Building and linking succeeds, but trying to run ./foo leads to
./foo: error while loading shared libraries: libpapi.so: cannot open
shared object file: No such file or directory

The library is in the location specified by libfoo_la_LDFLAGS (.a and
.so). But the rpath /opt/packages/papi/4.1.2.1/lib is not available. How
do I get it into foo without specifying it as
foo_LDFLAGS = -Wl,-rpath /opt/packages/papi/4.1.2.1/lib?

Thanks,
Christian
--
Christian Rössel
Jülich Supercomputing Centre
Telefon +49 2461 61-1773

------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDirig Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]