Problem 85

Summary: Linking problem with granular libraries
Product: Geant4 Reporter: Gabriele Cosmo <Gabriele.Cosmo>
Component: configAssignee: John.Allison
Status: CLOSED LATER    
Severity: normal CC: Gunter.Folger
Priority: P2    
Version: 0.0   
Hardware: All   
OS: All   

Description Gabriele Cosmo 2000-04-10 07:36:54 CEST
Here is the tricky one!

If a user legitimately adopt angle brackets in the #include statements
(#include <G4KernelHeader.hh>) for inclusion of G4 kernel headers in the
user application, the application won't link, since the dependency map will
not be correctly generated.
This can be easily tested I guess on any platform/compiler (Linux-g++).
Comment 1 John.Allison 2000-08-19 17:21:59 CEST
I propose fixing this by the following changes tested on Linux.
-M follows all headers, including files specified by #include <...>.
Steve, please do a test build with just these changes and check
that dependency (.d) files do not get too big.
If all's OK, will you approve, Gabriele?

bash-2.02$ cvs diff
cvs diff: Diffing .
Index: binmake.gmk
===================================================================
RCS file: /afs/cern.ch/sw/geant4/cvs/geant4/config/binmake.gmk,v
retrieving revision 1.45
diff -r1.45 binmake.gmk
291c291
<       g++ -MM $(CPPFLAGS) $< ) | sed 's!$(G4TMPDIR)/exe/$*.o!& $@!' >$@
---
>       g++ -M $(CPPFLAGS) $< ) | sed 's!$(G4TMPDIR)/exe/$*.o!& $@!' >$@
Index: common.gmk
===================================================================
RCS file: /afs/cern.ch/sw/geant4/cvs/geant4/config/common.gmk,v
retrieving revision 1.14
diff -r1.14 common.gmk
119c119
< # g++ -MM is good at this, except it forgets the subdirectory
---
> # g++ -MM (or -M) is good at this, except it forgets the subdirectory
138c138
<       g++ -MM $(CPPFLAGS) $< ) | sed 's!$(G4TMPDIR)/$*.o!& $@!' >$@
---
>       g++ -M $(CPPFLAGS) $< ) | sed 's!$(G4TMPDIR)/$*.o!& $@!' >$@
cvs diff: Diffing sys
Comment 2 John.Allison 2000-08-19 17:22:59 CEST
I propose fixing this by the following changes tested on Linux.
-M follows all headers, including files specified by #include <...>.
Steve, please do a test build with just these changes and check
that dependency (.d) files do not get too big.
If all's OK, will you approve, Gabriele?

bash-2.02$ cvs diff
cvs diff: Diffing .
Index: binmake.gmk
===================================================================
RCS file: /afs/cern.ch/sw/geant4/cvs/geant4/config/binmake.gmk,v
retrieving revision 1.45
diff -r1.45 binmake.gmk
291c291
<       g++ -MM $(CPPFLAGS) $< ) | sed 's!$(G4TMPDIR)/exe/$*.o!& $@!' >$@
---
>       g++ -M $(CPPFLAGS) $< ) | sed 's!$(G4TMPDIR)/exe/$*.o!& $@!' >$@
Index: common.gmk
===================================================================
RCS file: /afs/cern.ch/sw/geant4/cvs/geant4/config/common.gmk,v
retrieving revision 1.14
diff -r1.14 common.gmk
119c119
< # g++ -MM is good at this, except it forgets the subdirectory
---
> # g++ -MM (or -M) is good at this, except it forgets the subdirectory
138c138
<       g++ -MM $(CPPFLAGS) $< ) | sed 's!$(G4TMPDIR)/$*.o!& $@!' >$@
---
>       g++ -M $(CPPFLAGS) $< ) | sed 's!$(G4TMPDIR)/$*.o!& $@!' >$@
cvs diff: Diffing sys