diff: nested modules & parallel makes

Fergus Henderson fjh at cs.mu.OZ.AU
Mon Nov 9 14:50:33 AEDT 1998


Estimated hours taken: 1

Change the documentation and test cases to reflect the fact that we
currently don't support parallel makes for nested modules.
(The comments in the write_depenency_file predicate in compiler/modules.m
explain why not.)

doc/reference_manual.texi:
	Update the list of bugs and limitations in the sub-modules chapter
	to say that we don't support parallel makes for nested modules.

tests/hard_coded/Mmakefile:
tests/hard_coded/nested*:
tests/hard_coded/parent*:
tests/hard_coded/sub-modules/Mmakefile:
tests/hard_coded/sub-modules/nested*:
tests/hard_coded/sub-modules/parent*:
	Move the sub-module test cases to a new subdirectory
	`tests/hard_coded/sub-modules'.  One reason for this is just
	to separate out the test cases for this feature, just as
	we do with the typeclass test cases.
	But the other reason is to ensure that the nested module test
	cases won't get built in parallel, since currently there are
	some problems with the Mmake rules for building nested modules
	that cause race conditions if you use parallel makes.

Index: doc/reference_manual.texi
===================================================================
RCS file: /home/mercury1/repository/mercury/doc/reference_manual.texi,v
retrieving revision 1.113
diff -u -r1.113 reference_manual.texi
--- reference_manual.texi	1998/11/09 01:54:25	1.113
+++ reference_manual.texi	1998/11/09 03:08:26
@@ -2755,13 +2755,19 @@
 then the compiler may report some spurious errors.
 @item
 The compiler sometimes reports spurious errors if you
-defining an equivalence type in a nested module and export it
+define an equivalence type in a sub-module and export it
 as abstract type.
 @item
-The Mercury build tool Mmake sometimes tries to build things in the
+When using nested modules,
+the Mercury build tool Mmake sometimes tries to build things in the
 wrong order and hence reports spurious errors about @samp{.int*} files
 not being found.  In these cases, simply typing @samp{mmake} again will
 usually solve the problem.
+ at item
+Using @samp{mmake} to do parallel makes (e.g. @samp{mmake --jobs 2})
+doesn't always work correctly if you're using nested sub modules.
+(The work-around is to use separate sub-modules instead of nested
+sub-modules, i.e. to put the sub-modules in separate source files.)
 @end itemize
 
 @node Type classes
Index: tests/hard_coded/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/tests/hard_coded/Mmakefile,v
retrieving revision 1.46
diff -u -r1.46 Mmakefile
--- Mmakefile	1998/11/02 09:49:16	1.46
+++ Mmakefile	1998/11/09 03:23:38
@@ -58,16 +58,10 @@
 	minint_bug \
 	mode_choice \
 	name_mangling \
-	nested \
-	nested2 \
-	nested3 \
-	nested_intermod_main \
 	no_fully_strict \
 	no_inline \
 	nondet_ctrl_vn \
 	nullary_ho_func \
-	parent \
-	parent2 \
 	pragma_c_code \
 	pragma_inline \
 	pragma_import \
@@ -94,11 +88,6 @@
 	write \
 	write_reg1
 
-# The following is required to make the test cases
-#	nested, nested2, and nested3
-# work reliabily with parallel makes -- without this they occasionally fail.
-RM_C = :
-
 #-----------------------------------------------------------------------------#
 
 # some tests need to be compiled with particular options
@@ -111,8 +100,6 @@
 MCFLAGS-nondet_ctrl_vn	=	--optimize-value-number
 MCFLAGS-rnd		=	-O6
 MCFLAGS-bigtest		=	--intermodule-optimization -O3
-MCFLAGS-nested_intermod	=	--intermodule-optimization
-MCFLAGS-nested_intermod_main =	--intermodule-optimization
 
 # In grade `none' with options `-O1 --opt-space' on kryten
 # (a sparc-sun-solaris2.5 system), mode_choice needs to be linked
@@ -145,7 +132,7 @@
 
 #-----------------------------------------------------------------------------#
 
-SUBDIRS = typeclasses
+SUBDIRS = typeclasses nested_mods
 
 #-----------------------------------------------------------------------------#
 
cvs diff: tests/hard_coded/nested.exp was removed, no comparison available
cvs diff: tests/hard_coded/nested.m was removed, no comparison available
cvs diff: tests/hard_coded/nested2.exp was removed, no comparison available
cvs diff: tests/hard_coded/nested2.m was removed, no comparison available
cvs diff: tests/hard_coded/nested3.exp was removed, no comparison available
cvs diff: tests/hard_coded/nested3.m was removed, no comparison available
cvs diff: tests/hard_coded/nested_intermod.m was removed, no comparison available
cvs diff: tests/hard_coded/nested_intermod_main.exp was removed, no comparison available
cvs diff: tests/hard_coded/nested_intermod_main.m was removed, no comparison available
cvs diff: tests/hard_coded/parent.child.m was removed, no comparison available
cvs diff: tests/hard_coded/parent.child2.m was removed, no comparison available
cvs diff: tests/hard_coded/parent.exp was removed, no comparison available
cvs diff: tests/hard_coded/parent.m was removed, no comparison available
cvs diff: tests/hard_coded/parent2.child.m was removed, no comparison available
cvs diff: tests/hard_coded/parent2.exp was removed, no comparison available
cvs diff: tests/hard_coded/parent2.m was removed, no comparison available
cvs diff: tests/hard_coded/sub-modules/Mmakefile is a new entry, no comparison available
cvs diff: tests/hard_coded/sub-modules/nested.exp is a new entry, no comparison available
cvs diff: tests/hard_coded/sub-modules/nested.m is a new entry, no comparison available
cvs diff: tests/hard_coded/sub-modules/nested2.exp is a new entry, no comparison available
cvs diff: tests/hard_coded/sub-modules/nested2.m is a new entry, no comparison available
cvs diff: tests/hard_coded/sub-modules/nested3.exp is a new entry, no comparison available
cvs diff: tests/hard_coded/sub-modules/nested3.m is a new entry, no comparison available
cvs diff: tests/hard_coded/sub-modules/nested_intermod.m is a new entry, no comparison available
cvs diff: tests/hard_coded/sub-modules/nested_intermod_main.exp is a new entry, no comparison available
cvs diff: tests/hard_coded/sub-modules/nested_intermod_main.m is a new entry, no comparison available
cvs diff: tests/hard_coded/sub-modules/parent.child.m is a new entry, no comparison available
cvs diff: tests/hard_coded/sub-modules/parent.child2.m is a new entry, no comparison available
cvs diff: tests/hard_coded/sub-modules/parent.exp is a new entry, no comparison available
cvs diff: tests/hard_coded/sub-modules/parent.m is a new entry, no comparison available
cvs diff: tests/hard_coded/sub-modules/parent2.child.m is a new entry, no comparison available
cvs diff: tests/hard_coded/sub-modules/parent2.exp is a new entry, no comparison available
cvs diff: tests/hard_coded/sub-modules/parent2.m is a new entry, no comparison available

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "Binaries may die
WWW: <http://www.cs.mu.oz.au/~fjh>  |   but source code lives forever"
PGP: finger fjh at 128.250.37.3        |     -- leaked Microsoft memo.



More information about the developers mailing list