[ANN] multi-platform CMake build prototype for mruby

58 views
Skip to first unread message

Jon

unread,
May 9, 2012, 5:11:27 PM5/9/12
to rubyin...@googlegroups.com
You've likely heard about mruby (an Ruby targeted for embedded use) and may even have toyed with building it yourself using one of our DevKit's.

But I believe mruby needs a more flexible and maintainable build infrastructure that enables developers using different platforms to quickly start playing with the code rather than tweaking Makefiles. One way to do that is to that is to leverage the multi-platform CMake build infrastructure rather than static Makefiles.

With some help from a couple of other interested souls, I've hacked up a CMake prototype for mruby.

  http://jonforums.github.com/ruby/2012/05/09/cmake-prototype-for-mruby.html

If you're experienced with CMake or at all interested in trying to make this happen, I'd love to hear from you.

Jon


p.s. - even though the CMake creates Makefiles usable by `nmake` from the Windows SDK, the build currently fails...best to use a DevKit for the moment.

Jon

unread,
May 18, 2012, 1:42:07 PM5/18/12
to rubyin...@googlegroups.com
You've likely heard about mruby (an Ruby targeted for embedded use) and may even have toyed with building it yourself using one of our DevKit's.

But I believe mruby needs a more flexible and maintainable build infrastructure that enables developers using different platforms to quickly start playing with the code rather than tweaking Makefiles. One way to do that is to that is to leverage the multi-platform CMake build infrastructure rather than static Makefiles.

With some help from a couple of other interested souls, I've hacked up a CMake prototype for mruby.

  http://jonforums.github.com/ruby/2012/05/09/cmake-prototype-for-mruby.html



mruby now builds on Windows using our DevKit, or nmake makefiles, or Visual Studio 10 IDE (and probably others) thanks to the cmake prototype.

I'm looking for a few adventurous souls to hammer on the cmake proto in preparation for submitting a pull request to the official mruby repo.


Info to get started at


Thanks!

Jon

---
Fail fast. Fail often. Fail publicly. Learn. Adapt. Repeat.
twitter: @jonforums

Jon

unread,
May 18, 2012, 2:10:25 PM5/18/12
to rubyin...@googlegroups.com


On Friday, May 18, 2012 1:42:07 PM UTC-4, Jon wrote:
You've likely heard about mruby (an Ruby targeted for embedded use) and may even have toyed with building it yourself using one of our DevKit's.

But I believe mruby needs a more flexible and maintainable build infrastructure that enables developers using different platforms to quickly start playing with the code rather than tweaking Makefiles. One way to do that is to that is to leverage the multi-platform CMake build infrastructure rather than static Makefiles.

With some help from a couple of other interested souls, I've hacked up a CMake prototype for mruby.

  http://jonforums.github.com/ruby/2012/05/09/cmake-prototype-for-mruby.html



mruby now builds on Windows using our DevKit, or nmake makefiles, or Visual Studio 10 IDE (and probably others) thanks to the cmake prototype.

I'm looking for a few adventurous souls to hammer on the cmake proto in preparation for submitting a pull request to the official mruby repo.


Info to get started at



instead of a double link, the cross compiling post link should have been http://jonforums.github.com/ruby/2012/05/13/cross-compiling-mruby.html

Luis Lavena

unread,
May 19, 2012, 10:21:09 AM5/19/12
to rubyin...@googlegroups.com
On Fri, May 18, 2012 at 2:42 PM, Jon <jon.f...@gmail.com> wrote:
>> You've likely heard about mruby (an Ruby targeted for embedded use) and
>> may even have toyed with building it yourself using one of our DevKit's.
>>
>> But I believe mruby needs a more flexible and maintainable build
>> infrastructure that enables developers using different platforms to quickly
>> start playing with the code rather than tweaking Makefiles. One way to do
>> that is to that is to leverage the multi-platform CMake build infrastructure
>> rather than static Makefiles.
>>
>> With some help from a couple of other interested souls, I've hacked up a
>> CMake prototype for mruby.
>>
>>
>> http://jonforums.github.com/ruby/2012/05/09/cmake-prototype-for-mruby.html
>>
>
>
> mruby now builds on Windows using our DevKit, or nmake makefiles, or Visual
> Studio 10 IDE (and probably others) thanks to the cmake prototype.
>
> I'm looking for a few adventurous souls to hammer on the cmake proto in
> preparation for submitting a pull request to the official mruby repo.
>
>   https://github.com/mruby/mruby/issues/81#issuecomment-5791331
>
> Info to get started at
>
>   http://jonforums.github.com/ruby/2012/05/09/cmake-prototype-for-mruby.html
>   http://jonforums.github.com/ruby/2012/05/09/cmake-prototype-for-mruby.html
>
> Thanks!
>

Nice stuff Jon!

I just tested cmake from inside build directory and failed:

https://gist.github.com/2730963

Tried from the root of the repository without success.

Platform: OSX (Snow Leopard), GCC 4.6.3 (MacPorts)

Cheers,
--
Luis Lavena
AREA 17
-
Perfection in design is achieved not when there is nothing more to add,
but rather when there is nothing more to take away.
Antoine de Saint-Exupéry

Jon

unread,
May 19, 2012, 1:34:58 PM5/19/12
to rubyin...@googlegroups.com
 
> mruby now builds on Windows using our DevKit, or nmake makefiles, or Visual
> Studio 10 IDE (and probably others) thanks to the cmake prototype.
>
> I'm looking for a few adventurous souls to hammer on the cmake proto in
> preparation for submitting a pull request to the official mruby repo.
>
>   https://github.com/mruby/mruby/issues/81#issuecomment-5791331
>
> Info to get started at
>
>   http://jonforums.github.com/ruby/2012/05/09/cmake-prototype-for-mruby.html
>   http://jonforums.github.com/ruby/2012/05/09/cmake-prototype-for-mruby.html
>  
>

Nice stuff Jon!

I just tested cmake from inside build directory and failed:

https://gist.github.com/2730963

Tried from the root of the repository without success.

Platform: OSX (Snow Leopard), GCC 4.6.3 (MacPorts)


Thanks for testing on OSX Luis, that looks spectacularly broken ;)

I'm only aware of one other person who's testing on OSX, and it appears to work fine for him on Lion 10.7 https://github.com/thecodeshop/mruby/wiki/CMake-compatible

Even though I don't have a Mac, I suspect/hope it may be a CMake version issue since OBJECT was added in 2.8.8, and an early version of my `jonforums-mods/cmake` branch allowed 2.6.

Please grab a fresh copy of my branch and try again. If it still fails, please add `cmake --version` and the cmake config results to the following issue after running something like `cmake ..` from the `build` subdir.


 FYI, I purposely prevent in-tree builds so try from the `build` subdir or another dir. Also, if you tried running cmake from the repo root, clean out any cmake artifacts as this may be confusing cmake. I've got a TODO to figure out how to prevent cmake from polluting a dir it knows it can't build from https://github.com/thecodeshop/mruby/blob/jonforums-mods/cmake/CMakeLists.txt#L33-34

Thanks!

Jon

Jon

unread,
May 19, 2012, 8:01:22 PM5/19/12
to rubyin...@googlegroups.com
still broken?

Luis Lavena

unread,
May 19, 2012, 8:07:32 PM5/19/12
to rubyin...@googlegroups.com
On Sat, May 19, 2012 at 9:01 PM, Jon <jon.f...@gmail.com> wrote:
>
> [...]
>
> still broken?
>

Didn't had time to check again. Will do on monday.

Jon

unread,
May 20, 2012, 9:39:02 PM5/20/12
to rubyin...@googlegroups.com
On Sat, May 19, 2012 at 9:01 PM, Jon <jon.f...@gmail.com> wrote:
>
> [...]
>
> still broken?
>

Didn't had time to check again. Will do on monday.


I can repro on Win7 32bit using CMake 2.8.6 https://github.com/thecodeshop/mruby/issues/22#issuecomment-5814110

Try updating to latest of


and see if it works. Please close the GH issue if it does.

Thanks.

Jon

Luis Lavena

unread,
May 21, 2012, 10:02:51 AM5/21/12
to rubyin...@googlegroups.com
On Sun, May 20, 2012 at 10:39 PM, Jon <jon.f...@gmail.com> wrote:
>
> I can repro on Win7 32bit using CMake
> 2.8.6 https://github.com/thecodeshop/mruby/issues/22#issuecomment-5814110
>
> Try updating to latest of
>
>   https://trac.macports.org/browser/trunk/dports/devel/cmake/Portfile
>   https://github.com/thecodeshop/mruby/tree/jonforums-mods/cmake
>

Works like a charm, thank you.

> and see if it works. Please close the GH issue if it does.
>

Closed!

Awesome work Jon and TheCodeShop team!

Jon

unread,
May 21, 2012, 1:07:36 PM5/21/12
to rubyin...@googlegroups.com
On Sun, May 20, 2012 at 10:39 PM, Jon <jon.f...@gmail.com> wrote:
>
> I can repro on Win7 32bit using CMake
> 2.8.6 https://github.com/thecodeshop/mruby/issues/22#issuecomment-5814110
>
> Try updating to latest of
>
>   https://trac.macports.org/browser/trunk/dports/devel/cmake/Portfile
>   https://github.com/thecodeshop/mruby/tree/jonforums-mods/cmake
>

Works like a charm, thank you.

> and see if it works. Please close the GH issue if it does.
>

Closed!

Awesome work Jon and TheCodeShop team!

Yeh!

I guessed that your SL system is `Mac OS X Snow Leopard 10.6 64bit (2012-05-21)` and added it to the "CMake Compatible" page at https://github.com/thecodeshop/mruby/wiki/CMake-compatible

If I guessed wrong, please update.

Thanks again for testing!

Jon

Jon

unread,
May 22, 2012, 2:21:53 PM5/22/12
to rubyin...@googlegroups.com
CMake multi-platform build support for mruby just landed in the main mruby repo:  https://github.com/mruby/mruby/pull/182

For Windows hackers, this means you can build mruby using your favorite Windows toolchain.

 * DevKit or other MSYS/MinGW?  Yes
 * Visual Studio 8/9/10/11 IDE? Yes
 * NMake + Windows SDK command line? Yes
 * MinGW only? Yes
 * MSBuild command line? Yes

and other's. Download CMake 2.8.8+ [1] and type `cmake --help` to see what other build generators are supported.

Take mruby out for a spin. Hack it into your favorite Windows (or other) project and see where it takes you :)

Jon

Reply all
Reply to author
Forward
0 new messages