• Login
sketchucation logo sketchucation
  • Login
πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

Need Help Compiling Gem for 32 bit Mac OS X

Scheduled Pinned Locked Moved Developers' Forum
14 Posts 5 Posters 1.1k Views 5 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    Anton_S
    last edited by 25 Aug 2014, 08:46

    Thanks for the heads up, TT, I will install 10.5.8 Leopard. According to online search people experienced errors when they upgraded to Snow Leopard (10.6.x) or later. I assume it will work properly on Leopard (10.5.x).

    1 Reply Last reply Reply Quote 0
    • S Offline
      slbaumgartner
      last edited by 25 Aug 2014, 12:52

      After much hair-pulling and tweaking by hand, I got a GEM to compile under Mavericks and SU 2014. It was such an ad-hoc mess that I don't recommend trying it!

      Unfortunately, the Ruby installed by SU is not configured correctly to enable compiling a GEM. Among the many issues I wrestled with: the build script for that particular GEM assumed there was a ruby interpreter available at the path set up by SU - which there is not, only the framework library; the mkmf system determinedly generated makefiles for the native architecture (64-bit) and the system-installed Ruby - which led to all sorts of clashes; some libraries and features that are normally part of the Ruby distribution were suppressed by Trimble after finding they caused bugsplats in SU.

      This is a shame, because one of the supposed advantages of a GEM is that you don't have to be an expert code developer to build and install it. However, after what I went through I can sympathize with Trimble and TT: fixing it is way harder than it sounds!

      1 Reply Last reply Reply Quote 0
      • D Offline
        driven
        last edited by 25 Aug 2014, 13:15

        Hi Anton

        libffi.6.dylib is included in the Sketchup Ruby framework.

        is it possible to utilise that for your needs???

        just thinking out loud...

        john

        learn from the mistakes of others, you may not live long enough to make them all yourself...

        1 Reply Last reply Reply Quote 0
        • S Offline
          slbaumgartner
          last edited by 25 Aug 2014, 16:42

          @driven said:

          Hi Anton

          libffi.6.dylib is included in the Sketchup Ruby framework.

          is it possible to utilise that for your needs???

          just thinking out loud...

          john

          fiddle is the Ruby 1.0.0 wrapper for libffi. I haven't tried using it, but require 'fiddle' returns true on SU 2014, so maybe John's idea is your easiest route?

          1 Reply Last reply Reply Quote 0
          • A Offline
            Anton_S
            last edited by 25 Aug 2014, 16:56

            @slbaumgartner said:

            @driven said:

            Hi Anton

            libffi.6.dylib is included in the Sketchup Ruby framework.

            is it possible to utilise that for your needs???

            just thinking out loud...

            john

            fiddle is the Ruby 1.0.0 wrapper for libffi. I haven't tried using it, but require 'fiddle' returns true on SU 2014, so maybe John's idea is your easiest route?

            Yes, Fiddle is a good idea, but the way you interact with functions is a bit more similar to Win32API rather than Ruby DL or FFI. SketchyPhysics uses Ruby DL for 1.8.x categories and Ruby FFI for 2.0.x categories since DL was deprecated since 1.9.3. The way you call functions in DL and FFI is function_name(params), but in Fiddle, you should write function_name.call(params). Which forces me due much more work in compatibility, but it does avoids the pain of compiling. I will attempt to compile FFI in Mac OS X 10.5.8 If no luck, I migrate to Fiddle.

            Thanks for suggestions πŸ˜„

            1 Reply Last reply Reply Quote 0
            • T Offline
              tt_su
              last edited by 25 Aug 2014, 17:20

              My general experience is that it's much simpler to just write a C++ extension that makes the system calls one need.

              1 Reply Last reply Reply Quote 0
              • W Offline
                willeykj
                last edited by 26 Aug 2014, 01:29

                @anton_s said:

                @slbaumgartner said:

                @driven said:

                Hi Anton

                libffi.6.dylib is included in the Sketchup Ruby framework.

                is it possible to utilise that for your needs???

                just thinking out loud...

                john

                fiddle is the Ruby 1.0.0 wrapper for libffi. I haven't tried using it, but require 'fiddle' returns true on SU 2014, so maybe John's idea is your easiest route?

                Yes, Fiddle is a good idea, but the way you interact with functions is a bit more similar to Win32API rather than Ruby DL or FFI. SketchyPhysics uses Ruby DL for 1.8.x categories and Ruby FFI for 2.0.x categories since DL was deprecated since 1.9.3. The way you call functions in DL and FFI is function_name(params), but in Fiddle, you should write function_name.call(params). Which forces me due much more work in compatibility, but it does avoids the pain of compiling. I will attempt to compile FFI in Mac OS X 10.5.8 If no luck, I migrate to Fiddle.

                Thanks for suggestions πŸ˜„

                Anton,

                You can use Fiddle and retain the "normal" calling syntax if you use Fiddle::Importer.

                1 Reply Last reply Reply Quote 0
                • A Offline
                  Anton_S
                  last edited by 26 Aug 2014, 01:47

                  Well, okay, seems I'm convinced to use Fiddle πŸ˜†

                  1 Reply Last reply Reply Quote 0
                  • A Offline
                    Anton_S
                    last edited by 27 Aug 2014, 11:10

                    Okay, I finished migrating to Fiddle. It wasn't as complicated as I thought. In fact, file sizes got way smaller since DL and Fiddle use same techniques to import functions.

                    One thing to note, imported functions remain capitalized in Ruby 2.0.0, but are not capitalized in 1.8.x categories. I had to add some wrapper methods for compatibility.

                    I ought to finish some things on the TODO list before uploading 3.4. Thanks for ya'll help, especially willeykj!

                    You guys rock!

                    1 Reply Last reply Reply Quote 0
                    • A Offline
                      Anton_S
                      last edited by 27 Aug 2014, 11:14

                      Oh wait, Fiddle::Importer is very similar to DL::Importable. I will migrate to Fiddle.
                      Sorry for misleading you guys.

                      Thanks for all the help πŸ˜„

                      1 Reply Last reply Reply Quote 0
                      • 1 / 1
                      1 / 1
                      • First post
                        14/14
                        Last post
                      Buy SketchPlus
                      Buy SUbD
                      Buy WrapR
                      Buy eBook
                      Buy Modelur
                      Buy Vertex Tools
                      Buy SketchCuisine
                      Buy FormFonts

                      Advertisement