Problem 85 - Linking problem with granular libraries
Summary: Linking problem with granular libraries
Status: CLOSED LATER
Alias: None
Product: Geant4
Classification: Unclassified
Component: config (show other problems)
Version: 0.0
Hardware: All All
: P2 normal
Assignee: John.Allison
URL:
Depends on:
Blocks:
 
Reported: 2000-04-10 07:36 CEST by Gabriele Cosmo
Modified: 2000-11-10 02:49 CET (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
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