libtool convenience libraries

my project is split up in the following way:

src <= library built from convenience libraries in the subdirs
|- algorithm <= convenience library libalgorithm.la
|- math <= convenience library libmath.la
|- …
program <= link to the library

the convenience libraries are specified in the Makefile.am (in the corresponding subdir):
noinst_LTLIBRARIES = libgroalgorithm.la

the shared library:
lib_LTLIBRARIES = libgroxx.la
libgroxx_la_LIBADD = algorithm/libgroalgorithm.la
math/libgromath.la

to configure i set
CC pgcc
CXX pgCC
i tried LD not set, pgCC, pgcc, ld (GNU), gcc
AR was never set

all the convenience libraries seem to compile fine (the .la files are there and the archives .a are non-empty)
when i try to link them together into the libtool library, the command hangs. no error message, no processor time, no disk access, just doesn’t do anything:

/bin/sh …/libtool --mode=link --tag=CC pgcc -o libgroxx.la -rpath /scratch/igcpc01/markus/gromosXX/LINUX_PGC/lib -no-undefined -version-info 0:3:0 algorithm/libgroalgorithm.la configuration/libgroconfiguration.la interaction/libgrointeraction.la math/libgromath.la simulation/libgrosimulation.la topology/libgrotopology.la util/libgroutil.la io/libgroio.la -L/scratch/igcpc01/markus/programs/gsl-1.5-pgc/lib -lgsl -lgslcblas -lm -lm
mkdir .libs

[Ctrl-C]
make[3]: *** [libgroxx.la] Interrupt
make[2]: *** [all-recursive] Interrupt
make[1]: *** [all-recursive] Interrupt
make: *** [all] Interrupt
Total time : 24:53.35s
CPU utilisation (percentage) : 8.9%

the project compiles fine with gcc-3.4 and intel icc 8.0.

pgCC is:
pgCC 5.2-2
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2004, STMicroelectronics, Inc. All Rights Reserved.

system is:
Linux igcpc01 2.6.7 #1 SMP Fri Aug 13 15:34:21 CEST 2004 i686 GNU/Linux
(debian)
libtool: 1.5.8

any ideas?
more info needed?

thanks for all hints!
markus

First off, I’ve personally never used libtool and don’t really know much about it. However, in reading over the documentation and googling “libtool pgcc” I may have some ideas. Of course, input from other users would be welcome.

libtool is GNU and as such is configured for gcc. One possible reason is that libtool is using gcc specific flags and/or not passing in “-fPIC”. I saw one post where the user said that libtool converted all his “-Rs” to “–rpath”. So your “-rpath” might be being converted incorrectly.

I’d like to know what command is causing the hang-up. Try running again with “sh -x …/libtool …” to have the shell echo to standard error each command before its executed.

As a side note, if your goal here is to create a shared object it might be easier to create the .so directly. Section 8.2 of the PGI user’s guide or more information about creating and using shared objects.

  • Mat

Thanks Mat

i ran the libtool with sh x (good idea!) and noted (to my dismay) that it hang on a path including an nfs mount from a machine which was down at the moment!
sorry 'bout that!

now i ONLY get lots of undefined references. many to templated methods of my own, but some also to the C++ standard template library:

…/src/.libs/libgroxx.a(inframe.o)(.text+0x2e36): In function __CPR1317__clear__Q2_3std1295_Rb_tree__tm__1277_Q2_3std78basic_string__tm__58_cQ2_3std20char_traits__tm__2_cQ2_3std18allocator__tm__2_cQ2_3std330pair__tm__317_CQ2_3stdJ44JQ2_3std218vector__tm__203_Q2_3stdJ44JQ2_3std105allocator__tm__88_Q2_3stdJ44JQ2_3std360_Select1st__tm__341_Q2_3stdJ131JQ2_3std100less__tm__J374JQ2_3std359allocator__tm__J490JFv_v': : undefined reference to __CPR1353___M_erase__Q2_3std1295_Rb_tree__tm__1277_Q2_3std78basic_string__tm__58_cQ2_3std20char_traits__tm__2_cQ2_3std18allocator__tm__2_cQ2_3std330pair__tm__317_CQ2_3stdJ47JQ2_3std218vector__tm__203_Q2_3stdJ47JQ2_3std105allocator__tm__88_Q2_3stdJ47JQ2_3std360_Select1st__tm__341_Q2_3stdJ134JQ2_3std100less__tm__J377JQ2_3std359allocator__tm__J493JFPQ2_3std24_Rb_tree_node__tm__4_Z2Z_v’
make[2]: *** [md] Error 2

it seems like i can get around the undefined references for my own templated functions if i declare them inline. but obviously i don’t want to do that for all of them…
maybe i should use -Wc,tused or one of these options… (had no time yet to try)

(all template methods are in the headers, no export statements)

anyway,
thanks for getting me started,
markus