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!

···

On Mon, Dec 3, 2012 at 7:59 PM, Alberich de megres <alberich2k5@gmail.com>wrote:

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

Quoting Alberich de megres (alberich2k5@gmail.com):

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

···

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

--
  * Se la Strada e la sua Virtu' non fossero state messe da parte,
* K * Carlo E. Prelz - fluido@fluido.as che bisogno ci sarebbe
  * di parlare tanto di amore e di rettitudine? (Chuang-Tzu)

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 Tue, Dec 4, 2012 at 12:08 PM, Carlo E. Prelz <fluido@fluido.as> wrote:

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

Quoting Alberich de megres (alberich2k5@gmail.com):

> 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

--
  * Se la Strada e la sua Virtu' non fossero state messe da parte,
* K * Carlo E. Prelz - fluido@fluido.as che bisogno ci sarebbe
  * di parlare tanto di amore e di rettitudine? (Chuang-Tzu)

Quoting Alberich de megres (alberich2k5@gmail.com):

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

···

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

--
  * Se la Strada e la sua Virtu' non fossero state messe da parte,
* K * Carlo E. Prelz - fluido@fluido.as che bisogno ci sarebbe
  * di parlare tanto di amore e di rettitudine? (Chuang-Tzu)

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

···

On Dec 5, 2012, at 03:03 , Alberich de megres <alberich2k5@gmail.com> wrote:

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
[...]

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!

···

On Wed, Dec 5, 2012 at 9:18 PM, Ryan Davis <ryand-ruby@zenspider.com> wrote:

On Dec 5, 2012, at 03:03 , Alberich de megres <alberich2k5@gmail.com> > wrote:

> 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
> [...]

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

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?

···

On Dec 6, 2012, at 13:52 , Alberich de megres <alberich2k5@gmail.com> wrote:

Hi Ryan,

yes, I run:
$ gem install ...

I'm trying to crosscompile gitlab:
GitHub - gitlabhq/gitlabhq: GitLab CE Mirror | Please open new issues in our issue tracker on GitLab.com

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?

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

···

On Thu, Dec 6, 2012 at 11:53 PM, Ryan Davis <ryand-ruby@zenspider.com>wrote:

On Dec 6, 2012, at 13:52 , Alberich de megres <alberich2k5@gmail.com> > wrote:

> Hi Ryan,
>
> yes, I run:
> $ gem install ...
>
> I'm trying to crosscompile gitlab:
> GitHub - gitlabhq/gitlabhq: GitLab CE Mirror | Please open new issues in our issue tracker on GitLab.com
>
> 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?

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?

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

···

On Fri, Dec 7, 2012 at 9:55 AM, Alberich de megres <alberich2k5@gmail.com>wrote:

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

On Thu, Dec 6, 2012 at 11:53 PM, Ryan Davis <ryand-ruby@zenspider.com>wrote:

On Dec 6, 2012, at 13:52 , Alberich de megres <alberich2k5@gmail.com> >> wrote:

> Hi Ryan,
>
> yes, I run:
> $ gem install ...
>
> I'm trying to crosscompile gitlab:
> GitHub - gitlabhq/gitlabhq: GitLab CE Mirror | Please open new issues in our issue tracker on GitLab.com
>
> 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?

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?