Best tools for compiling Ruby (Windows)?

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 quite
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

Hello,
This should help get you started.
http://www.rubygarden.org/ruby?HowToBuildOnWindows

···

--
Alex Combas
http://noodlejunkie.blogspot.com/

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

···

On 3/3/06, Glenn Smith <glenn.ruby@gmail.com> wrote:

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 quite
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).

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=C:\Program Files\Microsoft Visual C++ Toolkit
2003\bin;C:\Program Files\Microsoft Platform SDK\Bin;%PATH%
Set INCLUDE=C:\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=C:\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.

···

On 3/3/06, Glenn Smith <glenn.ruby@gmail.com> wrote:

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 quite
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).

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

···

--
software manufaktur - rubylab.newfoundedpower.com

Thanks Gents - good info as ever.
G

···

On 04/03/06, Curt Hibbs <ml.chibbs@gmail.com> wrote:

On 3/3/06, Glenn Smith <glenn.ruby@gmail.com> wrote:
> 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
quite
> 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).

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

Curt Hibbs wrote:

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

I think there is some confusion regarding VC++ versions and hope this
table is helpful:

VC++ 6.0 = IMHO, not very standards-compliant with C++ language
VC++ 2002 (7.0) = IMHO, buggy & beta-quality release
VC++ 2003 (7.1) = IMHO, very nice! freely downloadable as VC++ 2003
Toolkit 1.01
VC++ 2005 (8.0) = IMHO, bloated with new proprietary features

IMHO, VC++ 2003 is the best C++ compiler from Microsoft because it is
very standards-compliant and reliable compared to prior versions.

Microsoft VC++ Toolkit 2003 1.01 is freely downloadable and is the same
optimizing compiler as MS VC++ 2003 PROFESSIONAL. The compiler version
displayed by cl.exe is 13.10.3077. However, the lack of debug libraries
make it useful only for creating release builds (which is the same
quality as the very expensive optimizing compiler).

Is Austin running into problems compiling Ruby for debug build or
release build?

If Ruby builds with VC++ 6.0 but doesn't build with VC++ 2003 for
release build, then the Ruby code should be investigated.

But if Austin is building for debug, then he needs to obtain the debug
libraries which are not included with VC++ 2003 Toolkit. Note that VC++
2003 Standard has those missing debug libraries.

···

--
Posted via http://www.ruby-forum.com/\.

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.

···

--
Posted via http://www.ruby-forum.com/.

Actually, VC++ 8, not VC++ 2003. VS.NET 2003 is VC++ 7.1.

I have succeeded, but not in everything, and my free time over the
last three months has been approximately nil.

-austin

···

On 3/4/06, Curt Hibbs <ml.chibbs@gmail.com> wrote:

On 3/3/06, Glenn Smith <glenn.ruby@gmail.com> wrote:
> 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 quite
> 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).

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.

--
Austin Ziegler * halostatue@gmail.com
               * Alternate: austin@halostatue.ca

Note that mingw/msys builds are NOT compatible with VC++2003 or
VC++2005 builds because of a different runtime environment. At a
minimum, there is a mismatch between where errno is defined (somehow).

If you are using the One-Click Installer for 1.8.2, you will need to
compile extensions with VC++2003 (using MSVCR71.DLL); if you are using
the One-Click Installer for 1.8.4, you will be able to compile
extensions with VC6 or msys/mingw. You MUST NOT mix the versions or
bad things may happen to your Ruby programs.

-austin

···

On 3/18/06, Kaspar Schiess <eule@space.ch> wrote:

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.

--
Austin Ziegler * halostatue@gmail.com
               * Alternate: austin@halostatue.ca

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

···

--
Posted via http://www.ruby-forum.com/.

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

Sorry for any confusion,
Curt

···

On 3/4/06, Rich A. <usrlocalinfo@yahoo.com> wrote:

Curt Hibbs wrote:
> 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

I think there is some confusion regarding VC++ versions and hope this
table is helpful:

VC++ 6.0 = IMHO, not very standards-compliant with C++ language
VC++ 2002 (7.0) = IMHO, buggy & beta-quality release
VC++ 2003 (7.1) = IMHO, very nice! freely downloadable as VC++ 2003
Toolkit 1.01
VC++ 2005 (8.0) = IMHO, bloated with new proprietary features

IMHO, VC++ 2003 is the best C++ compiler from Microsoft because it is
very standards-compliant and reliable compared to prior versions.

Microsoft VC++ Toolkit 2003 1.01 is freely downloadable and is the same
optimizing compiler as MS VC++ 2003 PROFESSIONAL. The compiler version
displayed by cl.exe is 13.10.3077. However, the lack of debug libraries
make it useful only for creating release builds (which is the same
quality as the very expensive optimizing compiler).

Is Austin running into problems compiling Ruby for debug build or
release build?

If Ruby builds with VC++ 6.0 but doesn't build with VC++ 2003 for
release build, then the Ruby code should be investigated.

But if Austin is building for debug, then he needs to obtain the debug
libraries which are not included with VC++ 2003 Toolkit. Note that VC++
2003 Standard has those missing debug libraries.

--
Posted via http://www.ruby-forum.com/\.

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

···

On 3/28/06, Peter Piper <pete@nospam.com> wrote:

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.

Austin Ziegler wrote:

···

On 3/18/06, Kaspar Schiess <eule@space.ch> wrote:

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.

Note that mingw/msys builds are NOT compatible with VC++2003 or
VC++2005 builds because of a different runtime environment. At a
minimum, there is a mismatch between where errno is defined (somehow).

If you are using the One-Click Installer for 1.8.2, you will need to
compile extensions with VC++2003 (using MSVCR71.DLL); if you are using
the One-Click Installer for 1.8.4, you will be able to compile
extensions with VC6 or msys/mingw. You MUST NOT mix the versions or
bad things may happen to your Ruby programs.

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?

--
      vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407

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 :o)

···

On 04/03/06, Rich A. <usrlocalinfo@yahoo.com> wrote:

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

--
Posted via http://www.ruby-forum.com/\.

--

All the best
Glenn
Aylesbury, UK

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!

Wilson Bilkovich wrote:

···

On 3/28/06, Peter Piper <pete@nospam.com> wrote:

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

--
Posted via http://www.ruby-forum.com/\.

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

···

On 3/31/06, Joel VanderWerf <vjoel@path.berkeley.edu> wrote:

Austin Ziegler wrote:
> On 3/18/06, Kaspar Schiess <eule@space.ch> wrote:
>> 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.
>
> Note that mingw/msys builds are NOT compatible with VC++2003 or
> VC++2005 builds because of a different runtime environment. At a
> minimum, there is a mismatch between where errno is defined (somehow).
>
> If you are using the One-Click Installer for 1.8.2, you will need to
> compile extensions with VC++2003 (using MSVCR71.DLL); if you are using
> the One-Click Installer for 1.8.4, you will be able to compile
> extensions with VC6 or msys/mingw. You MUST NOT mix the versions or
> bad things may happen to your Ruby programs.

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?

Even so, doing RUBYOPT= on the command line cured the problem.

Peter Piper wrote:

···

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!

Wilson Bilkovich wrote:

On 3/28/06, Peter Piper <pete@nospam.com> wrote:

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

--
Posted via http://www.ruby-forum.com/\.

Curt Hibbs wrote:

···

On 3/31/06, Joel VanderWerf <vjoel@path.berkeley.edu> wrote:

Austin Ziegler wrote:

On 3/18/06, Kaspar Schiess <eule@space.ch> wrote:

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.

Note that mingw/msys builds are NOT compatible with VC++2003 or
VC++2005 builds because of a different runtime environment. At a
minimum, there is a mismatch between where errno is defined (somehow).

If you are using the One-Click Installer for 1.8.2, you will need to
compile extensions with VC++2003 (using MSVCR71.DLL); if you are using
the One-Click Installer for 1.8.4, you will be able to compile
extensions with VC6 or msys/mingw. You MUST NOT mix the versions or
bad things may happen to your Ruby programs.

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.

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

--
      vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407

...

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.

-austin

···

On 3/31/06, Joel VanderWerf <vjoel@path.berkeley.edu> wrote:

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

--
Austin Ziegler * halostatue@gmail.com
               * Alternate: austin@halostatue.ca