Re: [C--] a skeleton file for qc-- to start?

Xingzhi Pan <[email protected]> Thu, 15 Oct 2009 09:56:35 +0800
Newsgroups gmane.comp.lang.c--
Message-ID <[email protected]>
It works. Thank you Wonseok! That option is in the manual but I
neither noticed it nor realized what it means.

I visited your website. We share similar interests in programming languages=
 (-:

I'm just briefly writing here how I built qc-- here so others may find
it useful.

As of 20091015, building qc--20090627 on Debian 5 or Ubuntu 9.04 can
be done by installing:

- OCaml 3.08.2
- Lua 4.0.1
- Noweb
- GCC 4.3
- texlive-latex3
- texlive-latex-base
- texlive-latex-extra

The first two are compiled from source while the rest can be installed
by apt-get.

And how about my questions on "section"s?

Cheers,
Xingzhi

2009/10/14 Wonseok Chae <[email protected]>:
> Hi Xingzhi Pan,
>
> You omitted compiler option "-globals":
>
> $ qc--.opt -globals sp1.c--
>
> However, your program has still a problem around line 16:
>
> =A0 =A0 =A0 =A0 =A0=A0 sp1( 3, 3 );
>
> which does not match the definition of function "sp1" :-)
>
> By the way, I did experience the same problems with Cygwin and qc--
> compilation process. You might find some tips in my memo
> (http://ttic.uchicago.edu/~wchae/files/MLPolyRforC--.pdf ).
>
> Cheers,
> Wonseok
>
> On Wed, Oct 14, 2009 at 9:26 AM, Xingzhi Pan <[email protected]> wrot=
e:
>>
>> Hi list,
>>
>> I've built qc--20090627 on Debian and now I'm ready to try it out. Howev=
er
>> I
>> couldn't find a proper "skeleton" c-- source file to start with. The
>> closest I
>> could get (modified from the document) is
>>
>> =A0 =A0target byteorder little;
>> =A0 =A0section "text" {
>> =A0 =A0 =A0 =A0/* Ordinary recursion */
>> =A0 =A0 =A0 =A0export sp1;
>> =A0 =A0 =A0 =A0sp1( bits32 n ) {
>> =A0 =A0 =A0 =A0 =A0bits32 s, p;
>> =A0 =A0 =A0 =A0 =A0if n =3D=3D 1 {
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0return( 1, 1 );
>> =A0 =A0 =A0 =A0 =A0} else {
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0s, p =3D sp1( n-1 );
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0return( s+n, p*n );
>> =A0 =A0 =A0 =A0 =A0}
>> =A0 =A0 =A0 =A0}
>> =A0 =A0 =A0 =A0export main;
>> =A0 =A0 =A0 =A0main() {
>> =A0 =A0 =A0 =A0 =A0 =A0sp1( 3, 3 );
>> =A0 =A0 =A0 =A0 =A0 =A0return( 0 );
>> =A0 =A0 =A0 =A0}
>> =A0 =A0}
>>
>> I used
>> =A0 =A0qc--.opt sp1.c--
>> and got
>> =A0 =A0sp1.o: In function `Cmm.ref_to_global_area':
>> =A0 =A0(.data+0x0): undefined reference to
>> `Cmm.globalsig.aQOYZWMPACZAJaMABGMOZeCCPY'
>> =A0 =A0collect2: ld returned 1 exit status
>>
>> Can anyone point me to somewhere to start? Thanks in advance!
>>
>> Another question: does "section" actually correspond to the same concept
>> when
>> people talk about X86 assembly (.text, .data, .bss, etc.)?
>>
>> PS, it's somewhat troublesome to build qc-- from scratch - partly because
>> I
>> tried to do it on Cygwin first. After getting frustrated I turned to
>> Debian.
>> But even then I had to build Lua 4, Ocaml 3.08 (these guys are a little
>> big old
>> nowadays), install some Latex packages (not mentioned in the INSTALL
>> file), and
>> modify the configure script. It took me a few hours to figure out
>> everything
>> needed.
>>
>> Cheers.
>>
>> --
>> Pan, Xingzhi
>> http://www.panxingzhi.net
>> http://code.google.com/p/pypl0
>> http://code.google.com/p/dircompare/
>> _______________________________________________
>> Cminusminus mailing list
>> [email protected]
>> https://www.eecs.harvard.edu/mailman/listinfo/cminusminus
>
>



-- =

Pan, Xingzhi
http://www.panxingzhi.net
http://code.google.com/p/pypl0
http://code.google.com/p/dircompare/
_______________________________________________
Cminusminus mailing list
[email protected]
https://www.eecs.harvard.edu/mailman/listinfo/cminusminus