[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[dennou-ruby:004074] Re: numru-narray



竹広さま,みなさま

畔野です.
私の経験では,GPhys に依存するものもすべてインストールし直す必要がありま した.
スクリプトとパッチ一式をお送りしますので,参考になれば幸いです.


On 2020/06/05 0:04, Shin-ichi Takehiro wrote:
竹広です.

GPhys 使って大規模データ処理したくてあがいてます.

narray の代わりに numru-narray を使えば良いのでしょうが,
これを使った GPhys をインストールするにはどうすればいいのか
教えていただけませんか.

gem install に -- --with-narray-inculde といったオプションで
numru-narray を指定すればいいかと思い, 試行錯誤してみましたが,
うまくいってません.

どうぞよろしくお願いします.






--
------------------------
畔野 貴弘 (BANNO Takahiro)
banno@xxxxxxxxxxxxxxxxxx
banno.takahiro.h79@xxxxxxxxxx
------------------------

diff --git a/Rakefile b/Rakefile
index 2342f10..c4546c3 100644
--- a/Rakefile
+++ b/Rakefile
@@ -9,7 +9,7 @@ rescue LoadError
   puts 'If you want to create gem, You must install Bundler'
 end
 
-Bundler::GemHelper.install_tasks(name: "gphys")
+Bundler::GemHelper.install_tasks(name: "gphys-bigmem")
 
 require './lib/numru/gphys/version.rb'
 def version
diff --git a/ext/numru/gphys/extconf.rb b/ext/numru/gphys/extconf.rb
index 37cdcca..ade3810 100644
--- a/ext/numru/gphys/extconf.rb
+++ b/ext/numru/gphys/extconf.rb
@@ -17,7 +17,8 @@ else
 end
 dir_config('narray', narray_include, narray_lib)
 
-require "narray"
+require "numru/narray"
+NArray = NumRu::NArray
 if NArray.const_defined?(:SUPPORT_BIGMEM) && NArray::SUPPORT_BIGMEM
 
   case RbConfig::CONFIG["CC"]
diff --git a/gphys-bigmem.gemspec b/gphys-bigmem.gemspec
index eaebc15..c331ee6 100644
--- a/gphys-bigmem.gemspec
+++ b/gphys-bigmem.gemspec
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
 require 'numru/gphys/version'
 
 Gem::Specification.new do |spec|
-  spec.name          = "gphys-bigmem"
+  spec.name          = "gphys"
   spec.version       = NumRu::GPhys::VERSION
   spec.authors           = ["Takeshi Horinouchi", "Ryo Mizuta",\
     "Daisuke Tsukahara", "Seiya Nishizawa", "Shin-ichi Takehiro"]
@@ -30,13 +30,13 @@ Gem::Specification.new do |spec|
 
   spec.required_ruby_version = Gem::Requirement.new(">= 1.8")
 
-  spec.add_runtime_dependency(%q<narray-bigmem>)
-  spec.add_runtime_dependency(%q<narray_miss-bigmem>)
-  spec.add_runtime_dependency(%q<numru-misc-bigmem>)
+  spec.add_runtime_dependency(%q<numru-narray>)
+  spec.add_runtime_dependency(%q<narray_miss>)
+  spec.add_runtime_dependency(%q<numru-misc>)
   spec.add_runtime_dependency(%q<numru-units>, [">= 1.7"])
-  spec.add_runtime_dependency(%q<ruby-netcdf-bigmem>)
-  spec.add_runtime_dependency(%q<ruby-dcl-bigmem>)
-  spec.add_runtime_dependency(%q<ruby-fftw3-bigmem>)
+  spec.add_runtime_dependency(%q<ruby-netcdf>)
+  spec.add_runtime_dependency(%q<ruby-dcl>)
+  spec.add_runtime_dependency(%q<ruby-fftw3>)
   #spec.add_runtime_dependency(%q<gsl>, [">= 1.14"])
   #spec.add_runtime_dependency(%q<rb-gsl>, [">= 1.14"])
   #spec.add_runtime_dependency(%q<ruby-lapack>, [">= 1.5"])
diff --git a/lib/numru/derivative.rb b/lib/numru/derivative.rb
index ca1ce43..cc7a2e4 100644
--- a/lib/numru/derivative.rb
+++ b/lib/numru/derivative.rb
@@ -1,5 +1,6 @@
 # -*- coding: utf-8 -*-
-require "narray"
+require "numru/narray"
+NArray = NumRu::NArray unless defined?(NArray)
 
 ############################################################
 
diff --git a/lib/numru/gphys/assoccoords.rb b/lib/numru/gphys/assoccoords.rb
index 2d2eea4..827d4ae 100644
--- a/lib/numru/gphys/assoccoords.rb
+++ b/lib/numru/gphys/assoccoords.rb
@@ -1,5 +1,6 @@
 # -*- coding: utf-8 -*-
-require "narray"
+require "numru/narray"
+NArray = NumRu::NArray unless defined?(NArray)
 #require "numru/gphys_ext"
 
 module NumRu
diff --git a/lib/numru/gphys/attribute.rb b/lib/numru/gphys/attribute.rb
index 8f8d910..6ea05a2 100644
--- a/lib/numru/gphys/attribute.rb
+++ b/lib/numru/gphys/attribute.rb
@@ -1,4 +1,5 @@
-require "narray"
+require "numru/narray"
+NArray = NumRu::NArray unless defined?(NArray)
 
 module NumRu
 =begin
diff --git a/lib/numru/gphys/coordmapping.rb b/lib/numru/gphys/coordmapping.rb
index ceb95ac..36e86e7 100644
--- a/lib/numru/gphys/coordmapping.rb
+++ b/lib/numru/gphys/coordmapping.rb
@@ -1,4 +1,5 @@
-require "narray"
+require "numru/narray"
+NArray = NumRu::NArray unless defined?(NArray)
 
 =begin
 = class CoordMapping
diff --git a/lib/numru/gphys/mdstorage.rb b/lib/numru/gphys/mdstorage.rb
index 60d6e36..bf5b229 100644
--- a/lib/numru/gphys/mdstorage.rb
+++ b/lib/numru/gphys/mdstorage.rb
@@ -1,4 +1,5 @@
-require "narray"
+require "numru/narray"
+NArray = NumRu::NArray unless defined?(NArray)
 
 module NumRu
   class MDStorage
diff --git a/lib/numru/gphys/narray_ext.rb b/lib/numru/gphys/narray_ext.rb
index 741cc2a..76a5b21 100644
--- a/lib/numru/gphys/narray_ext.rb
+++ b/lib/numru/gphys/narray_ext.rb
@@ -1,4 +1,5 @@
-require "narray"
+require "numru/narray"
+NArray = NumRu::NArray unless defined?(NArray)
 
 class NArray
 
diff --git a/lib/numru/gphys/subsetmapping.rb b/lib/numru/gphys/subsetmapping.rb
index 33966c3..44b03ac 100644
--- a/lib/numru/gphys/subsetmapping.rb
+++ b/lib/numru/gphys/subsetmapping.rb
@@ -1,4 +1,5 @@
-require "narray"
+require "numru/narray"
+NArray = NumRu::NArray unless defined?(NArray)
 
 module NumRu
 
diff --git a/lib/numru/gphys/unumeric.rb b/lib/numru/gphys/unumeric.rb
index 8375d4d..8a2acb0 100644
--- a/lib/numru/gphys/unumeric.rb
+++ b/lib/numru/gphys/unumeric.rb
@@ -546,7 +546,8 @@ end   # module NumRu
 ######################################
 if $0 == __FILE__
 
-  require "narray"
+  require "numru/narray"
+  NArray = NumRu::NArray unless defined?(NArray)
 
   include NumRu
   a = UNumeric[ 10.0, Units['m/s'] ]

Attachment: install.sh
Description: Bourne shell script

diff --git a/narray_miss.gemspec b/narray_miss.gemspec
index 4e17098..83bd16f 100644
--- a/narray_miss.gemspec
+++ b/narray_miss.gemspec
@@ -31,6 +31,6 @@ Gem::Specification.new do |s|
 
   # specify any dependencies here; for example:
   #s.add_development_dependency "rspec"
-  s.add_runtime_dependency "narray"
-  #s.add_runtime_dependency "numru-narray"
+  #s.add_runtime_dependency "narray"
+  s.add_runtime_dependency "numru-narray"
 end
diff --git a/Rakefile b/Rakefile
index 6797be2..c20987c 100644
--- a/Rakefile
+++ b/Rakefile
@@ -21,8 +21,8 @@ def version
 end
 
 # manual calls of install_tasks to support multiple gemspec files
-Bundler::GemHelper.install_tasks(name: "numru-misc")
-#Bundler::GemHelper.install_tasks(name: "numru-misc-bigmem")
+#Bundler::GemHelper.install_tasks(name: "numru-misc")
+Bundler::GemHelper.install_tasks(name: "numru-misc-bigmem")
 
 =begin
 task :default => :test
diff --git a/lib/numru/misc/misc.rb b/lib/numru/misc/misc.rb
index 81da853..06bcd91 100644
--- a/lib/numru/misc/misc.rb
+++ b/lib/numru/misc/misc.rb
@@ -1,4 +1,5 @@
-require "narray"
+require "numru/narray"
+NArray = NumRu::NArray unless defined?(NArray)
 
 module NumRu
 
diff --git a/numru-misc-bigmem.gemspec b/numru-misc-bigmem.gemspec
index 97ae35e..dd54e38 100644
--- a/numru-misc-bigmem.gemspec
+++ b/numru-misc-bigmem.gemspec
@@ -6,7 +6,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
 require "numru/misc"
 
 Gem::Specification.new do |spec|
-  spec.name          = "numru-misc-bigmem"
+  spec.name          = "numru-misc"
   spec.version       = NumRu::Misc::VERSION
   spec.authors     = ["Takeshi Horinouchi"]
   spec.email       = ["horinout@xxxxxxxxxxxxxx"]
@@ -21,5 +21,5 @@ Gem::Specification.new do |spec|
   spec.require_paths = ["lib"]
 
   spec.required_ruby_version = Gem::Requirement.new(">= 1.6")
-  spec.add_runtime_dependency(%q<narray-bigmem>)
+  spec.add_runtime_dependency(%q<numru-narray>)
 end
diff --git a/GenWrapper/dcl_rb_heading b/GenWrapper/dcl_rb_heading
index dc5b075..2c40e05 100644
--- a/GenWrapper/dcl_rb_heading
+++ b/GenWrapper/dcl_rb_heading
@@ -1,7 +1,7 @@
 require "numru/dcl/narray_type.rb"
 
 if NumRu::DCL::SUPPORT_BIGMEM
-  if Object.const_defined?(:NArray)
+  if Object.const_defined?(:NArray) && !defined?(NumRu::NArray)
     raise "Incompatibility found. The loaded NumRu::DCL was compiled to " +
           "use NumRu::NArray, but here NArray has already been loaded."
   end
diff --git a/Rakefile b/Rakefile
index c4fab7f..7883cd2 100644
--- a/Rakefile
+++ b/Rakefile
@@ -9,7 +9,7 @@ rescue LoadError
 end
 
 # manual calls of install_tasks to support multiple gemspec files
-Bundler::GemHelper.install_tasks(name: "ruby-dcl")
+Bundler::GemHelper.install_tasks(name: "ruby-dcl-bigmem")
 
 require './lib/numru/dcl/version.rb'
 def version
diff --git a/ruby-dcl-bigmem.gemspec b/ruby-dcl-bigmem.gemspec
index e69de29..e690436 100644
--- a/ruby-dcl-bigmem.gemspec
+++ b/ruby-dcl-bigmem.gemspec
@@ -0,0 +1,39 @@
+# coding: utf-8
+require "rubygems" unless defined?(Gem)
+
+lib = File.expand_path('../lib', __FILE__)
+$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
+require 'numru/dcl/version'
+
+#old# filelist = `git ls-files | egrep -v '^GenWrapper|^.git|^ToDo'`.split("\n")
+#old# filelist.concat(Dir::glob('ext/**/*.c'))
+#old# filelist.concat(Dir::glob('lib/**/*.rb'))
+
+filelist = %w!ChangeLog Gemfile LICENSE.txt Rakefile ruby-dcl.gemspec!
+filelist.concat( Dir::glob("ext/**/*.c\0ext/**/*.rb\0ext/**/*.default") )
+filelist.concat( Dir::glob('lib/**/*.rb') )
+filelist.concat( Dir::glob("demo/**/*.rb\0demo/**/*.dat") )
+filelist.uniq!
+
+Gem::Specification.new do |spec|
+  spec.name          = "ruby-dcl"
+  spec.version       = NumRu::DCL::VERSION
+  spec.authors     = ["T. Horinouchi", "K. Kuroi", "K. Goto"\
+    ,"S. Nishizawa", "T. Koshiro",'GFD Dennou Club']
+  spec.email       = ["eriko@xxxxxxxxxxxxxx"]
+
+  spec.summary     = %q{one-to-one interface to the DCL graphic library}
+  spec.description = %q{RubyDCL is a ruby interface to the scientific graphic library DCL. It supports all the subroutines and functions in DCL on a one-to-one basis. }
+  spec.homepage    = 'http://www.gfd-dennou.org/arch/ruby/products/ruby-dcl/' 
+  spec.licenses       = ["BSD-2-Clause"]
+
+  spec.files         = filelist
+  spec.test_files    = spec.files.grep(%r{^demo/})
+  spec.require_paths = ["ext","lib"]
+  spec.extensions << "ext/numru/extconf.rb"
+
+  spec.required_ruby_version = Gem::Requirement.new(">= 1.6")
+  spec.add_runtime_dependency(%q<numru-narray>, [">= 1.0.3"])
+  spec.add_runtime_dependency(%q<narray_miss>, [">= 0"])
+  spec.add_development_dependency(%q<gtk2>, [">= 0"])
+end
diff --git a/Rakefile b/Rakefile
index 6e5e6d1..23df4c4 100644
--- a/Rakefile
+++ b/Rakefile
@@ -9,8 +9,8 @@ rescue LoadError
   puts 'If you want to create gem, You must install Bundler'
 end
 
-Bundler::GemHelper.install_tasks(name: "ruby-fftw3")
-##Bundler::GemHelper.install_tasks(name: "ruby-fftw3-bigmem")
+#Bundler::GemHelper.install_tasks(name: "ruby-fftw3")
+Bundler::GemHelper.install_tasks(name: "ruby-fftw3-bigmem")
 
 require './lib/numru/fftw3/version.rb'
 def version
diff --git a/lib/numru/fftw3.rb b/lib/numru/fftw3.rb
index 2ced096..c193e3a 100644
--- a/lib/numru/fftw3.rb
+++ b/lib/numru/fftw3.rb
@@ -7,7 +7,7 @@ require "numru/fftw3/version"
 require "numru/fftw3/fftw3"
 
 if NumRu::FFTW3::SUPPORT_BIGMEM
-  if Object.const_defined?(:NArray)
+  if Object.const_defined?(:NArray) && !defined?(NumRu::NArray)
     raise "Incompatibility found. The loaded NumRu::FFTW3 was compiled to " +
           "use NumRu::NArray, but here NArray has already been loaded."
   end
diff --git a/ruby-fftw3-bigmem.gemspec b/ruby-fftw3-bigmem.gemspec
index e69de29..ba59f5e 100644
--- a/ruby-fftw3-bigmem.gemspec
+++ b/ruby-fftw3-bigmem.gemspec
@@ -0,0 +1,28 @@
+# coding: utf-8
+lib = File.expand_path('../lib', __FILE__)
+$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
+require 'numru/fftw3/version'
+
+filelist = %w!ChangeLog .ChangeLog.until20110419 Gemfile LICENSE.txt Rakefile ruby-fftw3.gemspec!
+filelist.concat(Dir::glob("ext/**/*.c\0ext/**/*.rb\0lib/**/*.rb\0test/**/*.rb"))
+
+Gem::Specification.new do |spec|
+  spec.name          = "ruby-fftw3"
+  spec.version       = NumRu::FFTW3::VERSION
+  spec.authors       = ["Takeshi Horinouchi"]
+  spec.email         = ['eriko@xxxxxxxxxxxxxx']
+
+  spec.summary          = %q{The Ruby interface of the FFTW (ver 3) library}
+  spec.description      = %q{The Ruby interface of the FFTW3, Fast Fourier Transform library FFTW Ver.3. Since ver.1, ruby-fftw3 supports all kinds of FFTs in FFTW3. Works with NArray (or NumRu::NArray).}
+  spec.homepage         = 'http://www.gfd-dennou.org/arch/ruby/products/ruby-fftw3/'
+  spec.licenses         = ["BSD-2-Clause"]
+
+  spec.files            = filelist
+  spec.test_files       = spec.files.grep(%r{^test/})
+  spec.require_paths = ["ext","lib"]
+
+  spec.required_ruby_version = Gem::Requirement.new(">= 1.8")
+  spec.add_runtime_dependency(%q<numru-narray>, [">= 0"])
+
+  spec.extensions << "ext/numru/fftw3/extconf.rb"
+end
diff --git a/Rakefile b/Rakefile
index e457f52..f3dfb0f 100644
--- a/Rakefile
+++ b/Rakefile
@@ -10,8 +10,8 @@ rescue LoadError
 end
 
 # manual calls of install_tasks to support multiple gemspec files
-Bundler::GemHelper.install_tasks(name: "ruby-netcdf")
-#Bundler::GemHelper.install_tasks(name: "ruby-netcdf-bigmem")
+#Bundler::GemHelper.install_tasks(name: "ruby-netcdf")
+Bundler::GemHelper.install_tasks(name: "ruby-netcdf-bigmem")
 
 require './lib/numru/netcdf/version'
 def version
diff --git a/lib/numru/netcdf.rb b/lib/numru/netcdf.rb
index 4e68f01..24fe06e 100644
--- a/lib/numru/netcdf.rb
+++ b/lib/numru/netcdf.rb
@@ -1,6 +1,7 @@
-require 'narray'
+require 'numru/narray'
 require 'numru/netcdf/version'
 require 'numru/netcdfraw'
+NArray = NumRu::NArray unless defined?(NArray)
 
 if NArray.const_defined?(:SUPPORT_BIGMEM) && NArray::SUPPORT_BIGMEM
   unless NumRu::NetCDF::SUPPORT_BIGMEM
diff --git a/ruby-netcdf-bigmem.gemspec b/ruby-netcdf-bigmem.gemspec
index ec7076d..8312b77 100644
--- a/ruby-netcdf-bigmem.gemspec
+++ b/ruby-netcdf-bigmem.gemspec
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
 require 'numru/netcdf/version'
 
 Gem::Specification.new do |spec|
-  spec.name          = "ruby-netcdf-bigmem"
+  spec.name          = "ruby-netcdf"
   spec.version       = NumRu::NetCDF::VERSION
   spec.authors           = ["Takeshi Horinouchi", "Tsuyoshi Koshiro",\
     "Shigenori Otsuka", "Seiya Nishizawa", "T Sakakima"]
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
   spec.extensions << "ext/numru/extconf.rb"
 
   spec.required_ruby_version = Gem::Requirement.new(">= 1.8")
-  spec.add_runtime_dependency(%q<narray-bigmem>, [">= 0"])
-  spec.add_runtime_dependency(%q<narray_miss-bigmem>, [">= 0"])
+  spec.add_runtime_dependency(%q<numru-narray>, [">= 0"])
+  spec.add_runtime_dependency(%q<narray_miss>, [">= 0"])
 
 end