1

I am building a C extension that uses the Mac OSX Accelerate Framework. When I compile normal C code I include the header

#include <Accelerate/Accelerate.h>

and compile with

llvm-gcc -framework Accelerate code.c -o code

The flag takes care of finding the right libraries. Can I do something similar for a ruby C extension? I assume I need to include the framework in extconf.rb but I don't know how.

Rojj
  • 1,170
  • 1
  • 12
  • 32
  • 2
    I _think_ you just need to add [`have_framework('Accelerate')`](http://ruby-doc.org/stdlib-2.3.1/libdoc/mkmf/rdoc/MakeMakefile.html#method-i-have_framework) to `extconf.rb` and it will set up the command to use the appropriate `-framework` switch. – matt May 05 '16 at 23:45
  • It works. If you add an answer I will accept it. Thanks – Rojj May 06 '16 at 13:33

1 Answers1

1

To use a framework in a Ruby extension, you need to use the have_framework method in your extconf.rb. This will add the appropriate command line options in the Makefile.

In your case you want:

have_framework('Accelerate')
matt
  • 78,533
  • 8
  • 163
  • 197