FFI Gem on Win32

S

Simon Smith

Hi,

I need to install the 0.2.0 FFI gem for MRI on a win32 system. I have
thus far been unable to get it to compile. The issue is with nmake:

Code:
C:/atb/ruby/bin/ruby.exe extconf.rb install ffi-0.2.0.gem
checking for ffi_closure_alloc() in ffi.lib... no
creating Makefile
creating extconf.h

nmake

Microsoft (R) Program Maintenance Utility Version 8.00.50727.42
Copyright (C) Microsoft Corporation.  All rights reserved.

makefile(181) : fatal error U1052: file '$(srcdir)/ffi.mk' not found
Stop.


Gem files will remain installed in
C:/atb/ruby/lib/ruby/gems/1.8/gems/ffi-0.2.0
for inspection.
Results logged to
C:/atb/ruby/lib/ruby/gems/1.8/gems/ffi-0.2.0/ext/gem_make.out

I have found various posts on the net complaining of the same problem
but no actual solution to it. Could somebody please provide me with
instructions on how to install this on win32 or where I can get a
precompiled win32 gem?

Thanks in advance for your help.

P.S. I will also eventually need to install the same version on Jruby
too.
 
W

Wayne Meissner

2008/12/13 Simon Smith said:
Hi,

I need to install the 0.2.0 FFI gem for MRI on a win32 system. I have
thus far been unable to get it to compile. The issue is with nmake:

makefile(181) : fatal error U1052: file '$(srcdir)/ffi.mk' not found
Stop.

Unfortunately, thats just the start of the fun on windows. There are
a few code changes needed to support windows as well.

I have ported the latest FFI code to windows, but building it is a bit
involved - you need msys+mingw, you need to build ruby from source
(matching the one-click version) using mingw, and then build the FFI
gem using that new ruby install.

Hopefully, there will be binary gems available for ruby-ffi 0.3.0
P.S. I will also eventually need to install the same version on Jruby
too.

JRuby already contains FFI - no need to install anything more, and is
possibly the least painful way of using it on windows.
 
D

Daniel Berger

Wayne said:
Unfortunately, thats just the start of the fun on windows. There are
a few code changes needed to support windows as well.

I have ported the latest FFI code to windows, but building it is a bit
involved - you need msys+mingw, you need to build ruby from source
(matching the one-click version) using mingw, and then build the FFI
gem using that new ruby install.

No hope for people who want to build it via VC++ ?

Regards,

Dan
 
W

Wayne Meissner

2008/12/13 Daniel Berger said:
Wayne Meissner wrote:

No hope for people who want to build it via VC++ ?

Sure there is, if someone else wants to go to the effort of porting
the code. I 'm not going to do it myself though, since the mingw
builds work fine. With binary releases for 0.3.0, the issue of what
compiler is used is a moot point for most people.
 
S

Simon Smith

Unfortunately rebuilding ruby itself from source wont be an option due
to the amount of testing that will be needed.

I will just try to complete my FFI port under jruby for now. Do you know
when ffi 0.3.0 with the binary gems will be available?
 
R

Roger Pack

I have ported the latest FFI code to windows, but building it is a bit
involved - you need msys+mingw, you need to build ruby from source
(matching the one-click version) using mingw, and then build the FFI
gem using that new ruby install.

As a note you can download mingw ruby from [1] or install your own from
Luis Lavena's installer trivially [2].
It might build straight at that point.
Cheers!
-=r



[1]
http://www.akitaonrails.com/2008/7/26/still-playing-with-ruby-on-windows
[2] http://github.com/luislavena/rubyinstaller/tree/master
 
S

Simon Smith

Hi,

Thanks for your help so far, much appreciated, this looks like it almost
works now but I am having trouble installing the link though.

Code:
C:\Code\jruby\Installs\luislavena-rubyinstaller>rake install
(in C:/Code/jruby/Installs/luislavena-rubyinstaller)
"C:/Code/jruby/Installs/luislavena-rubyinstaller/sandbox/msys/bin/bash.exe"
--lo
gin -i -c "make install"
/miniruby.exe  ../ruby_1_8/instruby.rb --dest-dir="" --extout=".ext"
--make="ma
ke" --mflags="- --unix" --make-flags=" --unix" --installed-list
installed.list
--mantype="man"
installing binary commands
installing command scripts
installing library scripts
installing headers
installing manpages
installing extension objects
installing extension scripts
ruby setup.rb install --no-ri --no-rdoc
--destdir=C:/Code/jruby/Installs/luislav
ena-rubyinstaller/sandbox/rubygems_mingw
mkdir -p
C:/Code/jruby/Installs/luislavena-rubyinstaller/sandbox/rubygems_mingw/
C:/Code/jruby/Installs/luislavena-rubyinstaller/sandbox/ruby_mingw/lib/ruby/site
_ruby/1.8
C:/Code/jruby/Installs/luislavena-rubyinstaller/sandbox/ruby_mingw/lib/ruby/1.8/
fileutils.rb:243:in `mkdir': Invalid argument -
C:/Code/jruby/Installs/luislaven
a-rubyinstaller/sandbox/rubygems_mingw/C: (Errno::EINVAL)
from
C:/Code/jruby/Installs/luislavena-rubyinstaller/sandbox/ruby_mingw/
lib/ruby/1.8/fileutils.rb:243:in `fu_mkdir'
from
C:/Code/jruby/Installs/luislavena-rubyinstaller/sandbox/ruby_mingw/
lib/ruby/1.8/fileutils.rb:217:in `mkdir_p'
from
C:/Code/jruby/Installs/luislavena-rubyinstaller/sandbox/ruby_mingw/
lib/ruby/1.8/fileutils.rb:215:in `reverse_each'
from
C:/Code/jruby/Installs/luislavena-rubyinstaller/sandbox/ruby_mingw/
lib/ruby/1.8/fileutils.rb:215:in `mkdir_p'
from
C:/Code/jruby/Installs/luislavena-rubyinstaller/sandbox/ruby_mingw/
lib/ruby/1.8/fileutils.rb:201:in `each'
from
C:/Code/jruby/Installs/luislavena-rubyinstaller/sandbox/ruby_mingw/
lib/ruby/1.8/fileutils.rb:201:in `mkdir_p'
from
C:/Code/jruby/Installs/luislavena-rubyinstaller/sandbox/ruby_mingw/
lib/ruby/1.8/fileutils.rb:1527:in `mkdir_p'
from setup.rb:141
rake aborted!
Command failed with status (1): [ruby setup.rb install --no-ri --no-rdoc
--...]

(See full trace by running task with --trace)

Do you know if I am missing a command somewhere. It seems like the whole
process unzips and builds fine it is just falling over in the final
stages when installing the files.

The folder
"C:/Code/jruby/Installs/luislavena-rubyinstaller/sandbox/rubygems_mingw"
already exists, but I think the C: part on the end is an issue.
 
L

Luis Lavena

Hi,

Thanks for your help so far, much appreciated, this looks like it almost
works now but I am having trouble installing the link though.

Code:
C:\Code\jruby\Installs\luislavena-rubyinstaller>rake install
(in C:/Code/jruby/Installs/luislavena-rubyinstaller)
"C:/Code/jruby/Installs/luislavena-rubyinstaller/sandbox/msys/bin/bash.exe"
--lo
gin -i -c "make install"
/miniruby.exe  ../ruby_1_8/instruby.rb --dest-dir="" --extout=".ext"
--make="ma
ke" --mflags="- --unix" --make-flags=" --unix" --installed-list
installed.list
--mantype="man"
installing binary commands
installing command scripts
installing library scripts
installing headers
installing manpages
installing extension objects
installing extension scripts
ruby setup.rb install --no-ri --no-rdoc
--destdir=C:/Code/jruby/Installs/luislav
ena-rubyinstaller/sandbox/rubygems_mingw
mkdir -p
C:/Code/jruby/Installs/luislavena-rubyinstaller/sandbox/rubygems_mingw/
C:/Code/jruby/Installs/luislavena-rubyinstaller/sandbox/ruby_mingw/lib/ruby/site
_ruby/1.8
C:/Code/jruby/Installs/luislavena-rubyinstaller/sandbox/ruby_mingw/lib/ruby/1.8/
fileutils.rb:243:in `mkdir': Invalid argument -
C:/Code/jruby/Installs/luislaven
a-rubyinstaller/sandbox/rubygems_mingw/C: (Errno::EINVAL)
        from
C:/Code/jruby/Installs/luislavena-rubyinstaller/sandbox/ruby_mingw/
lib/ruby/1.8/fileutils.rb:243:in `fu_mkdir'
        from
C:/Code/jruby/Installs/luislavena-rubyinstaller/sandbox/ruby_mingw/
lib/ruby/1.8/fileutils.rb:217:in `mkdir_p'
        from
C:/Code/jruby/Installs/luislavena-rubyinstaller/sandbox/ruby_mingw/
lib/ruby/1.8/fileutils.rb:215:in `reverse_each'
        from
C:/Code/jruby/Installs/luislavena-rubyinstaller/sandbox/ruby_mingw/
lib/ruby/1.8/fileutils.rb:215:in `mkdir_p'
        from
C:/Code/jruby/Installs/luislavena-rubyinstaller/sandbox/ruby_mingw/
lib/ruby/1.8/fileutils.rb:201:in `each'
        from
C:/Code/jruby/Installs/luislavena-rubyinstaller/sandbox/ruby_mingw/
lib/ruby/1.8/fileutils.rb:201:in `mkdir_p'
        from
C:/Code/jruby/Installs/luislavena-rubyinstaller/sandbox/ruby_mingw/
lib/ruby/1.8/fileutils.rb:1527:in `mkdir_p'
        from setup.rb:141
rake aborted!
Command failed with status (1): [ruby setup.rb install --no-ri --no-rdoc
--...]

(See full trace by running task with --trace)

Do you know if I am missing a command somewhere. It seems like the whole
process unzips and builds fine it is just falling over in the final
stages when installing the files.

The folder
"C:/Code/jruby/Installs/luislavena-rubyinstaller/sandbox/rubygems_mingw"
already exists, but I think the C: part on the end is an issue.

Is a bug in rubygems and the recipes need to be updated for 1.3.1 to
fix it.

I think I have those fixes locally and need to push to github, need to
verify.

Sorry for the problems,
 
L

Luis Lavena

Cheers, please let me know when/where I can download it from when it is
ready.

I've updated the recipes last night, you can "git pull" to get the
updated source and then execute it again.

In any case, you have sandbox/ruby_mingw built and ready for use. Now
you can take sandbox/mingw and sandbox/msys as build tools for compile
anything for this Ruby.

I believe I've described how to use this previously, but don't have
the links handy.

Regards,
 
R

Roger Pack

C:/Code/jruby/Installs/luislavena-rubyinstaller/sandbox/ruby_mingw/lib/ruby/1.8/
fileutils.rb:243:in `mkdir': Invalid argument -
C:/Code/jruby/Installs/luislaven
a-rubyinstaller/sandbox/rubygems_mingw/C: (Errno::EINVAL)
from
C:/Code/jruby/Installs/luislavena-rubyinstaller/sandbox/ruby_mingw/
lib/ruby/1.8/fileutils.rb:243:in `fu_mkdir'

Yeah doing rake CHECKOUT=1 helped me overcome that once
-=r
 

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

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,821
Latest member
AleidaSchi

Latest Threads

Top