Cross compiling

Hi!

I’m cross compiling some ruby gems and projects for the Raspberry PI.
While using this line:

For example, while trying to install gitlab, when running this line
bundle install --without development test --deployment

It starts to compile lots of stuff, as the raspberry pi only have 256MB
it
ends up failing due to memory needed.

Is there a way to cross compile the bundle install?
(I already has the ruby cross compiled).

Thanks!
Alberich

Hello Again,
And sorry to insist, maybe it is a newbie-stupid question, but I
couldn’t
find information on how to cross-complie bundle installs.

Can anyone helpme please?

thanks!

Subject: Re: Cross compiling
Date: Tue 04 Dec 12 07:57:07PM +0900

Quoting Alberich de megres ([email protected]):

And sorry to insist, maybe it is a newbie-stupid question, but I couldn’t
find information on how to cross-complie bundle installs.

Can anyone helpme please?

I have no ready-made recipes. But I am certainl you will find tons of
documents on Rasp-related cross compiling in the Rasp-related
forums. If you solve the general cross-compile task, then it is
trivial to solve the Ruby-lib-specific cross-compile task. With most
of these extensions, you go the ext directory, run

ruby extconf.rb

and then run make.

If you do that while applying the steps you will have learned when
solving the general cross-compile task, the resulting .so file will be
ready to be copied to the appropriate directories on the Rasp.

I hope you will post a howto to the list, once you have completed your
task.

Carlo

Hi Carlo,

I’m using gem and bundle to install software. And is at this point where
I’m lost.
There’s no extension directory and no extconf.rb file.

I could identify a Rakefile, and a Gemfile.
Tried setting up somethin like:
export CC=arm-linux-gcc, and so
export PATH=/path/to/cross-compiled/ruby/bin:$PATH
then gem install

But i’m getting something:
/dest/bin/gem: line 8: require: command not found
/dest/bin/gem: line 9: require: command not found
/dest/bin/gem: line 10: require: command not found
dest/bin/gem: line 12: required_version: command not found
[…]

I think I’m loosing something… can you help me please?

thanks!

On Dec 5, 2012, at 03:03 , Alberich de megres [email protected]
wrote:

But i’m getting something:
/dest/bin/gem: line 8: require: command not found
/dest/bin/gem: line 9: require: command not found
/dest/bin/gem: line 10: require: command not found
dest/bin/gem: line 12: required_version: command not found
[…]

that looks like it is being run by bash, not ruby.

Subject: Re: Cross compiling
Date: Wed 05 Dec 12 08:03:00PM +0900

Quoting Alberich de megres ([email protected]):

I’m using gem and bundle to install software. And is at this point where
I’m lost.
There’s no extension directory and no extconf.rb file.

I could identify a Rakefile, and a Gemfile.

where you find a rakefile (provided you downloaded the gem and
extracted the data) you should also find a directory called ‘ext’. The
C extensions are almost always cleanly contained inside there,
(together with the extconf.rb file I mentioend earlier).

Sorry I do not use gems, nor rake… I really do not like the whole
concept of gems.

Carlo

On Dec 6, 2012, at 13:52 , Alberich de megres [email protected]
wrote:

I though I should run gem from bash. How should I run it?

You’re not running gem FROM bash… you’re running it WITH bash.
Something is terribly wrong. Probably the shebang line of the gem file
itself?

Hi Ryan,

yes, I run:
$ gem install …

I’m trying to crosscompile gitlab:

The install instructions are here:
https://github.com/gitlabhq/gitlabhq/blob/stable/doc/install/installation.md

I though I should run gem from bash. How should I run it?

My goal is to cross compile gems, not to compile them on the target
system. Is there any alternative?

thanks!

I think I understand now.
But my main problem is still how to cross-compile bundle install. The
bundle will download extensions and compile them, so i’m not sure how to
tell the bundle to use the cross-compiler toolchain. How could I do it?

Thanks!!

Hello again,

Sorry to insist,
I’m really interested on this, but don’t know how to go on. I couldn’t
find
info about howto cross-compile the “bundle install …” for arm. Iis not
the arm side which I’m interested on, is on how to tell the bundle
install
to use the cross-compiler.

thanks