[m-rev.] for review: configure option for LARGE_CONFIG

Mark Brown mark at cs.mu.OZ.AU
Mon Feb 13 17:11:57 AEDT 2006


Hi,

This addresses an issue which I encountered recently, and which was also
reported by Ondrej Bojar on mercury-bugs.

With this change, the G12 system is able to find a solution to 1000-queens
on saturn.  :-)

Cheers,
Mark.

Estimated hours taken: 1.5
Branches: main

Add a configure option to enable LARGE_CONFIG when compiling boehm_gc.
This should probably be made the default, but I'll leave that until after
the performance impact has been measured.

For future versions of boehm_gc, it might make sense to _not_ define
LARGE_CONFIG by default.

configure.in:
	Subst the variable ENABLE_BOEHM_LARGE_CONFIG with the appropriate
	C compiler option.

Mmake.common.in:
	Set the BOEHM_CFLAGS variable to the value of the configured variable.
	In future, other options may also be specified in BOEHM_CFLAGS (which
	is why it has a more generic name).

boehm_gc/Makefile:
	Include BOEHM_CFLAGS in the CFLAGS variable, in our version of the
	Makefile for this package.

Index: Mmake.common.in
===================================================================
RCS file: /home/mercury1/repository/mercury/Mmake.common.in,v
retrieving revision 1.85
diff -u -r1.85 Mmake.common.in
--- Mmake.common.in	3 Dec 2005 05:19:38 -0000	1.85
+++ Mmake.common.in	13 Feb 2006 04:35:42 -0000
@@ -143,6 +143,9 @@
 # now included in FLAGS files
 # MCFLAGS	+= --no-infer-all --halt-at-warn --no-warn-inferred-erroneous
 
+# Options to pass to the C compiler when building Boehm-GC.
+BOEHM_CFLAGS = @ENABLE_BOEHM_LARGE_CONFIG@
+
 # 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
Index: configure.in
===================================================================
RCS file: /home/mercury1/repository/mercury/configure.in,v
retrieving revision 1.443
diff -u -r1.443 configure.in
--- configure.in	4 Jan 2006 05:16:29 -0000	1.443
+++ configure.in	13 Feb 2006 05:31:29 -0000
@@ -420,6 +420,33 @@
 esac
 #-----------------------------------------------------------------------------#
 #
+# Determine whether to define LARGE_CONFIG when compiling boehm_gc.
+# XXX This should probably be enabled by default.
+#
+AC_ARG_ENABLE(gc-large-config,
+[  --enable-gc-large-config
+                          enable large heaps when using conservative GC],
+enable_gc_large_config="$enableval",enable_gc_large_config=no)
+AC_MSG_CHECKING(whether to enable large heaps when using conservative GC)
+case $enable_gc_large_config in
+	yes)
+		AC_MSG_RESULT(yes)
+		ENABLE_BOEHM_LARGE_CONFIG=-DLARGE_CONFIG
+		;;
+	no)
+		AC_MSG_RESULT(no)
+		ENABLE_BOEHM_LARGE_CONFIG=
+		;;
+	*)
+		AC_MSG_RESULT(yes)
+		AC_MSG_WARN([unexpected argument to --enable-gc-large-config])
+		ENABLE_BOEHM_LARGE_CONFIG=-DLARGE_CONFIG
+		;;
+esac
+AC_SUBST(ENABLE_BOEHM_LARGE_CONFIG)
+
+#-----------------------------------------------------------------------------#
+#
 # Find the GCC source code
 # and determine whether or not to enable the GCC back-end interface.
 #
Index: boehm_gc/Makefile
===================================================================
RCS file: /home/mercury1/repository/mercury/boehm_gc/Makefile,v
retrieving revision 1.60
diff -u -r1.60 Makefile
--- boehm_gc/Makefile	4 Oct 2005 10:34:37 -0000	1.60
+++ boehm_gc/Makefile	13 Feb 2006 04:27:18 -0000
@@ -83,7 +83,7 @@
 # Mercury-specific CFLAGS:
 CFLAGS= -I$(srcdir)/include \
 	-DSILENT -DNO_DEBUGGING -DNO_EXECUTE_PERMISSION \
-	$(CFLAGS_FOR_PIC) $(DLL_CFLAGS) $(EXTRA_CFLAGS)
+	$(BOEHM_CFLAGS) $(CFLAGS_FOR_PIC) $(DLL_CFLAGS) $(EXTRA_CFLAGS)
 # Note that the `mgnuc' script also passes -DNO_SIGNALS, unless
 # profiling was enabled (see comments in runtime/mercury_prof_mem.h for why).
 # We need $(CFLAGS_FOR_PIC) because we might be building a shared library.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list