Re: rpath configuration
On May 30, 2013 8:03 PM, "Gary V. Vaughan" wrote: > > Hi Bob, > > On 31 May 2013, at 09:57, "Gary V. Vaughan" wrote: > > On 31 May 2013, at 08:28, Bob Rossi wrote: > >> On Fri, May 24, 2013 at 07:15:50PM -0400, Bob Rossi wrote: > >>> I'm building a program that links against boost with libtool. > >>> > >>> The boost library is installed on the system and is a shared library. > >>> > >>> When i run my program ./test_suite I get, > >>> $ ./test_suite > >>> .../build/.libs/lt-test_suite: error while loading shared libraries: libboost_filesystem.so.1.53.0: cannot open shared object file: No such file or directory > > Didn't notice this on first blush, sorry. It seems you are getting a libtool > link invocation out of Automake after all, so you can probably ignore most of > my earlier reply. > > This error seems to indicate that the ./test_suite wrapper script is not > setting LD_LIBRARY_PATH correctly. Take a look inside that script to see what > is going on, and get some clues of what went wrong with the link. Or do "./libtool --mode=run your command line" to have libtool set the appropriate paths for you. Dan ___ https://lists.gnu.org/mailman/listinfo/libtool
Re: rpath configuration
Hi Bob, On 31 May 2013, at 09:57, "Gary V. Vaughan" wrote: > On 31 May 2013, at 08:28, Bob Rossi wrote: >> On Fri, May 24, 2013 at 07:15:50PM -0400, Bob Rossi wrote: >>> I'm building a program that links against boost with libtool. >>> >>> The boost library is installed on the system and is a shared library. >>> >>> When i run my program ./test_suite I get, >>> $ ./test_suite >>> .../build/.libs/lt-test_suite: error while loading shared libraries: >>> libboost_filesystem.so.1.53.0: cannot open shared object file: No such file >>> or directory Didn't notice this on first blush, sorry. It seems you are getting a libtool link invocation out of Automake after all, so you can probably ignore most of my earlier reply. This error seems to indicate that the ./test_suite wrapper script is not setting LD_LIBRARY_PATH correctly. Take a look inside that script to see what is going on, and get some clues of what went wrong with the link. Cheers, -- Gary V. Vaughan (gary AT gnu DOT org) ___ https://lists.gnu.org/mailman/listinfo/libtool
Re: rpath configuration
Hi Bob, On 31 May 2013, at 08:28, Bob Rossi wrote: > Ping. > > Is this the active libtool mailing list? Yes it is. If you don't get a reply it means that nobody who read your request is confident about the right answer. In my case, I only know just enough about C++ to avoid it at all costs, which is why I didn't respond initially :) > On Fri, May 24, 2013 at 07:15:50PM -0400, Bob Rossi wrote: >> I'm building a program that links against boost with libtool. >> >> The boost library is installed on the system and is a shared library. >> >> When i run my program ./test_suite I get, >> $ ./test_suite >> .../build/.libs/lt-test_suite: error while loading shared libraries: >> libboost_filesystem.so.1.53.0: cannot open shared object file: No such file >> or directory >> >> My Makefile looks like, >> >> noinst_PROGRAMS += test_suite To avoid building the test_suite unless invoked with `make check` you can use: check_PROGRAMS += test_suite >> test_suite_SOURCES = \ >>src/progs/test_suite/fixture.cpp \ >>src/progs/test_suite/main.cpp >> >> test_suite_CPPFLAGS = \ >>@BOOST_CPPFLAGS@ >> >> test_suite_LDFLAGS = \ >>@BOOST_LDFLAGS@ >> >> test_suite_LDADD = \ >>@BOOST_LIBS@ >> >> Where the boost variables are, >> BOOST_CPPFLAGS = -IBOOSTDIR/boost_1_53_0_prefix/include Not literally -IBOOSTDIR I trust. You probably need something more like: -I $(BOOSTDIR)/... >> BOOST_LDFLAGS = -LBOOSTDIR/boost_1_53_0_prefix/lib Likewise. >> BOOST_LIBS = -lboost_filesystem -lboost_system >> >> I have a few questions. >> >> For linking against system libraries, is using LDFLAGS and LDADD >> appropriate the way I have done it? I don't see any reference to libtool or a libtool archive here, so how does Automake know it should be linking with libtool in this case? Unfortunately, some distributions remove the .la files from system directories that libtool uses to figure out the correct linker invocation. If your system is missing files such as: $(BOOSTDIR)/boost_1_53_0_prefix/lib/boost_system.la ...then you have to force Automake to use libtool. Check the Automake manual for details of how to set test_suite_LINK appropriately. Also, you need to add the CXX tag to LT_INIT to incorporate C++ settings into your generated project libtool script, if you didn't do that already. >> Is it my responsibility to add the -rpath libtool option to include >> BOOSTDIR/boost_1_53_0_prefix/lib? Libtool's -rpath option is for specifying the target library's install destination, not for adding the location of deplibs. Automake will set -rpath for you, so there's almost never any need to specify it manually. >> Should I be setting LD_LIBRARY_PATH when running from the build >> directory? No, libtool will take care of that (LD_LIBRARY_PATH is just one spelling of that variable for linux and a few other Unices) automatically. >> I notice that when I link against libtool created libraries in the >> same Makefile I don't see this issue at all. Is that because Automake can tell you want to link using libtool, but in the case of the Makefile.am you paste above, Automake thinks you want to link with g++? Please show the output from running make to demonstrate what you are actually seeing. Cheers, -- Gary V. Vaughan (gary AT gnu DOT org) ___ https://lists.gnu.org/mailman/listinfo/libtool
Re: rpath configuration
On Fri, May 24, 2013 at 07:15:50PM -0400, Bob Rossi wrote: > I'm building a program that links against boost with libtool. > > The boost library is installed on the system and is a shared library. > > When i run my program ./test_suite I get, > $ ./test_suite > .../build/.libs/lt-test_suite: error while loading shared libraries: > libboost_filesystem.so.1.53.0: cannot open shared object file: No such file > or directory > > My Makefile looks like, > > noinst_PROGRAMS += test_suite > > test_suite_SOURCES = \ > src/progs/test_suite/fixture.cpp \ > src/progs/test_suite/main.cpp > > test_suite_CPPFLAGS = \ > @BOOST_CPPFLAGS@ > > test_suite_LDFLAGS = \ > @BOOST_LDFLAGS@ > > test_suite_LDADD = \ > @BOOST_LIBS@ > > Where the boost variables are, > BOOST_CPPFLAGS = -IBOOSTDIR/boost_1_53_0_prefix/include > BOOST_LDFLAGS = -LBOOSTDIR/boost_1_53_0_prefix/lib > BOOST_LIBS = -lboost_filesystem -lboost_system > > I have a few questions. > > For linking against system libraries, is using LDFLAGS and LDADD > appropriate the way I have done it? > > Is it my responsibility to add the -rpath libtool option to include > BOOSTDIR/boost_1_53_0_prefix/lib? > > Should I be setting LD_LIBRARY_PATH when running from the build > directory? > > I notice that when I link against libtool created libraries in the > same Makefile I don't see this issue at all. Ping. Is this the active libtool mailing list? Bob ___ https://lists.gnu.org/mailman/listinfo/libtool
rpath configuration
Hi, I'm building a program that links against boost with libtool. The boost library is installed on the system and is a shared library. When i run my program ./test_suite I get, $ ./test_suite .../build/.libs/lt-test_suite: error while loading shared libraries: libboost_filesystem.so.1.53.0: cannot open shared object file: No such file or directory My Makefile looks like, noinst_PROGRAMS += test_suite test_suite_SOURCES = \ src/progs/test_suite/fixture.cpp \ src/progs/test_suite/main.cpp test_suite_CPPFLAGS = \ @BOOST_CPPFLAGS@ test_suite_LDFLAGS = \ @BOOST_LDFLAGS@ test_suite_LDADD = \ @BOOST_LIBS@ Where the boost variables are, BOOST_CPPFLAGS = -IBOOSTDIR/boost_1_53_0_prefix/include BOOST_LDFLAGS = -LBOOSTDIR/boost_1_53_0_prefix/lib BOOST_LIBS = -lboost_filesystem -lboost_system I have a few questions. For linking against system libraries, is using LDFLAGS and LDADD appropriate the way I have done it? Is it my responsibility to add the -rpath libtool option to include BOOSTDIR/boost_1_53_0_prefix/lib? Should I be setting LD_LIBRARY_PATH when running from the build directory? I notice that when I link against libtool created libraries in the same Makefile I don't see this issue at all. Thanks, Bob ___ https://lists.gnu.org/mailman/listinfo/libtool