Best tools for compiling Ruby (Windows)?

G

Glenn Smith

------=_Part_1895_1822748.1141424270957
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Hi

I'd like to figure out how I can download and compile the latest version of
Ruby on Windows. I know I can get Curt's one-click installer, but I'd quit=
e
like the ability to compile it for myself.

Question is, which is the best (free) compiler for the job? Visual C++ or
Borland? Or another?

I have tried to use the MS VC++ Toolkit 2003, with NMAKE 1.5 - both freely
downloadable from MS but as soon as I issue a win32\configure i686-mswin32
(from memory), NMAKE falls over immediately. Can't remember the error
off-hand but if it's important I can run it again.

Am I using the right version of tools? Should I really be using Borland?
(their CPP5.5 is also freely downloadable).






--

All the best
Glenn
Aylesbury, UK

------=_Part_1895_1822748.1141424270957--
 
A

Alex Combas

SGVsbG8sClRoaXMgc2hvdWxkIGhlbHAgZ2V0IHlvdSBzdGFydGVkLgpodHRwOi8vd3d3LnJ1Ynln
YXJkZW4ub3JnL3J1Ynk/SG93VG9CdWlsZE9uV2luZG93cwoKCi0tCkFsZXggQ29tYmFzCmh0dHA6
Ly9ub29kbGVqdW5raWUuYmxvZ3Nwb3QuY29tLwo=
 
C

Curt Hibbs

Hi

I'd like to figure out how I can download and compile the latest version = of
Ruby on Windows. I know I can get Curt's one-click installer, but I'd qu= ite
like the ability to compile it for myself.

Question is, which is the best (free) compiler for the job? Visual C++ o= r
Borland? Or another?

I have tried to use the MS VC++ Toolkit 2003, with NMAKE 1.5 - both freel= y
downloadable from MS but as soon as I issue a win32\configure i686-mswin3= 2
(from memory), NMAKE falls over immediately. Can't remember the error
off-hand but if it's important I can run it again.

Am I using the right version of tools? Should I really be using Borland?
(their CPP5.5 is also freely downloadable).

Don't use VC++ 2003. Austin Zeigler, and experienced Rubyist, has been
struggling to get Ruby to compile with VC++ 2003 and, as far as I
know, he has not yet succeeded.

You should have no problem with either VC++ 6.0 SP5, or VC++ 7.1 (aka
VS.NET 2001).

Curt
 
G

Glenn Smith

------=_Part_5499_27719484.1141478413891
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Thanks Gents - good info as ever.
G

n

Don't use VC++ 2003. Austin Zeigler, and experienced Rubyist, has been
struggling to get Ruby to compile with VC++ 2003 and, as far as I
know, he has not yet succeeded.

You should have no problem with either VC++ 6.0 SP5, or VC++ 7.1 (aka
VS.NET 2001).

Curt


--

All the best
Glenn
Aylesbury, UK

------=_Part_5499_27719484.1141478413891--
 
W

Wilson Bilkovich

Hi

I'd like to figure out how I can download and compile the latest version = of
Ruby on Windows. I know I can get Curt's one-click installer, but I'd qu= ite
like the ability to compile it for myself.

Question is, which is the best (free) compiler for the job? Visual C++ o= r
Borland? Or another?

I have tried to use the MS VC++ Toolkit 2003, with NMAKE 1.5 - both freel= y
downloadable from MS but as soon as I issue a win32\configure i686-mswin3= 2
(from memory), NMAKE falls over immediately. Can't remember the error
off-hand but if it's important I can run it again.

Am I using the right version of tools? Should I really be using Borland?
(their CPP5.5 is also freely downloadable).

VC++ 2003 works fine, it's 2005 that's a big change, and difficult to
make function properly.
If you install these three things, you should be able to compile
anything you want on Win32.
1. Visual C++ Toolkit 2003 (free)
2. MS Platform SDK 2003 (free, and you only need to install the
basics. Leave most things unchecked.)
3. MS .NET SDK 1.1 (not! 2.0)

That will give you a new version of NMAKE (don't use 1.5), along with
the compiler and the various headers and libraries you need.

Once you've downloaded and installed these, you'll need to configure
your environment variables. Here's what my vcvars32.bat file looks
like:
@echo off

Set PATH=3DC:\Program Files\Microsoft Visual C++ Toolkit
2003\bin;C:\Program Files\Microsoft Platform SDK\Bin;%PATH%
Set INCLUDE=3DC:\Program Files\Microsoft Visual C++ Toolkit
2003\include;C:\Program Files\Microsoft Platform
SDK\Include;C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include;%INCLUDE%
Set LIB=3DC:\Program Files\Microsoft Visual C++ Toolkit
2003\lib;C:\Program Files\Microsoft Platform SDK\Lib;C:\Program
Files\Microsoft Visual Studio .NET 2003\Vc7\lib;%LIB%

echo Setting Visual C++ environment variables.
echo You lose 1d6 sanity points.
echo.
 
G

Glenn Smith

------=_Part_8411_22777353.1141512377708
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

I have happily compiled it on my laptop using Visual Studio Enterprise
Edition (SP6). Unfortunately the RUDL package which I use for the odd game
I've written no longer works. Might try recompiling that from source too.

Also, I finally managed to get a good working Linux distro (Zenwalk)
installed (had all sorts of problems with many distros for some reason).
First thing I downloaded and compiled was... well, you know :eek:)




I forgot to mention that I was able to compile Ruby 1.8.2
One-click-installer using MS VC++ 2003 last year--sometime between
1.8.2-14 and 1.8.2-15.

These are the exact tools I used to compile:

MS VC++ 2003 Toolkit 1.01
http://msdn.microsoft.com/visualc/vctoolkit2003/

MS PSDK Feb 2003 (a newer version is available but I used this version)
http://www.microsoft.com/msdownload/platformsdk/sdkupdate/psdk-full.htm


--

All the best
Glenn
Aylesbury, UK

------=_Part_8411_22777353.1141512377708--
 
C

Curt Hibbs

My mistake -- Wilson is correct, it VC++ 2005 that you should avoid.

Sorry for any confusion,
Curt
 
K

Kaspar Schiess

Hello Glenn,
Question is, which is the best (free) compiler for the job? Visual
C++ or Borland? Or another?
I won't say mine's best, however all RMagick binary releases are compiled
using mingw and msys. I think they integrate posix/unix stuff nicely with
windows while guaranteeing binary compatibility with other windows builds.

Just thought I'd complete the thread with what works for me.

best regards,
kaspar
 
W

Wilson Bilkovich

After following the simple:
http://www.rubygarden.org/ruby?HowToBuildOnWindows

I compiled ruby (latest stable snapshot) fine on Windows2000.
If I do ruby -v I get "ruby 1.8.4 (2006-03-27) [i386-mingw32]", but if I
try and run a ruby script I get:

"no such file found -- urby gems (LoadError)"

I've tried relative and absolute paths.

Check your "RUBYOPT" environment variable, and clear it out if it has
something in it.
 
P

Peter Piper

I dont have an enviroment var called RUBYOPT, only the usual PATH and
TMP.

Can I check this enviroment var from the command line somehow or set it
to off?

Many thanks!
 
C

Curt Hibbs

I've done a little work with an extension compiled with VC++2003 and
ruby-1.8.4, One-Click. Am I just lucky that it works? Or is that known
to be OK?

You're lucky.

It all depends on what Windows APIs it uses in combination with other
Windows API calls outside of the extension. One known culprit is the
global variable ERRNO which is physically part of the runtime DLL --
and there is a different runtime DLL for each compiler version. So if
you extension calls an API that sets ERRNO, and another part of Ruby
checks the value of ERRNO, they will be using different memory
locations, with unpredictable results.

Curt
 
J

Joel VanderWerf

Curt said:
You're lucky.

It all depends on what Windows APIs it uses in combination with other
Windows API calls outside of the extension. One known culprit is the
global variable ERRNO which is physically part of the runtime DLL --
and there is a different runtime DLL for each compiler version. So if
you extension calls an API that sets ERRNO, and another part of Ruby
checks the value of ERRNO, they will be using different memory
locations, with unpredictable results.

Hm, any plans to migrate the One-Click Installer to VC++2003?
 
C

Curt Hibbs

...

The One-Click Installer for 1.8.2 was on VC++2003. However, because
the most common free compiler (mingw/msys) was not compatible with it
and any number of other reasons, 1.8.4 is now based on the Ruby 1.8.4
build built in Japan (I'm sorry; my mind is blanking on the name of
the site and the person behind it) which is built with VC6 -- and is
NO LONGER AVAILABLE to users.

That's one reason I'm working on 1.8.4 with VC++ 2005 in my
(completely nonexistent) free time so that people can get VC++ 2005
and *build* things on Windows quickly and easily.

At least once I've figured out how to do it. It's not as easy as it
might first appear, and the *official* version of zlib is never
compiled against anything but MSVCR6.DLL (e.g., VC6) so to have a
compatible zlib, you have to compile it yourself. It's a pain in the
ass.

Yeah, Austin got it right.The official Japanese build of ruby for
windows (ruby-mswin32) uses vc++6, and almost all available binaries
for various extensions are also built with vc++6.

When I moved to vc++7 for 1.8.2 it cause a lot of subtle problems.
Starting with 1.8.4 I'm actually using the ruby-mswin32 build as a
based and adding more extensions on top of it. The have got a number
of things right that I always had problems with (Tk/Tcl support,
iconv, readline, etc.). So it was also a relief to start with a base
where those pieces were already problem included.

Curt
 
C

Curt Hibbs

Yeah, Austin got it right.The official Japanese build of ruby for
windows (ruby-mswin32) uses vc++6, and almost all available binaries
for various extensions are also built with vc++6.

When I moved to vc++7 for 1.8.2 it cause a lot of subtle problems.
Starting with 1.8.4 I'm actually using the ruby-mswin32 build as a
based and adding more extensions on top of it. The have got a number
of things right that I always had problems with (Tk/Tcl support,
iconv, readline, etc.). So it was also a relief to start with a base
where those pieces were already problem included.

Curt

I need to start proof reading my responses before I hit "Send" -- I'm
embarrassed at the number of grammatical errors in my little post
above! :-(
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,138
Messages
2,570,803
Members
47,349
Latest member
jojonoy597

Latest Threads

Top