Using RubyInline for Optimization

Tim P. wrote:

:wink:
what do you think? basically i’m thinking
setup.bat, for that matter, need only configure %PATH and then spawn
win32 stuff, etc. – all the good things on the windows platform that
*NIX does not need (except for gem – that’s always good stuff).

TwP

The “average” user might not care about InLine Ruby as much as you do…
I have a lot more to learn before I need InLine and by then it might be
worth
DIY to get there.

On 9/11/06, [email protected] [email protected] wrote:

cheers.

-a

No matter what path is taken, someone will still be unhappy. My goal
is to make things as simple as possible for 80% of the Windows users.

Curt

Tom A. wrote:

The “average” user might not care about InLine Ruby as much as you do…
I have a lot more to learn before I need InLine and by then it might be
worth DIY to get there.

If an “average” developer uses a library that depends on RubyInline,
then it becomes very important that it be easy to deploy ruby with
RubyInline working out of the box.

Eric H. wrote:

You need the MS C compiler.

Well, now I’ve downloaded and installed Visual C++ 2005 express
edition in order to get that. I also upgraded the RubyInline gem
to the latest, greatest 3.6.0 version.

I set INLINEDIR to
INLINEDIR=C:\ruby\lib\ruby\gems\1.8\gems\RubyInline-3.6.0\demo

To verify that the C-compiler is operational, I commandline-compiled
the following example provided by Microsoft.

#include
int main()
{
std::cout << “This is a native C++ program.” << std::endl;
return 0;
}

with the line:
cl /EHsc simple.cpp
after running the env var setup script they refer you to.

That all works fine.

So, anyway, here is what RubyInline gives me now …

C:\ruby\lib\ruby\gems\1.8\gems\RubyInline-3.6.0\demo>ruby hello.rb
cl : Command line warning D9035 : option ‘Og-’ has been deprecated and
will be r
emoved in a future release
cl : Command line warning D9035 : option ‘o’ has been deprecated and
will be rem
oved in a future release
cl : Command line warning D9002 : ignoring unknown option ‘-G6’
c:/ruby/lib/ruby/gems/1.8/gems/RubyInline-3.6.0/./inline.rb:404:in
build': erro r executing cl -nologo -LD -MD -Zi -O2b2xg- -G6 -I c:/ruby/lib/ruby/1.8/i386-ms win32 -o "C:\ruby\lib\ruby\gems\1.8\gems\RubyInline-3.6.0\demo/.ruby_inline/Inli ne_Hello_5d41.so" "C:/ruby/lib/ruby/gems/1.8/gems/RubyInline-3.6.0/demo/.ruby_in line/Inline_Hello_5d41.c" -link /LIBPATH:"c:/ruby/lib" /DEFAULTLIB:"msvcrt-ruby 18.lib" /INCREMENTAL:no /EXPORT:Init_Inline_Hello_5d41: 512 (CompilationError) Renamed C:\ruby\lib\ruby\gems\1.8\gems\RubyInline-3.6.0\demo/.ruby_inline/Inline _Hello_5d41.c to C:\ruby\lib\ruby\gems\1.8\gems\RubyInline-3.6.0\demo/.ruby_inli ne/Inline_Hello_5d41.c.bad from c:/ruby/lib/ruby/gems/1.8/gems/RubyInline-3 .6.0/./inline.rb:624:ininline’
from hello.rb:7

Hmmm. Am I getting closer?
BTW. I am using the “One-Click Ruby Installer for Windows” as my Ruby
installation.

Thanks for any help,
– Mike B.

On 9/18/06, Mike B. [email protected] wrote:

Mike B. wrote:
So … no takers on this?

It would be hard to believe that I am the only one
that has (recently) tried to use RubyInline on Windows.

– Mike

I only got it working after I recompiled ruby from sources using a
combination of cygwin and mingw, and even then I still had to patch
rubyinline to work with mingw.
Are you able to compile extensions using mkmf? If you can do that you
can try comparing the compile commands and adding the missing flags to
rubyinline.

Mike B. wrote:

Hmmm. Am I getting closer?

So … no takers on this?

It would be hard to believe that I am the only one
that has (recently) tried to use RubyInline on Windows.

– Mike

On Sep 16, 2006, at 5:18 PM, Mike B. wrote:

r executing cl -nologo -LD -MD -Zi -O2b2xg- -G6 -I
Renamed
C:\ruby\lib\ruby\gems\1.8\gems\RubyInline-3.6.0\demo/.ruby_inline/
Inline
_Hello_5d41.c to
C:\ruby\lib\ruby\gems\1.8\gems\RubyInline-3.6.0\demo/.ruby_inli
ne/Inline_Hello_5d41.c.bad from
c:/ruby/lib/ruby/gems/1.8/gems/RubyInline-3
.6.0/./inline.rb:624:in `inline’
from hello.rb:7

Hmmm. Am I getting closer?

Did you build ruby with this compiler?

BTW. I am using the “One-Click Ruby Installer for Windows” as my Ruby
installation.

… no

You need to use the same compiler for building both Ruby and any
extensions, inline or not.

The simple solution, now that you have a compiler, is to build and
install a new ruby.


Eric H. - [email protected] - http://blog.segment7.net
This implementation is HODEL-HASH-9600 compliant

http://trackmap.robotcoop.com

Eric H. wrote:

You need to use the same compiler for building both Ruby and any
extensions, inline or not.

The simple solution, now that you have a compiler, is to build and
install a new ruby.

Sigh … I get the picture.

I guess that means I have to abandon all the fine work done by
Curt H. on the one-click installer and start from scratch.
I am not an ace with C makefiles etc. these days so I sense that
could be a tough road.

Would it be easier to track down the exact C compiler used by
Curt and install that instead?.

Thanks for your help,
– Mike B.

On Sep 15, 2006, at 11:47 AM, Joel VanderWerf wrote:

Tom A. wrote:

The “average” user might not care about InLine Ruby as much as you
do…
I have a lot more to learn before I need InLine and by then it
might be worth DIY to get there.

If an “average” developer uses a library that depends on
RubyInline, then it becomes very important that it be easy to
deploy ruby with RubyInline working out of the box.

RubyInline has the ability to create a gem that includes the built
library removing the need to install a compiler.


Eric H. - [email protected] - http://blog.segment7.net
This implementation is HODEL-HASH-9600 compliant

http://trackmap.robotcoop.com