for review: turning off intermodule stuff in the library

Zoltan Somogyi zs at cs.mu.OZ.AU
Wed Mar 4 15:26:43 AEDT 1998


Fergus wrote:
> On 03-Mar-1998, Zoltan Somogyi <zs at cs.mu.OZ.AU> wrote:
> > 
> > library/Mmakefile:
> > 	Only turn on non-interface intermodule information flow
> > 	if LIBRARY_INTERMODULE is defined.
> > 
> > Mmake.common.in:
> > 	Turn on LIBRARY_INTERMODULE by default. It can be turned off
> > 	by Mmake.{,stage.}params.
> 
> `mmake install' in the library directory would fail, messily;
> it might be better to add some code to make it print out
> an error message, so people don't waste time tracking down the
> cause of the failure.

LIBRARY_INTERMODULE should always be enabled when running mmake install.
You can guarantee this by disabling the rules for installs if it is not
enabled.

> Also I just realized another problem with this:
> some of the test cases in the tests subdirectory
> explicitly pass `--intermodule-optization' or
> `--transitive-intermodule-optimization' to mmc,
> so these tests will fail if the `.opt' and `.trans_opt'
> files have not been built.
> Off-hand I can't think of a good solution to this.

The ones in the term directory don't need the .opt or .trans_opt
files from the library. I believe the others do not either, but don't
know for sure. In any case, just noting which tests will fail if
LIBRARY_INTERMODULE is set to no would be good enough. (I can't compile
this list now because cyclone is down again !%(^%!(^grumble%)^.)

> > Mmake.common.in:
> > +# Do we want to deal with intermodule information when building the library
> > +LIBRARY_INTERMODULE = yes
> 
> It would be a good idea to add a comment here explaining why
> you might want to override this.

OK.

> > -# CHECK_TERM_OPTS = --check-termination
> > +CHECK_TERM_OPTS = --check-termination
> 
> I don't think the CHECK_TERM_OPTS should be enabled?

Right. The new diff follows.

Zoltan.

Index: ../Mmake.common.in
===================================================================
RCS file: /home/mercury1/repository/mercury/Mmake.common.in,v
retrieving revision 1.25
diff -u -u -r1.25 Mmake.common.in
--- Mmake.common.in	1998/01/01 05:25:13	1.25
+++ Mmake.common.in	1998/03/04 04:21:36
@@ -171,6 +171,14 @@
 # Options to pass to the Mercury compiler
 MCFLAGS	= --no-infer-all --halt-at-warn $(EXTRA_MCFLAGS)
 
+# Do we want to deal with intermodule information when building the library?
+# By default yes, since this way we note immediately when intermodule
+# optimization breaks, and always at installation time, since we must install
+# the library's .opt and .trans_opt files as well. However, during development
+# some problems are easier to track down without intermodule optimization
+# complicating things.
+LIBRARY_INTERMODULE = yes
+
 #-----------------------------------------------------------------------------#
 
 # The Mmake.params file can be used to override definitions in this file
Index: Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/library/Mmakefile,v
retrieving revision 1.22
diff -u -u -r1.22 Mmakefile
--- Mmakefile	1998/02/18 23:57:10	1.22
+++ Mmakefile	1998/03/04 04:18:49
@@ -41,10 +41,20 @@
 		MERCURY_SP_OVERRIDING_LIB_OBJS="$(NU_OVERRIDING_LIBRARY_QLS)" \
 		$(SCRIPTS_DIR)/msl
 
+ifeq ($(LIBRARY_INTERMODULE),yes)
+
 INTERMODULE_OPTS = --transitive-intermodule-optimization
 ENABLE_TERM_OPTS = --enable-termination
 # CHECK_TERM_OPTS = --check-termination
 
+else
+
+INTERMODULE_OPTS =
+ENABLE_TERM_OPTS =
+CHECK_TERM_OPTS =
+
+endif
+
 MCD	=	MERCURY_INT_DIR=. \
 		MERCURY_C_INCL_DIR=$(RUNTIME_DIR) $(MC) \
 			--generate-dependencies $(INTERMODULE_OPTS)
@@ -135,8 +145,17 @@
 check		: library.check
 
 .PHONY: all-ints 
+
+ifeq ($(LIBRARY_INTERMODULE),yes)
+
 all-ints: ints int3s opts trans_opts
 
+else
+
+all-ints: ints int3s
+
+endif
+
 .PHONY: ints 
 ints		: library.ints
 
@@ -264,7 +283,11 @@
 
 #-----------------------------------------------------------------------------#
 
+ifeq ($(LIBRARY_INTERMODULE),yes)
+
 # Installation targets
+# Note that LIBRARY_INTERMODULE should be turned off only during development.
+# A full install requires the library's .opt and .trans_opt files.
 
 .PHONY: install
 install: install_mercury $(INSTALL_SICSTUS) $(INSTALL_NUPROLOG)
@@ -347,5 +370,7 @@
 install_sicstus_compile: sicstus_compile
 	[ -d $(INSTALL_SP_ARCH_DIR) ] || mkdir -p $(INSTALL_SP_ARCH_DIR)
 	cp `vpath_find sicstus_compile` $(INSTALL_SP_ARCH_DIR)
+
+endif
 
 #-----------------------------------------------------------------------------#



More information about the developers mailing list