Forum: Ruby Best tools for compiling Ruby (Windows)?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
80500a30fa7d7387d497408f5a4d91d3?d=identicon&s=25 Glenn Smith (Guest)
on 2006-03-03 23:19
(Received via mailing list)
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
622fa8560c82dfaa59c91ec75efb0c19?d=identicon&s=25 Alex Combas (Guest)
on 2006-03-04 05:52
(Received via mailing list)
Hello,
This should help get you started.
http://www.rubygarden.org/ruby?HowToBuildOnWindows
C475cffda1800fbc3f3af17bc10c220f?d=identicon&s=25 Curt Hibbs (Guest)
on 2006-03-04 07:22
(Received via mailing list)
On 3/3/06, Glenn Smith <glenn.ruby@gmail.com> wrote:
> 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
80500a30fa7d7387d497408f5a4d91d3?d=identicon&s=25 Glenn Smith (Guest)
on 2006-03-04 14:22
(Received via mailing list)
Thanks Gents - good info as ever.
G

On 04/03/06, Curt Hibbs <ml.chibbs@gmail.com> wrote:
> > Question is, which is the best (free) compiler for the job?  Visual C++
> > Am I using the right version of tools?  Should I really be using
> Curt
>
>


--

All the best
Glenn
Aylesbury, UK
25e11a00a89683f7e01e425a1a6e305c?d=identicon&s=25 Wilson Bilkovich (Guest)
on 2006-03-04 20:40
(Received via mailing list)
On 3/3/06, Glenn Smith <glenn.ruby@gmail.com> wrote:
> 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.
49abfc4f262687476f9ca0e16f0e131e?d=identicon&s=25 Rich A. (usrlocal)
on 2006-03-04 22:54
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.
49abfc4f262687476f9ca0e16f0e131e?d=identicon&s=25 Rich A. (usrlocal)
on 2006-03-04 23:05
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/sd...
80500a30fa7d7387d497408f5a4d91d3?d=identicon&s=25 Glenn Smith (Guest)
on 2006-03-04 23:48
(Received via mailing list)
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:
> MS PSDK Feb 2003 (a newer version is available but I used this version)
> http://www.microsoft.com/msdownload/platformsdk/sd...
>
>
> --
> Posted via http://www.ruby-forum.com/.
>
>


--

All the best
Glenn
Aylesbury, UK
C475cffda1800fbc3f3af17bc10c220f?d=identicon&s=25 Curt Hibbs (Guest)
on 2006-03-05 12:18
(Received via mailing list)
My mistake -- Wilson  is correct, it VC++ 2005 that you should avoid.

Sorry for any confusion,
Curt
6e32b16ec35070a346dd4e08799589e5?d=identicon&s=25 Kaspar Schiess (kaspar)
on 2006-03-18 17:56
(Received via mailing list)
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
Cec8a9c67f25ebbaa7a802a16a409828?d=identicon&s=25 Peter Piper (Guest)
on 2006-03-28 19:49
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.
25e11a00a89683f7e01e425a1a6e305c?d=identicon&s=25 Wilson Bilkovich (Guest)
on 2006-03-28 20:04
(Received via mailing list)
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.
Cec8a9c67f25ebbaa7a802a16a409828?d=identicon&s=25 Peter Piper (Guest)
on 2006-03-28 20:54
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.
Cec8a9c67f25ebbaa7a802a16a409828?d=identicon&s=25 Peter Piper (Guest)
on 2006-03-28 21:01
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.
31ab75f7ddda241830659630746cdd3a?d=identicon&s=25 Austin Ziegler (Guest)
on 2006-03-31 22:39
(Received via mailing list)
On 3/4/06, Curt Hibbs <ml.chibbs@gmail.com> wrote:
> > 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.

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
31ab75f7ddda241830659630746cdd3a?d=identicon&s=25 Austin Ziegler (Guest)
on 2006-03-31 22:42
(Received via mailing list)
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.

-austin
47b1910084592eb77a032bc7d8d1a84e?d=identicon&s=25 Joel VanderWerf (Guest)
on 2006-04-01 00:14
(Received via mailing list)
Austin Ziegler wrote:
>
> 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?
C475cffda1800fbc3f3af17bc10c220f?d=identicon&s=25 Curt Hibbs (Guest)
on 2006-04-01 00:20
(Received via mailing list)
On 3/31/06, Joel VanderWerf <vjoel@path.berkeley.edu> wrote:
> >> Just thought I'd complete the thread with what works for me.
>
> 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
47b1910084592eb77a032bc7d8d1a84e?d=identicon&s=25 Joel VanderWerf (Guest)
on 2006-04-01 00:30
(Received via mailing list)
Curt Hibbs wrote:
>>>>
>> I've done a little work with an extension compiled with VC++2003 and
> 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?
31ab75f7ddda241830659630746cdd3a?d=identicon&s=25 Austin Ziegler (Guest)
on 2006-04-01 00:45
(Received via mailing list)
On 3/31/06, Joel VanderWerf <vjoel@path.berkeley.edu> wrote:
> Hm, any plans to migrate the One-Click Installer to VC++2003?

...

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
C475cffda1800fbc3f3af17bc10c220f?d=identicon&s=25 Curt Hibbs (Guest)
on 2006-04-01 02:10
(Received via mailing list)
On 3/31/06, Austin Ziegler <halostatue@gmail.com> wrote:
> 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
C475cffda1800fbc3f3af17bc10c220f?d=identicon&s=25 Curt Hibbs (Guest)
on 2006-04-01 08:59
(Received via mailing list)
On 3/31/06, Curt Hibbs <ml.chibbs@gmail.com> wrote:
> > the site and the person behind it) which is built with VC6 -- and is
> > ass.
> 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!  :-(
This topic is locked and can not be replied to.