Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New gem format and g2c -> f2c fix #3

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# ignore native extensions build output
mkmf.log
Makefile
*.o
*.so

# ignore editor temp files
*.swp

# ignore built gem
*.gem

# ignore generated docs
doc/

# ignore bundler output
Gemfile.lock

# ignore files generated from templates
ext/lapack/rb_lapack_c.c
ext/lapack/rb_lapack_d.c
ext/lapack/rb_lapack_s.c
ext/lapack/rb_lapack_x.c
ext/lapack/rb_lapack_z.c
ext/linalg/cdata.c
ext/linalg/chardata.c
ext/linalg/cmatrix.c
ext/linalg/cmatrix.h
ext/linalg/cmatrixc.c
ext/linalg/dmatrix.c
ext/linalg/dmatrix.h
ext/linalg/dmatrixr.c
ext/linalg/idata.c
ext/linalg/ldata.c
ext/linalg/scomplex.c
ext/linalg/scomplex.h
ext/linalg/sdata.c
ext/linalg/smatrix.c
ext/linalg/smatrix.h
ext/linalg/smatrixr.c
ext/linalg/zdata.c
ext/linalg/zmatrix.c
ext/linalg/zmatrix.h
ext/linalg/zmatrixc.c


5 changes: 5 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
source "http://rubygems.org"

# Will automatically pull in this gem and all its
# dependencies specified in the gemspec
gem "linalg", :path => File.expand_path("..", __FILE__)
11 changes: 11 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
require "bundler"
Bundler.setup

gemspec = eval(File.read("linalg.gemspec"))

task :build => "#{gemspec.full_name}.gem"

file "#{gemspec.full_name}.gem" => gemspec.files + ["linalg.gemspec"] do
system "gem build linalg.gemspec"
system "gem install linalg-#{Linalg::VERSION}.gem"
end
7 changes: 2 additions & 5 deletions ext/lapack/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def self.read
cppdefs = {
"extern" => "",

# these are in g2c.h
# these are in f2c.h
"C_f" => "void",
"Z_f" => "void",
}
Expand Down Expand Up @@ -271,8 +271,7 @@ def write_c
end

def config
unless have_header("g2c.h") and
have_library("g2c") and
unless have_header("f2c.h") and
have_library("blas") and
have_library("lapack")
puts "A full LAPACK installation was not found."
Expand All @@ -286,8 +285,6 @@ def config
"rb_lapack_z.c",
"rb_lapack_x.c",
]

$CFLAGS += ' -I.. -include g2c_typedefs.h'
end

def create
Expand Down
2 changes: 1 addition & 1 deletion ext/lapack/rb_lapack.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include "ruby.h"

#include <g2c.h>
#include <f2c.h>

#include "include/BLAS.h"
#include "include/LAPACK.h"
Expand Down
2 changes: 1 addition & 1 deletion ext/linalg/dcomplex.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include <stdlib.h>
#include <math.h>

#include <g2c.h>
#include <f2c.h>

#include "ruby.h"

Expand Down
5 changes: 1 addition & 4 deletions ext/linalg/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
#
####################################################

unless have_header("g2c.h") and
have_library("g2c") and
unless have_header("f2c.h") and
have_library("blas") and
have_library("lapack")
puts "A full LAPACK installation was not found."
Expand All @@ -32,8 +31,6 @@
# why doesn't $INCFLAGS work
$CFLAGS += " -I../lapack/include"

$CFLAGS += ' -I.. -include g2c_typedefs.h'

####################################################
#
# Instantiator
Expand Down
2 changes: 1 addition & 1 deletion ext/linalg/xdata.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#include "ruby.h"

#include <g2c.h>
#include <f2c.h>

#include "linalg.h"
#include "dcomplex.h"
Expand Down
2 changes: 1 addition & 1 deletion ext/linalg/xmatrix.h.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <math.h>
#include <time.h>

#include <g2c.h>
#include <f2c.h>

#include "BLAS.h"
#include "LAPACK.h"
Expand Down
Loading