Blitz logo

Blitz Devel :

From: Theodore Papadopoulo (Theodore.Papadopoulo_at_[hidden])
Date: 2004-05-05 12:00:10


        Hi Julian,

[ Sorry for the delay in the answer, I took two days off. ]

cummings_at_[hidden] said:
> The specific change that I made was in the -I include file search
> directory options that are used to build the blitz library and example
> codes. These used to be $(top_srcdir) and $(top_builddir), and I
> changed it to $(srcdir) and $(top_srcdir).

$(top_builddir) is needed to find the config.h file which is system
specific and installed in the build directory since generated by
autoconf (now and by the compiler subdirectory previously).

> If I remember right, I
> made this change because I was running into problems in the case where
> the --prefix option is not used and the user is just building blitz
> locally. I'm not an expert on automake and autoconf, but from what I
> read in the online manuals, it seems like searching the source
> directories is the right way to find header files, whereas the build
> directories would be used to locate compiled object files for
> archiving or linking.

Yes, this is true except for the fact that we have a generated source
file (config.h) which is compiler dependent.

> If you
> could, please send a specific instance of how you configure blitz to
> compile in a separate directory and how the current Makefile
> configuration fails. What are the variables $(top_srcdir) and
> $(top_builddir) being converted to in your case? I'm sure there is a
> way to make this work properly.

Sure assume that the blitz source is somewhere eg: ~/src/Cvs/blitz
Create your compilation directory somewhere else eg: ~/compiles/blitz-linux-gcc-3.4

cd ~/compiles/blitz-linux-gcc-3.4
~/src/Cvs/blitz/configure --with-cxx=gcc

And then proceed as usual...
Once again (maybe I'm overdoing, sorry). config.h is generated in
~/compiles/blitz-linux-gcc-3.4/blitz. All compilations of blitz
(lib,examples,benchmark,...) require this file. The -I$(top_srcdir)
only accounts for the files in ~/src/Cvs/blitz/blitz

and

top_srcdir=~/src/Cvs/blitz
top_builddir=~/compiles/blitz-linux-gcc-3.4

I really believe that adding top_builddir is the way to go. The only
problem I can see is that when compiling in the source dir, you get
twice the same -IXXX, but it would be hard to defend a compiler for
which this would lead to troubles...

top_srcdir and top_builddir are there to find the blitz/*.h (resp
source and generated ones). srcdir might be useful to include some
other .h, but keeping top_builddir is mandatory here.

        Regards,

        Theo.
 
--------------------------------------------------------------------
Theodore Papadopoulo
Email: Theodore.Papadopoulo_at_[hidden] Tel: (33) 04 92 38 76 01
 --------------------------------------------------------------------