Top Level Namespace

Defined Under Namespace

Modules: <%= full_module_name %>, Cumo, DeclMethod, NArrayMethod, NArrayType, NMathMethod, StoreFrom Classes: DefAlias, DefAllocFunc, DefClass, DefConst, DefError, DefInclueModule, DefLib, DefMethod, DefModule, DefModuleFunction, DefStruct, ErbPP, Store, StoreArray, StoreNum, UndefAllocFunc, UndefMethod, UndefSingletonMethod

Constant Summary collapse

HEADER_DIRS =
(ENV['CPATH'] || '').split(':')
LIB_DIRS =
(ENV['LIBRARY_PATH'] || '').split(':')

Instance Method Summary collapse

Instance Method Details

#create_dependObject



32
33
34
35
36
37
38
39
40
41
42
43
# File 'ext/cumo/extconf.rb', line 32

def create_depend
  message "creating depend\n"
  depend_path = File.join(__dir__, "depend")
  File.open(depend_path, "w") do |depend|
    depend_erb_path = File.join(__dir__, "depend.erb")
    File.open(depend_erb_path, "r") do |depend_erb|
      erb = ERB.new(depend_erb.read)
      erb.filename = depend_erb_path
      depend.print(erb.result)
    end
  end
end

#have_numo_narray!Object



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'ext/cumo/extconf.rb', line 10

def have_numo_narray!
  version_path = File.join(__dir__, "..", "..", "numo-narray-version")
  version = File.read(version_path).strip
  gem_spec = Gem::Specification.find_by_name("numo-narray", version)

  $INCFLAGS += " -I#{gem_spec.gem_dir}/ext/numo/narray"
  if !have_header("numo/narray.h")
    puts "
    Header numo/narray.h was not found. Give pathname as follows:
    % ruby extconf.rb --with-narray-include=narray_h_dir"
    exit(1)
  end

  if RUBY_PLATFORM =~ /cygwin|mingw/
    $LDFLAGS += " -L#{gem_spec.gem_dir}/ext/numo"
    unless have_library("narray","nary_new")
      puts "libnarray.a not found"
      exit(1)
    end
  end
end