Forum: IronRuby Problems compiling IronRuby on Mac Leopard

Posted by Ben Aurel (Guest)
on 2008-05-06 11:32
(Received via mailing list)
Hi
I try to write a little blog article about installing mono and
ironruby on Mac Leopard from the ground up. It's a bit a bumpy road
(especially to get mono build from sources), but I'm almost there.

I'm following these instructions
http://sparcs.kaist.ac.kr/~tinuviel/download/IronRuby/HOWTO

and work with the latest patch:
$ patch -p0 < patch-mono-r94

from here: 
http://sparcs.kaist.ac.kr/~tinuviel/download/IronRuby/patch-mono-r94

but it doesn't work:
$ rake compile mono=1

rake aborted!
cannot resolve path System.dll
~/mono/compiling/ironruby/rakefile:137
(See full trace by running task with --trace)

(* with --trace see below)

What's needed that the System.dll can be resolved?

Thanks for your help.
Ben


(*)
$ sudo rake compile mono=1 --trace
(~/mono/compiling/ironruby)
** Invoke compile (first_time)
** Invoke happy (first_time)
** Execute happy
** Invoke clean_build (first_time)
** Invoke happy
** Execute clean_build
** Invoke compile_dlr (first_time)
** Invoke clean_build
** Execute compile_dlr
rake aborted!
cannot resolve path System.dll
./context.rb:90:in `resolve_framework_path'
./context.rb:89:in `each'
./context.rb:89:in `resolve_framework_path'
./context.rb:130:in `resolve_framework_path'
./context.rb:405:in `resolve_framework_path'
./context.rb:420:in `references'
./context.rb:418:in `each'
./context.rb:418:in `references'
./context.rb:434:in `compile'
./context.rb:432:in `chdir'
./context.rb:432:in `compile'
/mono/compiling/ironruby/rakefile:137
./context.rb:578:in `instance_eval'
./context.rb:578:in `source_context'
/mono/compiling/ironruby/rakefile:135
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:546:in `call'
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:546:in 
`execute'
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:541:in `each'
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:541:in 
`execute'
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:508:in
`invoke_with_call_chain'
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in 
`synchronize'
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in
`invoke_with_call_chain'
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:518:in
`invoke_prerequisites'
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1183:in `each'
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1183:in `send'
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1183:in `each'
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:515:in
`invoke_prerequisites'
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:507:in
`invoke_with_call_chain'
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in 
`synchronize'
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in
`invoke_with_call_chain'
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:494:in `invoke'
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1931:in 
`invoke_task'
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in 
`top_level'
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in `each'
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in 
`top_level'
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1948:in
`standard_exception_handling'
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1903:in 
`top_level'
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1881:in `run'
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1948:in
`standard_exception_handling'
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1878:in `run'
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.1/bin/rake:31
/opt/local/bin/rake:16:in `load'
/opt/local/bin/rake:16
Posted by Sanghyeon Seo (Guest)
on 2008-05-06 12:16
(Received via mailing list)
2008/5/6 Ben Aurel <ben.aurel@gmail.com>:
>  What's needed that the System.dll can be resolved?

You need to have pkg-config correctly configured.

$ pkg-config --variable=libdir mono
/usr/lib

If you don't get any output, try setting PKG_CONFIG_PATH so that
pkg-config can find mono.pc.
Posted by Ben Aurel (Guest)
on 2008-05-06 12:42
(Received via mailing list)
that's my line in ~/.bash_profile:
...
export PKG_CONFIG_PATH="/opt/mono/lib/pkgconfig/"
,...

and this is what I get with
$ pkg-config --variable=libdir mono

/opt/mono/lib/pkgconfig/../../lib

should this be correct - no? What's wrong here?
Posted by Ben Aurel (Guest)
on 2008-05-06 12:54
(Received via mailing list)
I forgot to mention:

after restarting the shell, I tried it once again:

$ rake compile mono=1
(in /mono/compiling/ironruby)
Read in 33 resources from
'../ironruby/src/microsoft.scripting.core/Microsoft.Scripting.txt'
Writing resource file...  Done.

--and than this error (?):
./actions/comdispatch/DispCallable.cs(134,9): error CS0452: The type
`T' must be a reference type in order to use it as type parameter `T'
in the generic type or method
`Microsoft.Scripting.Actions.RuleBuilder<T>'.
./actions/comdispatch/comtypelibdesc.cs(141,9): error CS0452: The type
`T' must be a reference type in order to use it as type parameter `T'
in the generic type or method
`Microsoft.Scripting.Actions.RuleBuilder<T>'.

--
Compilation failed: 2 error(s), 0 warnings
rake aborted!
Command failed with status (1): [gmcs 
/out:"/users/shared/xfiles/root/nowit...]
/mono/compiling/ironruby/rakefile:137

When I now try to run it again I simply get:

$ sudo rake compile mono=1
rake aborted!
cannot resolve path System.dll
Posted by Sanghyeon Seo (Guest)
on 2008-05-06 13:29
(Received via mailing list)
2008/5/6 Ben Aurel <ben.aurel@gmail.com>:
>  --and than this error (?):
>  ./actions/comdispatch/DispCallable.cs(134,9): error CS0452: The type
>  `T' must be a reference type in order to use it as type parameter `T'
>  in the generic type or method
>  `Microsoft.Scripting.Actions.RuleBuilder<T>'.
>  ./actions/comdispatch/comtypelibdesc.cs(141,9): error CS0452: The type
>  `T' must be a reference type in order to use it as type parameter `T'
>  in the generic type or method
>  `Microsoft.Scripting.Actions.RuleBuilder<T>'.

This is a recent unrelated error. This problem is reported as Mono bug 
#387040.
https://bugzilla.novell.com/show_bug.cgi?id=387040

The last working revision is r98. If all you want is to try IronRuby,
you could update to old revisions.

>  When I now try to run it again I simply get:
>
>  $ sudo rake compile mono=1
> rake aborted!
>  cannot resolve path System.dll

Of course, you are using sudo, which resets the shell environment.
Therefore, don't.
Posted by Ivan Porto carrero (casualjim)
on 2008-05-06 13:53
(Received via mailing list)
oh I have a script that should do all that.
i can email it to you if you want.
I also have that blogpost up that explains everything

http://flanders.co.nz/2008/02/05/compiling-mono-and-ironruby-on-osx-leopard/
Posted by Ben Aurel (Guest)
on 2008-05-06 14:25
(Received via mailing list)
ok, I'm a little confused now. What excactly do I have to do now in
order to compile it?
I'm stuck with compiling ironruby.

$ rake compile mono=1
rake aborted!
cannot resolve path System.dll

What to do??
Posted by Ben Aurel (Guest)
on 2008-05-06 14:27
(Received via mailing list)
Ivan, your article was one of the references for my attempt to install
ironruby on leopard. It would be very nice if you could send me your
script to ben.aurel@gmail.com
thanks
Posted by Sanghyeon Seo (Guest)
on 2008-05-06 14:32
(Received via mailing list)
2008/5/6 Ben Aurel <ben.aurel@gmail.com>:
> ok, I'm a little confused now. What excactly do I have to do now in
>  order to compile it?

I believe I already answered all your questions. If you have some
more, please state it.

1. Cannot resolve path System.dll
Configure pkg-config correctly. Make sure PKG_CONFIG_PATH is set. Make
sure you don't use sudo, which reset the shell environment.

2. Bizarre CS0452 error from Mono C# compiler
Mono bug #387040. No solution yet. Downgrade to SVN r98.
Posted by Ben Aurel (Guest)
on 2008-05-06 14:49
(Received via mailing list)
Seo,

As I've writte in my 2nd response PKG_CONFIG_PATH is set. The question
is: Is it set correctly and what is the criteria for the correct
setting?
Posted by Ben Aurel (Guest)
on 2008-05-06 15:01
(Received via mailing list)
ok I have the reason why it didn't worked.

on the post of Ivan
(http://flanders.co.nz/2008/02/05/compiling-mono-and-ironruby-on-osx-leopard/)

I copied the line:

export 
PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:/opt/local/lib/pkgconfig"

now the path (/usr/local/...) has other exclamation marks than there
are on my mac.

" (blog)
" (my mac)

I don't know if you can see the difference. But fact is that it
doesn't work with the "blog marks".

Does somebody has an explanation for this?

thanks
Ben
Posted by Thibaut Barrère (thbar)
on 2008-05-06 15:12
(Received via mailing list)
> Does somebody has an explanation for this?

The double quote is transformed into mister &#8221;, a nicer yet
incompatible-with-your-command-line version of itself.

cheers

Thibaut
--
http://blog.logeek.fr - learning content for developers
http://evolvingworker.com - tools for a better day
Posted by Ben Aurel (Guest)
on 2008-05-06 15:16
(Received via mailing list)
thanks,
does that mean, that my terminal don't know the character set used on
the website?



On Tue, May 6, 2008 at 3:10 PM, Thibaut Barrère
Posted by Ben Aurel (Guest)
on 2008-05-06 15:24
(Received via mailing list)
if I understand Seo correctly, I *have* to downgrade in order to
compile ironruby for mac. There is no other option.

Could somebody tell me the (best) way for downgrading the sources. Can
I downgrade with SVN the existing sources? If yes - how?
Or is it better to remove the checked out sources and make a checkout
again with the specific revision number? Again - how?

thanks for your help

Benh
Posted by Thibaut Barrère (thbar)
on 2008-05-06 15:25
(Received via mailing list)
>  does that mean, that my terminal don't know the character set used on the
website?

If you use the html version on the OS X command line, the variable will 
keep
the quotes inside the value instead of acting like a string delimiter:

Macintosh:temp thbar$ export
SOMEVAR="/usr/local/lib/pkgconfig:/opt/local/lib/pkgconfig"
Macintosh:temp thbar$ echo $SOMEVAR
*"/usr/local/lib/pkgconfig:/opt/local/lib/pkgconfig"*

On the other hand, if you use the regular double-quote, you'll get the
expected behaviour:

Macintosh:temp thbar$ export
SOMEVAR="/usr/local/lib/pkgconfig:/opt/local/lib/pkgconfig"
Macintosh:temp thbar$ echo $SOMEVAR
*/usr/local/lib/pkgconfig:/opt/local/lib/pkgconfig
*

hope this helps

-- Thibaut
Posted by Sanghyeon Seo (Guest)
on 2008-05-06 15:29
(Received via mailing list)
2008/5/6 Ben Aurel <ben.aurel@gmail.com>:
>  Could somebody tell me the (best) way for downgrading the sources. Can
>  I downgrade with SVN the existing sources? If yes - how?

Yes. svn update -r 98.
Posted by Ben Aurel (Guest)
on 2008-05-06 16:30
(Received via mailing list)
thanks,

I always got the error:

svn: Failed to add file 'web/makefile': object of the same name already 
exists

I removed web/Makefile, and than it worked ...
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.