[mercury-users] rotd-2002-12-01 array.m:708: `SUCCESS_INDICATOR' undeclared

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Dec 4 10:17:09 AEDT 2002


On 03-Dec-2002, Ondrej Bojar <oboj7042 at ss1000.ms.mff.cuni.cz> wrote:
> My computer was changed again, so I need to get Mercury running again. I
> used to use rotd-2002-03-17 and now I wished to use the current
> rotd-2002-12-01.
> 
> However, I'm again unable to make it compile (problems similar to the
> rotd-2002-03-17).

The simplest solution is to install the binary distribution,
rather than using the source distribution.

> mercury_trace_alias.c:98: Unable to find a register to spill in class
>     `SIREG'.

Please try the attached patch.  It may work around the problem.  If it does,
let us know, and we'll commit this patch to our CVS repository.

> So I used the second hint from 'BUGS' file and
> (again from scratch) used these params:
>
> CFLAGS-mercury_trace_alias = -O0
> GRADE = hlc.gc

That won't work unless you already have a working Mercury compiler installed.
The BUGS file says

 | If this problem occurs when compiling the source distribution, install
 | from the binary distribution instead.
 |    
 | If a similar problem occurs when compiling your program, there are a
 | few possible work-arounds:

Did you try the binary distribution, like it suggests?

The work-arounds suggested are for the case where the problem
affects compiling your own program.  For compiling the Mercury compiler
itself, the second work-around cannot be applied directly.
Changing GRADE to hlc.gc requires rebuilding the .c files that we include
in the "source" distribution.

So, to make this approach work, you'd need to first install a working
Mercury compiler (from the binary distribution), and then use that
to compile the source distribution... of course you might find it
easier to just stop after installing the binary distribution ;-)

Another alternative is to use the other suggestion of GRADE=asm_jump.gc
rather than GRADE=hlc.gc; that doesn't require rebuilding the C sources.

> Unfortunately, the hint 'use a different C compiler than gcc 2.96' is not
> plausible for me, I don't have the root here (and I'm really afraid of
> installing the C compiler myself).

GCC is not that hard to install from source.
You don't need to be root to install GCC --
just use the --prefix option to configure to
install it in a directory for which you have write permission,
e.g. a subdirectory of your home directory.

The GCC web page has some fairly complicated installation instructions.
But the short version is to just do the following 

	1. download the gcc source distribution,
	   e.g. the file gcc-3.2.1.tar.gz
	   <http://gcc.gnu.org/mirrors.html>

	2. run the following commands

		tar zxf gcc-3.2.1.tar.gz
		cd gcc-3.2.1
		mkdir $HOME/gcc-3.2.1-install
		sh configure --prefix=$HOME/gcc-3.2.1-install
		make bootstrap
		make install

	3. add $HOME/gcc-3.2.1-install/bin to your PATH

> I don't precisely understand the workaround:
> 
> * Use `asm_jump.*' compilation grades instead of `asm_fast.*'
>   grades. Note that `asm_jump.*' grades are not usually installed.

The comment about asm_jump.* grades usually not being installed
means that if this problem affects your own program (not the Mercury
compiler), and you want to apply this work-around, you will need
to first install the Mercury runtime and standard library in that grade
(e.g. by configure with `sh configure --enable-libgrades=asm_jump.gc').

So, in summary:
	1. please try the attached patch and let us know if it works
	2. if that doesn't work, try the binary distribution
	3. if that doesn't work, try putting GRADE=asm_jump.gc in Mmake.params

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
-------------- next part --------------
cvs diff: Diffing .
Index: mercury_trace_alias.c
===================================================================
RCS file: /home/mercury1/repository/mercury/trace/mercury_trace_alias.c,v
retrieving revision 1.6
diff -u -d -u -r1.6 mercury_trace_alias.c
--- mercury_trace_alias.c	2002/03/06 14:35:03	1.6
+++ mercury_trace_alias.c	2002/12/03 22:43:42
@@ -88,7 +88,8 @@
 		MR_free(MR_alias_records[slot].MR_alias_words);
 
 		for (i = slot; i < MR_alias_record_next - 1; i++) {
-			MR_alias_records[slot] = MR_alias_records[slot+1];
+			MR_assign_structure(MR_alias_records[slot],
+				MR_alias_records[slot + 1]);
 		}
 
 		MR_alias_record_next--;


More information about the users mailing list