[vsipl++] [patch] Building VSIPL++ shared libraries

Stefan Seefeld stefan at codesourcery.com
Fri Feb 27 22:33:50 UTC 2009


Jules Bergmann wrote:
> Ok to apply?

Jules, overall this looks fine. I have one high-level question (at the 
end), as well as a couple of specific comments / questions.



> +if test "x$BUILD_SHARED_LIB" != "x"; then
> +  CXXFLAGS="-fPIC $CXXFLAGS"
> +  CFLAGS="-fPIC $CFLAGS"
> +fi

I think the above should be further conditionalized so it only applies 
when we are dealing with GCC. (I believe autoconf defines $GCC to 'yes' 
in that case.)

> +debuglib:
> +	echo LIBS: $LIBS

Did you mean to leave this in ?

>  define link_app
>  @echo linking $@
>  $(CXX) $(LDFLAGS) $(call dir_var,$(dir $<),LDFLAGS) -o $@ $^ \
> -  -Llib -lsvpp $(call dir_var,$(dir $<),LIBS) $(LIBS)
> +  $(call dir_var,$(dir $<),LIBS) $(LIBS)
>  endef

Where does the link command get -lsvpp from after this change ?

>  hdr	+= $(patsubst $(srcdir)/src/%, %, \
> -             $(wildcard $(srcdir)/src/vsip/opt/cuda/*.hpp))
> -hdr	+= $(patsubst $(srcdir)/src/%, %, \
>               $(wildcard $(srcdir)/src/vsip/opt/diag/*.hpp))
>  

After you take cuda out of $hdr, would dependency generation still work 
with CUDA enabled ? (It looks like instead of removing the above, we 
should decorate it with

#ifdef SOME_CUDA_VARIABLE
...
#endif

no ?

> +ifdef BUILD_SHARED_LIB
> +libs += lib/libsvpp.so
> +lib_svpp := lib/libsvpp.so
> +else
> +lib_svpp := lib/libsvpp.$(LIBEXT)
> +endif

This raises an interesting question: Are we ever going to ship a 
DSO-only build variant ? With DSOs enabled, I would expect us to provide 
both, libsvpp.a, as well as libsvpp.so.
(Note that this makes compilation slightly more complex, as then we have 
to build two sets of objects, one with -fPIC and one without. But the 
alternative, adding more build variants, sounds even worse, as far as 
build times and memory footprints are concerned.

Thanks,
		Stefan

-- 
Stefan Seefeld
CodeSourcery
stefan at codesourcery.com
(650) 331-3385 x718



More information about the vsipl++ mailing list