<br><br><div><span class="gmail_quote">On 2/17/06, <b class="gmail_sendername">Julien Fischer</b> <<a href="mailto:juliensf@cs.mu.oz.au">juliensf@cs.mu.oz.au</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>On Thu, 16 Feb 2006, Jonathan Morgan wrote:<br><br>> On 2/11/06, Jonathan Morgan <<a href="mailto:jonmmorgan@gmail.com">jonmmorgan@gmail.com</a>> wrote:<br>> ><br>> ><br>> > For your information, I have just been trying the latest rotd, and MS
<br>> > ilasm breaks as well when compiling injection.m.  So maybe I'll backport<br>> > your change to mercury-0.12.2 and try it with that (as I know MS ilasm can<br>> > handle it).<br>> ><br>> > Jon
<br>> ><br>><br>> I have used DotGnu on Win32, with mercury-0.12.2 on Cygwin.  It seems to go<br>> all right compiling the IL, but breaks when building C# code, because it<br>> doesn't have the /addmodule command line option.  I'll look into what we can
<br>> do to fix that (if anything).<br>><br><br>That's was more or less where I ended up  with it.</blockquote><div><br>As I said, it is possible to use the -fmodule=  option.  Here I'll put a dump of my experiences in case someone more knowledgable than I knows what to do.
<br><br><br>cscc  /t:library /lib:`cygpath -w -a /installs/mercury-compiler-0.12.2/tmp_dir/library` \<br>    /out:array__csharp_code.dll `echo "/addmodule:mercury_dotnet.dll /addmodule:mercury_il.dll /addmodule:array.dll
 /addmodule:assoc_list.dll /addmodule:benchmarking.dll /addmodule:bool.dll /addmodule:builtin.dll /addmodule:char.dll /addmodule:construct.dll /addmodule:deconstruct.dll /addmodule:dir.dll /addmodule:enum.dll /addmodule:exception.dll
 /addmodule:float.dll /addmodule:int.dll /addmodule:integer.dll /addmodule:io.dll /addmodule:lexer.dll /addmodule:list.dll /addmodule:map.dll /addmodule:math.dll /addmodule:ops.dll /addmodule:parser.dll /addmodule:private_builtin.dll /addmodule:
random.dll /addmodule:require.dll /addmodule:rtti_implementation.dll /addmodule:set.dll /addmodule:set_ordlist.dll /addmodule:set_tree234.dll /addmodule:set_unordlist.dll /addmodule:std_util.dll /addmodule:store.dll /addmodule:
string.dll /addmodule:svmap.dll /addmodule:svset.dll /addmodule:table_builtin.dll /addmodule:term.dll /addmodule:term_io.dll /addmodule:time.dll /addmodule:tree234.dll /addmodule:type_desc.dll /addmodule:varset.dll" | sed 's/\/addmodule:/-fmodule=/g'` /t:module    array__csharp_code.cs
<br><br>Note that array__csharp_code.dll did in fact compile.<br><br>cscc  /t:library /lib:`cygpath -w -a /installs/mercury-compiler-0.12.2/tmp_dir/library` \<br>    /out:builtin__csharp_code.dll `echo "/addmodule:mercury_dotnet.dll /addmodule:mercury_il.dll /addmodule:
builtin.dll /addmodule:array.dll /addmodule:assoc_list.dll /addmodule:benchmarking.dll /addmodule:bool.dll /addmodule:char.dll /addmodule:construct.dll /addmodule:deconstruct.dll /addmodule:dir.dll /addmodule:enum.dll /addmodule:
exception.dll /addmodule:float.dll /addmodule:int.dll /addmodule:integer.dll /addmodule:io.dll /addmodule:lexer.dll /addmodule:list.dll /addmodule:map.dll /addmodule:math.dll /addmodule:ops.dll /addmodule:parser.dll /addmodule:private_builtin.dll /addmodule:
random.dll /addmodule:require.dll /addmodule:rtti_implementation.dll /addmodule:set.dll /addmodule:set_ordlist.dll /addmodule:set_tree234.dll /addmodule:set_unordlist.dll /addmodule:std_util.dll /addmodule:store.dll /addmodule:
string.dll /addmodule:svmap.dll /addmodule:svset.dll /addmodule:table_builtin.dll /addmodule:term.dll /addmodule:term_io.dll /addmodule:time.dll /addmodule:tree234.dll /addmodule:type_desc.dll /addmodule:varset.dll" | sed 's/\/addmodule:/-fmodule=/g'` /t:module    builtin__csharp_code.cs
<br>builtin.m:512: `mercury_code' is not a member of the namespace `mercury.builtin'<br><br>builtin.m:512: called object is not a method or delegate<br><br>builtin.m:594: `mercury_code' is not a member of the namespace `mercury.builtin'
<br><br>builtin.m:594: called object is not a method or delegate<br><br>builtin.m:595: invalid return value<br><br>builtin.m:605: `runtime' is not a member of the namespace `mercury'<br><br>builtin.m:605: `runtime' is not a member of the namespace `mercury'
<br><br>builtin.m:605: invalid left operand to `.'<br><br>builtin.m:605: called object is not a method or delegate<br><br>builtin.m:613: `runtime' is not a member of the namespace `mercury'<br><br>builtin.m:613: `runtime' is not a member of the namespace `mercury'
<br><br>builtin.m:613: invalid left operand to `.'<br><br>builtin.m:613: called object is not a method or delegate<br><br>builtin.m:621: `runtime' is not a member of the namespace `mercury'<br><br>builtin.m:621: `runtime' is not a member of the namespace `mercury'
<br><br>builtin.m:621: invalid left operand to `.'<br><br>builtin.m:621: called object is not a method or delegate<br><br>builtin.m:629: `runtime' is not a member of the namespace `mercury'<br><br>builtin.m:629: `runtime' is not a member of the namespace `mercury'
<br><br>builtin.m:629: invalid left operand to `.'<br><br>builtin.m:629: called object is not a method or delegate<br><br>builtin.m:638: `runtime' is not a member of the namespace `mercury'<br><br>builtin.m:638: `runtime' is not a member of the namespace `mercury'
<br><br>builtin.m:638: invalid left operand to `.'<br><br>builtin.m:638: called object is not a method or delegate<br><br>builtin.m:646: `runtime' is not a member of the namespace `mercury'<br><br>builtin.m:646: `runtime' is not a member of the namespace `mercury'
<br><br>builtin.m:646: invalid left operand to `.'<br><br>builtin.m:646: called object is not a method or delegate<br><br>builtin.m:654: `runtime' is not a member of the namespace `mercury'<br><br>builtin.m:654: `runtime' is not a member of the namespace `mercury'
<br><br>builtin.m:654: invalid left operand to `.'<br><br>builtin.m:654: called object is not a method or delegate<br><br>builtin.m:662: `runtime' is not a member of the namespace `mercury'<br><br>builtin.m:662: `runtime' is not a member of the namespace `mercury'
<br><br>builtin.m:662: invalid left operand to `.'<br><br>builtin.m:662: called object is not a method or delegate<br><br>However, builtin's C# code will not compile, and it is unable to find the namespaces.  Any ideas why one would and the other wouldn't?
<br><br>make[2]: *** [builtin__csharp_code.dll] Error 1<br>make[2]: Leaving directory `/installs/mercury-compiler-0.12.2/tmp_dir/library'<br>To clean up from failed install, remove tmp_dir<br>make[1]: *** [install_grades] Error 1
<br>make[1]: Leaving directory `/installs/mercury-compiler-0.12.2'<br><br>Next step, I gave up on the install and started writing a custom command line for builtin C# code, ending up with something like the following:<br>
<br>cscc /t:library -L "C:\cygwin\installs\mercury-compiler-0.12.2\tmp_dir\library" -o builtin__csharp_code.dll -fmodule=mercury_dotnet.dll -fmodule=mercury_il.dll -fmodule=builtin.dll -fmodule=array.dll -fmodule=assoc_list.dll -fmodule=
benchmarking.dll -fmodule=bool.dll -fmodule=char.dll -fmodule=construct.dll -fmodule=deconstruct.dll -fmodule=dir.dll -fmodule=enum.dll -fmodule=exception.dll -fmodule=float.dll -fmodule=int.dll -fmodule=integer.dll -fmodule=
io.dll -fmodule=lexer.dll -fmodule=list.dll -fmodule=map.dll -fmodule=math.dll -fmodule=ops.dll -fmodule=parser.dll -fmodule=private_builtin.dll -fmodule=random.dll -fmodule=require.dll -fmodule=rtti_implementation.dll -fmodule=
set.dll -fmodule=set_ordlist.dll -fmodule=set_tree234.dll -fmodule=set_unordlist.dll -fmodule=std_util.dll -fmodule=store.dll -fmodule=string.dll -fmodule=svmap.dll -fmodule=svset.dll -fmodule=table_builtin.dll -fmodule=term.dll
 -fmodule=term_io.dll -fmodule=time.dll -fmodule=tree234.dll -fmodule=type_desc.dll -fmodule=varset.dll /t:module builtin__csharp_code.cs<br><br>This failed similarly.  I tried replacing /t:library with -shared (from the cscc documentation) but it refused to recognise it.  I couldn't find an equivalent option to /t:module - though I presume there must be one, since it has the -fmodule flag.
<br><br>Next, I decided to try MS csc with the DotGnu ilasm generated DLLs.  When giving it the standard command-line, it complained that all the modules I was referencing were actually assemblies, and advised me to use /R (reference assembly, rather than addmodule).  After changing this it compiled perfectly.  I presume that this means that DotGnu ilasm is creating its DLLs differently from how MS ilasm does - though whether that is affecting cscc is not anything that I can judge.
<br><br>My feeling is that it's probably possible to patch up this rough hack to the extent that it can build the C# code (it can currently build all the il it's given before getting to the C#), but I do not have the necessary knowledge to do so.
<br><br>After that there is the fun of duplicating all the changes for Mono, modifying the compiler for mmc --make and probably generate-dependencies as well, and (I suggest) adding a compiler option to disable MC++ (is this likely to affect mmake?  Will it try to build cpp_code files that aren't there?).
<br><br>I recommend looking at how a pre-existing tool (eg. csant) handles command-lines for the different compilers.  However, I don't know what you do if the various ilasms behave differently, as they will all be detected as ilasm (you might be able to base it on the C# compiler, assuming that the same IL compiler is used).
<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">> Incidentally, I also notice that DotGnu installs al (which is identical to
<br>> ilalink) as well as ilalink, at least on DotGnu/Win32.<br>><br><br>Hmmm ... it wasn't nice enough to do that for me on Linux.<br></blockquote></div><br>On Windows they are more interested in moving over those anti-social people who use Microsoft products :).
<br><br>Jon<br>