[m-rev.] diff: parallelizing compilation

Keri Harris keri at gentoo.org
Sat Oct 14 17:08:18 AEST 2006


compiler/modules.m

On an SMP machine, it appears to be possible to attempt to generate .init 
files before the associated .c files have been generated. An example of this 
behaviour on a 32-way sparc32/linux box is:

gmake[1]: Entering directory 
`/home/keri/mercury-compiler-0.13.0/tmpdir/library'
mmc --make-short-interface --grade hlc.gc      --mercury-linkage 
shared --flags LIB_FLAGS   --flags 
INTER_FLAGS -R/home/keri/usr/lib/mercury-0.13.0/lib/hlc.gc -R/home/keri/usr/lib/mercury-0.13.0/lib     
array
mmc --make-short-interface --grade hlc.gc      --mercury-linkage 
shared --flags LIB_FLAGS   --flags 
INTER_FLAGS -R/home/keri/usr/lib/mercury-0.13.0/lib/hlc.gc -R/home/keri/usr/lib/mercury-0.13.0/lib     
benchmarking

<snip>

mmc --make-short-interface --grade hlc.gc      --mercury-linkage 
shared --flags LIB_FLAGS   --flags 
INTER_FLAGS -R/home/keri/usr/lib/mercury-0.13.0/lib/hlc.gc -R/home/keri/usr/lib/mercury-0.13.0/lib  --no-warn-nothing-exported   
mer_std
echo > mer_std.init
../util/mkinit -k array.c array2d.c assoc_list.c bag.c benchmarking.c bimap.c 
bintree.c bintree_set.c bitmap.c bool.c bt_array.c builtin.c char.c 
construct.c cord.c counter.c deconstruct.c dir.c enum.c eqvclass.c 
exception.c float.c gc.c getopt.c getopt_io.c graph.c group.c hash_table.c 
injection.c int.c integer.c io.c lexer.c library.c list.c map.c math.c 
maybe.c mer_std.c multi_map.c mutvar.c ops.c pair.c parser.c pprint.c 
pqueue.c private_builtin.c profiling_builtin.c prolog.c queue.c random.c 
rational.c rbtree.c relation.c require.c robdd.c rtti_implementation.c set.c 
set_bbbtree.c set_ctree234.c set_ordlist.c set_tree234.c set_unordlist.c 
solutions.c sparse_bitset.c stack.c std_util.c store.c string.c svarray.c 
svbag.c svbimap.c sveqvclass.c svmap.c svmulti_map.c svqueue.c svrelation.c 
svset.c svvarset.c table_builtin.c term.c term_io.c term_size_prof_builtin.c 
term_to_xml.c time.c tree234.c type_desc.c unit.c univ.c varset.c 
version_array.c version_array2d.c version_bitmap.c version_hash_table.c 
version_store.c version_types.c  >> mer_std.init
../util/mkinit: error opening file `array.c': No such file or directory
../util/mkinit: error opening file `array2d.c': No such file or directory

<snip>

../util/mkinit: error opening file `version_store.c': No such file or 
directory
../util/mkinit: error opening file `version_types.c': No such file or 
directory
../util/mkinit: error while creating .init file.
gmake[1]: *** [mer_std.init] Error 1


Index: modules.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/modules.m,v
retrieving revision 1.407
diff -u -B -r1.407 modules.m
--- modules.m	13 Oct 2006 04:52:22 -0000	1.407
+++ modules.m	14 Oct 2006 06:57:43 -0000
@@ -5245,7 +5245,7 @@
     module_name_to_file_name(ModuleName, ".dv", no, DvFileName, !IO),
 
     io.write_strings(DepStream, [
-        InitFileName, " : ", DepFileName, "\n",
+        InitFileName, " : ", DepFileName, " $(", MakeVarName, ".cs)\n",
         "\techo > ", InitFileName, "\n"
     ], !IO),
     io.write_strings(DepStream, [


Keri.
-- 
Keri Harris - Gentoo Developer
Public Key:
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xA128F5ED
Key fingerprint = 1690 30DA 4950 E710 A871 07D7 AF04 BFB6 A138 F5ED
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mercurylang.org/archives/reviews/attachments/20061014/2d87b7c1/attachment.sig>


More information about the reviews mailing list