[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Linking problem when built in parallel
From: |
Adam Mercer |
Subject: |
Linking problem when built in parallel |
Date: |
Mon, 4 May 2009 16:27:10 -0500 |
Hi
I've inherited the maintenance of a library at work and there is
currently a linking problem when the library is built in parallel,
i.e. the -j option is passed to make, it builds find when the -j
option is not specified. It fails with the following error:
$ make -j2
<snip>
/bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I.
-I../include -I../include/lal -I/opt/local/include
-I/opt/local/include -I/opt/local/include -DFR_LONG_LONG
-I/opt/local/include -g -W -Wall -MT LALEmpty.lo -MD -MP -MF
.deps/LALEmpty.Tpo -c -o LALEmpty.lo LALEmpty.c
echo 'const char *lalBuildDate = "'`date +"%Y-%m-%dT%H:%M:%S%z"`'";'
>LALBuildDate.c
gcc -DHAVE_CONFIG_H -I. -I../include -I../include/lal
-I/opt/local/include -I/opt/local/include -I/opt/local/include
-DFR_LONG_LONG -I/opt/local/include -g -W -Wall -MT lal-version.o
-MD -MP -MF .deps/lal-version.Tpo -c -o lal-version.o lal-version.c
make[2]: *** No rule to make target `../lib/liblal.la', needed by
`lal-version'. Stop.
make[2]: *** Waiting for unfinished jobs....
mv -f .deps/lal-version.Tpo .deps/lal-version.Po
mkdir .libs
gcc -DHAVE_CONFIG_H -I. -I../include -I../include/lal
-I/opt/local/include -I/opt/local/include -I/opt/local/include
-DFR_LONG_LONG -I/opt/local/include -g -W -Wall -MT LALEmpty.lo -MD
-MP -MF .deps/LALEmpty.Tpo -c LALEmpty.c -fno-common -DPIC -o
.libs/LALEmpty.o
gcc -DHAVE_CONFIG_H -I. -I../include -I../include/lal
-I/opt/local/include -I/opt/local/include -I/opt/local/include
-DFR_LONG_LONG -I/opt/local/include -g -W -Wall -MT LALEmpty.lo -MD
-MP -MF .deps/LALEmpty.Tpo -c LALEmpty.c -o LALEmpty.o >/dev/null 2>&1
mv -f .deps/LALEmpty.Tpo .deps/LALEmpty.Plo
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
$
The appropriate Makefile.am is below:
lib_LTLIBRARIES = liblal.la
liblal_la_SOURCES = LALEmpty.c
nodist_liblal_la_SOURCES = LALBuildDate.c
liblal_la_DEPENDENCIES = \
$(top_builddir)/packages/std/src/libstd.la \
$(top_builddir)/packages/tools/src/libtools.la \
$(top_builddir)/packages/sample/src/libsample.la \
$(top_builddir)/packages/hello/src/libhello.la \
$(top_builddir)/packages/factories/src/libfactories.la \
$(top_builddir)/packages/vectorops/src/libvectorops.la \
$(top_builddir)/packages/utilities/src/libutilities.la \
$(top_builddir)/packages/stats/src/libstats.la \
$(top_builddir)/packages/inject/src/libinject.la \
$(top_builddir)/packages/date/src/libdate.la \
$(top_builddir)/packages/tdfilter/src/libtdfilter.la \
$(top_builddir)/packages/window/src/libwindow.la \
$(top_builddir)/packages/fft/src/libfft.la \
$(top_builddir)/packages/clremoval/src/libclremoval.la \
$(top_builddir)/packages/stochastic/src/libstochastic.la \
$(top_builddir)/packages/inspiral/src/libinspiral.la \
$(top_builddir)/packages/noisemodels/src/libnoisemodels.la \
$(top_builddir)/packages/bank/src/libbank.la \
$(top_builddir)/packages/ring/src/libring.la \
$(top_builddir)/packages/findchirp/src/libfindchirp.la \
$(top_builddir)/packages/pulsar/src/libpulsar.la \
$(top_builddir)/packages/houghpulsar/src/libhoughpulsar.la \
$(top_builddir)/packages/burstsearch/src/libburstsearch.la \
$(top_builddir)/packages/tracksearch/src/libtracksearch.la \
$(top_builddir)/packages/tfclusters/src/libtfclusters.la \
$(top_builddir)/packages/slopefilters/src/libslopefilters.la \
$(top_builddir)/packages/block/src/libblock.la \
$(top_builddir)/packages/timefreq/src/libtimefreq.la
liblal_la_LIBADD = $(liblal_la_DEPENDENCIES) @LALLIBADD@
bin_PROGRAMS = lal-version
lal_version_SOURCES = lal-version.c
lal_version_LDADD = $(top_builddir)/lib/liblal.la
MOSTLYCLEANFILES = LALBuildDate.c
TESTS = lal-version
LALBuildDate.c: $(liblal_la_DEPENDENCIES)
echo 'const char *lalBuildDate = "'`date +"%Y-%m-%dT%H:%M:%S%z"`'";' >$@
liblal_la_SOURCES is set to LALEmpty.c and lal_version_LDADD is set to
liblal.la, so if I understand the syntax correctly (which seems to be
a big if) lal-version should not be built until liblal.la is
available. Then why does make try to build lib-version before building
liblal.la?
I'm clearly missing something but have been starring at this for days,
and any help would be greatly appreciated.
Cheers
Adam
- Linking problem when built in parallel,
Adam Mercer <=