diff: still more clpr changes

Fergus Henderson fjh at cs.mu.oz.au
Wed Sep 3 22:28:49 AEST 1997


More changes to clean up the packaging of the CLP(R) interface.

clpr/README:
	Update to reflect recent changes.
	Add pointer to clpr/clpr/README.

clpr/Mmakefile:
	Add `--intermodule-optimization' to MCFLAGS.
	Add new target `ints' and make `install_ints' depend on that.

clpr/cfloat.m:
	Fix a bug that broke things when compiled with
	`--intermodule-optimization': it was defining a global
	variable inside `pragma c_header_code'.  I moved the
	definition into `pragma c_code'.

clpr/clpr/Mmakefile:
	Ensure that the header files get installed when you
	run `mmake install'.

clpr/clpr/README.Mercury:
	Document the changes from CLP(R) version 1.2.

clpr/samples/Mmakefile:
	Add rule for `mmake clean'.

cvs diff: Diffing .
Index: Mmakefile
===================================================================
RCS file: /home/staff/zs/imp/clpr/Mmakefile,v
retrieving revision 1.1
diff -u -u -r1.1 Mmakefile
--- Mmakefile	1997/09/03 10:36:16	1.1
+++ Mmakefile	1997/09/03 12:08:23
@@ -14,6 +14,9 @@
 # (This may be necessary for code using the `unsafe_*' preds in dump.m.)
 MCFLAGS = --no-optimize-duplicate-calls	
 
+# In case the user of the library wants intermodule optimization...
+MCFLAGS += --intermodule-optimization
+
 # We need to use a grade with trailing
 GRADE = asm_fast.gc.tr
 
@@ -50,13 +53,16 @@
 check: libcfloat_lib clpr
 	cd samples && $(SUBDIR_MMAKE) check
 
+.PHONY: ints
+ints: $(cfloat_lib.dates) $(cfloat_lib.date3s) $(cfloat_lib.optdates)
+
 #-----------------------------------------------------------------------------#
 
 .PHONY: install
 install: install_ints install_init install_lib install_clpr
 
 .PHONY: install_ints
-install_ints: $(cfloat_lib.ints) $(cfloat_lib.int3s) $(cfloat_lib.opts)
+install_ints: ints
 	[ -d $(INSTALL_INT_DIR) ] || mkdir -p $(INSTALL_INT_DIR)
 	for file in $(cfloat_lib.ints) $(cfloat_lib.int3s) $(cfloat_lib.opts); \
 	do \
Index: README
===================================================================
RCS file: /home/staff/zs/imp/clpr/README,v
retrieving revision 1.2
diff -u -u -r1.2 README
--- README	1996/07/24 05:49:12	1.2
+++ README	1997/09/03 12:11:49
@@ -1,10 +1,11 @@
 This is an example of an interface with a constraint solver. The directory
-./clpr/ contains the CLP(R) source, but it been modified quite a bit to resolve
-symbol name conflicts. The script ./clpr/resolve_name_conflicts was run on
-the source to transform some conflicting names to nicer ones. However, this
-has left the source fairly unreadable.
+./clpr contains the CLP(R) version 1.2 source, with a few modifications
+to make it work with Mercury (these chanes are documented in the file
+./clpr/README.Mercury).  See ./clpr/README for more information,
+particularly the RESEARCH SOFTWARE DISCLAIMER and the USER AGREEMENT.
 
-The files svar.m, svar_float.m, float_svar.m, and dump.m provide the
-Mercury interface to the CLP(R) constraint solver.  The other .m files
-in this directory are example programs that use this interface.
+The files cfloat.m, cfloat_float.m, float_cfloat.m, and dump.m in
+this directory provide the Mercury interface to the CLP(R) constraint solver. 
+The files in the `samples' directory are a few example programs that use
+this interface.
 
Index: cfloat.m
===================================================================
RCS file: /home/staff/zs/imp/clpr/cfloat.m,v
retrieving revision 1.5
diff -u -u -r1.5 cfloat.m
--- cfloat.m	1997/09/03 10:36:18	1.5
+++ cfloat.m	1997/09/03 11:37:54
@@ -325,9 +325,6 @@
 	struct ML_cfloat_choicepoint *next;
 } ML_cfloat_choicepoint;
 
-ML_cfloat_choicepoint ML_cfloat_first_choicepoint;
-ML_cfloat_choicepoint * ML_cfloat_current_cp = &ML_cfloat_first_choicepoint;
-
 #define ML_cfloat_maybe_trail_solver()				\
 	do {							\
 		if (stamp != MR_current_choicepoint_id()) {	\
@@ -343,6 +340,10 @@
 ").
 
 :- pragma c_code("
+
+static ML_cfloat_choicepoint ML_cfloat_first_choicepoint;
+static ML_cfloat_choicepoint * ML_cfloat_current_cp =
+					&ML_cfloat_first_choicepoint;
 
 void
 ML_cfloat_trail_solver(void)
cvs diff: Diffing clpr
Index: clpr/Makefile
===================================================================
RCS file: /home/staff/zs/imp/clpr/clpr/Makefile,v
retrieving revision 1.2
diff -u -u -r1.2 Makefile
--- Makefile	1997/08/24 10:17:34	1.2
+++ Makefile	1997/09/03 11:56:59
@@ -109,11 +109,11 @@
 ##############################################################################
 
 SHELL = /bin/sh
-CC = cc
+CC = gcc
 CCOPT = -O # -Olimit 2603
 
 # Default path to init.clpr
-LIBPATH = \"/home/munta/staff/roland/clp/v1.2/lib\"
+LIBPATH = \"`pwd`\"
 
 CFLAGS = $(CCOPT) -DLIBPATH=$(LIBPATH)
 
Index: clpr/Mmakefile
===================================================================
RCS file: /home/staff/zs/imp/clpr/clpr/Mmakefile,v
retrieving revision 1.1
diff -u -u -r1.1 Mmakefile
--- Mmakefile	1997/09/03 10:36:57	1.1
+++ Mmakefile	1997/09/03 11:52:58
@@ -37,7 +38,16 @@
 INSTALL_MERC_CLPR_LIB_DIR = $(INSTALL_MERC_GC_LIB_DIR)
 
 .PHONY: install
-install:
+install: install_headers install_lib
+
+.PHONY: install_headers
+install_headers: *.h
+	-[ -d $(INSTALL_INC_DIR) ] || mkdir -p $(INSTALL_INC_DIR)
+	-[ -d $(INSTALL_INC_DIR)/clpr ] || mkdir -p $(INSTALL_INC_DIR)/clpr
+	cp *.h $(INSTALL_INC_DIR)/clpr
+
+.PHONY: install_lib
+install_lib:
 	-[ -d $(INSTALL_MERC_CLPR_LIB_DIR) ] || \
 		mkdir -p $(INSTALL_MERC_CLPR_LIB_DIR)
 	cp libclpr.a libclpr.$(EXT_FOR_SHARED_LIB) \
cvs diff: clpr/README.Mercury is a new entry, no comparison available
cvs diff: Diffing samples
Index: samples/Mmakefile
===================================================================
RCS file: /home/staff/zs/imp/clpr/samples/Mmakefile,v
retrieving revision 1.1
diff -u -u -r1.1 Mmakefile
--- Mmakefile	1997/09/03 10:37:26	1.1
+++ Mmakefile	1997/09/03 10:48:57
@@ -52,4 +52,8 @@
 .PHONY: cs
 cs: $(CS)
 
+.PHONY: clean
+clean:
+	rm -f *.out *.res
+
 #-----------------------------------------------------------------------------#

-- 
Fergus Henderson <fjh at cs.mu.oz.au>   |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>   |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3         |     -- the last words of T. S. Garp.



More information about the developers mailing list