Question

I'm new to using libtool. However, this problem seems to be weird. Everything is there but the libtool said "libtool: link: 'cuda_transfer.lo' is not a valid libtool object". However, the rule for generating this lo file is right there in the Makefile. Besides, the two header files are also right in where they are supposed to be and do work. Any idea about what is going wrong?

cuda_transfer.lo: particles_cuda.h ../../include/psc_particles_cuda.h

The other two places in Makefile where cuda_transfer.lo appeared are followed

libsubdir_la_DEPENDENCIES = cuda_transfer.lo \

libsubdir_la_LIBADD = \
    cuda_transfer.lo \

The .c.lo: segment is following:

.c.lo:
    $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
    $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
    $(am__mv) $$depbase.Tpo $$depbase.Plo
#   $(AM_V_CC)source='$<' object='$@' libtool=yes \
#   DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
#   $(AM_V_CC_no)$(LTCOMPILE) -c -o $@ $<

How to interpret this human-unfriendly code. = =

Below is the code segment suggested by Brett.

noinst_LTLIBRARIES = libsubdir.la
libsubdir_la_SOURCES = \
        psc_fields_cuda.c \
        psc_particles_cuda.c \
        psc_push_particles_cuda.c \
        psc_push_fields_cuda.c \
        psc_bnd_cuda.c \
        psc_bnd_particles_cuda.c \
        psc_bnd_fields_cuda.c \
        b40c/kernel_utils.h \
        b40c/radixsort_kernel_common.h \
        b40c/radixsort_key_conversion.h \
        b40c/radixsort_reduction_kernel.h \
        b40c/radixsort_scanscatter_kernel.h \
        b40c/radixsort_scanscatter_kernel3.h \
        b40c/radixsort_scanscatter_kernel4.h \
        b40c/radixsort_spine_kernel.h \
        b40c/vector_types.h \
        cuda_common.h \
        cuda_sort2.h \
        cuda_sort2_spine.h \
        particles_cuda.h \
        psc_bnd_cuda.h \
        psc_bnd_cuda_fields.h \
        psc_cuda.h

libsubdir_la_LIBADD = \
        cuda_transfer.lo \
        cuda_spine.lo \
        cuda_sort2.lo \
        cuda_sort3.lo \
        cuda_exchange_particles.lo \
        cuda_exclusive_scan_2.lo \
        cuda_push_part_yz_1vb.lo

The only thing that looks like a generating rule about cuda_transfer.lo is

cuda_transfer.lo: particles_cuda.h ../../include/psc_particles_cuda.h
Was it helpful?

Solution 2

Well, it's better not to read configure.ac ever :-) But if you still wish, configure.ac is a combination of m4 preprocessor code and ordinary (bourne) shell snippets. You may check info m4 and info autoconf, the docs are pretty decent.

The hard part of your question, regarding the .lo file. It seems that your makefile contains dependency chain for it, but no explicit build-rules. You may try to locate a common rule for compiling .c -> .lo, like this:

.c.lo:
      $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
      $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
      ...

OTHER TIPS

try this:

yum -y install libtool*

then make clean and restart again

Install latest libtool. Delete the .lo file and use 'make' again.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top