[Halld-offline] Confusion about JANA build

Matthew Shepherd mashephe at indiana.edu
Sat Mar 12 13:45:53 EST 2011


Hi David,

I recently did svn update on my copy of jana.  Then I went into the src directory and typed "make clean; make".  The build started but then failed on one of the utilities.  I tracked the problem down to the fact that the build was using src/../include as the include path.  This is the location of the installed headers.  Apparently make does not install the headers before trying to build the executables so I was trying to build executables with old headers.  There was a function mismatch and the build failed with "no matching function" error.

So I remember a conversation we had a long time ago about the difference between make and make install and then go back to src and type:  "make clean; make install"  This time the build works fine.

I notice in both cases the include path passed to the compiler is the same and this include path is passed to both library compilation and executable compilation.

g++ -fPIC -I. -I.. -I/Users/mashephe/gluex/svn/jana/prod/src/../include

When one is building the JANA library itself, one is relying on the fact that all headers are accessible from . or .. (which is the case) to avoid pulling in old headers installed in src/../include.  However, when the build moves on to the utilities the paths . and .. and no longer are sufficient to get headers (One needs ../.. also.) and old stuff comes in through src/../include.

Luckily my build actually failed due to a missing function to alert me to the problem.  For example, if the function ordering was different in the header then make would work fine and I'd have an incompatibility between the memory layouts in my compiled code and the JANA library.

This very thing has made me nervous in builds of the main tree many times.  I don't like the fact that when I do a make inside of the tree I see the build is looking for headers in the install locations.  I'm trusting that it will find the up to date headers first not the ones from my previously installed build.  Often may paranoia will lead me to go in and wipe out all previously built headers and libraries manually.

I wonder if we can modify the system to make using only the source tree.  For example, the jana tree should build by issuing a single make command without reference to install locations.  A second install target would install headers and libraries needed to compile other external packages that use jana.  (This seems to be the convention for most distributed packages that I know of.)  I believe this means that the jana executables need to know where to find their appropriate libraries and headers within the tree -- they can't resort to a common install location.

It would be nice to see something similar for the main halld tree.  This would guarantee that each build was using fresh headers and libraries, not previously installed.

Thoughts?

Matt




More information about the Halld-offline mailing list